You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Controller/Payment/ReturnController.php

32 lines
989 B
PHP

<?php
declare(strict_types=1);
namespace App\Controller\Payment;
use App\Helper\Log;
use App\Service\RequestService;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;
use Psr\Http\Message\ResponseInterface as Psr7ResponseInterface;
class ReturnController extends AbstractController
{
private RequestService $requestService;
public function __construct(RequestService $requestService)
{
$this->requestService = $requestService;
}
public function go(RequestInterface $request, ResponseInterface $response): Psr7ResponseInterface
{
$token = $request->route('token');
Log::info('returnPage token:' . $token, [], 'platform');
$requestLog = $this->requestService->getRequestLogByToken($token);
$returnUrl = $requestLog->getDataValue('returnUrl');
Log::info('returnPage returnUrl:' . $returnUrl, [], 'platform');
return $response->redirect($returnUrl);
}
}