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.
- 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 thesignature
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
Param | Type | Description |
---|---|---|
data | String | Transaction information is encode with base64encode & json_encode format |
signature | String | signature to check data signature = |
time | String | Response time |
Decode
- Partners use the
Base64Decode
function to decode data in string form. - Use the
JSON_Decode
function to decode the data a second time in json form.
Param | Required | Type | Description |
---|---|---|---|
planRefId | Required | String | Unique reference code of partner. Partner-provided identifier for the plan. |
planId | Required | String | AppotaPay-generated subscription plan ID |
customerId | Required | String | Customer ID |
currency | Required | String | Currency unit |
amount | Required | Integer | Payment amount |
paymentMethods | Required | Array | Payment method list (Only show if the integration model is Merchant hosted) |
paymentMethods.*.paymentMethodId | Required | String | Payment method ID |
paymentMethods.*.rank | Required | Integer | Indicate the order which payments methods will be attempted for a payment cycle instance. Available values - 1 to 5 |
immediateActionType | Optional | String | Charge immediately when successfully creating the plan, null: charge at anchorDate time - FULL_AMOUNT: charge when successfully initializing the plan |
failedCycleAction | Required | String | Action of plan when the payment cycle fails - STOP: Stop the plan - RESUME: Skip the failed cycle and proceed to the next cycle |
serviceName | Optional | String | Service name of subscription plan (Only show if the integration model is Checkout Page) |
status | Required | String | 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 |
actions | Optional | Array | If status is REQUIRES_ACTION, the object has specific information to perform the next action to activate the payment method |
actions.*.url | Optional | String | URL to perform action |
actions.*.action | Optional | String | 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.*.method | Optional | String | HTTP method for calling the url. - GET - POST |
schedule | Required | Object | Object containing the configurations of how Subscriptions cycles will be scheduled |
schedule.interval | Required | String | The type of interval between consecutive Subscriptions cycles |
schedule.intervalCount | Required | String | The number of units of interval between consecutive Subscriptions cycles |
schedule.totalRecurrence | Optional | Integer | The total number of times the end user will be charged If the parameter is not used, Subscriptions plan will run on indefinitely |
schedule.anchorDate | Optional | String | 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.retryInterval | Optional | String | The type of interval between failed attempt and retries. |
schedule.retryIntervalCount | Optional | Integer | The number of units of retryInterval between consecutive retries |
notificationConfig.[subscription.cycle.retrying] | Optional | Array | 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] | Optional | Array | Specify which channel you want to notify your customer through when the cycle is successfully completed Accepted value ["EMAIL"] |
notificationConfig.[subscription.cycle.failed] | Optional | Array | Specify which channel you want to notify your customer through when the cycle failed Accepted value ["EMAIL"] |
notificationConfig.[subscription.plan.activated] | Optional | Array | Specify which channel you want to notify your customer through when the subscription plan is activated Accepted value ["EMAIL"] |
notificationConfig.[subscription.plan.inactivated] | Optional | Array | Specify which channel you want to notify your customer through when the subscription plan is inactivated Accepted value ["EMAIL"] |
createdAt | Required | String | Creation time (standard format: ISO-8601) |
updatedAt | Required | String | Last updated time (standard format: ISO-8601) |