Payment gateway response URL not working (CCAvenue)

598 views Asked by At

I am trying to integrate the CCAvenue payment gateway into my project everything works but when I cancel the payment or the payment is successful, the payment gateway sends data to the response link for that I have created a function and route for that. the function works when I call using the browser but when payment gateways try to redirect to that link, the payment gateway does not find the link and I get a 404 error by payment gateway, The page you're looking for cannot be found!

I tried contacting the payment gateway and they say that the response page is not accessible by the payment gateway.

the routes I tried

$routes->post('response', 'Payment::paymentResponse');
or
$routes->match(['get', 'post'], 'response', [Payment::class, 'paymentResponse']);
2

There are 2 answers

0
Anurag On

Thank you everyone for the reply.

the solution is to disable CSRF just for that particular route/link for ex.

public array $globals = [
        'before' => [
            'csrf' => ['except' => ['response']],
0
Pran On

Disable CSRF validation for the response page route.

1, Goto app/Http/Middleware/VerifyCsrfToken.php

2, Add the route in $except array

protected $except = [
        '/response',
    ];