diff --git a/app/Endpoint/Callback/Http/Controllers/YeePayNotifyController.php b/app/Endpoint/Callback/Http/Controllers/YeePayNotifyController.php index ae9b7e0e..fedc181a 100644 --- a/app/Endpoint/Callback/Http/Controllers/YeePayNotifyController.php +++ b/app/Endpoint/Callback/Http/Controllers/YeePayNotifyController.php @@ -14,9 +14,9 @@ class YeePayNotifyController extends Controller { public function __invoke(Request $request) { - logger()->debug('yeepay notify', $request->input()); + $this->info('request parameters', $request->input()); - // $this->validateSign($request); + $this->validateSign($request); switch ($request->input('service')) { case 'accountpay.behalf.Pay': @@ -85,15 +85,18 @@ class YeePayNotifyController extends Controller { $yeePayService = new YeePayService(config('services.yeepay')); - logger()->debug('yeepay notify sign------>', [ - 'sign' => $request->input('sign'), - 'sign2' => $yeePayService->sign($request->input()), - ]); - if ($request->input('sign') === $yeePayService->sign($request->input())) { return; } throw new Exception('签名错误'); } + + protected function info($message, array $context = []) + { + logger()->build([ + 'driver' => 'daily', + 'path' => storage_path('logs/yeepay-notify.log'), + ])->info('yeepay notify', $context); + } }