Integration
Merchants want to integrate the payment flow on their cashier page, PayerMax provides Direct API access. For the Direct API interface, merchants need to have PCI-DSS certification if they process card number information by themselves.
1. Integration Steps
On the checkout page, the merchant calls the Direct API-Apply Token interface to obtain the secure URL for security authentication;
Merchants need to open secureUrl in the form of a hidden Iframe on the checkout page. The opening method can refer to the following code:
// only js
function doRiskCollect(secureUrl) {
const iframe = document.createElement('iframe')
iframe.width = 0
iframe.height = 0
iframe.style.visibility = 'hidden'
iframe.style.display = 'none'
iframe.src = secureUrl
document.body.appendChild(iframe)
}
//all on the merchant app after placing an order
doRiskCollect([SECURE_URL]);
3)The user enters payment information on the checkout page and calls the Direct API interface to complete the payment.
2. Order Repeat Check
When a merchant submits a Direct API request, the submitted order number must be unique. If PayerMax recognizes that the merchant is requesting with the same order number, it will reject the request and return: Duplicate order.
3. Response Scenarios
The transaction status of Direct API access is divided into the following scenarios:
- Complete the payment online, please update the transaction result according to【Transaction Status】in the response, and do not update the transaction result according to the code and message.
- Redirect to wallet/bank/3ds authentication, the response contains redirectUrl, please update the transaction result according to【Callback Notification】
4. API Parameters
For details, please refer: API