Barcode payment

Introduction

The barcode/QR Code payment is an offline instant payment solution for the in-store checkout. This payment solution enables merchants to collect money by scanning the barcode/QR code that is shown on a customer’s Alipay/Wechat wallet app. One advantage of using the barcode/QR code payment is that it does NOT require Alipay/Wechat Wallet App has the internet connection.

Flow

participant Customer
Merchant->Customer: 1. Merchant scan\na customer's QRCode
Merchant->scanforpay: 2. Create a payment
scanforpay->Payment\nPlatform: 3. Create a payment
Payment\nPlatform-->scanforpay: 4. Notify the result
scanforpay-->Merchant: 5. Notify the result

Merchant Create Payment API

Service URL

POST

https://pay.scanforpay.com/api/offline/pay
Request Body
Name Parameter Type Required Description
Store ID storeNo String (15) Y Assigned by scanforpay
Merchant Order Number partnerOrderNo String (32) Y Generated by merchant
20180802100000001
The barcode code value barcode String (20) Y Get by scaning the customer's QRCode
Transaction amount orderAmount int Y The unit of the transaction amount is the smallest unit of the currency
If the currency is RMB, the unit is Fen. So if the transaction amount is 1 Yuan, 100 should be passed;if curreny is JPY, the unit is Japanese Yen
Transaction description orderTitle String(100) N Transaction description
Operatore ID operatorId String(20) N 100001
Terminal ID terminalNo String(20) N 100002
Notify Url notifyUrl String(200) N System will call this url when payment succeed.
If this is empty, system will not notify the result
Sample
{
    "request": {
        "header": {
            "requestTime": "2018-07-25T18:06:05+08:00",
            "partnerNo": "10001",
            "signType": "SHA256",
            "version": "1.0",
            "reqMsgId": "fd03f269-3180-4575-8af0-8f6cf324fb0f"
        },
        "body": {
            "storeNo": "100010000000002",
            "partnerOrderNo": "p20180725180605466813",
            "barcode": "284447106610060508",
            "orderAmount": 2100,
            "orderTitle": "Consume",
            "operatorId": "211918",
            "terminalNo": "123456",
            "notifyUrl": "http://192.168.31.72:8080/scanforpay/notify"
        }
    },
    "signature": "2d2d5c66a67a24b5e13705cc38f34d93c395a7d9e0e4ff9425c9ce07b806a1cc"
}
Response body
Name Parameter Type Required Description
Response code code int(5) Y 1:success,Others: Fail
Response message msg varchar (100) Y Response message
Order Number orderNo varchar(32) Y Generageted by scanforpay
Merchant Order Number partnerOrderNo String (32) Y Generated by merchant
20180802100000001
Transaction Amount orderAmount int Y The unit of the transaction amount is the smallest unit of the currency
If the currency is RMB, the unit is Fen. So if the transaction amount is 1 Yuan, 100 should be passed;if curreny is JPY, the unit is Japanese Yen
Wallet wallet String (10) Y Wechat: Wechat Pay
Alipay: Alipay
Transaction Status status int Y 0:To be Paid
1:Success
2:Fail
3:Refunded
Transation Time payTime String(25) N Date time with timezone, see RFC 3339 Section 5.6 for details.
2018-07-25T17:54:00+08:00
Currency currency varchar(5) Y JPY
Buyer account buyer varchar(30) N c*@gmail.com
Buyer Id buyerId varchar(30) N 208xxxxxxxxxx012
Sample
Successful response sample
{
    "response": {
        "header": {
            "partnerNo": "10001",
            "respTime": "2018-07-25T18:06:12+08:00",
            "signType": "SHA256",
            "version": "1.0",
            "reqMsgId": "213ca19e-c75f-450d-9acf-46e860570bb9"
        },
        "body": {
            "code": 1,
            "msg": "success",
            "orderNo": "2018072518060757",
            "partnerOrderNo": "p20180725180605466813",
            "payTime": "2018-07-25T18:06:12+08:00",
            "wallet": "Alipay",
            "currency": "JPY",
            "status": 1,
            "buyer":"cd****@qq.com",
            "buyerId":"208xxxxxxxxxx012"
        }
    },
    "signature": "0710b2630b467c14b3d54295def7f89be61097c21472547823b43c58f3466b08"
}
Failed response sample
{
    "response": {
        "header": {
            "partnerNo": "10001",
            "respTime": "2018-07-25T17:37:14+08:00",
            "signType": "SHA256",
            "version": "1.0",
            "reqMsgId": "c11fe1c7-069b-4399-be00-31830a5de63d"
        },
        "body": {
            "code": 30
            "msg": "订单不存在",
        }
    },
    "signature": "5719065ecea463366cbf39b728b9b8cba940365c0c053dd96effde57f7edc1f8"
}

results matching ""

    No results matching ""