Laravel5-PaypalIPN icon indicating copy to clipboard operation
Laravel5-PaypalIPN copied to clipboard

419 unknown status

Open lubomirstankov opened this issue 7 years ago • 2 comments

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');```

lubomirstankov avatar Oct 27 '17 09:10 lubomirstankov

I have exactly the same issue. Did you find a solution for this 419 error code ?

Thank you.

DonDiegoAA avatar Jan 17 '18 01:01 DonDiegoAA

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.

Erroler avatar Aug 24 '19 18:08 Erroler