ecshop增加pc扫描二维码微信支付功能代码
1、使用PHP QR Code生成二维码,下载,在商品支付页面加入include 'phpqrcode/phpqrcode.php';$pay_url ='http://www.xxx.com/weixin/weixin.php?order_id='.$order['order_sn']; QRcode::png($pay_url, 'images/image.png', 'L', 8); echo '<img src="images/image.png" />';生成一个指向微信支付的手机连接二维码,手机扫描进入

3、手机打开页面调用代码<html><head> <meta http-equiv="content幻腾寂埒-type" content="text/html;charset=utf-8"/> <title>微信安全支付</title> <script type="text/javascript"> //调用微信JS api 支付 function jsApiCall() { WeixinJSBridge.invoke( 'getBrandWCPayRequest', <?php echo $jsApiParameters; ?>, function(res){ WeixinJSBridge.log(res.err_msg); //alert(res.err_code+res.err_desc+res.err_msg); } ); } function callpay() { if (typeof WeixinJSBridge == "undefined"){ if( document.addEventListener ){ document.addEventListener('WeixinJSBridgeReady', jsApiCall, false); }else if (document.attachEvent){ document.attachEvent('WeixinJSBridgeReady', jsApiCall); document.attachEvent('onWeixinJSBridgeReady', jsApiCall); } }else{ jsApiCall(); } } callpay(); </script></head><body> </br></br></br></br> </body></html>

5、找到notify_url.php文件上面添加define('IN_ECS', true);require('../includes/init.php');require('../includes/lib_payment.php');调用订单信息

7、更多安全信息和详细信息就不列举了