


Detailed explanation of WeChat applet payment function development error summary
Mar 27, 2017 pm 02:06 PMThis article mainly introduces relevant information on the summary of errors in the development of the payment function of WeChat Mini Program. Friends in need can refer to the following
Summary of errors in the development of payment function of WeChat Mini Program
WeChat Mini Program I finally got through the pitfalls in payment, and found that there are quite a lot of pitfalls inside. I’m posting a post now, hoping that students who will fall into the trap in the future can take a look at it:
https://pay.weixin.qq.com/ wiki/doc/api/wxa/wxa_api.php?chapter=7_4&index=2
The business process can be seen here when you read the document. The first pitfall is to obtain the user's openid. The parameters must be spelled in the url connection, otherwise an error of {"errcode":40013,"errmsg":"invalid appid, hints: [ req_id: iil1ba0504ns86 ]"} will be reported
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
The second pitfall is the unified payment ordering interface. Signature pitfall is a pitfall that many people encounter. This is because MD5 encryption is often different from the encrypted signature in the signature tool.
Signature Encryption tool address: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=20_1
When signing and encrypting, it must be converted to utf-8 and encrypted I use my own interface to encrypt digest.update(data.getBytes("utf-8"));
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
Return data analysis xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
|
The third is to call payment, here There are also a few pitfalls. The first is that many appIds cannot be written as appid. The second is that the parameter format of preoatid must be written correctly prepay_id=wx2017011711060194dccf725232155886323. The third is that a payment signature error is reported when calling payment, and you also need to check the signature interface. Check whether the signatures are consistent and check whether the parameters are correct. When calling WeChat payment, you must add the appId
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
Thank you for reading, I hope it can help everyone, thank you for your support of this site!
The above is the detailed content of Detailed explanation of WeChat applet payment function development error summary. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Xianyu WeChat mini program officially launched

What is the name of Xianyu WeChat applet?

WeChat applet implements image upload function

Implement the drop-down menu effect in WeChat applet

Use WeChat applet to achieve carousel switching effect

How to use PHP to develop the second-hand transaction function of WeChat applet?

Implement image filter effects in WeChat mini programs

Implement image rotation effect in WeChat applet
