Alipay In-store: Merchant QR Code
This is the Alipay In-store flow where the consumer scans the merchant's QR code to accept the payment.
Payment Method Properties
Available country codes Country where the merchant (POS device) is domiciled | CH, GB |
Processing (Presentation) currencies | CHF, GBP |
Settlement currencies | CHF, GBP |
Consumer currencies | CNY |
Channel member tag | alipaymerchantqrc |
Scheme name in the settlement file | Alipay In-store |
Minimum transaction amount | CNY 0.1 |
Maximum transaction amount | Single transaction limit: CNY 50,000 Total transaction limit in a day: CNY 50,000 Total transaction limit in a month: CNY 200,000 |
Session timeout | 35 minutes |
Refund | Full, partial and multiple partial refunds are available. |
Refund Validity | 360 days |
Chargeback | No |
Integration Type | Asynchronous |
Sandbox | Scheme-hosted |
Transaction Flow
- The cashier creates a payment order in the SmartPOS.
- Alipay generates a QR code, displayed on the SmartPOS.
- The cashier presents the QR code to the consumer.
- The consumer scans the QR code with the Alipay app.
- The consumer enters the required payment password in the Alipay app.
- Alipay sends the payment result to PPRO and the consumer.
- PPRO forwards the information to you and the merchant.
Alipay In-store Integration
Specific input parameters for the TRANSACTION call
Field Name | M/O/C | Type | Description |
---|---|---|---|
specin.storeid | M | ascii | The identifier of the store, as boarded with Alipay. Up to 32 characters, only [0-9a-zA-Z-_] . |
specin.storename | M | utf-8 | The name of the store, as boarded with Alipay. |
For standard input parameters, see Input parameters for the TRANSACTION call.
Specific output parameters for the TRANSACTION call
Field Name | Type | Description |
---|---|---|
SPECOUT.ALIPAYBUYERUSERID | numeric | A unique Alipay user ID corresponding to the buyer’s Alipay account. 16 digits beginning with 2088. |
SPECOUT.ALIPAYMERCHANTID | ascii | The merchant ID, as boarded with Alipay |
SPECOUT.ALIPAYMERCHANTNAME | utf-8 | The merchant’s name, as boarded with Alipay |
SPECOUT.ALIPAYSTOREID | ascii | The identifier of the store, as boarded with Alipay. It can contain only [0-9a-zA-Z-_] , up to 32 characters |
SPECOUT.ALIPAYSTORENAME | utf-8 | The name of the store, as boarded with Alipay |
SPECOUT.ALIPAYQRCODE | utf-8 | URL to the image of the QR code |
SPECOUT.CNYAMOUNT | utf-8 | CNY Amount in major units |
SPECOUT.SRCCURRENCY | utf-8 | The currency used according to the wallet’s currency. Example: CNY |
SPECOUT.SRCAMOUNT | utf-8 | The transaction amount in the pricing currency. The value of this parameter is in the range of 001 - 10000000000 and with two decimal places. In minor units. Example: 3925 |
For standard output parameters, see Output parameters for the TRANSACTION call.
Specific output parameters for the REFUND call
Field Name | Type | Description |
---|---|---|
SPECOUT.CNYAMOUNT | utf-8 | CNY amount in major units |
SPECOUT.DSTAMOUNT | utf-8 | Transaction amount in CNY |
SPECOUT.DSTCURRENCY | utf-8 | CNY currency |
SPECOUT.FXRATE | utf-8 | The exchange rate used for the refund; this is the same exchange rate used for the original payment. Can have up to eight digits after the decimal point |
TRANSACTION call input
tag=alipaymerchantqrc
&txtype=TRANSACTION
&countrycode=DE
¤cy=EUR
&amount=1055
&merchanttxid=GVk8ZenqKSQG
&login=johndoe
&password=wXBrpVporFVjGO4R
&contractid=JOHNDOECONTRACT
&channel=testchannel
&merchantredirecturl=https%3A%2F%2Fmerchant.com%2Fwork%2Fppro2%2Flanding.php
¬ificationurl=https%3A%2F%2Fmerchant.com%2Fwork%2Fppro2%2Fnotification.php
&specin.dynamicdescriptor=DynDescriptor
&accountholdername=John%20Doe
&specin.storename=Widgets%20LLC
&specin.storeid=WIDGETS123
&returnmode=urlencodeext
TRANSACTION call output
STATUS=SUCCESSFUL
&RAND2112459470=f97243f8b9da2aa40c461652ff9cdc64312d1f9f
&TXID=643772308&MERCHANTTXID=GVk8ZenqKSQG
&FUNDSSTATUS=NOT_EXPECTED
&FLAGS=
&ERRMSG=
&CHANNEL=testchannel
&TAG=alipaymerchantqrc
&REDIRECTSECRET=izReipLmavT6qIOHkxYpzoOf2sCMBni1
&SPECOUT.ALIPAYMERCHANTID=Merchant380
&SPECOUT.ALIPAYMERCHANTNAME=Merchant LTD
&SPECOUT.ALIPAYSTOREID=WIDGETS123
&SPECOUT.ALIPAYSTORENAME=Widgets LLC
&SPECOUT.PAYMENTPURPOSE=3VZKUHP
&SPECOUT.ALIPAYQRCODE=https://qr.alipay.com/bax00450gieal5w1cxdy80db
&SPECOUT.CNYAMOUNT=73.65
&SPECOUT.SRCAMOUNT=1055
&SPECOUT.SRCCURRENCY=EUR
Merchant QRC Cancellation
Cancellation Flow
Cancelling before the customer scans the merchant QR code (not allowed)
If PPRO receives a cancellation request before customer scans the QR code, a CannotCancel error will be returned.
REQUESTSTATUS=FAILED
&REQUESTFAILREASON=UNKNOWN
&STATUS=FAILED
&TXID=0
&ERRMSG=Transaction+in+state+TransactionFailed
&FAILREASON=UNKNOWN
&RAND2714027729=f8d6f4a5e4da53630c7fd04bcd385a89470fcdab
This is because the Alipay transaction is not active before the QR code is scanned and hence cannot be cancelled.
Cancelling after the customer scans the merchant QR code (allowed)
Before the customer clicks 'PAY' on the Alipay mobile app
- Cancellation is successful
After the customer clicks 'PAY' on the Alipay mobile app
- Will return a CannotCancel error as the transaction is completed by the customer.
- There is a very small chance of an edge case here where a cancel can unintentionally be allowed due to system or network delays. When this happens, the cancellation will be successful, and the customer will be refunded automatically. Alipay handles this case as a refund rather than a cancel.
Additional Information
About the transaction state
Except for technical problems, the transaction will first be in a PENDING state and the parameter SPECOUT.REDIRECTOPTIONAL
is returned (see well-known SPECOUT parameters).
We recommended that you not redirect the terminal to the payment page (REDIRECTURL) – only a static page is shown because the flow continues on the POS terminal, displaying a QR code image containing the value returned in SPECOUT.ALIPAYQRCODE
. The terminal may poll for a final state (SUCCEEDED
or FAILED
) every few seconds (at least 5 seconds between retries), with a timeout of, e.g., 180 seconds.
Using the Alipay sandbox app to make a QR code payment
Prerequisites
To send a transaction call on the Alipay sandbox app, you need the following parameters and values:
Parameter | Value |
---|---|
channel | testchannel |
tag | alipaymerchantqrc |
Important
At the moment, sandbox testing is available only for Android devices.
Downloading and installing the sandbox app
To download and install the Alipay sandbox app, follow the steps below:
- Create an Alipay account.
- Log in on the Alipay dev portal using the credentials created above.
- Go to Global Products > Buyer and generate a buyer account.
- Download the sandbox app from Global Products > Alipay sandbox app.
- Follow the download instructions on the dev portal. If the download link does not start the download, copy/paste it in the URL bar.
- If you downloaded the app on your computer, transfer it to your phone.
- If you downloaded the app on your phone and the file extension is
.zip
, rename the extension to.apk
.
- Run the
.apk
file on your phone to install the app. - Allow the installation of 3rd party apps if prompted.
Making a payment on the sandbox app
To make a test payment on the Alipay sandbox app, follow the steps below:
-
Log in on the Alipay sandbox app using your buyer account generated on the Alipay dev portal.
-
Send an API request to PPRO using the following values:
tag=alipaymerchantqrc, currecy=EUR, countrycode=AT
. -
PPRO API response containing the parameter
SPECOUT.ALIPAYQRCODE
is generated. -
Using a QR code generator, convert the value of
SPECOUT.ALIPAYQRCODE
to a QR code. -
In the Alipay sandbox app, tap the scan icon on the homepage to scan the QR code.
-
When prompted, enter the payment password generated in the buyer account.
-
Confirm the payment.
Find out more about the Alipay sandbox app here.
Updated about 1 year ago