Explorar o código

fix(payment): 处理微信订单查询异常

- 在 PaymentRecordService 中捕获 LogicException 异常以避免程序中断
- 优化 ExpressService 中的错误日志记录,使用上下文参数替代字符串拼接
runphp hai 4 meses
pai
achega
0554f291a7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Service/ExpressService.php

+ 1 - 1
src/Service/ExpressService.php

@@ -42,7 +42,7 @@ class ExpressService
             'transaction_id' => $transactionID,
         ]);
         if ($response->isFailed()) {
-            Log::error('查询订单发货状态失败'.json_encode($response->toArray()));
+            Log::error('查询订单发货状态失败{transaction_id}{response}', ['transaction_id' => $transactionID, 'response' => $response->toArray()]);
             throw_logic_exception('查询订单发货状态失败');
         }
         return $response->toArray()['order'];