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

Channel IDChannel Description
ALIPAY_WAPAlipay in web page in mobile browser
ALIPAY_PCAlipay in web page in PC browser
UPI_SEQUnionPay Online payment (redirect to UnionPay web, or app)

API Request

Endpoint

https://api.iotpaycloud.com/v1/create_order

Method

POST

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 Orderopen in new window 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

NameRequiredTypeSampleDescription
mchIdyString(30)10000701merchant id assigned by IOTPay
mchOrderNoyString(30)20160427210604000490unique order id assigned by merchant
jobNoyString(50)merchant login name
currencyyString(3)CAD3 letter representation for currency, eg: CAD
channelIdyString(24)ALIPAY_PCALIPAY_PC, ALIPAY_WAP, or UPI_SEQ
amountyint100payment amount in cents, eg. $28.65 is 2865
devicenString(64)WEBdevice type (offline shop), use "WEB" when integrated on web
notifyUrlyString(200)http://xxx.com/notify.phpget notify when succeeded
returnUrlnString(200)ALIPAY_PC,ALIPAY_WAP need thisredirect to this url after payment
subjectyString(64)test productproduct title
bodyyString(255)this product is for funproduct description
remarksnString(200)remarks
clientIpyString(32)210.73.10.148client ip
signyString(32)C380BEC2BFD727A4B6845133519F3AD6signature

Response

NameRequiredTypeSampleDescription
resCodeyStringSUCCESS or FAIL
retCodeyStringSUCCESS or FAIL
retParamsyString{"alipayUrl": "https://...."}an object that contains the payment URL
payOrderIdyStringWN20240101003753223310135049Unique identifier generated by IOTPay
mchOrderNoyString20160427210604000490unique order id assigned by merchant
retDetailyStringdetail of the order
payUrlnStringmerchant need to redirect to this url, just echo payUrl to client or redirect to url in retParams
signyStringC380BEC2BFD727A4B6845133519F3AD6signature validating the response

Possible Fields in retParams

NameRequiredTypeSampleDescription
alipayUrly*Stringhttps://....returned if channel is ALIPAY_PC or ALIPAY_WAP, this is the redirect link to the payment page
orderStry*String_input_charset=utf-&...returned if channel is ALIPAY_WAP, this field contains information related to the order
unionpayUrly*Stringhttps://....returned if channel is UPI_SEQ, this is the redirect link to the payment page

Pay Result Notification

Please see Asynchronous notify.

Last Updated: