Saturday, February 5, 2011

PrestaShop TIps - Paypal module error : curl error:gnutls recv error (-9)

All of sudden, many people using Paypal payment method received following errors

-- Error 1--
Verification failure (using cURL).
Returned: cURL error:GnuTLS recv error (-9): A TLS packet with unexpected length was received.The PayPal transaction could not be VERIFIED.

If you are using PrestaShop, you will see your order has following warning message

-- Error 2 --
Payment Error and Warning: 0,00 € paid instead of 10,00 € !

But when you check the Paypal account transactions, both payer and receiver are showing correctly "complete"

I started investigating this issue, and look at log of IPN posted back from Paypal is correct. Below is my log, some of data is changed some data to xxxxx for security reason.

20:03:23,,mc_gross 0.10
20:03:23,,protection_eligibility Ineligible
20:03:23,,address_status confirmed
20:03:23,,payer_id 7XXXXXXXX2
20:03:23,,tax 0.00
20:03:23,,address_street 49 xxxxx ave
20:03:23,,payment_date 20:03:16 Feb 04, 2011 PST
20:03:23,,payment_status Completed
20:03:23,,charset gb2312
20:03:23,,address_zip m2jxxx
20:03:23,,mc_shipping 0.00
20:03:23,,mc_handling 0.00
20:03:23,,first_name Jinxxxx
20:03:23,,mc_fee 0.10
20:03:23,,address_country_code CA
20:03:23,,address_name EcoChoiceShop
20:03:23,,notify_version 3.0
20:03:23,,custom 222
20:03:23,,payer_status verified
20:03:23,,address_country Canada
20:03:23,,num_cart_items 1
20:03:23,,mc_handling1 0.00
20:03:23,,address_city toronto
20:03:23,,verify_sign AxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxgK
20:03:23,,mc_shipping1 0.00
20:03:23,,txn_id 7xxxxxxxxxxxxxxxxx44
20:03:23,,payment_type instant
20:03:23,,payer_business_name EcoChoiceShop
20:03:23,,last_name Jxxxxxxx
20:03:23,,address_state Ontario
20:03:23,,item_name1 ZZTestZZ
20:03:23,,quantity1 1
20:03:23,,receiver_id T8xxxxxBL4
20:03:23,,txn_type cart
20:03:23,,mc_gross_1 0.10
20:03:23,,mc_currency EUR
20:03:23,,residence_country CA
20:03:23,,transaction_subject 222

The high possibility of the cause is your provider (if you are using hosting company) has some changes on curl, see detailed here

Because the IPN data we received is correctly, so you can try to comment out following two lines TEMPORARY at /modules/paypal/validation.php to avoid this error.

But please note: once you remove the lines, if there is real error, you will not know. It is better to confirm you Paypal transaction for each order at this moment.

if ($result != 'VERIFIED')
$errors .= $paypal->getL('curlmethod').$result.' cURL error:'.curl_error($ch);

No comments: