Skip to main content
Version: 1.1

Payment process

Payment process image

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.1/orders/payment/bank

Header: How to generate JWT_TOKEN

{
"X-APPOTAPAY-AUTH": Bearer JWT_TOKEN,
"Content-Type": "application/json"
}

HTTP Request:

ParamsRequiredData typeDescription
orderIdStringPartner's Order ID
orderInfoStringOrder info (max 150 characters)
amountNumberPayment amount
clientIpStringCustomer's IP address
notifyUrlStringIPN URL to receive the transaction result.
redirectUrlStringURL to redirect
paymentMethodStringPayment method
bankCodeStringBank Code
actionStringAction payment
tokenStringToken used for payment (in case of using token)
extraDataStringAdditional information optional
signatureStringSignature check data

signature = HMAC_SHA256(data, secretKey)

data: amount={amount}&bankCode={bankCode}&clientIp={clientIp}&extraData={extraData}&notifyUrl={notifyUrl}&orderId={orderId}&orderInfo={orderInfo}&paymentMethod={paymentMethod}&redirectUrl={redirectUrl}&redirectUrl={redirectUrl}&token={token}

Example Request

{
"amount": 10000,
"orderId": "5f61cf4f41e2b",
"orderInfo": "test",
"bankCode": "VCB",
"paymentMethod": "ATM",
"clientIp": "103.53.171.140",
"extraData": "",
"action": "PAY",
"notifyUrl": "https://yourwebsite.com/ipn",
"redirectUrl": "https://yourwebsite.com/redirect",
"signature": "2308245a61934a85d10b4e03b7663b9ee4b64651cc8f885ad0dc67c8b729fec5"
}

HTTP Response:

ParamsData typeDescription
errorCodeIntegerError Code
messageStringError code detail
orderIdStringOrder ID
amountIntegerPayment amount
paymentUrlStringPayment URL
signatureStringSignature 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"
}