diff --git a/app/Http/Controllers/Api/WxpayController.php b/app/Http/Controllers/Api/WxpayController.php index 92f404f..1f4abfe 100644 --- a/app/Http/Controllers/Api/WxpayController.php +++ b/app/Http/Controllers/Api/WxpayController.php @@ -29,9 +29,9 @@ class WxpayController ]); $app = Factory::payment($config); try { - $response = $app->handlePaidNotify(function ($message, $fail) { + $response = $app->handlePaidNotify(function ($message, $fail) use ($agent_id) { //TODO 仅测试用 - DB::table('pay_debugs')->insert(['content' => json_encode($message)]); + DB::table('pay_debugs')->insert(['agent_id' => $agent_id, 'type' => 1, 'content' => json_encode($message)]); $this->log($message); // 请求成功 @@ -145,7 +145,10 @@ class WxpayController ]); $app = Factory::payment($config); try { - $response = $app->handleRefundedNotify(function ($message, $reqInfo, $fail) { + $response = $app->handleRefundedNotify(function ($message, $reqInfo, $fail) use ($agent_id) { + //TODO 仅测试用 + DB::table('pay_debugs')->insert(['agent_id' => $agent_id, 'type' => 2, 'content' => json_encode($message)]); + // 记录一下本地调试 $this->log(['message' => $message, 'reqInfo' => $reqInfo], 'refund'); // 请求成功