微信支付二维码不显示【PHP大佬进来看看】

查看 54|回复 5
作者:igoogle   
代码如下,url2获取结果为空,大佬看看哪里的问题啊?
[ol] $_REQUEST['WIDbody'],
    'out_trade_no' => $_REQUEST['WIDout_trade_no'],
    'total_fee' => $_REQUEST['WIDtotal_amount']*100,
        //'total_fee' => 1,
);
//模式二
/**
* 流程:
* 1、调用统一下单,取得code_url,生成二维码
* 2、用户扫描二维码,进行支付
* 3、支付完成之后,微信服务器会通知支付成功
* 4、在支付成功通知中需要查单确认是否真正支付成功(见:notify.php)
*/
$notify = new NativePay();

$input = new WxPayUnifiedOrder();
$input->SetBody($params['body']);
$input->SetAttach($params['body']);
$input->SetOut_trade_no($params['out_trade_no']);
$input->SetTotal_fee($params['total_fee']);
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetGoods_tag($params['body']);
$input->SetNotify_url("https://a.com/payment/Wxpay_gz/example/native_callback.php");
$input->SetTrade_type("NATIVE");
$input->SetProduct_id("123456789");
$result = $notify->GetPayUrl($input);
$url2 = $result["code_url"];
?>[/ol]复制代码

大佬, 二维码, 代码

vivi   
找ai给你看看啊
igoogle
OP
  

vivi 发表于 2023-2-21 16:35
找ai给你看看啊

AI看不懂的吧
danny、   
打印一下$result就知道了啊
igoogle
OP
  

danny、 发表于 2023-2-21 17:03
打印一下$result就知道了啊

result警告,没有输出信息
Warning: urlencode() expects parameter 1 to be string, array given in /www/wwwroot/a.com/payment/Wxpay_gz/example/native.php on line 94
danny、   

igoogle 发表于 2023-2-21 17:07
result警告,没有输出信息
Warning: urlencode() expects parameter 1 to be string, array given in /w ...

这不是很明显么,这报错了么
您需要登录后才可以回帖 登录 | 立即注册

返回顶部