master
elf 1 year ago
parent caf4681ea6
commit aee5d7ade7

@ -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)) {

Loading…
Cancel
Save