Process payment result
After the customer completes the payment process, the AppotaPay system notifies the result to the partner's system through 2 forms
- It is necessary to thoroughly check the parameters status, orderAmount, and signature to ensure they are valid before confirming the transaction as successful
- It is recommended to call the api to check the transaction status to ensure the most accurate updated results
- Use the 'signature' parameter to verify the integrity of the received data. The partner generates a signature from the data received from AppotaPay, then compares it with the 'signature' parameter sent by AppotaPay
- IPN is only returned when the transaction is successful
Redirect URL
- Customers will be directed to the partner's URL passed through the API via the 'redirectUrl' parameter.
- On this page, the partner checks the data, transaction status, and displays notifications to the customer.
The parameters (query string) sent along with the URL
Method: GET
Params | Data type | Description |
---|---|---|
data | String | The transaction information is in base64encode & json_encode format. |
signature | String | Signature to verify data integrity signature = |
time | String | Response time |
Example result
data=eyJ0cmFuc2FjdGlvbiI6eyJlcnJvckNvZGUiOjAsIm1lc3NhZ2UiOiJUaFx1MDBlMG5oIGNcdTAwZjRuZyIsInBhcnRuZXJDb2RlIjoiVEVTVCIsImFwaUtleSI6Im9NaEpwa3o3SzZIRGNSNlMiLCJvcmRlckFtb3VudCI6NTAwMDAsImFtb3VudCI6NTAwMDAsImRpc2NvdW50QW1vdW50IjowLCJmZWVVc2VyIjowLCJzdGF0dXMiOiJzdWNjZXNzIiwiY3VycmVuY3kiOiJWTkQiLCJvcmRlcklkIjoiNWY1YjQ2Y2I3M2ZkMCIsImJhbmtDb2RlIjoiU0hCIiwicGF5bWVudE1ldGhvZCI6IkFUTSIsInBheW1lbnRUeXBlIjoiV0VCIiwiYXBwb3RhcGF5VHJhbnNJZCI6IkFQMjAwOTEwMDE0MTI1QiIsInRyYW5zYWN0aW9uVHMiOjE1OTk4MTc0MzMsImV4dHJhRGF0YSI6InRlc3QgdGVzdCJ9fQ==
&signature=9487dd169d2178b249d1503d2f2d7f01d1210517f6ae3a2703760cb218c838f3&time=53485768945
IPN (Instant Payment Notification)
AppotaPay will send transaction notifications via the partner's API URL submitted to the API through the 'notifyUrl' parameter. The partner's server verifies the integrity of the data via the 'signature' parameter and then updates the status of the order
Header
{
"Content-Type": "applicaton/json"
}
Response params
Method: POST
Params | Data type | Description |
---|---|---|
data | String | The transaction information is in base64encode & json_encode format |
signature | String | Signature to verify data integrity signature = data: |
time | String | Response time |
Decode data
In both IPN & URL, when notifying the Partner, the data format will be the same.
1.The partner uses the Base64Decode function to decode the data into a string. 2.Use the JSON_Decode function to decode the data for the second time into JSON forma
Params | Requirement | Data type | Description |
---|---|---|---|
transaction | required | Object | Transaction information |
transaction.transactionId | required | String | The transaction code on AppotaPay's side |
transaction.reconciliationId | optional | String | The settlement transaction code when the transaction is successful |
transaction.partnerCode | required | String | Partnercode |
transaction.status | required | String | [Transaction status](#Status code table) |
transaction.errorCode | required | Integer | Error code table |
transaction.errorMessage | required | String | Error description |
transaction.orderAmount | required | Integer | Order amount |
transaction.amount | required | Integer | The payment amount to the provider |
transaction.discountAmount | required | Integer | Discount amount |
transaction.currency | required | String | Currency unit |
transaction.bankCode | optional | String | Bankcode Selected by the customer |
transaction.paymentMethod | required | String | Payment method |
transaction.action | required | String | Type of payment |
transaction.clientIp | optional | String | Customer's payment IP |
transaction.version | optional | String | Version API |
transaction.fee | optional | Object | Payment fee |
transaction.fee.customer_fee | optional | String | Payment fee charged to the custome |
transaction.createdAt | required | String | Transaction creation time. (in RFC-3339 standard format) |
transaction.updatedAt | required | String | Transaction update time. (in RFC-3339 standard format) |
partnerReference.order.id | required | String | Partner's order code |
partnerReference.order.info | required | String | Order information |
partnerReference.order.extraData | required | String | Optional additional information |
tokenResult | optional | String | Information token and card saved |
Status code table
Status | Description |
---|---|
pending | The transaction is pending processing. |
processing | The transaction is currently being processed. |
success | The transaction is successful. |
error | The transaction has failed. |
Token info
Code | Description |
---|---|
status | Card status |
message | Error message |
card | Card info |
card.status | Card status |
card.token | Token information for next payment |
card.card_number | Card number |
card.card_name | Card holder |
card.card_date | Issue/ Expiry date on card |
card.card_type | Card type |
Example Request:
{
"data": "eyJ0cmFuc2FjdGlvbiI6eyJ0cmFuc2FjdGlvbklk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171846e6962c5537c546ec5d6e6a864800db2366c330f418d7eff87661248a4c"
}
Response format
- When confirming a successful transaction via IPN, the partner needs to respond to AppotaPay to confirm that they have received the result
- In case the partner does not respond successfully, AppotaPay will attempt to respond up to 3 times, with a 5-minute interval between each attempt.
- The response is considered successful when HTTP code = 200 and the status parameter in the response body = 'ok'.
Example success response
HTTP Code: 200
Body:
{"status": "ok"}