From 72da6fe48a2244d33eed1d80ecec992c70e65198 Mon Sep 17 00:00:00 2001 From: Devil Date: Thu, 2 Jan 2020 00:25:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=94=AF=E4=BB=98=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E7=8E=AF=E5=A2=83=E4=B8=AD=E6=94=AF=E4=BB=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/OrderService.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/application/service/OrderService.php b/application/service/OrderService.php index 46dc338ea..1752b3a14 100755 --- a/application/service/OrderService.php +++ b/application/service/OrderService.php @@ -143,7 +143,7 @@ class OrderService } } - // 发起支付 + // 发起支付数据 $pay_data = array( 'user' => $params['user'], 'out_user' => md5($params['user']['id']), @@ -173,6 +173,17 @@ class OrderService return $ret; } + // 微信中打开并且webopenid为空 + if(in_array(APPLICATION_CLIENT_TYPE, ['pc', 'h5'])) + { + if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false && empty($pay_data['user']['weixin_web_openid'])) + { + // 授权成功后回调订单详情页面重新自动发起支付 + $url = MyUrl('index/order/detail', ['id'=>$pay_data['order_id'], 'is_pay_auto'=>1, 'is_pay_submit'=>1]); + session('plugins_weixinwebauth_pay_callback_view_url', $url); + } + } + // 发起支付 $pay_name = 'payment\\'.$payment[0]['payment']; $ret = (new $pay_name($payment[0]['config']))->Pay($pay_data);