Jump to content


Photo

always returns invalid!!


  • This topic is locked This topic is locked
2 replies to this topic

#1 scoutt

scoutt

    Junior Member

  • Members
  • 139 posts

Posted 07 November 2002 - 07:06 PM

I finally got the script working thanks to the test site, http://www.eliteweav...ing/ipntest.php , but now paypal always sends the invalid response. here is what the $res (from php)variable shows. and I am using the php ipntest script from paypal.

Result: HTTP/1.1 200 OK
Result: Date: Thu, 07 Nov 2002 20:45:57 GMT
Result: Server: Apache/1.3.26 (Unix) mod_bwlimited/1.0 PHP/4.2.2 mod_log_bytes/0.3 FrontPage/5.0.2.2510 mod_ssl/2.8.9 OpenSSL/0.9.6b
Result: X-Powered-By: PHP/4.2.2
Result: Expires: Tue, 01 Jan 1985 07:15:30 GMT
Result: Cache-Control: no-cache, must-revalidate
Result: Pragma: no-cache
Result: Connection: close
Result: Content-Type: text/html
Result:
Result: INVALID

someone explain why it returns invalid!! please

http://www.snippetlibrary.com
  • Mymnrumourf, xxkalliy and Calzumor like this

#2 paypal_pb

paypal_pb

    Advanced Member

  • Members
  • 2,960 posts

Posted 07 November 2002 - 09:57 PM

Best would be if we could take a look at "$req". If that's not possible having a look at your php code that performs the post might help. Are you using this:

// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';

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

// 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";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);

Patrick Breitenbach
PayPal, Inc.
Dev Net: https://www.paypal.com/pdn

#3 scoutt

scoutt

    Junior Member

  • Members
  • 139 posts

Posted 07 November 2002 - 11:22 PM

Yes Patrick, that is it, the $res is this

fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
$res = trim ($res); // Required on some Environments


and the script is the same on paypal or the site I posted in the first post. I think I might have figured out why it is failing. Would it fail if IPN was not set to on??

it is not sending a payment_status

http://www.snippetlibrary.com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users