Laravel5-PaypalIPN
Laravel5-PaypalIPN copied to clipboard
419 unknown status
When i test with IpN simulator i get 419 Unknown Status
My controller
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Fahim\PaypalIPN\PaypalIPNListener;
class PayController extends Controller
{
public function check(Request $request)
{
$ipn = new PaypalIPNListener();
$ipn->use_sandbox = false;
$verified = $ipn->processIpn();
$report = $ipn->getTextReport();
Log::info("-----new payment-----");
Log::info($report);
if ($verified) {
if ($_POST['address_status'] == 'confirmed') {
// Check outh POST variable and insert your logic here
}
} else {
}
}
}
`
My routes:
`<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::post('/check', 'PayController@check');```
I have exactly the same issue. Did you find a solution for this 419 error code ?
Thank you.
Usually 419 errors in Laravel are related to a missing CSRF token in the request. This happens because in Laravel all POST routes require it. To fix it you should disable the CSRF middleware for that specific route.