sh0umik / Laravel5-PaypalIPN

Paypal IPN Package for Laravel 5
34 stars 22 forks source link

419 unknown status #9

Open lubomirstankov opened 6 years ago

lubomirstankov commented 6 years ago

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');```
DonDiegoAA commented 6 years ago

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

Thank you.

Erroler commented 5 years ago

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.