重要参数:$trade_type = 'NATIVE';//交易类型,微信H5支付时固定为MWEB、电脑支付Native
请求返回code_url
根据code_url生成qr二维码
代码语言:javascript复制//生成支付二维码
$content = $code_url;
$qrcode_path = './Public/attached/qrcode/code'.'_'.$order_no.'.png';
$matrixPointSize = 10;
$matrixMarginSize = 1;
$errorCorrectionLevel = 'M';
makecode_no_pic($content,$qrcode_path,$matrixPointSize,$matrixMarginSize,$errorCorrectionLevel);
makecode_no_pic方法:
function makecode_no_pic($content,$qrcode_path_new,$matrixPointSize,$matrixMarginSize,$errorCorrectionLevel){
ob_clean ();
Vendor('phpqrcode.phpqrcode');
$object = new QRcode();
$object::png($content,$qrcode_path_new, $errorCorrectionLevel, $matrixPointSize, $matrixMarginSize);
}
将二维码的图片链接展示给客户端就可以完成付款了