aamarPay Payment Gateway enables Merchants to receive money from their customers by temporarily redirecting them to www.aamarpay.com. The gateway is connecting multiple payment terminal including card system, mobile financial
system, local and International wallet. After the payment is complete, the customer is returned to the merchant's site and seconds later the Merchant receives notification
about the payment along with the details of the transaction. This document is intended to be utilized by technical personnel supporting the online Merchant's
website. Working knowledge of HTML forms or cURL is required. You will probably require test accounts for which you need to open accounts via contact with aamarPay.com or already provided to you.
REST APIs are supported in two environments. Use the Sandbox environment for testing purposes, then move to the live environment for production processing. When testing, generate an order url with your test credentials to make calls to the Sandbox URIs. When you’re set to go live, use the live credentials assigned to your new signature key to generate a live order url to be used with the live URIs.
For Testing Purpose, use following Store ID and Signature Key :
store_id: "aamarpaytest",
signature_key: "dbb74894e82415a2f7ff0ec3a97e4183"
And hit the API: https://sandbox.aamarpay.com/jsonpost.php with your json data.
store_id: "aamarpaytest",
signature_key: "dbb74894e82415a2f7ff0ec3a97e4183"
And hit the API: https://sandbox.aamarpay.com/jsonpost.php with your json data.
For Production, use your Store ID and Signature Key (provided by aamarPay) :
store_id: "YOUR STORE ID",
signature_key: "YOUR SIGNATURE KEY"
And hit the API: https://secure.aamarpay.com/jsonpost.php with your json data.
store_id: "YOUR STORE ID",
signature_key: "YOUR SIGNATURE KEY"
And hit the API: https://secure.aamarpay.com/jsonpost.php with your json data.
Parameter | Description | Required | Example |
---|---|---|---|
store_id | Store ID will be provided by aamarpay | Yes | aamarpaytest |
signature_key | Signature key will be provided by aamarpay | Yes | dbb74894e82415a2f7ff0ec3a97e4183 |
cus_name | Client's name | Yes | Imtiaz Akil |
cus_email | Client's email address | Yes | imtiaz.akil@softbd.com |
cus_phone | Client's phone number | Yes | 01870762472 |
cus_add1 | Client's primary address | Yes | Dhaka |
cus_add2 | Client's secondary | Yes | Dhaka |
cus_city | Client's city name | Yes | Dhaka |
cus_country | Client's country name | Yes | Bangladesh |
amount | Amount | Yes | 10.00 |
tran_id | Unique transaction ID from merchant end | Yes | abCd422DedfE |
currency | Currency | Yes | BDT / USD |
success_url | Your success page link | Yes | https://example.com/success.php |
fail_url | Your fail page link | Yes | https://example.com/fail.php |
cancel_url | Your cancel page link | Yes | https://example.com/checkout.php |
desc | Payment description | Yes | T-Shirt |
opt_a | Optional Parameter | No | Test payment 1 |
opt_b | Optional Parameter | No | Test payment 2 |
opt_C | Optional Parameter | No | Test payment 3 |
type | To pass json data | Yes | "json" |
In success request :
request body :
{
store_id: "aamarpaytest",
signature_key: "dbb74894e82415a2f7ff0ec3a97e4183",
cus_name: "Imtiaz Akil",
cus_email: "imtiaz.akil@softbd.com",
cus_phone: "01870762472",
cus_add1: "53, Gausul Azam Road, Sector-14, Dhaka, Bangladesh",
cus_add2: "Dhaka",
cus_city: "Dhaka",
cus_country: "Bangladesh",
amount: "10.00",
tran_id: "14YToischo",
currency: "BDT",
success_url: "https://example.com/success.php",
fail_url: "https://example.com/fail.php",
cancel_url: "https://example.com/cancel.php",
desc: "Lend Money",
type: "json"
}
result: "true",
payment_url: "https://sandbox.aamarpay.com/paynow.php?track=AAM1604476085103491"
}
{
store_id: "aamarpaytest",
signature_key: "dbb74894e82415a2f7ff0ec3a97e4183",
cus_name: "Imtiaz Akil",
cus_email: "imtiaz.akil@softbd.com",
cus_phone: "01870762472",
cus_add1: "53, Gausul Azam Road, Sector-14, Dhaka, Bangladesh",
cus_add2: "Dhaka",
cus_city: "Dhaka",
cus_country: "Bangladesh",
amount: "10.00",
tran_id: "14YToischo",
currency: "BDT",
success_url: "https://example.com/success.php",
fail_url: "https://example.com/fail.php",
cancel_url: "https://example.com/cancel.php",
desc: "Lend Money",
type: "json"
}
response body :
{
result: "true",
payment_url: "https://sandbox.aamarpay.com/paynow.php?track=AAM1604476085103491"
}
When customer redirect with payment URL then customer will get the
payment methods.
NOTE: For sandbox only bKash payment method is available, when you
initiate payment with live you will get all payment method.
After successful payment client will redirect your success page which you are
already passing in our payment gateway as success_url and aamarPay will give
you all data as POST method in your success_url
All return variable given below :
{
pg_service_charge_bdt: "0.21",
pg_service_charge_usd: "Not-Available",
pg_card_bank_name: "",
pg_card_bank_country: "",
card_number:: "01826323538",
card_holder: "",
cus_phone: "01870762472",
desc: "",
success_url: "http://localhost/aamarpay/callback/success.php",
fail_url: "https://example.com/fail",
cus_name: "Imtiaz Akil",
cus_email: "imtiaz@softbd.com",
currency_merchant: "BDT",
convertion_rate: "",
ip_address: "103.228.202.73",
other_currency: "10.00",
pay_status: "Successful",
pg_txnid: "AAM1604470136103451",
epw_txnid: "AAM1604470136103451",
mer_txnid: "asdkfljaw34543",
store_id: "aamarpaytest",
merchant_id: "aamarpaytest",
currency: "BDT",
store_amount: "9.79",
pay_time: "2020-11-04 12:09:15",
amount: "10.00",
bank_txn: "6ED4FIJ1G0",
card_type: "bKash-bKash",
pg_card_risklevel: "",
pg_error_code_details: "true",
opt_a: "",
opt_b: "",
opt_c: "",
}
{
pg_service_charge_bdt: "0.21",
pg_service_charge_usd: "Not-Available",
pg_card_bank_name: "",
pg_card_bank_country: "",
card_number:: "01826323538",
card_holder: "",
cus_phone: "01870762472",
desc: "",
success_url: "http://localhost/aamarpay/callback/success.php",
fail_url: "https://example.com/fail",
cus_name: "Imtiaz Akil",
cus_email: "imtiaz@softbd.com",
currency_merchant: "BDT",
convertion_rate: "",
ip_address: "103.228.202.73",
other_currency: "10.00",
pay_status: "Successful",
pg_txnid: "AAM1604470136103451",
epw_txnid: "AAM1604470136103451",
mer_txnid: "asdkfljaw34543",
store_id: "aamarpaytest",
merchant_id: "aamarpaytest",
currency: "BDT",
store_amount: "9.79",
pay_time: "2020-11-04 12:09:15",
amount: "10.00",
bank_txn: "6ED4FIJ1G0",
card_type: "bKash-bKash",
pg_card_risklevel: "",
pg_error_code_details: "true",
opt_a: "",
opt_b: "",
opt_c: "",
}
Same data you will be get as a POST method in your fail_url when the transaction
is failed.
Note: We do not submit any data in cancel_url, it will be your product page link or
your home page link.
If you have any query you can contact with us at support@aamarpay.com
For integration query you can email us at integration@aamarpay.com
For integration query you can email us at integration@aamarpay.com