mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
调整接口授权通道(wap,web,wxapp,wechat,ios,android)
This commit is contained in:
parent
40e2e6f0b3
commit
e90ceaac25
@ -195,7 +195,11 @@ class Order extends Auth
|
||||
if ($order['status'] != 2) $this->error('订单不能发起支付哦!');
|
||||
if ($order['payment_status'] > 0) $this->error('订单已经完成支付!');
|
||||
try {
|
||||
$openid = $this->user[UserService::TYPES[$this->type]['auth']] ?? '';
|
||||
$openid = '';
|
||||
if (in_array($this->type, [UserService::APITYPE_WXAPP, UserService::APITYPE_WECHAT])) {
|
||||
$openid = $this->user[UserService::TYPES[$this->type]['auth']] ?? '';
|
||||
if (empty($openid)) $this->error("无法创建支付,未获取到OPENID");
|
||||
}
|
||||
$params = PaymentService::build($data['payid'])->create($openid, $order['order_no'], $order['amount_total'], '商城订单支付', '', $data['back']);
|
||||
$this->success('获取支付参数成功!', $params);
|
||||
} catch (HttpResponseException $exception) {
|
||||
|
@ -21,11 +21,19 @@ class UserService extends Service
|
||||
const TYPES = [
|
||||
UserService::APITYPE_WAP => [
|
||||
'name' => '手机浏览器',
|
||||
'auth' => '',
|
||||
'auth' => 'phone',
|
||||
],
|
||||
UserService::APITYPE_WEB => [
|
||||
'name' => '电脑浏览器',
|
||||
'auth' => '',
|
||||
'auth' => 'phone',
|
||||
],
|
||||
UserService::APITYPE_IOSAPP => [
|
||||
'name' => '苹果应用',
|
||||
'auth' => 'phone',
|
||||
],
|
||||
UserService::APITYPE_ANDROID => [
|
||||
'name' => '安卓应用',
|
||||
'auth' => 'phone',
|
||||
],
|
||||
UserService::APITYPE_WXAPP => [
|
||||
'name' => '微信小程序',
|
||||
@ -35,14 +43,6 @@ class UserService extends Service
|
||||
'name' => '微信服务号',
|
||||
'auth' => 'openid2',
|
||||
],
|
||||
UserService::APITYPE_ANDROID => [
|
||||
'name' => '安卓应用',
|
||||
'auth' => '',
|
||||
],
|
||||
UserService::APITYPE_IOSAPP => [
|
||||
'name' => '苹果应用',
|
||||
'auth' => '',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user