Offline Barcode Payment
About 382 wordsAbout 1 min
2025-03-07
Offline Barcode Payment
Currently, both Alipay and WeChat support offline barcode payment, provided that the merchant's POS system must include a barcode scanner capable of reading barcodes, and the POS system needs to convert the barcode into numerical values.
The merchant scans the barcode displayed in the shopper's mobile wallet application, and the POS application sends this barcode data to PingPong for processing when initiating the payment request.
Payment Process
Scan the shopper's barcode using the barcode scanner.
Convert the barcode data into numerical values for passing in the payment request. For example, the numerical values contain:
- Alipay 16-24 digits.
- WeChat Pay 18 digits.
Barcode value view is shown in the following figure:
Note: WeChat Pay sandbox testing requires using real WeChat wallet barcode values for testing.
- Initiate the payment request by calling the Order and Payment API, additionally specifying in the
paymentMethodobject:
- paymentMethod.type: Payment method
- scanCodeId: Barcode value
Payment Methods
Wechat-Offline
Request example:
{
"accId": "2023042011040310224447",
"clientId": "2023042011040310224",
"signType": "SHA256",
"sign": "{{Sign}}",
"version": "1.0",
"bizContent": {
"captureDelayHours": 0,
"amount": 0.02,
"currency": "CNY",
"requestId": "{{requestId}}",
"payResultUrl": "https://www.baidu.com",
"notificationUrl": "https://test-acquirerpay.pingpongx.com/qa/notify",
"merchantTransactionId": "{{merchantTransactionId}}",
"paymentMethod": {
"type": "Wechat-Offline",
"scanCodeId":"1328*******1501"
},
"device": {
"orderTerminal": "02"
}
}
}AlipayCN-Offline
Request example:
{
"accId": "2023042011040310224447",
"clientId": "2023042011040310224",
"signType": "SHA256",
"sign": "{{Sign}}",
"version": "1.0",
"bizContent": {
"captureDelayHours": 0,
"amount": 1,
"currency": "CNY",
"requestId": "{{requestId}}",
"payResultUrl": "https://www.baidu.com",
"notificationUrl": "https://test-acquirerpay.pingpongx.com/qa/notify",
"merchantTransactionId": "{{merchantTransactionId}}",
"paymentMethod": {
"type": "AlipayCN-Offline",
"scanCodeId":"286********2272"
},
"device": {
"orderTerminal": "02"
}
}
}AlipayHK-Offline
Request example:
{
"accId": "2023042011040310224447",
"clientId": "2023042011040310224",
"signType": "SHA256",
"sign": "{{Sign}}",
"version": "1.0",
"bizContent": {
"captureDelayHours": 0,
"amount": 1,
"currency": "HKD",
"requestId": "{{requestId}}",
"payResultUrl": "https://www.baidu.com",
"notificationUrl": "https://test-acquirerpay.pingpongx.com/qa/notify",
"merchantTransactionId": "{{merchantTransactionId}}",
"paymentMethod": {
"type": "AlipayHK-Offline",
"scanCodeId":"289********2243"
},
"device": {
"orderTerminal": "02"
}
}
}