--- url: >- https://acquirer-api-docs-v4-en.pingpongx.com/en/notes/onlinePayment/offlineBarcodePayment/index.md description: >- Offline barcode payment function supports completing payments by scanning the barcode in the shopper's mobile wallet, suitable for POS systems that have integrated barcode scanners. Mainly supports Alipay and WeChat Pay, where Alipay barcodes are 16-24 digits and WeChat Pay is 18 digits. When initiating a payment request, specify the payment method and barcode value. --- ## 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 1. Scan the shopper's barcode using the barcode scanner. 2. 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. 3. Initiate the payment request by calling the Order and Payment API, additionally specifying in the `paymentMethod` object: - paymentMethod.type: Payment method - scanCodeId: Barcode value ## Payment Methods ### Wechat-Offline Request example: ```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 Request example: ```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 Request example: ```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" } } } ```