0

We are doing some order testing on a development site with PayPal Sandbox but are getting the following error in Magento's var/log/payment_paypal_standard.log file when the IPN is received from PayPal:

PayPal IPN postback failure. See paypal_unknown_ipn.log for details.

Looking at the rest of the log in payment_paypal_standard.log we have the following:

[postback_to] => https://www.sandbox.paypal.com/webscr
[postback_result] =>
[exception] => PayPal IPN postback failure. See paypal_unknown_ipn.log for details.
[__pid] => 30534

We have PayPal enabled on our live site (on the same server) and it's working properly so not sure why the sandbox IPN's are failing.

The PayPal IPN history shows a code 200 for the IPN and the request is logged in the site's access_log file, so the IPN is being received successfully but the postback is failing.

The following error is logged in var/log/exception.log:

2016-03-08T16:07:41+00:00 ERR (3):
exception 'Exception' with message 'PayPal IPN postback failure. See paypal_unknown_ipn.log for details.' in /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/code/core/Mage/Paypal/Model/Ipn.php:155
Stack trace:
#0 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/code/core/Mage/Paypal/Model/Ipn.php(114): Mage_Paypal_Model_Ipn->_postBack(Object(Varien_Http_Adapter_Curl))
#1 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/code/core/Mage/Paypal/controllers/IpnController.php(43): Mage_Paypal_Model_Ipn->processIpnRequest(Array, Object(Varien_Http_Adapter_Curl))
#2 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Paypal_IpnController->indexAction()
#3 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#4 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#6 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#7 /var/www/vhosts/dev-2.domain.co.uk/httpdocs/index.php(87): Mage::run('', 'store')
#8 {main}

Running Magento CE 1.7.0.2 and tested on PHP 5.3 and 5.4.

How can we troubleshoot this to get it working?

1

Most probably the problem is in your curl library (which is very old, probably version 7.19.7 because you are using an old PHP version). PayPal Sandbox supports only TLS 1.2 while PayPal live supports TLS 1.0, TLS 1.1 and TLS 1.2. You can read some more information here - https://www.paypal.com/webapps/mpp/ssl-security-update . To be sure that this is the problem you can log the curl response in lib/Varien/Http/Adapter/Curl.php -> public function read(), after $response = curl_exec($this->_getResource()); add something like this:

Mage::log($this->getError(), Zend_Log::INFO, 'curl.log', true);

and it should return "SSL connect error". The solution is to update your curl library to at least version 7.34.0.

  • Just added the line you suggested and ran a test order, but no curl.log file was created. Any other options for catching the presumed error? – Chris Mar 8 '16 at 16:27
  • Try to log the $response. Also check if Curl.php is rewritten or copied to app/code/local/Varien/Http/Adapter. – michael Mar 8 '16 at 16:37
  • Ignore what I said previously - I was editing the file on the wrong site! The curl.log works and does indeed show SSL connect error. Will look at upgrading the prehistoric version of curl. – Chris Mar 8 '16 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.