feat : refund

This commit is contained in:
2025-02-24 15:30:58 +08:00
parent d0409088a6
commit c14901de4a
7 changed files with 105 additions and 24 deletions

View File

@@ -36,6 +36,7 @@ class RefundOrderService extends BaseService
*/
public function handle(): array
{
//todo 考虑是否枷锁
$orderId = (int)$this->request->input('order_id');
$type = (int)$this->request->input('type');
@@ -44,7 +45,7 @@ class RefundOrderService extends BaseService
if ($orderInfo->status != OrderCode::PAYED) throw new ErrException('该订单状态已变更,请勿重复操作,刷新后无法退款请联系客服');
//立即取消
$this->joinRefundQueue($orderId, $type);
$this->joinRefundQueue($orderId, $type, $orderInfo->amount, '用户主动取消订单');
return $this->return->success();
}