Hulp - Privérekening
  • Home
  • Betalingen en overboekingen
  • Geschillen en beperkingen
  • Mijn rekening
  • Mijn wallet
  • Inloggen en beveiliging
  • Tools voor verkopers

How do I modify my IPN PHP listener to support HTTP1.1?

Important: PayPal has required the use of HTTP 1.1 since October 2013.

To modify your IPN PHP listener to support HTTP1.1, you need to include the "Host" and "Connection" headers in the IPN postback script. The following example shows how: PHP
// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Host: www.paypal.com\r\n";
$header .= "Connection: close\r\n\r\n";
Note: For further compatibility, your PHP script should also trim the IPN validation response. Modify your script from this:
 
if (strcmp ($res, "VERIFIED") == 0) {
..
else if (strcmp ($res, "INVALID") == 0) {
To this:
 
if (strcmp (trim($res), "VERIFIED") == 0) {
..
else if (strcmp (trim($res), "INVALID") == 0) {
In PHP, check that the last line of your header includes double end-of-line markers: \r\n\r\n as in the next example:
 
$header .="Connection: close\r\n\r\n";
In PHP, open the socket connection to the same host declared in the header. Your header is declaring the host as:
 
$header .="Host: www.paypal.com\r\n";
You should open the connection to the same host:
 
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

Note: For new IPN integrations, we recommend these updated samples.

Meer manieren waarop we je kunnen helpen

Als je cookies accepteert, gebruiken we ze om je ervaring te verbeteren en aan je voorkeuren aan te passen. We gebruiken ze ook om onze partners in staat te stellen gepersonaliseerde advertenties van PayPal te laten zien wanneer je andere sites bezoekt. Cookies beheren en meer informatie