Payment in WeChat Web Browser

This endpoint generates a link that enables WeChat pay in the WeChat Web Browser (WeChat JSAPI). Merchants can either send the link directly to customer or generate a QR code from the link for the customers to scan.

How it works

API Request

Endpoint

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

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 Web Payment in WeChat Testopen in new window to test out the workflow for this functionality. Which may help you when going through the documentation.

Note that the link must be opened in the WeChat browser for this function to work, you can copy the link to a chat window in the WeChat application, and open the link there.

Parameters

NameRequiredTypeSampleDescription
mchIdyString(30)20001222merchant id assigned by IOTPay
mchOrderNoyString(30)20160427210604000490order number in merchant system,need to be unique
currencyyString(3)CADsupported currency: CAD, USD, CNY
QR code_paynint1set this param only in QR code mode
channelIdyString(24)WX_JSAPIFixed to WX_JSAPI
amountyint100payment amount,in cents,eg. $28.56 is 2856
clientIpyString(32)210.73.10.148client ip
returnUrlyString(200)http://xxx.com/success.phpredirect url after payment
notifyUrlyString(200)http://xxx.com/notify.phpIOTPay will notify this url when payment success
subjectyString(64)product id or titleproduct id or title
bodyyString(255)product descriptionproduct description
param1nString(64)don't pass value in this field,
will return mchOrderNo in notify
param2nString(64)will return original value in notify
extranString(512)
jobNoyString(50)merchant login name
remarksnString(200)remarks
signyString(32)C380BEC2BFD727A4B6845133519F3AD6signature

Note

When get notify, parameter "mchOrderNo" will be put into "param1",let "param1" empty when sending request.

After payment,merchant backend server still need notifyUrl to judge whether the transaction is successful

Return Result

namerequiredtypesampledescription
retCodeyStringSUCCESSSUCCESS/FAIL retCode indicate communication status,
need to check resCode for transaction
urlyStringif success=true, redirect to url
code_urlnStringreturn only when QR code_pay=1 in request

When code_url returned, merchant side should generate QR Code image based on code_url

Parameters of returnUrl and notifyUrl

nametypesampledescription
payOrderIdStringorder id of IOTPay
mchOrderNoStringorder id of merchant
channelOrderNoStringorder id of Alipay/WeChat Pay
statusIntsuccess code: 2 or 3
amountIntin cents
param1String
param2String
Last Updated: