Back to documentation
Return to Documentation Here
Pre Select Processor
Get processor list
This endpoint used to get Gateway list.
Get https://endelospay.com/api/v1.1/payment_api/gateways
# With shell, you can just pass the correct header with each request
curl "https://endelospay.com/api/v1.1/payment_api/gateways"
-H "Authorization: API_key:API_Secret"
<?php
require EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
?>
Make sure to replace
API_key:API_Secret
with your API keys.The above command returns JSON response like this:
[
{
"gateway_id":"10101",
"gateway_name":"Gateway Name",
},
]
Add the Script Tag
Pass gateway id in EndelosPay.payfunction with amount.
<script type="text/javascript" src="https://endelospay.com/js/dropin.js?token=[Your Token]"></script>
<script>
function pay(amount)
{
EndelosPay.pay({'amount':[amount],'gateway_id':'[gateway_id]'}).then(function(data){
alert(JSON.stringify(data,null,2))
})
.catch(function(error){
alert(JSON.stringify(error,null,2))
})
}
</script>
Order
Get Product List
<?php
include EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
$products = $EndelosPay->getProducts();
print_r($products);
?>
curl "https://endelospay.com/api/v1.1/order_api/get_products" \
-H "Authorization: API_key:API_Secret" \
The above command returns JSON response like this:
[
{
"name":"Incident Plan 59.99",
"price":"59.99",
"campaign":"142",
"id":"TM003"
},
{
"name":"Incident Plan 9.99",
"price":"9.99",
"campaign":"142",
"id":"TM001"
}
]
This endpoint used to get Product List.
HTTP Request
Get https://endelospay.com/api/v1.1/order_api/get_products
Process Credit Card Payment
curl "https://endelospay.com/api/v1.1/payment_api/card"
-X POST \
-H "Authorization: API_key:API_Secret" \
-H "Content-Type: application/json" \
-d '{ "first_name":"George", "last_name":"Washington", "email":"INever@lie.com", "mobile":"8042221111", "billing_address1":"3200 Mount Vernon Memorial Highway Mount", "billing_address2":"", "billing_city":"Vernon", "billing_state":"VA", "billing_zip":"22121", "order_description":"EYU314","customer_ip"=>"127.0.0.1" "amount":"59.99", "card_no":"4111111111111111", "card_cvv":"123", "expiry_month":"07", "expiry_year":"2025"
}'
<?php
include EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
$data = [
"first_name"=>"George",
"last_name"=>"Washington",
"email"=>"INever@lie.com",
"mobile"=>"8042221111",
"billing_address1"=>"3200 Mount Vernon Memorial Highway Mount ",
"billing_address2"=>"",
"billing_city"=>"Vernon",
"billing_state"=>"VA",
"billing_zip"=>"22121",
"customer_ip"=>$_SERVER['REMOTE_ADDR'],
"order_description"=>"EYU314",
"amount"=>"59.99",
"card_no"=>"4111111111111111",
"card_cvv"=>"123",
"expiry_month"=>"07",
"expiry_year"=>"2025"
];
$response = $EndelosPay->processPayment($data);
print_r($response);
?>
Success Json Response:
//Success Response
{
"status": "success",
"message": "",
"descriptor":"",
"transaction_id": "00624",
"amount": "59.99"
}
//Failed Response
{
"status": "fail",
"descriptor":"",
"message": "It did not pass 2-Party limitation",
"transaction_id": "00624",
"amount": "59.99"
}
This endpoint Process Payment.
Make sure to follow the zip code format for countries outside of the US.
If no country code is provided in the transaction, then US will be the default country and will require US formats
For example: Canada uses the format "XXX XXX" including the space
HTTP Request
POST https://endelospay.com/api/v1.1/payment_api/card
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
first_name | yes | String | First Name. |
last_name | yes | String | Last Name. |
billing_address1 | yes | String | Valid Address Line 1. |
billing_address2 | no | String | Address Line 2. |
billing_city | yes | String | City. |
billing_country | no | String | Default is US, 2 character only |
billing_state | yes | String | State Short Code. |
billing_zip | yes | amount | Zip. |
customer_ip | yes | String | Ip Address of Customer. |
yes | String | Valid Email Address. | |
mobile | yes | String | Valid Mobile No. |
amount | yes | Decimal | Amount To Process. Must Match With Order Amount |
card_no | yes | Integer | Card No. |
card_cvv | yes | Integer | Card Security Code. |
expiry_month | yes | Integer | 2 Digit Month e,g "06". |
expiry_year | yes | Integer | 4 Digit Year e,g "2022". |
order_description | yes | String | Valid Order Id Or Order Description |
Dropin Js
Add the Script Tag
On your webpage that you want to add the button for, copy and paste our script into where your scripts are
<script type="text/javascript" src="https://endelospay.com/js/dropin.js?token=[Your Token]"></script>
<script>
function pay(amount)
{
EndelosPay.pay({'amount':[amount]}).then(function(data){
alert(JSON.stringify(data,null,2))
})
.catch(function(error){
alert(JSON.stringify(error,null,2))
})
}
</script>
Add Button
Copy and paste our html button where you want the drop-in js code to appear
<div id="wrapper">
<button onclick="pay(4.99)">Pay $4.99</button>
</div>
Transaction History
curl "https://endelospay.com/api/v1.1/transaction_api/transactions"
-X POST \
-H "Authorization: API_key:API_Secret" \
-H "Content-Type: application/json" \
-d '{ "status":"success", "trans_id":"01", "from":"3186-08-22", "to":"3186-08-22", "page":"0"}'
<?php
include EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
$data = [
"trans_id"=>"01",
"status"=>"pending",
"from"=>"3186-08-22",
"to"=>"3186-08-22",
"page"=>"1",
];
$response = $EndelosPay->processPayment($data);
print_r($response);
?>
Success Json Response:
{
"total_records": "1",
"total_pages": "1",
"current_page": "1",
"result":[
{
"trans_id": "00001",
"amount": "9.99",
"status": "success",
"is_test": false
"order_id": null
"card_num": "************1111"
"date": "3186-08-22 23:59:59"
"first_name": "James"
"last_name": "Kirk"
}
]
}
This endpoint Process Payment.
HTTP Request
POST https://endelospay.com/api/v1.1/transaction_api/transactions
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
trans_id | no/td> | String | Transaction ID. |
status | no | String | Transaction Status. |
from | no | String | From Date (yyyy-mm-dd). |
to | no | String | To Date (yyyy-mm-dd). |
page | no | Integer | Page Number. |
Process eCheck Payment
curl "https://endelospay.com/api/v1.1/payment_api/echeck"
-X POST \
-H "Authorization: API_key:API_Secret" \
-H "Content-Type: application/json" \
-d '{ "first_name":"Sam", "last_name":"Malone", "billing_address1":"112.5 Beacon Street", "billing_address2":"", "billing_city":"Brighton", "billing_state":"MA","mobile":"", "billing_zip":"02135", "email":"drinking@cheers.com", "routing":"111111111", "account":"111111111", "order_description":"Test Order", "amount":"9.99"}'
<?php
include EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
$data = [
"first_name"=>"Sam",
"last_name"=>"Malone",
"billing_address1"=>"112.5 Beacon Street",
"billing_address2"=>"",
"billing_city"=>"Brighton",
"billing_country"=>"US",
"billing_state"=>"MA",
"billing_zip"=>"02135",
"customer_ip"=>$_SERVER['REMOTE_ADDR'],
"email" => "drinking@cheers.com",
"mobile" => "",
"routing_number"=>"111111111",
"checking_account_number"=>"111111111",
"order_description"=>"Test Order",
"amount"=>"9.99"
];
$response = $EndelosPay->processPayment($data);
print_r($response);
?>
Success Json Response:
{
"status": "pending",
"message": "",
"transaction_id": "00001",
"amount": "9.99"
}
This endpoint Process Payment.
HTTP Request
POST https://endelospay.com/api/v1.1/payment_api/echeck
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
first_name | yes | String | First Name. |
last_name | yes | String | Last Name. |
billing_address1 | yes | String | Valid Address Line 1. |
billing_address2 | no | String | Address Line 2. |
billing_city | yes | String | City. |
billing_country | no | String | Default is US, 2 character only |
billing_state | yes | String | State Short Code. |
billing_zip | yes | amount | Zip. |
customer_ip | yes | String | Ip Address of Customer. |
yes | String | Valid Email Address. | |
mobile | yes | String | Valid Mobile No. |
amount | yes | Decimal | Amount To Process. Must Match With Order Amount |
routing_number | yes | String | Rounting Number. |
checking_account_number | yes | String | Account Number. |
order_description | yes | String | Order Description |
Refund Request
curl "https://endelospay.com/api/v1.1/payment_api/refund"
-X POST \
-H "Authorization: API_key:API_Secret" \
-H "Content-Type: application/json" \
-d '{ "trans_id":"0000001","amount":"4.99"}'
<?php
include EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
$data = [
"trans_id"=>"0000001",
"amount"=>"4.99"
];
$response = $EndelosPay->refundPayment($data);
print_r($response);
?>
Success Json Response:
//Success Response
{
"trans_id": "00001",
"amount": "9.28",
"status": "success"
}
//Failed Response
{
"trans_id": "00001",
"message": "already refunded",
"amount": "9.28",
"status": "fail"
}
This endpoint Process Payment.
HTTP Request
POST https://endelospay.com/api/v1.1/payment_api/refund
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
trans_id | yes | String | Valid Transaction Id. |
amount | yes | Decimal | Amount To Process. Must Match With Order Amount |
Payment Token
Create Token
curl "https://endelospay.com/api/v1.1/payment_api/create-token"
-X POST \
-H "Authorization: API_key:API_Secret" \
-H "Content-Type: application/json" \
-d '{ "first_name":"Bruce", "last_name":"Wayne", "email":"not@batman.com", "mobile":"8042221111", "billing_address1":"1007 Mountain Drive", "billing_address2":"", "billing_city":"Gotham City", "billing_state":"NY", "billing_zip":"11368", "order_description":"EYU314","customer_ip"=>"127.0.0.1" }'
<?php
include EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
$data = [
"first_name"=>"Bruce",
"last_name"=>"Wayne",
"email"=>"not@batman.com",
"mobile"=>"8042221111",
"billing_address1"=>"1007 Mountain Drive",
"billing_address2"=>"",
"billing_city"=>"Gotham City",
"billing_state"=>"NY",
"billing_zip"=>"11368",
"customer_ip"=>$_SERVER['REMOTE_ADDR'],
"card_no"=>"4111111111111111",
"card_cvv"=>"123",
"expiry_month"=>"07",
"expiry_year"=>"2025"
];
$response = $EndelosPay->createToken($data);
print_r($response);
?>
Success Json Response:
{
"status": "success",
"token": "11AC11E1-1A1A-91190E4616F01081C54EAC16D053D3EC"
}
This endpoint Create Token.
HTTP Request
POST https://endelospay.com/api/v1.1/payment_api/create-token
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
first_name | yes | String | First Name. |
last_name | yes | String | Last Name. |
billing_address1 | yes | String | Valid Address Line 1. |
billing_address2 | no | String | Address Line 2. |
billing_city | yes | String | City. |
billing_country | no | String | Default is US, 2 character only |
billing_state | yes | String | State Short Code. |
billing_zip | yes | amount | Zip. |
customer_ip | yes | String | Ip Address of Customer. |
yes | String | Valid Email Address. | |
mobile | yes | String | Valid Mobile No. |
card_no | yes | Integer | Card No. |
card_cvv | yes | Integer | Card Security Code. |
expiry_month | yes | Integer | 2 Digit Month e,g "06". |
expiry_year | yes | Integer | 4 Digit Year e,g "2022". |
Process Payment With Token
curl "https://endelospay.com/api/v1.1/payment_api/token-payment"
-X POST \
-H "Authorization: API_key:API_Secret" \
-H "Content-Type: application/json" \
-d '{ "token":"11AC11E1-1A1A-91190E4616F01081C54EAC16D053D3EC", "order_description":"EYU314","customer_ip"=>"127.0.0.1" "amount":"59.99"}'
<?php
include EndelosPay;
$EndelosPay = new EndelosPay(API_KEY,API_SECRET);
$data = [
"token"=>"11AC11E1-1A1A-91190E4616F01081C54EAC16D053D3EC",
"customer_ip"=>$_SERVER['REMOTE_ADDR'],
"order_description"=>"EYU314",
"amount"=>"59.99"
];
$response = $EndelosPay->processTokenPayment($data);
print_r($response);
?>
Success Json Response:
//Success Response
{
"status": "success",
"message": "",
"descriptor":"",
"transaction_id": "00001",
"amount": "59.99"
}
//Failed Response
{
"status": "fail",
"descriptor":"",
"message": "It did not pass 2-Party limitation",
"transaction_id": "00001",
"amount": "59.99"
}
This endpoint Process Payment.
HTTP Request
POST https://endelospay.com/api/v1.1/payment_api/token-payment
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
token | yes | String | Valid Token. |
customer_ip | yes | String | Ip Address of Customer. |
amount | yes | Decimal | Amount To Process. Must Match With Order Amount |
order_description | yes | String | Valid Order Id Or Order Description |