Payment process
Explain
- Step 1: Customers choose services and products and then choose the form of payment via ATM / Visa card.
- Step 2, 3: The Partner server calls the AppotaPay server and receives the payment URL
- Step 4: The Partner's website or app redirects the customer to the checkout page URL
- Step 5, 6: Customers make the payment
- Step 7, 8: AppotaPay process the transaction then redirect to the partner’s url. At the same time, the AppotaPay server calls the IPN API (
notifyUrl
) of the partner server to notify the transaction result. - Step 9: The Partner's website or app displays the results to customers.
Note
Before processing the transaction, you should call the api to check the transaction status & carefully check the parameters of the status, amount & signature fields
API Integration Payment
ATM/Visa/Mastercard payments support token-saving payments (save card information for future payments)
(only supports some providers)
Endpoint: POST /api/v1/orders/payment/bank
Header: How to generate JWT_TOKEN
{
"X-APPOTAPAY-AUTH": Bearer JWT_TOKEN,
"Content-Type": "application/json"
}
HTTP Request:
Params | Required | Data type | Description |
---|---|---|---|
orderId | √ | String | Partner's Order ID |
orderInfo | √ | String | Order info (max 150 characters) |
amount | √ | Number | Payment amount |
clientIp | √ | String | Customer's IP address |
notifyUrl | √ | String | IPN URL to receive the transaction result. |
redirectUrl | √ | String | URL to redirect |
paymentMethod | String | Payment method | |
bankCode | String | Bank Code | |
extraData | String | Additional information optional | |
signature | √ | String | Signature check data signature = data: |
Example Request:
{
"amount": 10000,
"orderId": "5f61cf4f41e2b",
"orderInfo": "test",
"bankCode": "VCB",
"paymentMethod": "ATM",
"clientIp": "103.53.171.140",
"extraData": "",
"notifyUrl": "http://yourwebsite.com/ipn",
"redirectUrl": "http://yourwebsite.com/redirect",
"signature": "5c25b7b7607fd982d715a7e8f6c3c352672a9f76ba1362298d54874e312d1a67"
}
HTTP Response:
Params | Data type | Description |
---|---|---|
errorCode | Integer | Error Code |
message | String | Error code detail |
orderId | String | Order ID |
amount | Integer | Payment amount |
paymentUrl | String | Payment URL |
signature | String | Signature check data |
Example Response:
{
"errorCode": 0,
"message": "Thành công",
"orderId": "5f62d5bdbe3aa",
"amount": 50000,
"paymentUrl": "https://payment.dev.appotapay.com/bank/payment/process?tran=dGlkPUFQMjAwOTEwMDE4MjI5QiZvcmRlcklkPTVmNjJkNWJkYmUzYWEmdHM9MTYwMDMxMjc2Ng&sign=1a1fb2411ad118faa822867a81072138313580d5a099a68e64f8255b5bf69bf5",
"signature": "28263c482a5fa75c8c388d12477b10e4ee76572c28fce0cd4d089053b25a0392"
}