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

@@ -46,16 +46,18 @@ trait OrderChangeStatusTrait
* @param int $orderId
* @param int $type
* @param float|int $amount amount = 0 全部 amount > 0 部分
* @param string $reason
* @return void
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
protected function joinRefundQueue(int $orderId, int $type, float|int $amount = 0): void
protected function joinRefundQueue(int $orderId, int $type, float|int $amount = 0, string $reason = '系统自动'): void
{
$message = new RefundOrderProducer([
'order_id' => $orderId,
'type' => $type,
'amount' => $amount,
'reason' => $reason
]);
$producer = ApplicationContext::getContainer()->get(Producer::class);
$producer->produce($message);