In the docs and the forums it says that paynow sends a post update through the resulturl variable. Laravel needs crsf token for post requests, so now I am not sure if my status update route is not being called or is being called but failing (post requests without the crsf token get the 419 “Page expired” error.
Handling status update in laravel
kapilnarotam
#2
Just leaving a comment to help out others in case you’ve managed already. I believe the CRSF token is required when submitting forms from the web routes. Setup a post route in the api routes file, and you will be able to receive update from the resulturl
jamesof
#3
Hi there,
Laravel allows you to exclude certain URLs from CSRF protection. Inside App\Http\Middleware
there is a file named VerifyCsrfToken.php
that has an array named $except
where you can place the URLs to be excluded. Look at this documentation page here for more details: https://laravel.com/docs/9.x/csrf#csrf-excluding-uris (replace 9.x with your Laravel version for specifics)