---
url: >-
https://acquirer-api-docs-v4-en.pingpongx.com/notes/zh/onlinePayment/offlineBarcodePayment/index.md
description: >-
线下付款码支付功能支持通过扫描购物者手机钱包中的条形码完成支付,适用于已集成扫码枪的POS系统。主要支持支付宝和微信支付,其中支付宝条形码为16-24位数字,微信支付为18位数字。发起支付请求时需指定支付方式及条形码码值。
---
## 线下付款码支付
目前支付宝和微信都支持线下付款码支付,前提是商家POS系统必须包含可以读取条形码的扫码枪,POS系统需要将条形码转换为数值。
商家扫购物者手机钱包应用程序中显示的条形码,POS应用程序在发起付款请求的时候将此条形码数据发送给 PingPong 进行处理。
## 支付流程
1. 用扫码枪扫购物者的条形码。
2. 将条形码数据转换为数值,以便在付款请求中传递。
例如,数值包含:
- 支付宝16-24位。
- 微信支付18位数字。
条形码码值查看如下图所示:
> 备注:微信支付沙箱测试需要使用真实的微信钱包条形码码值进行测试。
3. 发起付款请求,调用 下单并支付接口,在`paymentMethod`对象中额外指定:
- paymentMethod.type:支付方式
- scanCodeId:条形码码值
## 支付方式
### Wechat-Offline
请求示例:
```json
{
"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
请求示例:
```json
{
"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
请求示例:
```json
{
"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"
}
}
}
```