wx pay
parent
4ddd23b0b2
commit
0284b4ed4a
|
|
@ -145,21 +145,21 @@ class Weixin
|
||||||
}
|
}
|
||||||
|
|
||||||
// 微信中打开
|
// 微信中打开
|
||||||
if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false)
|
// if(!empty($_SERVER['HTTP_USER_AGENT']) && stripos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false)
|
||||||
{
|
// {
|
||||||
$input = input();
|
// $input = input();
|
||||||
if(empty($input['code']))
|
// if(empty($input['code']))
|
||||||
{
|
// {
|
||||||
$this->GetUserOpenId($params);
|
// $this->GetUserOpenId($params);
|
||||||
} else {
|
// } else {
|
||||||
$ret = $this->Callback($input);
|
// $ret = $this->Callback($input);
|
||||||
if($ret['code'] != 0)
|
// if($ret['code'] != 0)
|
||||||
{
|
// {
|
||||||
return $ret;
|
// return $ret;
|
||||||
}
|
// }
|
||||||
$this->weixin_web_openid = $ret['data'];
|
// $this->weixin_web_openid = $ret['data'];
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 获取支付参数
|
// 获取支付参数
|
||||||
$ret = $this->GetPayParams($params);
|
$ret = $this->GetPayParams($params);
|
||||||
|
|
@ -338,6 +338,7 @@ class Weixin
|
||||||
$openid = isset($params['user']['weixin_openid']) ? $params['user']['weixin_openid'] : '';
|
$openid = isset($params['user']['weixin_openid']) ? $params['user']['weixin_openid'] : '';
|
||||||
} else {
|
} else {
|
||||||
$openid = $this->weixin_web_openid;
|
$openid = $this->weixin_web_openid;
|
||||||
|
$openid = isset($params['user']['weixin_web_openid']) ? $params['user']['weixin_web_openid'] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// appid
|
// appid
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue