Search code examples
phppaypalpaypal-ipn

paypal IPN successfully sent


I have set up a simple IPN using the code https://github.com/Quixotix/PHP-PayPal-IPN

However when I run the following

<?php
    include('ipnlistener.php');

    $listener = new IpnListener();
    $listener->use_sandbox = true;

    try {
        $verified = $listener->processIpn();
    } catch (Exception $e) {
        // fatal error trying to process IPN.
        exit(0);
    }

if ($verified) {

    if ($verified) {


     mail('[email protected]', 'Verified IPN', $listener->getTextReport()); 
    }
    else {
    /*
    An Invalid IPN *may* be caused by a fraudulent transaction attempt. It's
    a good idea to have a developer or sys admin manually investigate any 
    invalid IPN.
    */
    mail('[email protected]', 'Invalid IPN', $listener->getTextReport());
    }
}
?>

I am not getting any mail from my server saying it got the IPN from Paypal


Solution

  • You need to debug in detail, one way is to write the log after each line into file and then check which step is causing the problem, also you can directly browse IPN URL and check if email for invalid IPN is wokring or not. There may be an issue with mail server configuration.