Micro-channel pay - applet version

Recently the company should be required to do a micro-channel payment applet functions, in fact, just received my mind this feature is more conflict drops. How should I say, if it comes to the question of money, it should not be a small problem. Well, ado, the first thing I encountered in recording them pay it.
In fact, Tencent small programs this one is very seriously, and have a well developed API documentation, as well as DEMO y with mainstream language written; just change can be done in accordance with the general demo DEMO Download: https: // pay. weixin.qq.com/wiki/doc/api/jsapi.php?chapter=11_1.

Spend the day beginning to read through micro-channel payment documents in general, to pay to have a rough image and then slowly into the code of the demo. It is not difficult, but still in the preparation of some of Van wrong.

1, the most common mistake should appear where signatures (sign first signature); prompt "signature error"; If you find an error signature, first check whether the value of its own transmission problems, particularly the merchant key (in the business there are two keys called APIV3 key, called API key), here using the API key (remember, I'm here called APIV3 key, especially embarrassment), have signed MD5 encryption and HMAC- SHA256 two, the general default is MD5; if you find an error signature micro-channel provides a signature verification: https: //pay.weixin.qq.com/wiki/doc/api/jsapi.php chapter = 20_1?

2, unified under a single applet, type of transaction, if JSAPI, openid is to be worth it.

3, after the success in the use of payment under the single API applet wx.requestPayment (OBJECT)

Difficulties pay is still the signature, we must first understand the method signature. If the signature is wrong follow-up there is no way.

Guess you like

Origin www.cnblogs.com/kengver/p/11230946.html