Article From:https://segmentfault.com/q/1010000010190999
Question:

The H5 payment of the official network starts and pays the way of payment:

MWEB_URL= https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx20161110163838f231619da20804912345&package=1037687096

Hungry and the US takeaway H5 the way to tune up WeChat is:

weixin://wap/pay?appid%3Dwx2a416286e96100ed%26noncestr%3Dadw6la2278l9pif622p7p7s4svme6f8a%26package%3DWAP%26prepayid%3D<id>%26sign%3D<id>%26timestamp%3D1500021869
  • The latter will be returned directly to WeChat in the absence of cancellation, and will not be returned to the original address or set to redirect_url.

  • But the former, there will be a step like this
    Excuse me, has anyone ever encountered the capture event in H5?

Answer 0:

Go straight to the code.

WeixinJSBridge.invoke('getBrandWCPayRequest',{
                        "appId" : data.appid,
                        "timeStamp" : timeStamp.toString(),
                        "nonceStr" : data.nonceStr,
                        "package" : data.packages,
                        "signType" : "MD5",
                        "paySign" : data.paySign
                    },function(res){
                        if(res.err_msg == "get_brand_wcpay_request:ok"){
                            //WeChat succeeds in paying successful paymentAlert ("WeChat pays successful payment");}else if (reS.err_msg = = "get_brand_wcpay_request:cancel") {Alert ("cancel payment! ");}else{Alert ("payment failed! ");}});

By the way, the official API, click here:

Answer 1:

I also want to ask this question, can you tell me if you have solved it

It has been solved. If you generate a deeplink, you can cancel the click event.

Leave a Reply

Your email address will not be published. Required fields are marked *