Transaction QRcode payment
Introduction
The Transaction QR Code Payment solution is making use of the dynamically produced QR code to represent a transaction. In this payment solution, the customer does not need to input the transaction amount, but scan the generated QR code to complete the payment.
Internet connection is required when customers use Alipay app to scan the merchant QR code to pay.
Flow
participant Customer
Merchant->scanforpay: 1. Create order
scanforpay->Payment\nPlatform: 2. Create Order
Payment\nPlatform->scanforpay: 3. Return transaction\ninformation and qrcode
scanforpay->Merchant: 4. Return transaction\ninformation and qrcode
Customer->Merchant: 5.Scan the\nqrcode to pay
Customer->Payment\nPlatform: 6. pay
Payment\nPlatform-->Customer: 7. Notify the result
Payment\nPlatform-->scanforpay: 7. Notify the result
scanforpay-->Merchant: 8. Notify the result
Create QRCode API
Service URL
POST
https://pay.scanforpay.com/api/offline/create
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 |
Wallet | wallet | String (10) | Y | Wechat: Wechat Pay Alipay: Alipay |
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 |
Operator 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 |
QR code expiration time | it_b_pay | String(10) | N | Specifies the time period in which the user can complete the payment from the moment when the user scans the QR code. The trade is closed automatically once the time is up. The value of this field is 3m by default. The value of this field is in the range of 1m - 15d. Notes: 1、The following abbreviations are used to present units of time: m: minute h: hour d: day c: current day (Whenever the trade is created, it will be closed at 0:00). 2、Decimal point of the numerical value of this parameter is rejected, for example, 1.5h need to be transformed to 90m. Example:1d |
QR code expiration time | qr_code_it_b_pay | String(10) | N | Specifies the time period in which the user can complete the payment from the moment when the QR code was created. The trade is closed automatically once the time is up.The value of this field is in the range of 1m - 2h. If this parameter is specified, the it_b_pay parameter becomes invalid. Notes: 1、The following abbreviations are used to present units of time: m: minute h: hour 2、Decimal point of the numerical value of this parameter is rejected, for example, 1.5h need to be transformed to 90m. Example:1m |
Sample
{
"request": {
"header": {
"requestTime": "2018-07-25T17:53:52+08:00",
"partnerNo": "10001",
"signType": "SHA256",
"version": "1.0",
"reqMsgId": "615c1195-0cd0-421c-b612-538bf03eabc7"
},
"body": {
"storeNo": "100010000000002",
"partnerOrderNo": "p20180725175352983070",
"wallet": "Alipay",
"orderAmount": 2000,
"orderTitle": "Consume",
"operatorId": "211918"
}
},
"signature": "d02a1a795d3878d4cea551f55091bcf9fb05efcfda289e7bc781e2ceefa8a931"
}
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 |
Tranaction Qrcode | qrcode | varchar(100) | Y | The QR code of the transaction. |
Order Number | orderNo | varchar(32) | Y | Generageted by scanforpay |
Merchant Order Number | partnerOrderNo | String (32) | Y | Generated by merchant 20180802100000001 |
Big qrcode picture | qrcodeImageL | varchar(200) | Y | The big-sized QR code of the transaction. |
Normal qrcode picture | qrcodeImageM | varchar(200) | Y | The normal-sized QR code of the transaction. |
Small qrcode picture | qrcodeImageS | varchar(200) | Y | The smalls-sized QR code of the transaction. |
Sample
Successful response sample
{
"response": {
"header": {
"partnerNo": "10001",
"respTime": "2018-07-25T17:54:11+08:00",
"signType": "SHA256",
"version": "1.0",
"reqMsgId": "a47ceb57-9c1c-4190-88ec-30ae1e413d89"
},
"body": {
"code": 1,
"msg": "success",
"orderNo": "2018072517535241",
"partnerOrderNo": "p20180725175352983070",
"qrcode": "https://qr.alipay.com/bax01968y4zlr8n4usrb40b7",
"qrcodeImageS": "https://mobilecodec.alipay.com/show.htm?code=bax01968y4zlr8n4usrb40b7&picSize=S",
"qrcodeImageM": "https://mobilecodec.alipay.com/show.htm?code=bax01968y4zlr8n4usrb40b7&picSize=M",
"qrcodeImageL": "https://mobilecodec.alipay.com/show.htm?code=bax01968y4zlr8n4usrb40b7&picSize=L",
}
},
"signature": "a90a7457b39304645bf6eb18383e60d96c23361d238f319c6b6d5511c7044432"
}
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"
}