From 6fca649c860edd40c8c53598c24da3c415f7530b Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Tue, 25 Mar 2025 16:11:52 +0800 Subject: [PATCH] feat : spu --- app/Amqp/Consumer/Pay/GoodOrderPayFinishConsumer.php | 3 ++- app/Service/Amqp/Pay/PayGoodOrderFinishService.php | 5 +++++ app/Service/Common/Pay/Wx/WxJsRechargeOrderService.php | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Amqp/Consumer/Pay/GoodOrderPayFinishConsumer.php b/app/Amqp/Consumer/Pay/GoodOrderPayFinishConsumer.php index 0fb1920..1a37ae5 100644 --- a/app/Amqp/Consumer/Pay/GoodOrderPayFinishConsumer.php +++ b/app/Amqp/Consumer/Pay/GoodOrderPayFinishConsumer.php @@ -41,7 +41,7 @@ class GoodOrderPayFinishConsumer extends ConsumerMessage */ public function consumeMessage($data, AMQPMessage $message): Result { - if (!$data['order_sno'] || !$data['pay_type']) { + if (!$data['order_sno'] || !$data['pay_type'] || !$data['callback_data']) { $this->log->error('GoodOrderPayFinishConsumer:error:NoData:'.json_encode($data)); return Result::ACK; } @@ -53,6 +53,7 @@ class GoodOrderPayFinishConsumer extends ConsumerMessage $service->orderNo = $data['order_sno']; $service->payType = (int)$data['pay_type']; + $service->callbackData = $data['callback_data']; $service->orderType = OrderCode::ORDER_TYPE_GOOD; $service->handle(); diff --git a/app/Service/Amqp/Pay/PayGoodOrderFinishService.php b/app/Service/Amqp/Pay/PayGoodOrderFinishService.php index 3a642ba..2d8940e 100644 --- a/app/Service/Amqp/Pay/PayGoodOrderFinishService.php +++ b/app/Service/Amqp/Pay/PayGoodOrderFinishService.php @@ -43,6 +43,11 @@ class PayGoodOrderFinishService */ public int $orderType; + /** + * @var array + */ + public array $callbackData; + /** * @var Order */ diff --git a/app/Service/Common/Pay/Wx/WxJsRechargeOrderService.php b/app/Service/Common/Pay/Wx/WxJsRechargeOrderService.php index 62e3878..3441624 100644 --- a/app/Service/Common/Pay/Wx/WxJsRechargeOrderService.php +++ b/app/Service/Common/Pay/Wx/WxJsRechargeOrderService.php @@ -89,6 +89,7 @@ class WxJsRechargeOrderService extends WxJsRechargeBaseService $message = new GoodOrderPayFinishProducer([ 'order_sno' => $this->orderNo, 'pay_type' => self::PayType, + 'callback_data' => $this->callbackData, ]); $this->producer->produce($message);