Setup and Integration
Advance Recurring Callback
The advance Recurring Callback enables merchants to receive detailed recurring callback data in the JSON format. The normal callback setup will send a standard HTTP POST data to merchants.
A. How to enable the feature
1. Login into your senangPay dashboard
2. Go to Menu > Setting > Profile
3. Scroll down to the Shopping Cart Integration Link section.
4. Under the Recurring Callback URL input field, you will see a checkbox to enable the advance callback setting.
5. Tick the checkbox to allow senangPay to send the recurring callback data in the JSON format. Untick to receive the standard callback data format.
B. The JSON structure
Once you enable the advance callback feature, all your recurring callbacks will be sent in the JSON format with data as described below:
|recurring_id||The ID of your recurring payment.|
|status_id||This is to indicate the status of the payment. It only has 2 values which are; 1 for successful and 0 for failed.|
|order_id||This is the order that is sent to senangPay. This is to identify the shopping cart transaction.|
|transaction_id||This is the transaction ID used by senangPay. You can use this ID to track the transaction in senangPay|
|msg||This is the message to describe the payment status. The maximum length is 100 characters. Take note that the message may contain underscores. You can replace the underscore as space when displaying the message to your customer. Example: Payment_was_successful.|
|hash||This is the data to ensure the data integrity has passed from senangPay to the merchant’s shopping cart.|
|next_payment_date||Next payment date in UNIX timestamp.|
|payment_details||JSON array of payment schedule for recurring instalment, and payment history for recurring subscription.|
C. What if I have set the Return URL parameters set?
1. If you have custom return URL parameters, the JSON will follow the key and value set in your return URL parameters.
2. For example, if you have set the custom parameters as below, the JSON object will become as below:
- Return URL Parameters:
D. Parameters to send and generating the hash
Nothing is changed with the steps mentioned in our recurring API here. Enabling the advance recurring callback feature will only reflect the way senangPay sends the callback to your system.