Regarding "Action Required before October 7, 2013" email

Mayhem30
Contributor
Contributor

The PayPal email I received regarding changes to the IPN code contains incorrect information.

 

The code examples are missing the "content-length" header. Without this header, the IPN script will fail.

 

The example PHP code stated this :

 

PHP
// post back to PayPal system to validate
$header="POST /cgi-bin/webscr HTTP/1.1\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";

 

 

The correct PHP code is :

 

 $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";
 $header .= "Host: www.paypal.com\r\n";
 $header .= "Connection: close\r\n\r\n";

 

 

You may want to consider fixing this in your next notification email. I didn't relaize there was even an issue until I started receiving complaints from customers this morning about orders not being processed.

 

This is the error message I received when the 'content-length' header was not included :

 

HTTP/1.1 411 Length Required\r\n
Server: AkamaiGHost\r\n
Mime-Version: 1.0\r\n
Content-Type: text/html\r\n
Content-Length: 222\r\n
Expires: Fri, 19 Jul 2013 16:36:36 GMT\r\n
Date: Fri, 19 Jul 2013 16:36:36 GMT\r\n
Connection: close\r\n
\r\n
<HTML><HEAD>\n
<TITLE>Bad Request</TITLE>\n
</HEAD><BODY>\n
<H1>Bad Request</H1>\n
Your browser sent a request that this server could not understand.<P>\n
Reference*********************************************\n
</BODY>\n
</HTML>\n

Login to Me Too
10 REPLIES 10

Mitch-Match
Contributor
Contributor


@Mayhem30 wrote:

The PayPal email I received regarding changes to the IPN code contains incorrect information.

 

 

The correct PHP code is :

 

 $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";
 $header .= "Host: www.paypal.com\r\n";
 $header .= "Connection: close\r\n\r\n";

 

 I have modified my headers the same way, and now I am getting an error HTTP/1.1 301 Moved Permanently.

 

It is getting quite frustrating, don't you think ?

 

 

Login to Me Too

Mayhem30
Contributor
Contributor

Great ... what URL does it show it's moving to?

Login to Me Too

FontMenu
Contributor
Contributor

@Mayhem30 wrote:

Great ... what URL does it show it's moving to?


https://www.paypal.com/home

 

The last try got me an error 302 with the same Location:.

 

I need my script live so I give up for now. If I did half to my customers as what Paypal does to us, I would be out of business 😞

 

 

 

Login to Me Too

FontMenu
Contributor
Contributor

@Mitch-Match wrote:


@Mayhem30 wrote:

The PayPal email I received regarding changes to the IPN code contains incorrect information.

 

 

The correct PHP code is :

 

 $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";
 $header .= "Host: www.paypal.com\r\n";
 $header .= "Connection: close\r\n\r\n";

 

 I have modified my headers the same way, and now I am getting an error HTTP/1.1 301 Moved Permanently.

 

It is getting quite frustrating, don't you think ?

 

 


I spent most part of the day running experiments to see what is going on. To no avail.

 

A script which worked perfectly with the 1.00 headers definitly does not work with the new 1.1 headers we are requested to use.

 

I am VERY CONCERNED. Why bother millions of users with an email to get them to use headers which DO NOT WORK ? Don't people at Paypal test what they send in the big world ? Why **bleep** up customers scripts and not provide adequate support ?

 

This is frustrating, agravating, worrysome, and silly at best.

 

I wish Paypal personnel had at least a tiny bit of respect for the customers who bring in the good money they get for mistreating them 😞

 

Login to Me Too

Mayhem30
Contributor
Contributor

I haven't had time to test things - but are the 1.0 headers / code format still working properly?

Login to Me Too

Mitch-Match
Contributor
Contributor

Yes, the older headers code works fine. Both with or without SSL.

 

Seems the new code simply does not get anywhere.

 

Login to Me Too

Mayhem30
Contributor
Contributor

Ok, thank you. I'll revert back to the old code until this mess gets resolved.

Login to Me Too

Fonant
Contributor
Contributor

Also finding my IPN script breaks when using the new HTTP 1.1 headers as specified by PayPal.


The result I get is this, even though I sent a Content-length header:

 

HTTP/1.0 411 Length Required

Mime-Version: 1.0

Server: AkamaiGHost

Content-Type: text/html

Date: Thu, 25 Jul 2013 19:29:14 GMT

Connection: close

Content-Length: 222

Expires: Thu, 25 Jul 2013 19:29:14 GMT

 

<HTML><HEAD>

<TITLE>Bad Request</TITLE>

</HEAD><BODY>

<H1>Bad Request</H1>

Your browser sent a request that this server could not understand.<P>

Reference&#32;&#35;7&#46;4c240a3&#46;13780554&#46;9aa11

</HTML>

 

Have reverted to HTTP 1.0 headers. Perhaps the Akami server doesn't speak HTML 1.1 yet?

Login to Me Too

Fonant
Contributor
Contributor

Some more info here: http://www.codingforum.org/f5/paypal-ipn-http-1-1-a-7423-2.html

 

My code was using:

 

$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);

 

where this advises using:

 

$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.