From 0284b4ed4a5b24604d839928e06fbea2602dde5d Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sat, 25 May 2019 14:14:59 +0800 Subject: [PATCH] wx pay --- extend/payment/Weixin.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/extend/payment/Weixin.php b/extend/payment/Weixin.php index 87723ae5b..ec4570960 100755 --- a/extend/payment/Weixin.php +++ b/extend/payment/Weixin.php @@ -145,21 +145,21 @@ class Weixin } // 微信中打开 - if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) - { - $input = input(); - if(empty($input['code'])) - { - $this->GetUserOpenId($params); - } else { - $ret = $this->Callback($input); - if($ret['code'] != 0) - { - return $ret; - } - $this->weixin_web_openid = $ret['data']; - } - } + // if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) + // { + // $input = input(); + // if(empty($input['code'])) + // { + // $this->GetUserOpenId($params); + // } else { + // $ret = $this->Callback($input); + // if($ret['code'] != 0) + // { + // return $ret; + // } + // $this->weixin_web_openid = $ret['data']; + // } + // } // 获取支付参数 $ret = $this->GetPayParams($params); @@ -338,6 +338,7 @@ class Weixin $openid = isset($params['user']['weixin_openid']) ? $params['user']['weixin_openid'] : ''; } else { $openid = $this->weixin_web_openid; + $openid = isset($params['user']['weixin_web_openid']) ? $params['user']['weixin_web_openid'] : ''; } // appid