优化支付成功
parent
48821f1764
commit
2b215a615c
|
|
@ -49,16 +49,20 @@ class PayService
|
|||
if ($payLog->payable instanceof Order) {
|
||||
$order = $payLog->payable;
|
||||
|
||||
if ($order->isPaid()) {
|
||||
throw new BizException('订单已支付');
|
||||
}
|
||||
|
||||
if ($order->isCompleted()) {
|
||||
throw new BizException('订单已完成');
|
||||
}
|
||||
|
||||
// 支付方式
|
||||
$payWay = $payLog->pay_way;
|
||||
if ($payLog->isWxpay()) {
|
||||
$payWay = Order::PAY_WAY_WXPAY;
|
||||
}
|
||||
|
||||
if (! $order->isPending()) {
|
||||
throw new BizException('订单状态不是待支付');
|
||||
}
|
||||
|
||||
$order->update([
|
||||
'pay_sn' => $payLog->pay_sn,
|
||||
'pay_way' => $payWay,
|
||||
|
|
|
|||
Loading…
Reference in New Issue