ThinkPHP框架整合微信支付之Native 扫码支付模式二(2)
对应qrcode.html页面:
<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>微信安全支付</title> </head> <body> <div align="center" id="qrcode"> </div> <div align="center"> <p>订单号:<?php echo $out_trade_no; ?></p> </div> <div align="center"> <form action="./order_query.php" method="post"> <input name="out_trade_no" type='hidden' value="<?php echo $out_trade_no; ?>"> <button type="submit" >查询订单状态</button> </form> </div> <br> <div align="center"> <form action="./refund.php" method="post"> <input name="out_trade_no" type='hidden' value="<?php echo $out_trade_no; ?>"> <input name="refund_fee" type='hidden' value="1"> <button type="submit" >申请退款</button> </form> </div> <br> <div align="center"> <a href="../index.php" rel="external nofollow" >返回首页</a> </div> </body> <script src="__PUBLIC__/js/qrcode.js"></script> <script> if(<?php echo $unifiedOrderResult["code_url"] != NULL; ?>) { var url = "<?php echo $code_url;?>"; //参数1表示图像大小,取值范围1-10;参数2表示质量,取值范围'L','M','Q','H' var qr = qrcode(10, 'M'); qr.addData(url); qr.make(); var wording=document.createElement('p'); wording.innerHTML = "扫我,扫我"; var code=document.createElement('DIV'); code.innerHTML = qr.createImgTag(); var element=document.getElementById("qrcode"); element.appendChild(wording); element.appendChild(code); } </script> </html>
内容版权声明:除非注明,否则皆为本站原创文章。