WeChat public Number JS API payment, Android has no effect (will blink and disappear)

Source: Internet
Author: User
The code below, iOS can pay, but on the Android phone will appear pay reading bar (that three points), and then disappeared, did not jump out of the input password to pay the interface ....

Call the JS API to pay function Jsapicall () {weixinjsbridge.invoke (' getbrandwcpayrequest ',//Jsapiparameters ,
  , function (res) {//weixinjsbridge.log (res.err_msg);           alert (res.err_code+res.err_desc+res.err_msg);           if (res.err_msg = = ' Get_brand_wcpay_request:cancel ') {alert (' payment cancelled ');               } if (res.err_msg = = ' Get_brand_wcpay_request:ok ') {alert (' payment succeeded ');                                                     Location.replace (");       } return;   }       ); } function Handlepayorder () {if (typeof Weixinjsbridge = = "undefined") {if (Document.addeventlisten           ER) {document.addeventlistener (' Weixinjsbridgeready ', Jsapicall, false);                }else if (document.attachevent) {document.attachevent (' Weixinjsbridgeready ', jsapicall);           Document.attachevent (' Onweixinjsbridgeready ', jsapicall);        }}else{Jsapicall ();    }   }

There is the handlePayOrder use of this method, the document has written an example, as if the code does not explain the role of ... I can still pay for this method (Android or not)

Reply content:

The code below, iOS can pay, but on the Android phone will appear pay reading bar (that three points), and then disappeared, did not jump out of the input password to pay the interface ....

Call the JS API to pay function Jsapicall () {weixinjsbridge.invoke (' getbrandwcpayrequest ',//Jsapiparameters ,
  , function (res) {//weixinjsbridge.log (res.err_msg);           alert (res.err_code+res.err_desc+res.err_msg);           if (res.err_msg = = ' Get_brand_wcpay_request:cancel ') {alert (' payment cancelled ');               } if (res.err_msg = = ' Get_brand_wcpay_request:ok ') {alert (' payment succeeded ');                                                     Location.replace (");       } return;   }       ); } function Handlepayorder () {if (typeof Weixinjsbridge = = "undefined") {if (Document.addeventlisten           ER) {document.addeventlistener (' Weixinjsbridgeready ', Jsapicall, false);                }else if (document.attachevent) {document.attachevent (' Weixinjsbridgeready ', jsapicall);           Document.attachevent (' Onweixinjsbridgeready ', jsapicall);        }}else{Jsapicall ();    }   }

There is the handlePayOrder use of this method, the document has written an example, as if the code does not explain the role of ... I can still pay for this method (Android or not)

There is a problem with the signature parameter or the test environment does not add itself to the white list of payments

Debug on your computer with official developer tools to see the details of the interface call

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.