I'm testing my PHP script with Paypal sandbox, the script works with www.paypal.com
but not www.sandbox.paypal.com
. I recently received an email from PayPal asking to use HTTP 1.1 protocol instead of 1.0 so I have done that, and i'm using the Connection: close
in the header as specified, but the IPN URL hangs. When I try it with www.paypal.com
there is no hanging.
PayPal did specificy this in their second email
This is a follow-up to the bulletin we sent on 6 September, 2012. It has come to our attention that some merchants were experiencing issues getting their IPN scripts updated to use HTTP 1.1 because the scripts would get "hung" or take a long time to get a ‘VERIFIED’ response. We are including instructions on how to remedy this issue by adding a "Connection: close" header in the HTTP request.
But clearly that doesn't work.
$header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Host: $url\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$header .= "Connection: close\r\n";
Any ideas? Help much appreciated.