应用场景
随着互联网发展,众多网站都链接了微信、支付宝等支付方式,今天讲的是本人在做微信支付扫码支付时所遇到的坑,自我感觉比其他一些文档讲解的细致多,有用就拿去,没用也别喷,谢谢、
下单支付
可以先看一下文档,有个基本认知:https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1
1、必备条件
首先你要要申请一个公共账号,最好申请的时候就是服务号,因为微信支付的前提必须是服务号
如果是公众号需要先申请验证才能升级为服务号。
1.1、微信服务号申请地址:
http://www.weixinvip888.com/index.php?s=/index/wx.html
1.2、扫码支付流程
https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1
2、引入相关的jar包(此章讲解的扫码支付模式二)
<!-- 生成二维码所需的jar包 开始 -->
<dependency>
<groupId>com.uqihong</groupId>
<artifactId>qdcode</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.uqihong</groupId>
<artifactId>qdcodeSwetake</artifactId>
<version>1.0.0</version>
</dependency>
<!-- 生成二维码所需的jar包 结束 -->
<!-- 微信支付需要的jar包 -->
<dependency>
<groupId>xmlpull</groupId>
<artifactId>xmlpull</artifactId>
<version>1.1.3.1</version>
</dependency>
<dependency>
<