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();