Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10136 > unrolled thread

Paypal IPN and HTTP 1.1

Started byMitch Bujard <cli.mb@schoolfonts.com>
First post2013-07-17 15:36 +0200
Last post2013-07-22 22:33 +0200
Articles 15 — 5 participants

Back to article view | Back to comp.lang.php


Contents

  Paypal IPN and HTTP 1.1 Mitch Bujard <cli.mb@schoolfonts.com> - 2013-07-17 15:36 +0200
    Re: Paypal IPN and HTTP 1.1 "J.O. Aho" <user@example.net> - 2013-07-17 16:25 +0200
      Re: Paypal IPN and HTTP 1.1 Mitch Bujard <cli.mb@schoolfonts.com> - 2013-07-17 20:05 +0200
        OT: Paypal IPN and HTTP 1.1 "J.O. Aho" <user@example.net> - 2013-07-17 21:12 +0200
        Re: Paypal IPN and HTTP 1.1 Denis McMahon <denismfmcmahon@gmail.com> - 2013-07-17 23:31 +0000
          Re: Paypal IPN and HTTP 1.1 j <mung_me@att.net> - 2013-07-18 21:34 -0400
            Re: Paypal IPN and HTTP 1.1 Mitch Bujard <cli.mb@schoolfonts.com> - 2013-07-19 08:59 +0200
    Re: Paypal IPN and HTTP 1.1 Jerry Stuckle <jstucklex@attglobal.net> - 2013-07-17 11:02 -0400
    Re: Paypal IPN and HTTP 1.1 Mitch Bujard <cli.mb@schoolfonts.com> - 2013-07-20 12:25 +0200
      Re: Paypal IPN and HTTP 1.1 Jerry Stuckle <jstucklex@attglobal.net> - 2013-07-20 08:46 -0400
      Re: Paypal IPN and HTTP 1.1 "J.O. Aho" <user@example.net> - 2013-07-20 17:08 +0200
      Re: Paypal IPN and HTTP 1.1 j <mung_me@att.net> - 2013-07-22 10:33 -0400
        Re: Paypal IPN and HTTP 1.1 Mitch Bujard <cli.mb@schoolfonts.com> - 2013-07-22 20:57 +0200
          Re: Paypal IPN and HTTP 1.1 j <mung_me@att.net> - 2013-07-22 22:11 -0400
        Re: Paypal IPN and HTTP 1.1 Mitch Bujard <cli.mb@schoolfonts.com> - 2013-07-22 22:33 +0200

#10136 — Paypal IPN and HTTP 1.1

FromMitch Bujard <cli.mb@schoolfonts.com>
Date2013-07-17 15:36 +0200
SubjectPaypal IPN and HTTP 1.1
Message-ID<51e69dfa$0$18757$426a34cc@news.free.fr>
Today I got a message from Paypal entitled 'Action required before 
October 7, 2013'. It says that at that date, IPN listener scripts will 
have to be conformant to HTTP: 1.1 or they will stop working.

Then it summarily shows a few examples, and says that going to 
paypal.com/ipn will provide more. I have been there and the link to 
sample code is broken. How can a company like Paypal email to milions 
of customers to have them visit their site, and provide a broken link ? 
What a shame.

Mitch
http://FontMenu.com
---
Do what I say. Not what I do. Or vice versa. Or versa vice.

[toc] | [next] | [standalone]


#10137

From"J.O. Aho" <user@example.net>
Date2013-07-17 16:25 +0200
Message-ID<b4nnq5Fns9oU1@mid.individual.net>
In reply to#10136
On 17/07/13 15:36, Mitch Bujard wrote:
> Today I got a message from Paypal entitled 'Action required before
> October 7, 2013'. It says that at that date, IPN listener scripts will
> have to be conformant to HTTP: 1.1 or they will stop working.

That's been an requirement in the paypal documentation for a long while.

Don't think you need to do something unless you use an old web server 
daemon, would guess IIS4 or something like that.


> Then it summarily shows a few examples, and says that going to
> paypal.com/ipn will provide more. I have been there and the link to
> sample code is broken. How can a company like Paypal email to milions of
> customers to have them visit their site, and provide a broken link ?
> What a shame.

I think it's a miss communication, they seem to be in the middle of a 
move of the documentation to the developer site instead, download the 
PDF on the page and you get a new URL for it on another domain.


-- 

  //Aho

[toc] | [prev] | [next] | [standalone]


#10139

