Process payment result
After the customer completes the payment process, the AppotaPay system notifies the partner system of the transaction result via IPN.
Note
- Carefully verify the status, amount, and signature parameters before confirming a successful transaction.
- It is recommended to call the transaction status check API to ensure the result is updated accurately.
- Use the signature parameter to verify data integrity. The partner system must generate a signature from the received data and compare it with the signature provided by AppotaPay.
- IPN is sent only when the transaction reaches a final status: success, void, or error.
EndPoint
POST URL-IPN-PARTNER
Header Params
| Parameter | Requirement | Data types | Description |
|---|---|---|---|
| Content-Type | required | String | Value: application/json |
{
"Content-Type": "application/json"
}
Request Params
| Parameter | Requirement | Data types | Description |
|---|---|---|---|
| data | required | String | Transaction information is encoded in Base64 and JSON format |
| signature | required | String | HMAC_SECRETSHA256(data,SECRET_KEY) |
Data decoding
- The partner uses the Base64Decode function to decode the data in string format.
- The JSON_Decode function is used to decode the data a second time into JSON format.
| Parameter | Data types | Description | Notes |
|---|---|---|---|
| transaction | Object | Transaction information | |
| transaction.transaction_id | String | Transaction ID | |
| transaction.order_id | String | Order ID | |
| transaction.partner_ref_id | String | Partner reference transaction ID | |
| transaction.order_info | String | Order information | |
| transaction.status | String | Transaction status | pending = The transaction is pending. processing = The transaction is being processed. success = The transaction is successful. error = The transaction has failed. void = The transaction has been refunded. |
| transaction.amount | Integer | Payment amount | |
| transaction.bank_code | String | Bank codes *APPOTA: payment method = QR | |
| transaction.bank_type | String | *EWALLET: payment method = QR | |
| transaction.error_code | Integer | Transaction error code (Note: returned only if status != success) | |
| transaction.error_message | String | Transaction status details (Note: returned only if status != success) | |
| transaction.payment_method | String | Payment methods | |
| transaction.created_at | String | Transaction creation time (ISO 8601 format) | |
| transaction.paid_at | String | Transaction payment time (ISO 8601 format) | |
| version | String | Version IPN | |
| Time | string | Transaction confirm time (ISO 8601 format) |
Success
HTTP Code: 200
Body:
{"status": "ok"}
Failure
HTTP Status Code !=
200
| Parameter | Data types | Description |
|---|---|---|
| error_code | String | Error code |
| error_message | String | Error code description |