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

42次阅读

共计 1480 个字符,预计需要花费 4 分钟才能阅读完成。

代码如下,url2 获取结果为空,大佬看看哪里的问题啊?<?phpini_set(\’date.timezone\’,\’Asia/Shanghai\’);//error_reporting(E_ERROR);require_once "../lib/WxPay.Api.php";require_once "WxPay.NativePay.php";require_once \’log.php\’;if($_REQUEST[\’WIDout_trade_no\’] && $_REQUEST[\’WIDtotal_amount\’] && $_REQUEST[\’WIDbody\’]){}else{    die;}$params = array(    \’body\’ => $_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"];?> 复制代码 vivi 2023-02-21 16:35 2 找 ai 给你看看啊 igoogle 2023-02-21 16:56 3vivi 发表于 2023-2-21 16:35 找 ai 给你看看啊 AI 看不懂的吧? danny、2023-02-21 17:03 4 打印一下 $result 就知道了啊 igoogle 2023-02-21 17:07 5danny、发表于 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

正文完
 0