0

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

John Lobo
  • 14,355
  • 2
  • 10
  • 20
Osama Shaki
  • 139
  • 15
  • check which page you are redirecitng back .is it same get/renter/payment/status. – John Lobo Jun 12 '21 at 05:16
  • Yes John it is the same – Osama Shaki Jun 12 '21 at 05:18
  • 1
    try changing Route::any or just try accessing /get/renter/payment/status url in browser .or else post full web.php in question.Also addd VerifyCsrfToken middleware code too – John Lobo Jun 12 '21 at 05:20
  • I have tried the following and it worked: Route::any('get/renter/payment/status', 'OB@getpaymentstatus'); Thank you so much John, I have tried get and post but poth did not work, as the payment gateway is sending post response so post should work right? – Osama Shaki Jun 12 '21 at 05:26
  • @OsamaShaki can you help me integrate ipay88 – Sohail Khan Jun 19 '21 at 02:19
  • @Sohil what is the problem you are facing? are you able to follow their api doc or not? – Osama Shaki Jun 19 '21 at 06:21
  • can you please answer this question for me. [https://stackoverflow.com/questions/67996664/how-to-integrate-ipay88-payment-gateway-with-laravel](https://stackoverflow.com/questions/67996664/how-to-integrate-ipay88-payment-gateway-with-laravel) Thanks. – Sadek Nurul Jun 25 '21 at 10:54
  • @OsamaShaki can you share me a code ipay88 integration step by step – Malik Zubair Mukhtar Nov 22 '22 at 07:37
  • @MalikZubairMukhtar you can find all the details in their documentation, please have a look and let me know your issues. Thanks – Osama Shaki Dec 22 '22 at 02:54

2 Answers2

1

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());
John Lobo
  • 14,355
  • 2
  • 10
  • 20
  • Yes it is sending post, I have tried the first one and it did not work so the second one worked for me.. Thank you – Osama Shaki Jun 12 '21 at 05:30
0

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

Osama Shaki
  • 139
  • 15