Skip to main content
Version: Lastest

Payment method callback

After creating the payment method, the AppotaPay system calls back the results to the partner's system

Note
  • Using the signature parameter to check the integrity of the received data, the partner creates a signature from the data received by AppotaPay and then compares it with the signature parameter sent by AppotaPay.

Web callback

AppotaPay will send the results via the API URL of the partner sending AppotaPay for configuration, the partner server checks the data integrity through the signature parameter then updates the status of the payment method.

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

Request params

Method: POST

ParamTypeDescription
dataStringTransaction information is encode with base64encode & json_encode format
signatureStringSignature to check data

signature = HMAC_SHA256(data, secretKey)

timeStringResponse time

Decode

  1. Partners use the Base64Decode function to decode data in string form.
  2. Use the JSON_Decode function to decode the data a second time in json form.
ParamRequiredTypeDescription
eventRequiredString

Event:

- payment_method.activated: when the payment method has been activated and can be used for recurring payment

- payment_method.failed: payment method triggers failure when performing authentication or authorization

- payment_method.inactivated: payment method cannot be used for payment

- payment_method.expired: payment method has expired and cannot be used for payment

dataRequiredObjectData
data.paymentMethodRefIdRequiredString

Unique reference code of partner

Partner-provided identifier for the payment method.

data.paymentMethodIdRequiredStringPayment Method ID
data.customerIdRequiredStringCustomer ID
data.countryRequiredStringCountry code of transaction
data.currencyRequiredStringCurrency unit
data.paymentMethodRequiredString

Payment method

- CC_SUBS: payment with credit card

- EWALLET_SUBS: payment with ewallet

data.reusabilityRequiredString

Describes whether or not the payment method can be reused for subsequent payments.

- MULTIPLE_USE: may be reused for subsequent payments

data.cardOptionalObjectCard information
data.card.propertiesOptionalObjectProperties
data.card.properties.skipThreeDSecureOptionalString

This field value is only configurable for reusability = MULTIPLE_USE to indicate whether to perform 3DS during the linking phase

- YES: skip to perform 3DS

- NO: perform 3DS

data.card.properties.successReturnUrlOptionalStringURL where the end-customer is redirected if the linking is successful.
data.card.properties.failureReturnUrlOptionalStringURL where the end-customer is redirected if the linking is failed.
data.card.cardInfoOptionalObjectCard information
data.card.cardInfo.cardNumberOptionalStringCard number
data.card.cardInfo.cardMonthOptionalStringCard expiry month, contain the leading zero (E.g. 03)
data.card.cardInfo.cardYearOptionalStringCard expiry year (E.g. 2024)
data.card.cardInfo.cardHolderNameOptionalStringCard holder name
data.ewalletOptionalObjectEwallet information
data.ewallet.serviceCodeOptionalStringEwallet code
data.ewallet.propertiesOptionalObjectProperties
data.ewallet.properties.successReturnUrlOptionalStringURL where the end-customer is redirected if the linking is successful.
data.ewallet.properties.pendingReturnUrlOptionalStringURL where the end-customer is redirected if the linking is pending.
data.ewallet.properties.failureReturnUrlOptionalStringURL where the end-customer is redirected if the linking is failed.
data.billingOptionalObjectBilling information
data.billing.countryOptionalStringCountry code
data.billing.cityOptionalStringCity
data.billing.provinceStateOptionalStringProvince/ state
data.billing.addressOptionalStringAddress
data.billing.zipcodeOptionalStringZip code
data.statusRequiredString

Trạng thái:

- PENDING: request to initiate payment method has been sent, AppotaPay is processing to activate the payment method, then waiting for callback from AppotaPay to update status

- REQUIRES_ACTION: additional actions need to be performed to activate the payment method, common actions are OTP validation or redirecting the user to the authentication page

- ACTIVE: the payment method has been activated

- INACTIVE: payment method cannot be used to make transactions

- EXPIRED: authorization has expired or been invalid

- FAILED: create payment method unsuccessfully

data.actionsOptionalArrayIf status is REQUIRES_ACTION, the object has specific information to perform the next action to activate the payment method
data.actions.*.urlOptionalStringURL to perform action
data.actions.*.actionOptionalString

The purpose the corresponding action

- AUTH - Trigger this action in order to authorize linking or payment

- RESEND_AUTH - Trigger this action in order to resend the authorization code to the end-customer

data.actions.*.methodOptionalString

HTTP method for calling the url.

- GET

- POST

data.createdAtRequiredStringCreation time (standard format: ISO-8601)
data.updatedAtRequiredStringLast updated time (standard format: ISO-8601)

Response format

  • The partner needs to respond to AppotaPay to confirm that they have received the result
  • The response is considered successful when HTTP code = 200