Osama Shaki
Osama Shaki

Reputation: 149

ipay88 (Payment Gateway) with Laravel

I am integrating ipay88 payment gateway with Laravel framework. I have successfully integrated the payment gateway and the user is able to reach the payment page, the error is in the redirect page after payment done/cancel, the error is "

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.

In my web.php I have this route:

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

and I have added this rout to be excepted from CSRF token in VerifyCsrfToken

Could you please advise how to resolve this issue. Thank you

Upvotes: 0

Views: 907

Answers (2)

Osama Shaki
Osama Shaki

Reputation: 149

I have tried the following and it worked: Route::any('get/renter/payment/status', 'OB@getpaymentstatus'); Thank you all.

Upvotes: 0

John Lobo
John Lobo

Reputation: 15319

Look Like Payment gateway sending Post request so you can do the following

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

or you can allow all request if you needed

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

To verify which method is payment gateway is sending .You can do the following inside getpaymentstatus method.While trying below code change to route to any so you can verify easily

dd($request->method());

Upvotes: 1

Related Questions