From 363c5a15a732825ef4df81aff66ddb99dbd730aa Mon Sep 17 00:00:00 2001 From: zengyyh Date: Mon, 5 Aug 2024 11:06:35 +0800 Subject: [PATCH] zhifu --- app/api/service/Notify.php | 11 +++++++++++ app/api/service/Retail/Payment.php | 10 +++++----- app/common/enum/OrderType.php | 16 +++++++++++++++- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/app/api/service/Notify.php b/app/api/service/Notify.php index 0c67e55c..020152ec 100644 --- a/app/api/service/Notify.php +++ b/app/api/service/Notify.php @@ -212,6 +212,17 @@ class Notify ->setPaymentData($paymentData) ->handle(); } + //订单支付成功事件(开通商城(批发零售商城)) + if ($tradeInfo['order_type'] == OrderTypeEnum::RETAIL || $tradeInfo['order_type'] == OrderTypeEnum::SALE) { + $service = new Retail\PaySuccess(); + $service->setOrderNo($tradeInfo['order_no']) + ->setMethod($tradeInfo['pay_method']) + ->setTradeId($tradeInfo['trade_id']) + ->setPaymentData($paymentData) + ->handle(); + } + + Log::append('Notify-orderPaySucces', ['message' => '订单支付成功']); } catch (\Throwable $e) { // 记录错误日志 diff --git a/app/api/service/Retail/Payment.php b/app/api/service/Retail/Payment.php index f53548d9..b04ce087 100644 --- a/app/api/service/Retail/Payment.php +++ b/app/api/service/Retail/Payment.php @@ -100,11 +100,11 @@ class Payment extends BaseService // 构建第三方支付请求的参数 $payment = $this->unifiedorder($extra); // 记录第三方交易信息 - // $order_type = OrderTypeEnum::MEMBER;//开通会员 - // if ($this->orderInfo['order_type'] == IdentityEnum::DEALER) { - // $order_type = OrderTypeEnum::DEALER;//开通分销商 - // } - // $this->recordPaymentTrade($payment, $order_type); + $order_type = OrderTypeEnum::RETAIL;//开通零售商城 + if ($this->orderInfo['order_type'] == 20) { + $order_type = OrderTypeEnum::SALE;//开通批发商城 + } + $this->recordPaymentTrade($payment, $order_type); // 返回结果 return compact('payment'); } diff --git a/app/common/enum/OrderType.php b/app/common/enum/OrderType.php index bfc05369..710b00e4 100644 --- a/app/common/enum/OrderType.php +++ b/app/common/enum/OrderType.php @@ -34,12 +34,18 @@ class OrderType extends EnumBasics // 回收订单 const RECOVERY = 50; - // 回收订单 + // 采购商 const WHOLESALER = 60; // 余额充值订单 const RECHARGE = 100; + //零售商城 + const RETAIL = 70; + + //批发商城 + const SALE = 80; + /** * 获取订单类型值 @@ -75,6 +81,14 @@ class OrderType extends EnumBasics self::WHOLESALER => [ 'name' => '开通采购商订单', 'value' => self::WHOLESALER, + ], + self::RETAIL => [ + 'name' => '开通零售商城订单', + 'value' => self::RETAIL, + ], + self::SALE => [ + 'name' => '开通采批发商城订单', + 'value' => self::SALE, ] ]; }