Hello, we have received an email from PayPal recently asking us to update our integration to support HTTP 1.1 and TLS 1.2. I have read through the documentation and our current integration works fine so far. Nevertheless we get that email saying we have to update our integration. Is there something wrong with our code? Does fsockopen not support TLS 1.2? // Send an empty HTTP 200 OK response to acknowledge receipt of the notification
header('HTTP/1.1 200 OK');
if (empty($_POST))
exit ;
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value)
{
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
// post back to PayPal system to validate
$header = '';
$header .= "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen('tls://www.paypal.com', 443, $errno, $errstr, 30);
... View more