Magento 1.8.1 – Fix PayPal IPN Not Receiving Issue

magento-1.8paypal

Hope someone can shine some light on this!

Can anyone confirm what the Paypal IPN url should be set to for Standard payment?

I have been advised by a Paypal tech that it is http://www.yoursitename.com/index.php/paypal/ipn/index/ but the Paypal IPN history still shows the response code 500 and we are not getting order status change from "Pending Payment" to processing.

I have checked the logs but can seem to find anything that stands out and we have tried the old code change to the ipn.php file but still no luck!

Any help would be great as I don't have much hair left to pull out 🙁

Best Answer

Sometimes Paypal requests are wrong, so server don't fire Magento routes as it should and you get server error 500. For checking, is it your situation or not, try to do next:

1) Create folder named 'paypal' in Magento root folder.
2) Create file named 'ipn.php' in this 'paypal' folder.
3) Open file and add next content:

<?php
    date_default_timezone_set('America/Los_Angeles');
    require_once '../app/Mage.php';
    umask(0);
    $app = Mage::app('default');
    if ($app->getRequest()->isPost()) {
       return;
    }
    try {
        $data = $app->getRequest()->getPost();
        Mage::getModel('paypal/ipn')->processIpnRequest($data, new Varien_Http_Adapter_Curl());
    } catch (Exception $e) {
        Mage::logException($e);
        $app->getResponse()->setHttpResponseCode(500);
    } 
?>

4) Clear Magento cache and check is Paypal IPN start working for you.

If it start working, just keep it as is. When Paypal requests are correct - it will work with standard Magento way, otherwise - paypal/ipn.php file will be used.

Related Topic