Question

I am facing an issue with Paypal IPN message in Magento 1.8.1. When I placed the order with Paypal the Order status still shows Pending even I have set the IPN notification URL to http://www.devdomain.com/paypal/ipn/. Also try to place the IPN script in my root folder but no success. :(

I am using Paypal Standard. When I see inside the Paypal it shows 500 error in IPN history page.

Please advise how I can resolve this issue.

Was it helpful?

Solution

Finally I found the solution after reviewing in deep. This was cause to due "USER Agent" HTTP Header in request. You can update this on Ipn.php file. Just replace the below line from this function on app/code/core/Mage/Paypal/Model/Ipn.php (Don't apply on core file. Add it on local dir)

protected function _postBack(Zend_Http_Client_Adapter_Interface $httpAdapter)

at line 143 (in magento 1.8.1)

$httpAdapter->write(Zend_Http_Client::POST, $this->_config->getPaypalUrl(), '1.1', array(
                'Connection: close',
            ), $sReq);

replace with

$httpAdapter->write(Zend_Http_Client::POST, $this->_config->getPaypalUrl(), '1.1', array(
                'Connection: Close', 'User-Agent: your_company_name'
                ), $sReq);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top