FromMitch Bujard <cli.mb@schoolfonts.com>
Date2013-07-17 20:05 +0200
Message-ID<51e6dcfb$0$2416$426a74cc@news.free.fr>
In reply to#10137
On 2013-07-17 14:25:09 +0000, J.O. Aho said:

> On 17/07/13 15:36, Mitch Bujard wrote:

>> Then it summarily shows a few examples, and says that going to
>> paypal.com/ipn will provide more. I have been there and the link to
>> sample code is broken. How can a company like Paypal email to milions of
>> customers to have them visit their site, and provide a broken link ?
>> What a shame.
> 
> I think it's a miss communication, they seem to be in the middle of a 
> move of the documentation to the developer site instead, download the 
> PDF on the page and you get a new URL for it on another domain.

I use a php script as listener and was wondering if anybody here in the 
same case had received the same email. I implemented what they require 
and am confident it will eventually work fine when the change things. I 
was just agravated by a broken link, like so many users of mine do when 
it happens. Except that I am so small, and they are so big, one would 
not expect them to be fallible.

The broken link is indeed at x.com.

Mitch
http://FontMenu.com
---
If you do not change direction, you may end up where you are heading.
Lao Tzu

[toc] | [prev] | [next] | [standalone]


#10142 — OT: Paypal IPN and HTTP 1.1

From"J.O. Aho" <user@example.net>
Date2013-07-17 21:12 +0200
SubjectOT: Paypal IPN and HTTP 1.1
Message-ID<b4o8lcFrhccU1@mid.individual.net>
In reply to#10139
On 17/07/13 20:05, Mitch Bujard wrote:
> On 2013-07-17 14:25:09 +0000, J.O. Aho said:
>
>> On 17/07/13 15:36, Mitch Bujard wrote:
>
>>> Then it summarily shows a few examples, and says that going to
>>> paypal.com/ipn will provide more. I have been there and the link to
>>> sample code is broken. How can a company like Paypal email to milions of
>>> customers to have them visit their site, and provide a broken link ?
>>> What a shame.
>>
>> I think it's a miss communication, they seem to be in the middle of a
>> move of the documentation to the developer site instead, download the
>> PDF on the page and you get a new URL for it on another domain.
>
> I use a php script as listener and was wondering if anybody here in the
> same case had received the same email.

Not sure, as I'm on holiday, but I guess I'll see something on Monday if 
they have sent us something. We ain't using PHP at work, but nothing in 
out code that would need to be changed to support HTTP/1.1.


> I implemented what they require
> and am confident it will eventually work fine when the change things. I
> was just agravated by a broken link, like so many users of mine do when
> it happens. Except that I am so small, and they are so big, one would
> not expect them to be fallible.

Things works in mysterious ways at PayPal, as we are operating with 
payment solutions in more than just one country, so we have a bunch of 
contacts at PayPal and the Germans may say one thing and the Spaniards 
says something completely different.

At least they haven't been as bad as Moneybookers, I had to figure out 
what went wrong on their side and tell them what to fix... just for 
someone is "big" don't mean they do it right...

-- 

  //Aho

[toc] | [prev] | [next] | [standalone]


#10147

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-07-17 23:31 +0000
Message-ID<ks79gi$psp$10@dont-email.me>
In reply to#10139
On Wed, 17 Jul 2013 20:05:47 +0200, Mitch Bujard wrote:

> I was just agravated by a broken link

I feel your aggravation - paypal documentation links have always been 
crap, and finding what you want usually feels like navigating if not a 
minefield then at least a labyrinth, but this might not be the optimum 
place to rant about broken links on paypals developer docs. ;)

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#10151

Fromj <mung_me@att.net>
Date2013-07-18 21:34 -0400
Message-ID<ksa52k$blo$1@news.albasani.net>
In reply to#10147
On 7/17/2013 7:31 PM, Denis McMahon wrote:
> On Wed, 17 Jul 2013 20:05:47 +0200, Mitch Bujard wrote:
>
>> I was just agravated by a broken link
>
> I feel your aggravation - paypal documentation links have always been
> crap, and finding what you want usually feels like navigating if not a
> minefield then at least a labyrinth, but this might not be the optimum
> place to rant about broken links on paypals developer docs. ;)

I see PayPal is up to version 99.

I'm in need of rewriting my PayPal code as PayPal has changed so much. 
I'm not looking forward to it.

Jeff
>

[toc] | [prev] | [next] | [standalone]


#10153

FromMitch Bujard <cli.mb@schoolfonts.com>
Date2013-07-19 08:59 +0200
Message-ID<51e8e3d8$0$2114$426a74cc@news.free.fr>
In reply to#10151
On 2013-07-19 01:34:36 +0000, j said:

