From 0130f4dbba4e91fb60258d29dcff8197f3519014 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Tue, 21 Nov 2023 11:18:03 +0800 Subject: [PATCH] fixed --- app/common/service/pay/WeChatPayMerchantService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/common/service/pay/WeChatPayMerchantService.php b/app/common/service/pay/WeChatPayMerchantService.php index 06b5111..85b1f22 100644 --- a/app/common/service/pay/WeChatPayMerchantService.php +++ b/app/common/service/pay/WeChatPayMerchantService.php @@ -201,7 +201,7 @@ class WeChatPayMerchantService extends BasePayService $server->handlePaid(function (Message $message) { \think\facade\Log::info(['支付回调信息', $message]); if ($message['trade_state'] === 'SUCCESS') { - $this->handlePaid($message); + return $this->handlePaid($message); } else { \think\facade\Log::info('支付失败', $message); } @@ -224,6 +224,9 @@ class WeChatPayMerchantService extends BasePayService if (empty($order)) { throw new Exception('回调订单不存在'); } + if ($order['pay_status'] == PayOrderEnum::PAY_STATUS_ISPAID && !empty($order['transaction_id'])) { + return true; + } $order->transaction_id = $transaction_id; $order->pay_status = PayOrderEnum::PAY_STATUS_ISPAID; $order->finish_time = time();