From ce9590b4ec9f42adcdb24ea039a4674526fabe3b Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Tue, 21 Nov 2023 17:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=AC=BE=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/service/pay/WeChatPayMerchantService.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/common/service/pay/WeChatPayMerchantService.php b/app/common/service/pay/WeChatPayMerchantService.php index 7bf9cca..579e9e2 100644 --- a/app/common/service/pay/WeChatPayMerchantService.php +++ b/app/common/service/pay/WeChatPayMerchantService.php @@ -244,6 +244,7 @@ class WeChatPayMerchantService extends BasePayService if (empty($order)) { throw new Exception('回调订单不存在'); } + // 防止重复操作 if ($order['pay_status'] == PayOrderEnum::PAY_STATUS_ISPAID && !empty($order['transaction_id'])) { return true; } @@ -278,6 +279,10 @@ class WeChatPayMerchantService extends BasePayService \think\facade\Log::info(['退款回调信息', $message]); if($message['refund_status'] === 'SUCCESS') { $refundOrder = RefundOrder::where(['out_trade_no', $message['out_trade_no'], 'refund_sn'=>$message['out_refund_no']])->find(); + // 防止重复操作 + if ($refundOrder['refund_status'] == 1 && !empty($order['refund_id'])) { + return true; + } $refundOrder->refund_status = 1; $refundOrder->refund_id = $message['refund_id']; $refundOrder->finish_time = time();