6
0
Fork 0
release
李静 2021-12-20 11:12:28 +08:00
parent 1bab230f10
commit 59711b6495
1 changed files with 25 additions and 25 deletions

View File

@ -616,6 +616,31 @@ class OrderService
throw new BizException('支付方式不支持');
}
/**
* 支付成功
*
* @param string $sn
* @param array $params
* @return void
*/
public function paySuccess(string $sn, array $params = []): void
{
$order = Order::where('sn', $sn)->firstOrFail();
if (! $order->isPending()) {
throw new BizException('订单状态不是待支付');
}
$order->update([
'pay_sn' => $params['pay_sn'],
'pay_way' => $params['pay_way'],
'pay_at' => $params['pay_at'],
'status' => Order::STATUS_PAID,
]);
// todo 处理预收益
}
/**
* 更新包裹状态
*
@ -715,29 +740,4 @@ class OrderService
]);
}
}
/**
* 支付成功
*
* @param string $sn
* @param array $params
* @return void
*/
public function paySuccess(string $sn, array $params = []): void
{
$order = Order::where('sn', $sn)->firstOrFail();
if (! $order->isPending()) {
throw new BizException('订单状态不是待支付');
}
$order->update([
'pay_sn' => $params['pay_sn'],
'pay_way' => $params['pay_way'],
'pay_at' => $params['pay_at'],
'status' => Order::STATUS_PAID,
]);
// todo 处理预收益
}
}