mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +08:00
调整支付 openid 接口通道
This commit is contained in:
parent
388187cbe3
commit
51308e7b24
@ -15,6 +15,8 @@ abstract class Auth extends Controller
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 当前接口类型
|
* 当前接口类型
|
||||||
|
* 小程序使用 wxapp
|
||||||
|
* 服务号使用 wechat
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $type;
|
protected $type;
|
||||||
|
@ -193,7 +193,15 @@ class Order extends Auth
|
|||||||
if ($order['status'] != 2) $this->error('该订单不能发起支付哦!');
|
if ($order['status'] != 2) $this->error('该订单不能发起支付哦!');
|
||||||
if ($order['payment_status']) $this->error('订单已经支付,不需要再次支付哦!');
|
if ($order['payment_status']) $this->error('订单已经支付,不需要再次支付哦!');
|
||||||
try {
|
try {
|
||||||
$params = PaymentService::build($data['payid'])->create($this->user['openid'], $order['order_no'], $order['amount_total'], '商城订单支付', '');
|
$openid = '';
|
||||||
|
if ($this->type === 'wxapp') {
|
||||||
|
$openid = $this->user['openid1'];
|
||||||
|
} elseif ($this->type === 'wechat') {
|
||||||
|
$openid = $this->user['openid2'];
|
||||||
|
} else {
|
||||||
|
$this->error("接口类型{$this->type}未绑定支付");
|
||||||
|
}
|
||||||
|
$params = PaymentService::build($data['payid'])->create($openid, $order['order_no'], $order['amount_total'], '商城订单支付', '');
|
||||||
$this->success('获取支付参数成功!', $params);
|
$this->success('获取支付参数成功!', $params);
|
||||||
} catch (HttpResponseException $exception) {
|
} catch (HttpResponseException $exception) {
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user