Browse Source

fix(wechatpay): 调整支付成功日志记录位置

- 将交易成功日志记录移至回调处理逻辑之前
- 确保所有回调数据都被完整记录
- 避免因异常导致的日志丢失问题
runphp 3 months ago
parent
commit
8a92d04612
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/PaymentProvider.php

+ 1 - 1
src/PaymentProvider.php

@@ -109,9 +109,9 @@ class PaymentProvider implements PaymentProviderInterface
     {
         $inBody = $request['inBody'];
         $data = $this->notifyService->transactionSuccess($request['headers'], $request['inBody']);
+        Log::debug(__METHOD__ . json_encode($data));
         if ($data['event_type'] == 'TRANSACTION.SUCCESS') {
             // 交易成功
-            Log::debug(__METHOD__ . json_encode($data));
             $payment = $this->extensionPaymentEntity->where([
                 'out_trade_no' => $data['out_trade_no'],
             ])->findOrEmpty();