Browse Source

fix(ThirdParty/AlibabaAgent): 修复日志记录中的结果数据格式问题

- 将预下单API请求成功的日志记录从原始结果改为JSON编码格式
- 将创建订单API请求成功的日志记录从原始结果改为JSON编码格式
- 将免密支付API请求成功的日志记录从原始结果改为JSON编码格式
- 确保所有API响应结果都能正确序列化到日志中
- 避免因对象无法直接输出导致的日志记录失败问题
shichen 3 months ago
parent
commit
07c23bbc6b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/services/ThirdParty/AlibabaAgent/OrderService.php

+ 3 - 3
app/services/ThirdParty/AlibabaAgent/OrderService.php

@@ -69,7 +69,7 @@ class OrderService extends AlibabaAgentBaseService
69
             return false;
69
             return false;
70
         }
70
         }
71
 
71
 
72
-        Log::channel('alibaba')->info('[预下单] API请求成功', ['result' => $result]);
72
+        Log::channel('alibaba')->info('[预下单] API请求成功', ['result' => json_encode($result)]);
73
 
73
 
74
         return $this->formatPreviewResult($result);
74
         return $this->formatPreviewResult($result);
75
     }
75
     }
@@ -200,7 +200,7 @@ class OrderService extends AlibabaAgentBaseService
200
             return false;
200
             return false;
201
         }
201
         }
202
 
202
 
203
-        Log::channel('alibaba')->info('[创建订单] API请求成功', ['result' => $result]);
203
+        Log::channel('alibaba')->info('[创建订单] API请求成功', ['result' => json_encode($result)]);
204
 
204
 
205
         return $this->formatCreateOrderResult($result);
205
         return $this->formatCreateOrderResult($result);
206
     }
206
     }
@@ -253,7 +253,7 @@ class OrderService extends AlibabaAgentBaseService
253
             return false;
253
             return false;
254
         }
254
         }
255
 
255
 
256
-        Log::channel('alibaba')->info('[免密支付] API请求成功', ['result' => $result]);
256
+        Log::channel('alibaba')->info('[免密支付] API请求成功', ['result' => json_encode($result)]);
257
 
257
 
258
         return $this->formatProtocolPayResult($result);
258
         return $this->formatProtocolPayResult($result);
259
     }
259
     }