In-Store Payment Scenarios
Barcode (Scanning) Payment
Barcode Payment is also referred as Scanning Payment. It is an offline QR payment scenario.
The merchant will use the POS terminal or the Scanner to scan the customer’s QR code displayed on WeChat/Alipay/UnionPay/Snaplii App to conduct payment. The user only needs to display the QR code. The rest of the operations is done by the merchant.
Scenario Introduction
The following steps uses WeChat as an example to explain the Barcode payment scenario. Alipay, UnionPay and Snaplii flow is very similar to the WeChat payment flow.
Step 1: After logging into WeChat, the payer enters “Me”->“Wallet”->“Money” as shown in image 1 and image 2.
Step 2: Cashier creates a transaction order and the payer confirms the payment amount.
Step 3: Cashier scans the customer’s QR code using the POS terminal or the Scanner. Merchant’s POS system will submit the transaction order to the OpenAPI gateway.
Step 4: After the payment request is received by WeChat’s transaction system, the transaction system determines if the payer’s password must be verified. If the payment password is not required, the payment is made directly. Otherwise, the payer is prompted to enter the password. If the payment is successful, the payer will see a ‘successful payment’ message in WeChat. If the payment fails, a payment error page will be displayed instead.
Payment Workflow
Detailed payment workflow
-
After user places order [1.1]. The cashier uses the scanning device to scan the barcode displayed on the user’s mobile phone on WeChat, Alipay, UnionPay, or Snaplii App [1.2];
-
Merchant backend calls Barcode (Scanning) API to submit the payment request to SnapPay OpenAPI Service Gateway [1.3];
-
SnapPay verifies the payment request and submits the request to WeChat/Alipay/Snaplii server to make payment [1.4];
-
WeChat/Alipay/UnionPay/Snaplii returns the payment result to the SnapPay [1.5], and SnapPay returns the result to the merchant backend [1.6];
-
If the transaction status returned by SnapPay is USERPAYING (for example, waiting for user to enter the password), merchant should poll the order query API to obtain the transaction status. Please refer to Query Order API [2.1];
-
Our recommended polling interval is 5 seconds. If USERPAYING is still returned after 30 seconds, the cashier should be allowed to choose to continue the next polling [2.5] or cancel the order [4.1];
-
To cancel an order, please refer to Revoke Order API [4.1];
-
After the payment is successful, WeChat/Alipay/UnionPay/Snaplii will send an asynchronous notification to SnapPay [3.1]. SnapPay backend will notify the merchant that the payment is successful. Please refer to Asynchronous Notification [3.2].
Transaction QR Code Payment
Transaction QR Code Payment refers to the Scenario when the user opens the Alipay/WeChat app to scan the QR code displayed on the Merchant’s portal. This scenario can be used for in-store payment or Online E-commerce payment.
Scenario Introduction
The following instructions use Alipay payment as an example. WeChat payment scenario is very similar.
Payer scans the QR code displayed on the Merchant’s portal or POS terminal to conduct payment.
Step 1: Merchant will display the QR code on the POS terminal, a customer facing screen, or the website for the user to scan.
Step 2: Payer uses the “Scan” function from the Alipay App, scans the QR code, and views the transaction amount.
Step 3: Payer confirms payment by entering the password or through face recognition (if needed).
Step 4: Payment success message will be displayed on the App.
Payment workflow
Detailed payment workflow
-
After user places order [1.1], merchant backend calls Transaction QR Code Pay API to submit the payment request to SnapPay OpenAPI Service Gateway [1.2];
-
SnapPay verifies the payment request and requests WeChat/Alipay server to produce payment QR code [1.3];
-
WeChat/Alipay returns the QR code to the SnapPay [1.4], and SnapPay returns the QR code to the merchant [1.5];
-
Merchants generate QR code picture based on QR code value, and show it to users through POS machines or other devices [1.6];
-
User uses WeChat or Alipay App to scan the QR code on the mobile to pay [1.7], WeChat/Alipay will return the payment result to user [1.8];
-
During the user payment process, the merchant should poll the order query API to obtain the transaction status. Please refer to Query Order API [2.1];
-
We recommend the polling interval is 5 seconds. If USERPAYING is still returned after 30 seconds, the cashier should be allowed to choose to continue the next polling [2.5] or cancel the order [4.1];
-
To cancel an order, please refer to Revoke Order API [4.1];
-
After the payment is successful, WeChat/Alipay will send an asynchronous notification to SnapPay [3.1]. SnapPay backend will notify the merchant that the payment is successful. Please refer to Asynchronous Notification [3.2].