Need a little PHP help - New Paypal validation.
#1
I just received an e-mail from Paypal that I'm going to need to update my Validation form with them.

paypal Wrote:Action Required before February 1, 2013
Merchants need to update their IPN and/or PDT scripts to use HTTP 1.1, and include the “Host” header in the IPN postback script.

Example:

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

Now, my question is, my current php script is:


// post back to PayPal system to validate
$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= 'Content-Length: ' . strlen($req) . "\r\n\r\n";

I'm wondering: Do I need to keep content length in the header? Or.... Should I just ditch it, and go with the example?
nobody ever slaughtered an entire school with a smart phone and a twitter account – they have, however, toppled governments. - Jim Wright
Reply
#2
If the paypal receiving server is fully 1.1 then you technically don't need it but there are still good reasons to keep it and it's fully 1.1 compliant, meaning it doesn't hurt anything to have it. You can simply just add the Host field if you aren't already using it.
---
It's all just zeroes and ones and duct tape in the end.
Reply
#3
That's what I thought, but I will be honest, I'm not 100% up on the 1.1 compliance, and thought it would be best to get a second opinion Smile
nobody ever slaughtered an entire school with a smart phone and a twitter account – they have, however, toppled governments. - Jim Wright
Reply
#4
I totally read this as:

"Need a little PCP help"
Reply
#5
That would have been far more amusing for someone...

Though it's funny. The script I posted (theirs) contains a typo, and It took me putting it in dreamweaver and the page going full red before I noticed. I e-mailed them about it, and asked if it was just a missing " instead of a ;, and they argued with me until about 90 minutes ago via e-mail that I was wrong, and that it didn't have an error.

Their final email:

Quote:Recently you requested assistance from PayPal Merchant Technical Services. Below is a summary of your request and our response.

We will assume your issue has been resolved if we do not hear from you within 7 days.

Thank you for allowing us to be of service to you.

----------------------------

You are correct, there are a couple typos in the email. The correct header information you should be using is below:
// 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 .= 'Content-Length: ' . strlen($req) . "\r\n\r\n";

You can copy the above directly into your integration if you'd like.

Thank you for your patience.

Sincerely,
XXXX

Finally. Someone who would just look at it!
nobody ever slaughtered an entire school with a smart phone and a twitter account – they have, however, toppled governments. - Jim Wright
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)