6
0
Fork 0

优化支付成功

release
李静 2021-12-27 19:12:09 +08:00
parent 48821f1764
commit 2b215a615c
1 changed files with 8 additions and 4 deletions

View File

@ -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,