Setup and Integration
Callback URL
A. Support
Please take note that the Callback function is only applicable to integration using the shopping cart method. The Callback for WooCommerce and OpenCart are now available.
B. Purpose
Callback URL is used as an alternative notification to the merchant shopping cart in case of a breakdown in transaction flow. This function is only applicable to merchants who use the shopping cart method for integration with senangPay. This is optional so merchant can opt not to use this feature. However, this feature is recommended to ensure data integrity between merchant’s systems and senangPay’s.
C. Understanding breakdown in transaction flow
1. When a customer is doing a transaction using shopping cart, the customer will be redirected a few times to different systems.
2. If the transaction is approved by the bank but the customer encounters problems such as internet connection issues, there is a possibility that either:
- senangPay is updated with the correct transaction status but merchant online store is not.
- Both senangPay and the merchant online store is not updated with the correct transaction status.
D. Solution when there is a breakdown in transaction flow
1. Every transaction will go through a verification process in senangPay within 30 minutes to an hour after the initiation of the transaction. This buffer of 30 minutes to an 1 hour is to ensure that the transaction has been completed and that the status is final in Visa/Mastercard/FPX.
2. In case of a transaction breakdown where senangPay and the online merchant store is not updated with the latest status, senangPay will do a callback to the merchant once the verification process is done and senangPay has been updated with the latest status.
3. In case of a transaction breakdown where senangPay is updated with the latest status but the online merchant store is not, senangPay will do a callback immediately after the transaction is completed in senangPay.
4. If there is no breakdown in transaction, senangPay will still do a callback to the online merchant store once the transaction is completed in senangPay.
E. Parameters
The callback process entails sending the same parameters as the one sent to the return URL. The callback URL must print out a simple ‘OK’ in HTML format without any HTML tags.The OK response is needed in order for the callback function to know if it has successfully sent the callback data.
F. Callback failure
1. If the merchant has configured the URL for callback but senangPay is unable to connect to the URL or the URL did not return ‘OK’, senangPay will send an email to the merchant. The merchant must fix the issue and update their system with the correct status for the transaction. If you do not want to receive any failure email notification please set callback response as ‘Ignore the response’. (refer to next section for the location to set this). Take note that the callback URL must not be using session.
2. Please avoid using redirection for callback URL. This might lead to HTTP status 302.
G. Method
senangPay will send the data to callback URL using the HTTP POST method.
H. Callback Frequency
1. The frequency varies depending on the situation. If the transaction is still pending, senangPay will start sending callbacks 5 minutes after the transaction started. senangPay will send the callback in real time once it receives any status update from the banks.
2. The last callback will be 1 hour after the transaction started. This means you will receive multiple callbacks for the transactions.
3. It is also possible to receive a failed status followed by successful status. This is because the transaction is still not complete when senangPay made the initial query (for the status) with the banks.
4. The last callback will carry the final status of the transaction.
I. Where to set Callback URL ?
1. Go to Menu > Settings > Profile
2. Scroll down the page and you will see the setting fields on Shopping Cart Integration Link section
Please take note that :
- You might receive multiple callback for the same transaction. The latest callback data is considered as the most up-to-date data for the transaction.