From aee5d7ade78fb1911f6cf10e7fc3727a94e09c8e Mon Sep 17 00:00:00 2001 From: elf <360197197@qq.com> Date: Mon, 7 Aug 2023 23:16:06 +0800 Subject: [PATCH] yh --- app/Controller/Payment/NotifyController.php | 23 ++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/Controller/Payment/NotifyController.php b/app/Controller/Payment/NotifyController.php index 1e0a76b..847f252 100644 --- a/app/Controller/Payment/NotifyController.php +++ b/app/Controller/Payment/NotifyController.php @@ -33,9 +33,7 @@ class NotifyController extends AbstractController public function register(RequestInterface $request) { - $token = $request->route('token'); - $params = $request->all(); - Log::info(__CLASS__ . '[' . $token . ']:', $params); + [$token, $params] = $this->getTokenAndParams($request); $token = $request->route('token'); $requestLog = $this->requestService->getRequestLogByToken($token); @@ -63,9 +61,7 @@ class NotifyController extends AbstractController public function bindCard(RequestInterface $request) { - $token = $request->route('token'); - $params = $request->all(); - Log::info(__CLASS__ . '[' . $token . ']:', $params); + [$token, $params] = $this->getTokenAndParams($request); $requestLog = $this->requestService->getRequestLogByToken($token); @@ -94,9 +90,7 @@ class NotifyController extends AbstractController public function payment(RequestInterface $request) { - $token = $request->route('token'); - $params = $request->all(); - Log::info(__CLASS__ . '[' . $token . ']:', $params); + [$token, $params] = $this->getTokenAndParams($request); $requestLog = $this->requestService->getRequestLogByToken($token); @@ -139,9 +133,7 @@ class NotifyController extends AbstractController public function refund(RequestInterface $request) { - $token = $request->route('token'); - $params = $request->all(); - Log::info(__CLASS__ . '[' . $token . ']:', $params); + [$token, $params] = $this->getTokenAndParams($request); $requestLog = $this->requestService->getRequestLogByToken($token); @@ -180,6 +172,13 @@ class NotifyController extends AbstractController $baofu->notifySuccess(); } + protected function getTokenAndParams(RequestInterface $request) { + $token = $request->route('token'); + $params = $request->all(); + Log::info($request->getUri() . '[' . $token . ']:', $params); + return [$token, $params]; + } + protected function notify($url, $app, $data) { if (empty($url)) {