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.
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Controller\Payment;
|
|
|
|
|
|
|
|
use App\Helper\Log;
|
|
|
|
use App\Model\Order;
|
|
|
|
use Hyperf\HttpServer\Contract\ResponseInterface;
|
|
|
|
use Psr\Http\Message\ResponseInterface as Psr7ResponseInterface;
|
|
|
|
use Hyperf\HttpServer\Contract\RequestInterface;
|
|
|
|
|
|
|
|
class PageController extends AbstractController
|
|
|
|
{
|
|
|
|
public function index(RequestInterface $request, ResponseInterface $response): Psr7ResponseInterface
|
|
|
|
{
|
|
|
|
$orderNo = $request->input('order_no', '');
|
|
|
|
Log::info('redirectToOut orderNo:' . $orderNo, [], 'omipay');
|
|
|
|
if (!$orderNo) {
|
|
|
|
return '订单号错误';
|
|
|
|
}
|
|
|
|
$order = Order::where('order_no', $orderNo)->first();
|
|
|
|
if (!$order) {
|
|
|
|
return '订单号错误';
|
|
|
|
}
|
|
|
|
Log::info('redirectToOut url:' . $order->redirect_url, [], 'omipay');
|
|
|
|
return $response->redirect($order->redirect_url);
|
|
|
|
}
|
|
|
|
}
|