From 4477b22f9dc69e261d26ed0173c29ce953edf7bf Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Mon, 29 Jan 2024 18:20:52 +0800 Subject: [PATCH] 1 --- app/api/service/identity/Payment.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/api/service/identity/Payment.php b/app/api/service/identity/Payment.php index 1da23b5e..1173cb47 100644 --- a/app/api/service/identity/Payment.php +++ b/app/api/service/identity/Payment.php @@ -116,16 +116,17 @@ class Payment extends BaseService /** * 订单支付成功事件 * @param string $orderNo 当前订单号 + * @param int|null $tradeId + * @param array $paymentData * @return void * @throws BaseException * @author: wanghousheng */ - private function orderPaySuccess(string $orderNo): void + private function orderPaySuccess(string $orderNo, ?int $tradeId = null, array $paymentData = []): void { - $paymentData = [];// 获取订单详情 $service = new IdentityPaySuccessService(); // 订单支付成功业务处理 - $service->setOrderNo($orderNo)->setMethod($this->method)->setTradeId()->setPaymentData($paymentData); + $service->setOrderNo($orderNo)->setMethod($this->method)->setTradeId($tradeId)->setPaymentData($paymentData); if (!$service->handle()) { throwError($service->getError() ?: '订单支付失败'); } @@ -174,7 +175,7 @@ class Payment extends BaseService // 获取第三方交易记录信息 $tradeInfo = PaymentTradeModel::detailByOutTradeNo($outTradeNo); // 订单支付成功事件 - $this->orderPaySucces($tradeInfo['order_no'], $tradeInfo['trade_id'], $result); + $this->orderPaySuccess($tradeInfo['order_no'], $tradeInfo['trade_id'], $result); } // 返回订单状态 return $result ? $result['paySuccess'] : false;