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/PageController.php

30 lines
907 B
PHTML

2 years ago
<?php
declare(strict_types=1);
namespace App\Controller\Payment;
2 years ago
use App\Helper\Log;
2 years ago
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', '');
2 years ago
Log::info('redirectToOut orderNo:' . $orderNo, [], 'omipay');
2 years ago
if (!$orderNo) {
return '订单号错误';
}
$order = Order::where('order_no', $orderNo)->first();
if (!$order) {
return '订单号错误';
}
2 years ago
Log::info('redirectToOut url:' . $order->redirect_url, [], 'omipay');
2 years ago
return $response->redirect($order->redirect_url);
}
}