Detailed explanation of wechat payment H5 call payment (Java version)

Recently, WeChat paid for the project, and then paid the WeChat official account. Though it is not difficult, details need to be paid attention to. It took a long time to write a demo, and tested the payment process thoroughly. Official account of WeChat public number is shared below.

First, configure official account WeChat payment.

We need to configure WeChat official account payment address and test white list.

For example, the address of the payment JS page is http://www.xxx.com/shop/pay/

Configure www.xxx here com/shop/pay/

2、 Development process

WeChat official account is paid API (address). http://pay.weixin.qq.com/wiki/doc/api/index.PHP?chapter=7_4 ), what we need to develop is marked in red. As follows:

Call the unified ordering interface, so that you can get the prepay of wechat payment_ id( http://pay.weixin.qq.com/wiki/doc/api/index.php?chapter=9_1 )。

It can be in the form of Web authorization( http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html )

Send the following link in wechat https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx520c15f417810387&redirect_uri= URL & response of the order to jump_ type=code&scope=snsapi_ base&state=123#wechat_ redirect

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>