最近折腾微信扫码支付,看了微信官方文档,找了很多网页,发现和文档/demo不匹配,现在自己算是弄出来了(文件名称有所更改),贴出来分享一下
一.将有用的官方lib文件和使用的相关文件放置到vendor当中
二.调用同一支付接口
WechatController
1 | <span><span>三.</span><span><span>微信支付生成二维码</span><br><span> public function <span>qrcode(){<br><span> error_reporting (<span>E_ERROR);<br><span>vendor(<span> 'Wxpay.phpqrcode.phpqrcode' );<br><span> $url <span>= <span> $_GET [<span> "data" ];<br> \<span>QRcode<span>::<span>png(<span> $url );<br>}<br></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br><span>四.异步处理</span><br><span>具体处理流程和方式按个人需求</span>
|
登录后复制
1 | <span>form <span>action=<span> "" <span>method=<span> "post" <span>id=<span> "myForm-table" ><br> h2><span>订单信息<span>h2><br> div <span> class =<span> "orderNumber" ><br> p <span> class =<span> "a" ><span>订单号:<span> "{$v_oid}" <span>p><br> p <span> class =<span> "b" ><br> span <span> class =<span> "left" ><span>应付金额:strong>em><span>{ $v_amount }<span>em><span>元<span>strong><span>span><br> span <span> class =<span> "right" ><span>付款后,飞行之翼客服会与您联系,如有问题请咨询<span>24<span>小时飞行热线 <span>400-700-2016<span>span><br> <span>p><br> <span>div><br> h2><span>微信支付<span>h2><br> img <span>src=<span> "{:U('qrcode')}?data={$data}" <span>alt=<span> "<span>微信扫码<span>" ><br> div <span> class =<span> "order-submit" >a <span>href=<span> "javascript:<span>history<span>.<span>go<span>(-1);" <span> class =<span> "submitOrder Order" ><span>返回其他支付方式<span>a><span>div><br><span>form></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><br><span>成功的图就不附上了,这是我遇到的问题,由于要重构,所以比较乱,无效代码也比较多,需要整理,记录下来,分享一二</span>
|
登录后复制
1 | <span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span> </span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
|
登录后复制
以上就介绍了ThinkPHP微信扫码支付接口,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。