API Checkout - V1.2
Merchants can place orders by directly calling PayerMax server. Through this service, merchants can integrate various online payment methods such as debit cards, credit cards, and electronic wallets in India, Indonesia, and the Philippines. Easily have the ability to collect money from the Indian business.
1.Integration Steps
1.1 Call API and request to place an order
1.2 Open the H5 checkout page for users to pay according to the URL returned by PayerMax
1.3 Receive asynchronous callback notifications, process orders based on payment results
2.Payment parameters descriptions
Request and Response data format: application/json
2.1 Requested parameters:
PayerMax Payment Service Environment Address
Parameters | Type | Required or not | Max. length | Description | Sample value |
merchantId | String | Yes | 30 | Merchant ID assigned by PayerMax | SP12345678 |
bizType | String | Yes | 30 | Business code, “paymentTransQry” needs to be entered here for this API. | createTransOrder |
version | String | Yes | 5 | API version. Current value: 2.1 | 2.1 |
sign | String | Yes | 64 | For the MD5 character string signature, see | DD6F959727F2724B7FFFE16G8FF036F1 |
orderId | String | Yes | 64 | Merchant order id, only includes a-z, A-Z, 0-9, _. Different for each payment order | 1535876516149 |
custId | String | Yes | 64 | User ID provided by merchant | ZNW3e |
subject | String | Yes | 256 | Subject of order, which will be shown on cashier system. Suggest to assign goods title. | 3510 Gigs |
countryCode | String | Yes | 10 | For Country Code, capital letters, see | IN |
currency | String | Yes | 8 | For Currency Code, capital letters, see Must be consistent with countryCode, such as: Indian 'IN' corresponds to Indian Rupee 'INR' | INR |
totalAmount | String | Yes | 64 | Order amount | 150.00 |
frontCallBackUrl | String | Yes | 256 | Front-end redirect URL. The user will be redirected to this address after completing the payment, starting with http/https. | https://www.test.com/redirect/developer.html |
usePayResultType | String | Yes | 8 | Define whether to show PayerMax result page. 0 = no; 1 = yes. Value ‘1’ by default. | 1 |
transExpireTime | String | No | 10 | Define the payment duration in seconds, which is only available in India. If the order has not been completed within the duration, it will be closed. Range up to 72 hours. The default duration is 30 minutes(1800 seconds). | 1800 |
String | No | 32 | |||
mobileNo | String | No | 15 | User’s phone no. This value will be acquired for convenient selection when user’s phone no. is required for any payment channel. | |
language | String | No | 8 | Language settings, used to specify the display language of the cashier desk, English by default. Lowercase letters,see | en |
callbackUrl | String | No | 256 | Server-side call-back notification URL | https://****.com/payermax/rechargeNotify |
Requested parameters:
json
{
"merchantId": "SP12345678",
"bizType": "createTransOrder",
"version": "2.1",
"sign": "DD6F959727F2724B7FFFKI84DFF036F1",
"orderId": "1535433446149",
"custId": "ZNW3e",
"subject": "3510 Gigs",
"countryCode": "IN",
"currency": "INR",
"totalAmount": "150.00",
"frontCallBackUrl": "https://****.com/redirect/developer.html",
"usePayResultType": "1",
"transExpireTime": "1800",
"email": "",
"mobileNo": "",
"language": "en",
"callbackUrl": "https://****.com/payermax/rechargeNotify"
}
2.2 Response parameters:
Parameters | Type | Required | Max.length | Description | Sample value |
bizCode | String | Yes | 10 | Response code | 0000 |
data | Object | Yes | Response body,refer to the below【data parameters】 | ||
message | String | No | 256 | Response description, interface error prompt |
data parameters:
Parameters | Type | Required | Max.length | Description | Sample value |
tradeNo | String | Yes | 64 | payermax Platform Order ID | TRADE20190815020832111557141 |
orderId | String | Yes | 64 | Merchant Order ID | 1535433533149 |
requestUrl | String | Yes | 1024 | Jump to the result address.This address is valid for 15 minutes, after which the link fails | https://****.com/redirect/developer.html |
status | Number | Yes | 2 | The order status:0-Pending,1-Success,2-Failed; This parameter shows the current order status. The existing order status will be returned when the request is repeated. | 0 |
sign | String | Yes | 64 | For the MD5 character string signature, | DB73C116DE2F220A68BB96542885E171 |
Requested responses:
json
{
"data": {
"tradeNo": "TRADE201908150332111447141",
"orderId": "153543346149",
"requestUrl": "http://cashier-dev.payermax.com/index.html#/paySDKH5/cashierH5?merchantId=SP4189603&token=HrUbWDQkd7jcFp68AW2N7DOOHjb%2F9kh7RkljKNaLR7sgSfxVG5TvBbW89RNX%2ByQIU8P9auBWBCskuJJQxtO9HNZ%2BwhMG8lYR7l12k3%2FLaP%2BxhLEBDOjICucJS1bASn0V&tradeNo=TRADE20190815020832111447141&identifyId=8641043&language=en&usePayResultType=1&frontCallBackUrl=https%3A%2F%2Fxxx.com%2Fredirect%2Fdeveloper.html",
"status": 0,
"sign": "DB73C116DE2F220A68BB94322885E171"
},
"bizCode": "0000"
}
Response parameter processing example
js
//Response success
if(bizCode == "0000"){
if(status == 0){
//Jump to requestUrl
}else if(status == 1){
//Success
}else{
//Failure
}
}