Customer Scan QR Code
Info
These endpoint generates an one-time payment QR code for merchant to receive payment. Customer can scan Merchant's QR code (using Alipay, WeChat, or UnionPay) generated by this endpoint to launch payment.
How it works
API Request
Endpoint
https://api.iotpaycloud.com/v1/create_order
Method
POST
Header
Content-Type: application/x-www-form-urlencoded
! Tip
After you receive access credentials (merchant id, login name, merchant key). You can step through the demo General Order and select one of WX_NATIVE
, ALIPAY_QR
, UPI_QR
channels to test out the workflow for this functionality. Which may help you when going through the documentation.
Parameters
Name | Required | Type | Sample | Description |
---|---|---|---|---|
mchId | y | String(30) | 10000701 | merchant id assigned by IOTPay |
mchOrderNo | y | String(30) | 20160427210604000490 | unique order id assigned by merchant |
jobNo | y | String(50) | merchant login name | |
currency | y | String(3) | CAD | only CAD and USD supported, WX_NATIVE has support for CNY |
channelId | y | String(24) | WX_NATIVE | WX_NATIVE , ALIPAY_QR , UPI_QR supports customer QR scans |
amount | y | int | 100 | payment amount in cents, eg. $28.65 is 2865 |
device | n | String(64) | WEB | device type (offline shop), use "WEB" when integrated on web |
notifyUrl | y | String(200) | http://xxx.com/notify.php | get notify when succeeded |
returnUrl | n | String(200) | ALIPAY_PC,ALIPAY_WAP need this | redirect to this url after payment |
subject | y | String(64) | test product | product title |
body | y | String(255) | this product is for fun | product description |
extra | y* | String(512) | {"productId":"120989823"} | WX_NATIVE need this, product id is assigned by merchant |
remarks | n | String(200) | remarks | |
clientIp | y | String(32) | 210.73.10.148 | client ip |
sign | y | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | signature |
Note
Due to backwards compatibility requirements, we require the parameters to be wrapped like the following:
params={"amount":1,"mchId":"10000000","mchOrderNo":"9af01329f1ec4c4694631b077a0e8573","subject":"product title","sign":"F64C43C1487C7C0DA93DA93DD2961FA2","body":"product desc","clientIp":"127.0.0.1","extra":"{\"productId\":\"productTest001\"}","notifyUrl":"http://ngrok.4jicao.com/goods/payNotify","currency":"CAD","device":"WEB","channelId":"WX_NATIVE"}
Response
Name | Required | Type | Sample | Description |
---|---|---|---|---|
resCode | y | String | SUCCESS or FAIL | |
retCode | y | String | SUCCESS or FAIL | |
retParams | y | String | weixin://wxpay/bizpayurl?pr=nk******zz | payment link from WeChat/Alipay/UnionPay |
payOrderId | y | String | WN20240101003753223310135049 | Unique identifier generated by IOTPay |
mchOrderNo | y | String | 20160427210604000490 | unique order id assigned by merchant |
retDetail | y | String | weixin://wxpay/bizpayurl?pr=nk******zz | payment link from WeChat/Alipay/UnionPay |
codeUrl | n | String | weixin://wxpay/bizpayurl?pr=nk******zz | payment link from WeChat |
qr_code | n | String | https://qr.alipayplus.com/28******1j0Zc | payment link from Alipay/UnionPay |
sign | y | String | C380BEC2BFD727A4B6845133519F3AD6 | signature validating the response |
Pay Result Notification
Please see Asynchronous notify.