Closed Quixotix closed 13 years ago
I'm wondering if perhaps cURL is returning an integer for the response code rather than a string as a user has reported in the PHP docs. I am going to put a string cast on that, however, I will need Sandro to test the fix.
Sandro,
Can you do the following for me? First, use this new ipnlistener.php https://github.com/Quixotix/PHP-PayPal-IPN/blob/master/ipnlistener.php
Next, add this code to line 91, right before the if block:
foreach (curl_version() as $key => $value) {
if (is_array($value)) $value = implode(", ", $value);
error_log("cURL $key: $value");
}
error_log('cURL Response: '.$this->response);
error_log('cURL Status: '.$this->response_status);
Then run your IPN test and look in the error log. Can you send me that information?
We now know that the error is:
cURL error: [52] GnuTLS recv error (-9): A TLS packet with unexpected length was received.
There are quite a few others who have had this problem with cURL and paypal when cURL is built on GnuTLS rather than openSSL. One possible workaround...
curl_setopt($c, CURLOPT_SSLVERSION, 3)
But I don't think I want to explicitly set the SSL version in the IPN class itself. I think I need a way to set additional curl options based on individual needs.
This issue has been resolved. Simply this to your ipn listener script
$listener->force_ssl_v3;
Issue from Sandro originally posted on my Blog http://www.micahcarrick.com/paypal-ipn-with-php.html