> On 7/17/2013 7:31 PM, Denis McMahon wrote:
>> On Wed, 17 Jul 2013 20:05:47 +0200, Mitch Bujard wrote:
>> 
>>> I was just agravated by a broken link
>> 
>> I feel your aggravation - paypal documentation links have always been
>> crap, and finding what you want usually feels like navigating if not a
>> minefield then at least a labyrinth, but this might not be the optimum
>> place to rant about broken links on paypals developer docs. ;)
> 
> I see PayPal is up to version 99.
> 
> I'm in need of rewriting my PayPal code as PayPal has changed so much. 
> I'm not looking forward to it.

Welcome to the club ;°).


[toc] | [prev] | [next] | [standalone]


#10138

FromJerry Stuckle <jstucklex@attglobal.net>
Date2013-07-17 11:02 -0400
Message-ID<ks6bak$1pk$1@dont-email.me>
In reply to#10136
On 7/17/2013 9:36 AM, Mitch Bujard wrote:
> Today I got a message from Paypal entitled 'Action required before
> October 7, 2013'. It says that at that date, IPN listener scripts will
> have to be conformant to HTTP: 1.1 or they will stop working.
>
> Then it summarily shows a few examples, and says that going to
> paypal.com/ipn will provide more. I have been there and the link to
> sample code is broken. How can a company like Paypal email to milions of
> customers to have them visit their site, and provide a broken link ?
> What a shame.
>
> Mitch
> http://FontMenu.com
> ---
> Do what I say. Not what I do. Or vice versa. Or versa vice.
>
>

Your PHP question is?


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#10155

FromMitch Bujard <cli.mb@schoolfonts.com>
Date2013-07-20 12:25 +0200
Message-ID<51ea65af$0$2049$426a34cc@news.free.fr>
In reply to#10136
On 2013-07-17 13:36:58 +0000, Mitch Bujard said:

> Today I got a message from Paypal entitled 'Action required before 
> October 7, 2013'. It says that at that date, IPN listener scripts will 
> have to be conformant to HTTP: 1.1 or they will stop working.

Now, the follow-up. After modifying my PHP code, adding the stuff they 
want, I first got an error 411. Some googling showed me to a page where 
the guy had modified his code to prevent the error. So did I.

Now I get 301 Moved Permanently. Code still does not work.

Paypal community forums are quite dead.

