Javascript-WeChat public account payment interface problems

Source: Internet
Author: User
When calling the public account for payment, the following prompt is displayed: "The merchant has called the payment interface incorrectly. Merchants who have completed the transaction interface upgrade should use the Xinjiekou for transaction ". The call code is as follows: {code...} data is passed in by the backend. No problem occurs when all parameters are generated. Which of the following tips will pop up when you call a public account to pay? "The merchant has called the payment interface incorrectly. Merchants who have completed the upgrade of the transaction interface should use the Xinjiekou for transactions ".
The call code is as follows:

WeixinJSBridge. invoke ('getbrandwcpayrequest', {"appId": data. appid, // The Name Of The Public Account, which is "timeStamp": data. timeStamp, // timeStamp, the number of seconds since 1970 "nonceStr": data. nonce_str, // random string "package": data. prepay_id, "signType": "MD5", // signature method: "paySign": data. sign}, function (res) {if (res. err_msg = "get_brand_wcpay_request: OK") {// alert ('payment successful ')}});

Data is passed in by the backend. All parameters are generated.
I am very grateful to anyone who helps me solve this problem.

Reply content:

When calling the public account for payment, the following prompt is displayed: "The merchant has called the payment interface incorrectly. Merchants who have completed the transaction interface upgrade should use the Xinjiekou for transaction ".
The call code is as follows:

WeixinJSBridge. invoke ('getbrandwcpayrequest', {"appId": data. appid, // The Name Of The Public Account, which is "timeStamp": data. timeStamp, // timeStamp, the number of seconds since 1970 "nonceStr": data. nonce_str, // random string "package": data. prepay_id, "signType": "MD5", // signature method: "paySign": data. sign}, function (res) {if (res. err_msg = "get_brand_wcpay_request: OK") {// alert ('payment successful ')}});

Data is passed in by the backend. All parameters are generated.
I am very grateful to anyone who helps me solve this problem.

We recommend that you forcibly convert the returned results according to the instructions in the document.

Three questions:

1. check whether all the parameters are passed. 2. Ask the backend signature method. 3. For details, refer to the official js api! Look at the latest (http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html) Your Way seems outdated ~~~

With: https://github.com/thenbsp/wechat

Https://github.com/chanjarster/weixin-java-tools/wiki

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.