提交 144228de 编写于 作者: G gongfuxiang

支付插件优化

上级 e430c7bb
......@@ -298,7 +298,11 @@ class QQ
private function GetPayParams($params = [])
{
// 平台
$client_type = ApplicationClientType();
$client_type = APPLICATION_CLIENT_TYPE;
if($client_type == 'pc' && IsMobile())
{
$client_type = 'h5';
}
// 支付类型
$trade_type = empty($params['trade_type']) ? $this->GetTradeType($client_type) : $params['trade_type'];
......
......@@ -183,10 +183,10 @@ class Weixin
}
// 平台
$client_type = ApplicationClientType();
$client_type = $this->GetApplicationClientType();
// 微信中打开
if($client_type == 'h5' && IsWeixinEnv() && (empty($params['user']) || empty($params['user']['weixin_web_openid'])))
if($client_type == 'pc' && IsWeixinEnv() && (empty($params['user']) || empty($params['user']['weixin_web_openid'])))
{
exit(header('location:'.PluginsHomeUrl('weixinwebauthorization', 'pay', 'index', input())));
}
......@@ -230,6 +230,25 @@ class Weixin
return DataReturn($msg, -1);
}
/**
* 终端
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-12-07
* @desc description
*/
private function GetApplicationClientType()
{
// 平台
$client_type = APPLICATION_CLIENT_TYPE;
if($client_type == 'pc' && IsMobile())
{
$client_type = 'h5';
}
return $client_type;
}
/**
* 支付返回处理
* @author Devil
......@@ -301,7 +320,7 @@ class Weixin
if(APPLICATION == 'web' && IsWeixinEnv())
{
$html = $this->PayHtml($pay_data, $redirect_url);
die($pay_data['html']);
die($html);
} else {
$result = DataReturn('success', 0, $pay_data);
}
......@@ -399,7 +418,7 @@ class Weixin
}
// 平台
$client_type = ApplicationClientType();
$client_type = $this->GetApplicationClientType();
// openid
if($client_type == 'weixin')
......@@ -493,7 +512,7 @@ class Weixin
private function GetTradeType()
{
// 平台
$client_type = ApplicationClientType();
$client_type = $this->GetApplicationClientType();
// 平台类型定义
$type_all = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册