فهرست منبع

feat(lakala): 添加拉卡拉支付回调日志记录功能

- 在回调接口中获取并记录请求头信息
- 记录回调请求的原始 body 内容
- 使用 Log::debug 输出调试日志便于问题追踪
- 日志内容包括 headers 和 body 的 JSON 格式数据
runphp 4 ماه پیش
والد
کامیت
97db1feca6
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      src/Controller/Api/IndexController.php

+ 6 - 0
src/Controller/Api/IndexController.php

@@ -13,6 +13,12 @@ class IndexController
 {
     public function notify(NotifyService $notifyService): Json
     {
+        $headers = getallheaders();
+        $body = file_get_contents('php://input');
+        Log::debug('lakala notify {headers} {body}', [
+            'headers' => json_encode($headers),
+            'body' => json_encode($body),
+        ]);
         $notifyService->notify();
         return json(['code' => 'SUCCESS', 'message' => '执行成功']);
     }