lszyh
zengyyh 4 months ago
parent 8ea45791dd
commit 363c5a15a7
  1. 11
      app/api/service/Notify.php
  2. 10
      app/api/service/Retail/Payment.php
  3. 16
      app/common/enum/OrderType.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) {
// 记录错误日志

@ -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');
}

@ -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,
]
];
}

Loading…
Cancel
Save