Alipay+ DocsAlipay+ Docs

Obtain payment results

After calling the pay API, the Acquiring Partner (ACQP) can get the payment result in the following three ways:

  • Get the payment result from the synchronous response of the pay API.
  • Get the payment result from the asynchronous payment notification sent by Alipay+ through the notifyPayment API.
  • Call the inquiryPayment API to inquire about the payment result.

You (the ACQP) are required to support all three methods so that you are guaranteed to obtain the final payment result. For example, when you cannot receive the payment result notification due to network or system problems, the inquiryPayment API can work as a complement to ensure you get the final (success or failure) payment result.

Payment results obtained by the three methods might be inconsistent. This is because the payment result returned by the response of the pay API and the inquiryPayment API might be in the intermediate state (unknown). To get the final state of the payment result, you need to keep retrying the inquiryPayment API call and wait for Alipay+ to send the notifyPayment request. For how these two APIs collaborate to ensure you get the final payment result, see Collaboration between the notifyPayment and inquiryPayment APIs.

The following diagram illustrates all the possible combinations of the results that you might encounter in the three ways.

Obtain payment results

Figure 1. Possible combinations of the results

For how to receive payment notification through the notifyPayment API, see Receive payment notification.

For how to use the inquiryPayment API to inquire about the payment result, see Inquire about payment result.