Loading…

WeChat h5 web payment

When paying on a mobile browser, if the h5 web page is opened within WeChat, this interface cannot be used. You need to use the WeChat official account payment interface. ```javascript WXAPI.wxpayH5({ token: '000', money: 0.01, remark: 'Preferential payment: 0.01', payName: 'Preferential payment' }) ``` + token login credentials + money payment amount + payName The purchase name displayed on the payment interface + remark remark information will be recorded in the remark field in the background payment record. It does not need to be passed. + nextAction After the payment is successful, the next operation that needs to be performed does not need to be passed. + shopId the payment store ID, optional ["Detailed explanation of nextAction parameter usage"](https://www.yuque.com/apifm/doc/aetmlb) Return example: ```json { "code": 0, "data": { "outTradeId": "ZF2112120453290832", "nonce_str": "WozGX267jvphoAHi", "mweb_url": "https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx1217455813192383ec5d873fa2ceaf0000&package=1258802393", "appid": "wxa46b09d413fbcaff", "sign": "200E715B7C3F63F7BF81B4D4F6F6E717", "trade_type": "MWEB", "return_msg": "OK", "result_code": "SUCCESS", "mch_id": "1418156202", "return_code": "SUCCESS", "prepay_id": "wx1217455813192383ec5d873fa2ceaf0000" }, "msg": "success" } ``` After receiving the interface return, directly jump the page to the `mweb_url` field to the link address.