Alipay+ DocsAlipay+ Docs

Notify the payment result

The Acquiring Service Provider (ACQP) can call the notifyPushPayment API to notify Alipay+ of the payment result when the payment reaches a final status of success or failure.

To notify Alipay+ of the final payment result, you (the ACQP) need to complete the following steps:

Step 1: Send the payment notification to Alipay+.

Step 2: Receive the acknowledgment response from Alipay+.

Step 1: Send the payment notification

When the payment reaches a final status of success or failure, you can send the payment result notification to Alipay+ and pay attention to the rules below.

  • If the payment succeeds, send a paymentResult.resultStatus of S and paymentResult.resultCode of SUCCESS.
  • If the payment fails, send a paymentResult.resultStatus of F and an error code that corresponds to a specific reason.
    • Recommended: If the payment is declined for risk reasons, send a paymentResult.resultCode of RISK_REJECT.
    • Recommended: If the merchant's KYB failed or KYB level is not high enough, send a paymentResult.resultCode of MERCHANT_KYB_NOT_QUALIFIED.

Sample

The ACQP sends a payment notification request that indicates a successful payment.

copy
{
  "paymentResult": {
    "resultCode": "SUCCESS",
    "resultStatus": "S",
    "resultMessage": "success"
  },
  "paymentRequestId": "pay_1089760038715669_102775745070000",
  "paymentId": "20200101234567890130000",
  "paymentTime": "2020-01-01T12:01:01+08:30",
}

Step 2: Receive the acknowledgment response

After receiving the payment notification from the ACQP, Alipay+ returns an acknowledgment response to the ACQP. It is recommended that you detect whether Alipay+ fails to return the response with the parameter result.resultStatus of S and handle the response according to the instructions below.

result.resultStatus

result.resultCode

Notification status

Actions

S

SUCCESS

Notification succeeds.

N/A

F

...

Notification fails.

Take actions according to the result code (specified in the result.resultCode parameter). For more information, see Result codes in the API reference for notifyPushPayment.

U

...

Unknown

Retry the same request as below.

  • Retry 1~2 times within 5 seconds.
  • The subsequent intervals increase consecutively. For example, 30s, 1min, 2min, ...
  • A total of 15 retries are suggested.

No result received

Unknown

Sample

The ACQP receives a response that indicates Alipay+ has successfully received the notification.

copy
{
 "result": {
    "resultCode":"SUCCESS",
    "resultStatus":"S",
    "resultMessage":"Success"
 }
}

More information

For more information about how to use the notifiyPushPayment API, see notifyPushPayment.