ecshop增加pc扫描二维码微信支付功能代码

2025-05-19 03:16:28

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" />';生成一个指向微信支付的手机连接二维码,手机扫描进入

ecshop增加pc扫描二维码微信支付功能代码

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>

ecshop增加pc扫描二维码微信支付功能代码

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

ecshop增加pc扫描二维码微信支付功能代码

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

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