It's no so much as a php issue as Paypal inconsistency and lack of 
proper response and documentation. But it still is part of the php 
experience :(

Has anybody got some helpful experience to share ?

TIA

Mitch
http://FontMenu.com
---
To err is human but to really foul up requires a computer.
Dan Rather

[toc] | [prev] | [next] | [standalone]


#10160

FromJerry Stuckle <jstucklex@attglobal.net>
Date2013-07-20 08:46 -0400
Message-ID<kse0ge$bmd$1@dont-email.me>
In reply to#10155
On 7/20/2013 6:25 AM, Mitch Bujard wrote:
> On 2013-07-17 13:36:58 +0000, Mitch Bujard said:
>
>> Today I got a message from Paypal entitled 'Action required before
>> October 7, 2013'. It says that at that date, IPN listener scripts will
>> have to be conformant to HTTP: 1.1 or they will stop working.
>
> Now, the follow-up. After modifying my PHP code, adding the stuff they
> want, I first got an error 411. Some googling showed me to a page where
> the guy had modified his code to prevent the error. So did I.
>
> Now I get 301 Moved Permanentl y. Code still does not work.
>
> Paypal community forums are quite dead.
>
> It's no so much as a php issue as Paypal inconsistency and lack of
> proper response and documentation. But it still is part of the php
> experience :(
>
> Has anybody got some helpful experience to share ?
>
> TIA
>
> Mitch
> http://FontMenu.com
> ---
> To err is human but to really foul up requires a computer.
> Dan Rather
>

It has nothing to do with PHP (other than that's what you choose to 
use).  You could be using Perl, VBScript, C++ or even assembler to 
access the interface.  The problem would be the same.

You need to be asking Paypal.  They know their interface better than 
anyone else.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#10162

From"J.O. Aho" <user@example.net>
Date2013-07-20 17:08 +0200
Message-ID<b4vnfvFera3U1@mid.individual.net>
In reply to#10155
On 20/07/13 12:25, Mitch Bujard wrote:
> On 2013-07-17 13:36:58 +0000, Mitch Bujard said:
>
>> Today I got a message from Paypal entitled 'Action required before
>> October 7, 2013'. It says that at that date, IPN listener scripts will
>> have to be conformant to HTTP: 1.1 or they will stop working.
>
> Now, the follow-up. After modifying my PHP code, adding the stuff they
> want, I first got an error 411. Some googling showed me to a page where
> the guy had modified his code to prevent the error. So did I.
>
> Now I get 301 Moved Permanently. Code still does not work.
>
> Paypal community forums are quite dead.
>
> It's no so much as a php issue as Paypal inconsistency and lack of
> proper response and documentation. But it still is part of the php
> experience :(
>
> Has anybody got some helpful experience to share ?

Contact your Paypal account manager and make him to work and that way 
get proper solution from PayPal.

-- 

  //Aho

[toc] | [prev] | [next] | [standalone]


#10179

Fromj <mung_me@att.net>
Date2013-07-22 10:33 -0400
Message-ID<ksjfrh$nv0$1@news.albasani.net>
In reply to#10155
On 7/20/2013 6:25 AM, Mitch Bujard wrote:
> On 2013-07-17 13:36:58 +0000, Mitch Bujard said:
>
>> Today I got a message from Paypal entitled 'Action required before
>> October 7, 2013'. It says that at that date, IPN listener scripts will
>> have to be conformant to HTTP: 1.1 or they will stop working.

This looks like a server issue. HTTP 1.1 has been around for quite a 
while, why are you at 1.0?

I'm not sure what you can do in PHP other than send some headers with 
the host info. Otherwise I see that there are a number of changes in 1.1 
that can't be spoofed with a header.

I'd say deal with the server. Post some code if you like, I've written 
both IPN and PayPal Pro code so I (and I assume others) have some 
familiarity.

Jeff

>
> Now, the follow-up. After modifying my PHP code, adding the stuff they
> want, I first got an error 411. Some googling showed me to a page where
> the guy had modified his code to prevent the error. So did I.
>
> Now I get 301 Moved Permanently. Code still does not work.
>
> Paypal community forums are quite dead.
>
> It's no so much as a php issue as Paypal inconsistency and lack of
> proper response and documentation. But it still is part of the php
> experience :(
>
> Has anybody got some helpful experience to share ?
>
> TIA
>
> Mitch
> http://FontMenu.com
> ---
> To err is human but to really foul up requires a computer.
> Dan Rather
>

[toc] | [prev] | [next] | [standalone]


#10181

FromMitch Bujard <cli.mb@schoolfonts.com>
Date2013-07-22 20:57 +0200
Message-ID<51ed809e$0$3747$426a34cc@news.free.fr>
In reply to#10179
On 2013-07-22 14:33:32 +0000, j said:

> On 7/20/2013 6:25 AM, Mitch Bujard wrote:
>> On 2013-07-17 13:36:58 +0000, Mitch Bujard said:
>> 
>>> Today I got a message from Paypal entitled 'Action required before
>>> October 7, 2013'. It says that at that date, IPN listener scripts will
>>> have to be conformant to HTTP: 1.1 or they will stop working.
> 
> This looks like a server issue. HTTP 1.1 has been around for quite a 
> while, why are you at 1.0?
> 
> I'm not sure what you can do in PHP other than send some headers with 
> the host info. Otherwise I see that there are a number of changes in 
> 1.1 that can't be spoofed with a header.
> 
> I'd say deal with the server. Post some code if you like, I've written 
> both IPN and PayPal Pro code so I (and I assume others) have some 
> familiarity.

You are right. It can be the server.

I got several hosts and will try the same script that Paypal lists at
https://ppmts.custhelp.com/app/answers/detail/a_id/926/kw/IPN%20HTTP%2F1.1%20new%20code 


Thanks

Mitch
http://FontMenu.com

[toc] | [prev] | [next] | [standalone]


#10193

Fromj <mung_me@att.net>
Date2013-07-22 22:11 -0400
Message-ID<kskonh$f3p$1@news.albasani.net>
In reply to#10181
On 7/22/2013 2:57 PM, Mitch Bujard wrote:
> On 2013-07-22 14:33:32 +0000, j said:
>
>> On 7/20/2013 6:25 AM, Mitch Bujard wrote:
>>> On 2013-07-17 13:36:58 +0000, Mitch Bujard said:
>>>
>>>> Today I got a message from Paypal entitled 'Action required before
>>>> October 7, 2013'. It says that at that date, IPN listener scripts will
>>>> have to be conformant to HTTP: 1.1 or they will stop working.
>>
>> This looks like a server issue. HTTP 1.1 has been around for quite a
>> while, why are you at 1.0?
>>
>> I'm not sure what you can do in PHP other than send some headers with
>> the host info. Otherwise I see that there are a number of changes in
>> 1.1 that can't be spoofed with a header.
>>
>> I'd say deal with the server. Post some code if you like, I've written
>> both IPN and PayPal Pro code so I (and I assume others) have some
>> familiarity.
>
> You are right. It can be the server.
>
> I got several hosts and will try the same script that Paypal lists at
> https://ppmts.custhelp.com/app/answers/detail/a_id/926/kw/IPN%20HTTP%2F1.1%20new%20code
>
On 7/22/2013 2:57 PM, Mitch Bujard wrote:> On 2013-07-22 14:33:32 +0000, 
j said:
>
>> On 7/20/2013 6:25 AM, Mitch Bujard wrote:
>>> On 2013-07-17 13:36:58 +0000, Mitch Bujard said:
>>>
>>>> Today I got a message from Paypal entitled 'Action required before
>>>> October 7, 2013'. It says that at that date, IPN listener scripts will
>>>> have to be conformant to HTTP: 1.1 or they will stop working.
>>
>> This looks like a server issue. HTTP 1.1 has been around for quite a
>> while, why are you at 1.0?
>>
>> I'm not sure what you can do in PHP other than send some headers with
>> the host info. Otherwise I see that there are a number of changes in
>> 1.1 that can't be spoofed with a header.
>>
>> I'd say deal with the server. Post some code if you like, I've written
>> both IPN and PayPal Pro code so I (and I assume others) have some
>> familiarity.
>
> You are right. It can be the server.

I think so.
>
> I got several hosts and will try the same script that Paypal lists at
> https://ppmts.custhelp.com/app/answers/detail/a_id/926/kw/IPN%20HTTP%2F1.1%20new%20code

I use curl:

	$url = 'http://www.paypal.com/cgi-bin/webscr';

	$req = 'cmd=_notify-validate';

	foreach ($_POST as $key => $value){
		$value = urlencode(stripslashes($value));
		$req .= "&$key=$value";
	}

$ch = curl_init();

curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($_POST) + 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$req);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);

curl_close($ch);


	if (strcmp ($result, "VERIFIED") == 0) {

...


   Jeff
>
>
> Thanks
>
> Mitch
> http://FontMenu.com
>

[toc] | [prev] | [next] | [standalone]


#10183

FromMitch Bujard <cli.mb@schoolfonts.com>
Date2013-07-22 22:33 +0200
Message-ID<51ed9725$0$2116$426a34cc@news.free.fr>
In reply to#10179
On 2013-07-22 14:33:32 +0000, j said:

> On 7/20/2013 6:25 AM, Mitch Bujard wrote:
>> On 2013-07-17 13:36:58 +0000, Mitch Bujard said:
>> 
>>> Today I got a message from Paypal entitled 'Action required before
>>> October 7, 2013'. It says that at that date, IPN listener scripts will
>>> have to be conformant to HTTP: 1.1 or they will stop working.
> 
> This looks like a server issue. HTTP 1.1 has been around for quite a 
> while, why are you at 1.0?
> 
> I'm not sure what you can do in PHP other than send some headers with 
> the host info. Otherwise I see that there are a number of changes in 
> 1.1 that can't be spoofed with a header.

I finally got it to work. The code at paypal support page was helpful. 
I followed scrupulously what they advise, and it works !

Thank you for your support.

Now, I can concentrate on creating nice Xojo web apps, but it's not php ;^}

Mitch
http://FontMenu.com
---

Here is the code :
PN: HTTP1.0 to HTTP1.1 - php coding tips
Published 01/25/2013 10:23 AM   |    Updated 02/07/2013 02:05 AM
Developers need to include the "Host" and "Connection" headers in the 
IPN postback script:

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";


PLEASE NOTE:

1)     For further compatibility your php script should also trim the 
IPN validation response.
Please modify your script:

From:
if (strcmp ($res, "VERIFIED") == 0) {
..
else if (strcmp ($res, "INVALID") == 0) {

To:
if (strcmp (trim($res), "VERIFIED") == 0) {
..
else if (strcmp (trim($res), "INVALID") == 0) {


2)     In php make sure the last line of your header includes double 
end-of-line markers: \r\n\r\n as in the example above: $header 
.="Connection: close\r\n\r\n";

3)     In php make sure to open the socket connection to the same host 
declared in the header. As 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);

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web