|
|
@@ -5,6 +5,7 @@ namespace addons\epay\library; |
|
|
|
use addons\unishop\model\Config; |
|
|
|
use Exception; |
|
|
|
use think\Log; |
|
|
|
use think\Request; |
|
|
|
use think\Response; |
|
|
|
use think\Session; |
|
|
|
use Yansongda\Pay\Gateways\Alipay\Alipay; |
|
|
@@ -96,8 +97,11 @@ class Service |
|
|
|
Session::delete("openid"); |
|
|
|
Session::set("wechatorderdata", $params); |
|
|
|
$url = addon_url('epay/api/wechat', [], true, true); |
|
|
|
header("location:{$url}"); |
|
|
|
exit; |
|
|
|
$result = [ |
|
|
|
"trade_type"=>"MWEB", |
|
|
|
"mweb_url"=>$url |
|
|
|
]; |
|
|
|
return $result; |
|
|
|
} elseif ($request->isMobile()) { |
|
|
|
$method = 'wap'; |
|
|
|
} |
|
|
@@ -126,8 +130,12 @@ class Service |
|
|
|
//手机网页支付,跳转 |
|
|
|
$params['spbill_create_ip'] = $request->ip(0, false); |
|
|
|
$html = $pay->driver($type)->gateway('wap')->pay($params); |
|
|
|
header("location:{$html}"); |
|
|
|
exit; |
|
|
|
$result = [ |
|
|
|
"trade_type"=>"MWEB", |
|
|
|
"mweb_url"=>$html, |
|
|
|
"referer"=>Request::instance()->server('HTTP_REFERER') |
|
|
|
]; |
|
|
|
return $result; |
|
|
|
break; |
|
|
|
case 'app': |
|
|
|
//APP支付,直接返回字符串 |
|
|
@@ -153,7 +161,7 @@ class Service |
|
|
|
} |
|
|
|
} |
|
|
|
//返回字符串 |
|
|
|
$html = is_array($html) ? json_encode($html) : $html; |
|
|
|
// $html = is_array($html) ? json_encode($html) : $html; |
|
|
|
return $html; |
|
|
|
} |
|
|
|
|
|
|
|