Online Secure Payment
Note
This endpoint generates a link that will redirect users to third party payment page according to the channel provided.
How it works
Related Channel IDs
Channel ID | Channel Description |
---|---|
ALIPAY_WAP | Alipay in web page in mobile browser |
ALIPAY_PC | Alipay in web page in PC browser |
UPI_SEQ | UnionPay Online payment (redirect to UnionPay web, or app) |
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 ALIPAY_PC
, ALIPAY_WAP
, or UPI_SEQ
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 | 3 letter representation for currency, eg: CAD |
channelId | y | String(24) | ALIPAY_PC | ALIPAY_PC , ALIPAY_WAP , or UPI_SEQ |
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 |
remarks | n | String(200) | remarks | |
clientIp | y | String(32) | 210.73.10.148 | client ip |
sign | y | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | signature |
Response
Name | Required | Type | Sample | Description |
---|---|---|---|---|
resCode | y | String | SUCCESS or FAIL | |
retCode | y | String | SUCCESS or FAIL | |
retParams | y | String | {"alipayUrl": "https://.... "} | an object that contains the payment URL |
payOrderId | y | String | WN20240101003753223310135049 | Unique identifier generated by IOTPay |
mchOrderNo | y | String | 20160427210604000490 | unique order id assigned by merchant |
retDetail | y | String | detail of the order | |
payUrl | n | String | merchant need to redirect to this url, just echo payUrl to client or redirect to url in retParams | |
sign | y | String | C380BEC2BFD727A4B6845133519F3AD6 | signature validating the response |
Possible Fields in retParams
Name | Required | Type | Sample | Description |
---|---|---|---|---|
alipayUrl | y* | String | https://.... | returned if channel is ALIPAY_PC or ALIPAY_WAP , this is the redirect link to the payment page |
orderStr | y* | String | _input_charset=utf-&... | returned if channel is ALIPAY_WAP , this field contains information related to the order |
unionpayUrl | y* | String | https://.... | returned if channel is UPI_SEQ , this is the redirect link to the payment page |
Pay Result Notification
Please see Asynchronous notify.