作者 郭鑫

支付调试

@@ -26,6 +26,16 @@ class IndexController extends CommonController @@ -26,6 +26,16 @@ class IndexController extends CommonController
26 { 26 {
27 public function index() 27 public function index()
28 { 28 {
  29 + $return = $this->wxpay(['order_sn'=>123123123123],'保证金支付');
  30 + $qrcode_url = url('portal/Index/qrcode',['data'=>urlencode($return['code_url'])],true,true);
  31 + echo '<img src="'.$qrcode_url.'" alt=""/>';
  32 +// $back = [
  33 +// 'return'=>$return,
  34 +// 'code_url'=>base64_encode($return['code_url']),
  35 +// 'qrcode'=> '<img src="'.$qrcode_url.'" alt=""/>',
  36 +// 'alipay_url'=>url('portal/Alipay/alipay',array('order_sn'=>$edu['order_sn'],'name'=>$lic,'price'=>0.01))
  37 +// ];
  38 +
29 echo "<pre/>"; 39 echo "<pre/>";
30 print_r('7777'); 40 print_r('7777');
31 die; 41 die;
@@ -95,5 +105,13 @@ class IndexController extends CommonController @@ -95,5 +105,13 @@ class IndexController extends CommonController
95 } 105 }
96 } 106 }
97 107
  108 + // 微信支付二维码
  109 + public function qrcode() {
  110 + $data = $this->request->param('data');
  111 + require_once VENDOR_PATH.'WxpayAPI/example/phpqrcode/phpqrcode.php';
  112 + $url = urldecode($data);
  113 + \QRcode::png($url);
  114 + }
  115 +
98 116
99 } 117 }
@@ -106,7 +106,7 @@ class HomeBaseController extends BaseController @@ -106,7 +106,7 @@ class HomeBaseController extends BaseController
106 $input->SetBody($sort); 106 $input->SetBody($sort);
107 $input->SetAttach($orderInfo['order_sn']); 107 $input->SetAttach($orderInfo['order_sn']);
108 $input->SetOut_trade_no(\WxPayConfig::MCHID.date("YmdHis")); 108 $input->SetOut_trade_no(\WxPayConfig::MCHID.date("YmdHis"));
109 - $input->SetTotal_fee($orderInfo['price']*100);//$orderInfo['price_count']*100 109 + $input->SetTotal_fee(1);//$orderInfo['price_count']*100
110 $input->SetTime_start(date("YmdHis")); 110 $input->SetTime_start(date("YmdHis"));
111 $input->SetTime_expire(date("YmdHis", time() + 600)); 111 $input->SetTime_expire(date("YmdHis", time() + 600));
112 $input->SetGoods_tag("test"); 112 $input->SetGoods_tag("test");