Home >Backend Development >PHP Tutorial >How should the notify_url page be written, and how to get the notification message from Alipay after the payment is successful?
How should the notify_url page be written, how to get the Alipay notification message after the payment is successful, and how to process the payment status of the order in real time through asynchronous callbacks
How should the notify_url page be written, how to get the Alipay notification message after the payment is successful, and how to process the payment status of the order in real time through asynchronous callbacks
The Alipay docking document contains instructions on how Alipay will call your notify_url
. You can obtain the information given by Alipay based on the listed parameters, and then process the order. In addition, you need to ensure that your address can be accessed by Alipay, which means that your address should be accessible on the public Internet.
After successful Alipay payment, there will be two types of callbacks: synchronous and asynchronous. The web page that jumps synchronously can be blocked by the user, so it is better to write the payment callback in the asynchronous callback.
How to write asynchronous callback, please pay attention to the following:
Be sure to log, and save the received parameters and reply parameters as well as the results of key steps in the log.
Prevent duplicate submission processing. In fact, it is the main business logic of callback. (Add money to users, change fields, etc.)
Alipay’s documents all have demos in various languages, which can be used with almost any modification. Then just modify it to suit your own framework.