Respond to inquiries
Alipay+ calls the inquiryPushPayment API to inquire about the payment result of the Acquiring Service Provider (ACQP) before receiving the final payment result (success or failure) from the ACQP.
Processing logic
When responding to the inquiryPushPayment request from Alipay+, you need to pay attention to the rules below.
- You need to return two kinds of results. The parameter result is the result of the API call and the parameter paymentResult is the result of the payment.
- If the payment order does not exist, return a result.resultStatus of
F
and result.resultCode ofORDER_NOT_EXIST
. - If the payment order exists, return a result.resultStatus of
S
, a result.resultCode ofSUCCESS
, and a paymentResult according to your payment result.
- If the payment succeeds, return a paymentResult.resultStatus of
S
, a paymentResult.resultCode ofSUCCESS
. - If the payment is being processed, return a paymentResult.resultStatus of
U
, a paymentResult.resultCode ofPAYMENT_IN_PROCESS
. - If the payment fails, return a paymentResult.resultStatus of
F
and an error code that corresponds to a specific reason.
- Recommended: If the payment is declined for risk reasons, return a paymentResult.resultCode of
RISK_REJECT
. - Recommended: If the merchant's KYB failed or KYB level is not high enough, return a paymentResult.resultCode of
MERCHANT_KYB_NOT_QUALIFIED
.
- When no response from the ACQP is received, Alipay+ retries the inquiry request at incremental time intervals until receiving the final payment result status of
S
orF
, or until the payment expires. Currently, the intervals are 4s, 4s, 30s, 60s, 60s, 60s, 5min, and 5min. The intervals are subject to change in the future by Alipay+.
Sample
Alipay+ sends the payment inquiry request.
copy
{
"acquirerId": "1022188000000000001",
"pspId": "1022172000000000001",
"paymentRequestId": "20200101234567890132",
"paymentId": "20232112212211221212",
"codeValue": "00020201021126580014A000000615000101065887340212MBBQR1666203031000000000005204729853034585802MY5915RUMAHSIHATKIT"
}
The ACQP returns a response that indicates a successful payment.
copy
{
"result": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "success"
},
"paymentResult": {
"resultCode": "SUCCESS",
"resultStatus": "S",
"resultMessage": "success"
},
"paymentRequestId": "20200101234567890133333",
"paymentTime": "2020-01-01T12:01:01+08:30"
}
More information
For more information about how to use the inquiryPushPayment API, see inquiryPushPayment.