FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Paypal IPN and HTTP 1.1
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Paypal IPN and HTTP 1.1 [message #182184] Wed, 17 July 2013 13:36 Go to next message
Mitch Bujard is currently offline  Mitch Bujard
Messages: 19
Registered: July 2013
Karma: 0
Junior Member
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.
Re: Paypal IPN and HTTP 1.1 [message #182185 is a reply to message #182184] Wed, 17 July 2013 14:25 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
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
Re: Paypal IPN and HTTP 1.1 [message #182187 is a reply to message #182184] Wed, 17 July 2013 15:02 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: Paypal IPN and HTTP 1.1 [message #182188 is a reply to message #182185] Wed, 17 July 2013 18:05 Go to previous messageGo to next message
Mitch Bujard is currently offline  Mitch Bujard
Messages: 19
Registered: July 2013
Karma: 0
Junior Member
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
OT: Paypal IPN and HTTP 1.1 [message #182191 is a reply to message #182188] Wed, 17 July 2013 19:12 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
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
Re: Paypal IPN and HTTP 1.1 [message #182196 is a reply to message #182188] Wed, 17 July 2013 23:31 Go to previous messageGo to next message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
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(at)gmail(dot)com
Re: Paypal IPN and HTTP 1.1 [message #182200 is a reply to message #182196] Fri, 19 July 2013 01:34 Go to previous messageGo to next message
j is currently offline  j
Messages: 9
Registered: July 2011
Karma: 0
Junior Member
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
>
Re: Paypal IPN and HTTP 1.1 [message #182202 is a reply to message #182200] Fri, 19 July 2013 06:59 Go to previous messageGo to next message
Mitch Bujard is currently offline  Mitch Bujard
Messages: 19
Registered: July 2013
Karma: 0
Junior Member
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 ;°).
Re: Paypal IPN and HTTP 1.1 [message #182204 is a reply to message #182184] Sat, 20 July 2013 10:25 Go to previous messageGo to next message
Mitch Bujard is currently offline  Mitch Bujard
Messages: 19
Registered: July 2013
Karma: 0
Junior Member
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
Re: Paypal IPN and HTTP 1.1 [message #182209 is a reply to message #182204] Sat, 20 July 2013 12:46 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: Paypal IPN and HTTP 1.1 [message #182211 is a reply to message #182204] Sat, 20 July 2013 15:08 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
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
Re: Paypal IPN and HTTP 1.1 [message #182228 is a reply to message #182204] Mon, 22 July 2013 14:33 Go to previous messageGo to next message
j is currently offline  j
Messages: 9
Registered: July 2011
Karma: 0
Junior Member
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
>
Re: Paypal IPN and HTTP 1.1 [message #182230 is a reply to message #182228] Mon, 22 July 2013 18:57 Go to previous messageGo to next message
Mitch Bujard is currently offline  Mitch Bujard
Messages: 19
Registered: July 2013
Karma: 0
Junior Member
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
Re: Paypal IPN and HTTP 1.1 [message #182232 is a reply to message #182228] Mon, 22 July 2013 20:33 Go to previous messageGo to next message
Mitch Bujard is currently offline  Mitch Bujard
Messages: 19
Registered: July 2013
Karma: 0
Junior Member
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);
Re: Paypal IPN and HTTP 1.1 [message #182242 is a reply to message #182230] Tue, 23 July 2013 02:11 Go to previous message
j is currently offline  j
Messages: 9
Registered: July 2011
Karma: 0
Junior Member
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
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Easy to use ORM with fulltext search and/or search library
Next Topic: A curious thing...about tags.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 21:28:49 GMT 2024

Total time taken to generate the page: 0.01968 seconds