Skip to main content
Version: 1.1

Process payment result

After the customer completes the payment process, the AppotaPay system notifies the result to the partner's system through 2 forms

Note
  • It is necessary to carefully check the status, amount & signature field parameters
  • It is recommended to call the api to check the transaction status to ensure the most accurate updated results
  • IPN is only returned when the transaction is successful

Redirect

Method: GET

Params in query

partnerCode=TEST&apiKey=oMhJpkz7K6HDcR6S&amount=50000& currency=VND&orderId=5f61d06311019 &bankCode=SHB&paymentMethod=ATM&paymentType=WEB&appotapayTransId=AP200910016654B&errorCode=0 &message=Thành+công&transactionTs=1600246241&extraData=test+test&tokenResult={\"status\":0,\"message\":\"Th\\u00e0nh c\\u00f4ng\",\"card\":{\"status\":\"active\",\"token\":\"2331123162638222\",\"card_name\":\"NGUYEN VAN A\",\"card_number\":\"970400xxxxxx0001\",\"card_date\":\"\",\"card_type\":\"ATM_CARD\"}} &signature=9487dd169d2178b249d1503d2f2d7f01d1210517f6ae3a2703760cb218c838f3

IPN (Instant Payment Notification)

Server AppotaPay send payment result to notifyUrl

Header

{
"Content-Type": "applicaton/json"
}

Method : POST

HTTP Request:

ParamsData typeDescription
errorCodeIntegerError code
messageStringError code detail
partnerCodeStringYour Partner code
apiKeyStringAPI KEY
amountIntegerPayment amount
currencyStringCurrency code (default: VND)
orderIdStringOrder ID
bankCodeStringBank Code
paymentMethodStringPayment method
paymentTypeStringPayment type (default: WEB)
appotapayTransIdStringAppotaPay transaction ID
transactionTsIntegerPayment time
extraDataStringExtra data
tokenResultStringInformation token and card saved
signatureStringSignature check data

signature = HMAC_SHA256(data, secretKey)

data: amount={amount}&apiKey={apiKey}&appotapayTransId={appotapayTransId}&bankCode={bankCode}& currency={currency}&errorCode={errorCode}&extraData={extraData}&message={message}&orderId={orderId}&partnerCode={partnerCode}&paymentMethod={paymentMethod}&paymentType={paymentType}&tokenResult={tokenResult}&transactionTs={transactionTs}

Signature example data: amount=2000&apiKey=FJcmF8uj2ISveL5FvvNk4pnp8xrhINz8&appotapayTransId=AP231437168954&bankCode=VCB&currency=VND&errorCode=0&extraData=string&message=Success&orderId=11034005&partnerCode=APPOTAPAY&paymentMethod=ATM&paymentType=WEB&tokenResult={"status":0,"message":"Th\u00e0nh c\u00f4ng","card":{"status":"active","token":"2331123162638222","card_name":"NGUYEN VAN A","card_number":"970400xxxxxx0001","card_date":"","card_type":"ATM_CARD"}}&transactionTs=1679542882

Example Request:

{
"errorCode":0,
"message":"Thành công",
"partnerCode": "TEST",
"apiKey": "oMhJpkz7K6HDcR6S",
"amount":50000,
"currency":"VND",
"orderId":"5f5b46cb73fd0",
"bankCode":"SHB",
"paymentMethod":"ATM",
"paymentType":"WEB",
"appotapayTransId":"AP200910014125B",
"transactionTs":1599817433,
"extraData":"test test",
"tokenResult": "{\"status\":0,\"message\":\"Th\\u00e0nh c\\u00f4ng\",\"card\":{\"status\":\"active\",\"token\":\"4120587300058051\",\"card_name\":\"NGUYEN VAN A\",\"card_number\":\"970400xxxxxx0001\",\"card_date\":\"\",\"card_type\":\"ATM_CARD\"}}",
"signature":"d6ff2d38c2b1167c6d17b9dbb1380347b24c1bf912dc442dbd018b2e1ed74f3d"
}

HTTP Response:

HTTP Code: 200
Body: {"status": "ok"}

Transaction Status

use errorCode param for checking transaction status

Error CodeStatus
= 0Transaction successfully
!= 0Transaction failed or pending

Checking data

Use signature param to check response data from AppotaPay.