Skip to main content
Version: Lastest

PLan action callback

After creating the plan and the client performing information validation, the AppotaPay system calls back the results of the requires action to the partner.

Lưu ý
  • 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.

Redirect

AppotaPay will send the results via the API URL. The partner's URL has been sent to the API via the returnUrl parameters. The partner's server checks the data integrity via the signature parameter and then updates the status of the plan.

Request params

Method: GET

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
planRefIdRequiredString

Unique reference code of partner.

Partner-provided identifier for the plan.

planIdRequiredStringAppotaPay-generated subscription plan ID
customerIdRequiredStringCustomer ID
currencyRequiredStringCurrency unit
amountRequiredIntegerPayment amount
paymentMethodsRequiredArray

Payment method list

(Only show if the integration model is Merchant hosted)

paymentMethods.*.paymentMethodIdRequiredStringPayment method ID
paymentMethods.*.rankRequiredIntegerIndicate the order which payments methods will be attempted for a payment cycle instance. Available values - 1 to 5
immediateActionTypeOptionalString

Charge immediately when successfully creating the plan, null: charge at anchorDate time

- FULL_AMOUNT: charge when successfully initializing the plan

failedCycleActionRequiredString

Action of plan when the payment cycle fails

- STOP: Stop the plan

- RESUME: Skip the failed cycle and proceed to the next cycle

serviceNameOptionalString

Service name of subscription plan

(Only show if the integration model is Checkout Page)

statusRequiredString

Status:

- PENDING: request to initiate plan has been sent, wait exact status from AppotaPay

- REQUIRES_ACITON: additional actions need to be performed to activate plan

- ACTIVE: plan is activated to perform recurring payment with specific schedule

- INACTIVE: plan is inactivated or created unsuccessfully

actionsOptionalArrayIf status is REQUIRES_ACTION, the object has specific information to perform the next action to activate the payment method
actions.*.urlOptionalStringURL to perform action
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

actions.*.methodOptionalString

HTTP method for calling the url.

- GET

- POST

scheduleRequiredObjectObject containing the configurations of how Subscriptions cycles will be scheduled
schedule.intervalRequiredStringThe type of interval between consecutive Subscriptions cycles
schedule.intervalCountRequiredStringThe number of units of interval between consecutive Subscriptions cycles
schedule.totalRecurrenceOptionalInteger

The total number of times the end user will be charged

If the parameter is not used, Subscriptions plan will run on indefinitely

schedule.anchorDateOptionalString

Time to make recurring payments

Default: the date of schedule creation

Supported values: Timestamps between 1st to 28th of a month

Note: if anchorDate is null or date of schedule creation falls on 29/30/31, anchor date will be defaulted to 1st of next month

schedule.retryIntervalOptionalStringThe type of interval between failed attempt and retries.
schedule.retryIntervalCountOptionalIntegerThe number of units of retryInterval between consecutive retries
notificationConfig.[subscription.cycle.retrying]OptionalArray

Specify which channel you want to notify your customer through when the cycle is unsuccessful, so it's necessary to attempt the next time

Accepted value ["EMAIL"]

notificationConfig.[subscription.cycle.succeeded]OptionalArray

Specify which channel you want to notify your customer through when the cycle is successfully completed

Accepted value ["EMAIL"]

notificationConfig.[subscription.cycle.failed]OptionalArray

Specify which channel you want to notify your customer through when the cycle failed

Accepted value ["EMAIL"]

notificationConfig.[subscription.plan.activated]OptionalArray

Specify which channel you want to notify your customer through when the subscription plan is activated

Accepted value ["EMAIL"]

notificationConfig.[subscription.plan.inactivated]OptionalArray

Specify which channel you want to notify your customer through when the subscription plan is inactivated

Accepted value ["EMAIL"]

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