Reputation: 139
We've been working on a site functionality for a couple of days that uses the PAYPAL IPN. When we test our IPN listener in the developer.paypal IPN simulator, we get an error message "IPN Delivery Failed:500 Internal Server Error". Also in the IPN history in sandbox.paypal account, we get the HTTP response code of 500. However if we change these lines of code from sandbox to paypal, we get HTTP response code of 200(sent).
$header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
//use www.paypal for a live site
//$header .= "Host: www.paypal.com\r\n";
$header .= "Host: www.sandbox.paypal.com\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n";
$header .= "Connection: close\r\n\r\n";
$errstr=$errno='';
$paypalurl='ssl://www.sandbox.paypal.com';
//$paypalurl='ssl://www.paypal.com';
$fp = fsockopen ($paypalurl, 443, $errno, $errstr, 30);
Two months ago, I've worked on a similar IPN listener and it went fine when I was testing in sandbox. I tried to test that IPN listener yesterday and it was also giving me the 500 HTTP response code. I tried to look for errors in the error log but no error about the recent HTTP request is being listed.
Upvotes: 2
Views: 2049
Reputation: 2313
Upvotes: 1