Handle a notification
Alipay+ provides some notification interfaces to asynchronously notify the Acquiring Partner of the processing result. The Acquiring Partner needs to handle the notifications properly and returns a response to Alipay+.
The following table lists the notification interfaces that are provided for Auto Debit and how Alipay+ use them.
Used by Alipay+ to notify the Acquiring Partner of the authorization processing result, for example:
Used by Alipay+ to notify the Acquiring Partner of the payment processing result after handling the pay API request.
Used by Alipay+ to notify the Acquiring Partner of the merchant registration result after handling the registration API request.
How to handle a notification
The following sections describe the common things that the Acquiring Partner needs to take into consideration when handling the notification.
Accept a notification
For a scenario that a notification is required, an HTTP POST is fired. The HTTP request is sent in the raw JSON, of which the Content-Type request header is specified as
application/json. Ensure that the Acquiring Partner can access the HTTP body accordingly.
Verify the signature
The notification request that Alipay+ sends to the Acquiring Partner is signed. The merchant needs to verify the signature to confirm whether the notification is sent from Alipay+. For how to validate a signature, see Validate a signature.
After the notification is delivered successfully, verify and process the information from the notification body.
Acknowledge the notification with a response
After receiving the notification, no matter what the content in the notification request body is, the Acquiring Partner must return a receipt acknowledgment message to Alipay+. Meanwhile, the response must also be signed.
Note: The result in the notification response is only used for acknowledgment that whether the Acquiring Partner has received the notification or not.
For example, for a notifyPayment request, no matter what the payment result is specified in the request, as long as the Acquiring Partner receives the notification, the Acquiring Partner needs to return a response where the value of result.resultStatus must be set to
After receiving the notification, respond with an HTTP status code of
200 and send an acknowledgement with result.resultStatus of
S to indicate that your server received and processed the call. If you respond with another status code or acknowledge with other values, Alipay+ takes the notification delivery as unsuccessful. Therefore, Alipay+ will retry to send the notification.
- The interval between two adjacent times is: 2m, 10m, 10m, 1h, 2h, 6h, 15h
- The notifications will be sent 7 times at most, during a period of up to 24h22m. After that, no notifications will be sent anymore.
For more information about the notification interfaces, see: