Skip to main content
Version: Lastest

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 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

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

ParamsData typeDescription
dataStringThe transaction information is in base64encode & json_encode format.
signatureStringSignature to verify data integrity

signature = HMAC_SHA256(data, secretKey)

timeStringResponse 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

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

Response params

Method: POST

ParamsData typeDescription
dataStringThe transaction information is in base64encode & json_encode format
signatureStringSignature to verify data integrity

signature = HMAC_SHA256(data, secretKey)

data: data={data}

timeStringResponse 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

ParamsRequirementData typeDescription
transactionrequiredObjectTransaction information
transaction.transactionIdrequiredStringThe transaction code on AppotaPay's side
transaction.reconciliationIdoptionalStringThe settlement transaction code when the transaction is successful
transaction.partnerCoderequiredStringPartnercode
transaction.statusrequiredString[Transaction status](#Status code table)
transaction.errorCoderequiredStringError code table
transaction.errorMessagerequiredStringError description
transaction.orderAmountrequiredIntegerOrder amount
transaction.amountrequiredIntegerThe payment amount to the provider
transaction.discountAmountrequiredIntegerDiscount amount
transaction.currencyrequiredStringCurrency unit
transaction.bankCodeoptionalStringBankcode Selected by the customer
transaction.paymentMethodrequiredStringPayment method
transaction.actionrequiredStringType of payment
transaction.clientIpoptionalStringCustomer's payment IP
transaction.versionoptionalStringVersion API
transaction.feeoptionalObjectPayment fee
transaction.fee.customer_feeoptionalStringPayment fee charged to the custome
transaction.createdAtrequiredStringTransaction creation time. (in RFC-3339 standard format)
transaction.updatedAtrequiredStringTransaction update time. (in RFC-3339 standard format)
partnerReference.order.idrequiredStringPartner's order code
partnerReference.order.inforequiredStringOrder information
partnerReference.order.extraDatarequiredStringOptional additional information

Status code table

StatusDescription
pendingThe transaction is pending processing.
processingThe transaction is currently being processed.
successThe transaction is successful.
errorThe transaction has failed.

Example Request:

{

}

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"}