Laravel Paypal IPN

Posted 1 year ago by l_stankov01

Hello guys! I use this https://github.com/sh0umik/Laravel5-PaypalIPN and i try to make if order is success paypal return post data.. I make IPN configuration on paypal and all ok. But when payment is success it return my site and when i turn debug mode it say

No Post Data

Here is my PayController.php

public function paypalIpn()
{
    $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
            Log::info("payment verified and inserted to db");
        }
    } else {
        Log::info("Some thing went wrong in the payment !");
    }
}

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!
|
*/


// Routes only with views

Route::get('/404', function(){
return redirect('/');
})->name('back');

Route::get('/clear-cache', function() {
    $exitCode = Artisan::call('cache:clear');
    return redirect('/index.php');
});
// Routes with controllers


Auth::routes();


Route::get('/cp/buypl/success', '[email protected]')->name('checkp');

What i do wrong please tell me..

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.