Alipay+Alipay+

Payment exception handling

What are the common exceptions that may occur after a payment is initiated? What are the best practices to handle these exceptions?

The most common exception is timeout. When a payment is processed, Alipay+ sends an asynchronous notification to you for the result. If you do not receive a notification, you can call the inquiryPayment API to inquire about the payment result. The inquiryPayment call can be retried if no response is received or the PAYMENT_IN_PROCESS status is received.

If the user or merchant cancels or revokes the transaction, you can call the cancelPayment API within the cancellable period to reverse the transaction. After the cancellable period, the transaction will be posted to MPP and you can call the refund API to refund the transaction. However, fees and charges apply for a refund.