ipay88(支付网关)Laravel

ipay88 (Payment Gateway) with Laravel

我正在将 ipay88 支付网关与 Laravel 框架集成。我已经成功集成了支付网关并且用户能够到达支付页面,错误在支付后的重定向页面done/cancel,错误是“

The POST method is not supported for this route. Supported methods: GET, HEAD." Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The POST method is not supported for this route. Supported methods: GET, HEAD.

在我的 web.php 我有这条路线:

Route::get('/get/renter/payment/status', 'OB@getpaymentstatus');

并且我在 VerifyCsrfToken

中添加了此路由以从 CSRF 令牌中排除

请问如何解决这个问题。谢谢

看起来像支付网关发送 Post 请求,因此您可以执行以下操作

Route::post('/get/renter/payment/status', 'OB@getpaymentstatus');

或者如果需要,您可以允许所有请求

Route::any('/get/renter/payment/status', 'OB@getpaymentstatus');

要验证支付网关发送的是哪种方法。您可以在 getpaymentstatus method.While 中执行以下操作,尝试将下面的代码更改为路由到任何方式,以便您可以轻松验证

dd($request->method());

我尝试了以下方法并且有效:Route::any('get/renter/payment/status', 'OB@getpaymentstatus'); 谢谢大家