Accept a payment
After the account binding process is completed, the merchant can initiate a payment with the access token that is retrieved during the account binding process, without involving any further user interactions.
The following figure illustrates the workflow of how to initiate and process a payment.
Figure 1. The payment processing workflow of Auto Debit
Acquiring Service Provider actions
After receiving the payment request from the merchant, the Acquiring Service Provider (ACQP) needs to call the pay interface from Alipay+ to process the payment. When Alipay+ returns the response of the pay request, the ACQP needs to handle the payment result and return it to the merchant.
Initiate a payment request
After the account binding process is completed, the merchant as the auth client, obtains the user authorization (the access token). Then the merchant can initiate a payment request according to the business scenario, which can be an individual payment request or one of the subscription payment requests. The ACQP then uses the access token to assemble a request to call the pay interface.
- The following list provides the key information that the ACQP needs to take into consideration when configuring the request parameters of the pay interface:
- paymentAmount.currency: specifies the transaction currency.
- paymentAmount.value: the value of this parameter must be in the smallest currency unit. For example, when the currency is HKD, $5.99 must be specified as 599. When the currency is JPY, ￥599 must be specified as 599. Check ISO 4217 Currency Code for more details.
- paymentMethod.paymentMethodType: the value of this parameter must be set to
- paymentMethod.paymentMethodId: specifies the value of the accessToken parameter that is obtained in the account binding process.
- paymentFactor.isAgreementPayment: the value of this parameter must be set to
- paymentFactor.presentmentMode: the value of this parameter must be set to
- paymentExpiryTime: the expiration time expected for this payment. Normally, the Auto Debit payment can be processed and results can return synchronously in a very short time. However, when some issues (such as network timeout) occur, the payment will be closed by Alipay+ when the time reaches the expiration time. By default, the expiration time is 1 minute.
- paymentRequestId: must be a uniqure ID that is assigned by the payment initiator to identify an order payment.
- The following table lists the different results that the ACQP might receive from Alipay+.
Payment succeeds, which means the money is deducted from the user. Update the status from merchant side.
Payment fails. Take actions according to the error message in result.resultCode.
Payment in processing. Call the inquiryPayment interface to inquire the payment result. The inquiry request can be sent 10 to 20 times within 60 seconds.
No result received
The ACQP sends a request to Alipay+.
Alipay+ returns a response to the ACQP.
For more information about how to use the pay interface (such as the field description and format), see pay.