作者 郭鑫

支付调试

... ... @@ -26,6 +26,16 @@ class IndexController extends CommonController
{
public function index()
{
$return = $this->wxpay(['order_sn'=>123123123123],'保证金支付');
$qrcode_url = url('portal/Index/qrcode',['data'=>urlencode($return['code_url'])],true,true);
echo '<img src="'.$qrcode_url.'" alt=""/>';
// $back = [
// 'return'=>$return,
// 'code_url'=>base64_encode($return['code_url']),
// 'qrcode'=> '<img src="'.$qrcode_url.'" alt=""/>',
// 'alipay_url'=>url('portal/Alipay/alipay',array('order_sn'=>$edu['order_sn'],'name'=>$lic,'price'=>0.01))
// ];
echo "<pre/>";
print_r('7777');
die;
... ... @@ -95,5 +105,13 @@ class IndexController extends CommonController
}
}
// 微信支付二维码
public function qrcode() {
$data = $this->request->param('data');
require_once VENDOR_PATH.'WxpayAPI/example/phpqrcode/phpqrcode.php';
$url = urldecode($data);
\QRcode::png($url);
}
}
... ...
... ... @@ -106,7 +106,7 @@ class HomeBaseController extends BaseController
$input->SetBody($sort);
$input->SetAttach($orderInfo['order_sn']);
$input->SetOut_trade_no(\WxPayConfig::MCHID.date("YmdHis"));
$input->SetTotal_fee($orderInfo['price']*100);//$orderInfo['price_count']*100
$input->SetTotal_fee(1);//$orderInfo['price_count']*100
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetGoods_tag("test");
... ...