To integrate the Merchant-presented Mode Payment Entry Code Payment, the Acquiring Partner (ACQP) needs to complete the following steps.
In certain countries or regions, for legal or compliance reasons, the merchant information that is related to this payment must be registered before a payment can be processed. The merchant registration process only needs to be performed once.
The following figure illustrates the merchant registration flow:
Figure 2. Merchant registration flow
When processing merchant registration requests, Mobile Payment Partner must pay attention to the following items:
- Batch operations are not supported. Each time, only one merchant or store can be registered.
- For the cashier payment scenario, at least the merchant information must be registered.
- The response of the merchant registration request only indicates that the registration request is successfully accepted.
- Mobile Payment Partner returns the registration status to Alipay+ asynchronously (normally within 7 days), the ACQP can obtain the registration result by using inquiryRegistrationStatus interface.
- Alipay+ will notify the ACQP of the merchant registration status via notifyRegistrationStatus interface if the ACQP integrates this interface.
Alipay+ sends merchant registration request to Mobile Payment Partner.
Mobile Payment Partner returns result to Alipay+.
For more information about how to use the APIs (such as the field description), see registration.
Create an entry code
The Entry code is a static QR code which in fact is an encoded URL pointing to an WAP page. Users can enter an order amount on this WAP page. The following rules apply:
- Ensure that the WAP pages can only be accessed by using the HTTPS protocol.
- On the WAP page, the ACQP needs to provide fields to collect information such as payment amount.
- Transfer the WAP page address (URL) into a QR Code, which is to be printed and presented in Merchants' stores.
Note: The ACQP's WAP server must be able to identify Alipay+ supported digital wallets and retrieve other information through user-agent information in HTTPS requests.
Create a payment
A customer uses an Alipay+ supported digital wallet to scan the Entry Code and open an WAP page, and then enters the payment amount. The ACQP retrieves the payment order details form the Entry Code WAP page, and then sends a payment request to Alipay+ by using the pay interface. In response, Alipay+ returns paymentUrl to the ACQP.
The ACQP redirects the user to the page that links to paymentUrl. The user authorizes and completes the payment.
When you call the pay interface, pay attention to the following items:
- To enable the merchant page to be opened in the supported wallet, the ACQP must provide the domain of the merchant page to the Alipay+ technical team for registration.
- Check the user agent in the Entry Code WAP page request. Identify where the request comes from and decide whether to call the pay interface or route the order to other wallets. See Route the order for details.
- Monitor the payment result notifications sent from Alipay+, or use the inquiryPayment interface to query payment results.
- The ACQP can prepare a payment result page and configure the URL in the parameter
paymentRedirectUrl, which must be an HTTPS URL. After the user confirms the payment, the user is redirected to this page, where you can present the payment result retrieved from the notifyPayment or inquiryPayment interface.
The ACQP sends a request to Alipay+.
Alipay+ returns a response to the ACQP.
For more information about how to use the interface (such as the field description), see pay.
Handle payment result notifications
Alipay+ calls the notifyPayment interface to notify the ACQP about the payment result when payment reaches a final state of success or failure. After that, the ACQP needs to notify the merchant of the result accordingly.
For a successful payment transaction, an HTTP POST is fired once the transaction is successfully completed. The HTTP request is sent in the raw JSON, of which the Content-Type request header is specified as
application/json. Ensure that you can access the HTTP body accordingly.
For more information about what the request header, the successful payment notification request body and the failed payment notification body look like, see the samples below.
Verify the signature
The notification request that Alipay+ sends to the ACQP is signed. The merchant needs to verify the signature to confirm whether the notification is sent from Alipay+. For how to validate a signature, see Validate a signature.
After the notification is delivered successfully, verify whether the values of the paymentAmount and paymentRequestId parameters are as you expect (for example, the amount that you have calculated for the order that you are going to ship).
Acknowledge the notification with the required response
After receiving the notification, no matter whether the order processing succeeds or fails, you must return a receipt acknowledgment message to Alipay+. Meanwhile, the required response must also be signed.
For more information about what the header and body of the response look like, see the samples below.
Note: The notifyPayment interface cannot accept the failure that is caused by business reasons, for example, risk control validation failure. If the payment fails due to some business reasons, the ACQP must firstly accept the payment notification and return
SUCCESS to Alipay+, and then call the cancelPayment interface to perform a refund.
After receiving the notification, you must respond with an HTTP status code of
200 and send an acknowledgement with result.resultStatus of
S to indicate that your server received and processed the call. If you respond with other status codes, or acknowledge with other values, Alipay+ takes the notification delivery as unsuccessful. Therefore, Alipay+ will retry the notification sending.
- The interval between two adjacent times is: 2m, 10m, 10m, 1h, 2h, 6h, 15h
- 7 times - up to 24 hours 22 minutes
Alipay+ sends a request to the ACQP.
- Request header:
- Successful payment notification body:
- Failed payment notification request body:
The ACQP returns a response to Alipay+.
- Response header:
- Response body
For more information about how to use the interface (such as the field description), see notifyPayment.