From fc7cec0cd3792150bcd7cdf659e844d4b659bbb9 Mon Sep 17 00:00:00 2001 From: lixiaoyu <1906596264@qq.com> Date: Sat, 23 Sep 2023 15:37:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mobile/plugins/payment/wxpay.php | 14 +++++++------- mobile/source/helpers/dalianpay/config/config.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mobile/plugins/payment/wxpay.php b/mobile/plugins/payment/wxpay.php index 8356a00..fabb3fc 100755 --- a/mobile/plugins/payment/wxpay.php +++ b/mobile/plugins/payment/wxpay.php @@ -66,7 +66,7 @@ class wxpay // 配置参数 $this->payment = $payment; // 网页授权获取用户openid - if (!isset($_SESSION['openid']) || empty($_SESSION['openid'])) { +// if (!isset($_SESSION['openid']) || empty($_SESSION['openid'])) { // $button = '微信支付'; // return $button; @@ -79,17 +79,16 @@ class wxpay // $openid = $this->get_openid(); // 将当前页面url保存到$_SESSION中,供其他页面跳转 - $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; - $_SESSION['prev_url'] = $url; +// $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; +// $_SESSION['prev_url'] = $url; // header('Location: https://shop.heavenk.com/mobile/blank.php'); // exit; // 终止当前脚本的执行,确保页面跳转生效 // $_SESSION['openid'] = $openid; // $_SESSION['openid'] = 'oCTanxBeiVFWIekJT_GiPZM2UiGY'; //sc_test l or I - } +// } // $_SESSION['openid'] = 'oCTanxBeiVFWIekJT_GiPZM2UiGY'; // echo "openid: \r\n"; // var_dump($_SESSION['openid']); - $order_amount = $order['order_amount'] * 100; // 访问大连支付接口 // $url = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; @@ -123,6 +122,8 @@ class wxpay // } // echo "123546579\r\n"; + + $order_amount = $order['order_amount'] * 100; // 调用大连支付接口 require_once(BASE_PATH . 'helpers/dalianpay/demo/dalianpay.php'); $new_plugin = new dalianpay(); @@ -243,8 +244,7 @@ class wxpay wx.miniProgram.getEnv((res)=>{ if (res.miniprogram) { // 在微信小程序中打开 - wx.miniProgram.navigateTo({url: \'/pages/pay/pay\'}); - console.log(123) + wx.miniProgram.navigateTo({url: \'/pages/pay/pay?paydata='.$jsApiParameters.'\'}); }else{ //false代表在公众号里 if (typeof WeixinJSBridge == "undefined") diff --git a/mobile/source/helpers/dalianpay/config/config.php b/mobile/source/helpers/dalianpay/config/config.php index 4bf78d9..5ce5f44 100644 --- a/mobile/source/helpers/dalianpay/config/config.php +++ b/mobile/source/helpers/dalianpay/config/config.php @@ -18,7 +18,7 @@ // 交易类型 'transtype' => 'JSP501', // 微信支付 // 交易方式 - 'paytype' => 'W02', // 微信js支付 + 'paytype' => 'W06', // 微信小程序支付 // 门店号 'branchno' => '401', // 交易结果通知地址