YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

IPN Newbie - Getting INVALID response Options
atang00
#1 Posted : Tuesday, April 13, 2004 2:13:55 PM
Rank: Starting Member

Groups: Registered

Joined: 4/13/2004
Posts: 6
Location: ,
Hey all, I just started using IPN yesterday and been trying to get my perl script working eversince. After a few hours and no luck, I decided to post this message for additional help/suggestions. Details: My paypal settings: I'm a verified user, I have IPN activated, I have auto-return option set to 'OFF', my IPN url is correct. When doing a debug test on the $res, I do end up getting a HTTP1.1/200 status. Perl Coding: (basically straight from the sample) #!C:\\Perl\\bin\\perl.exe -w # read post from PayPal system and add 'cmd' read (STDIN, $query, $ENV{'CONTENT_LENGTH'}); $query .= '&cmd=_notify-validate'; # post back to PayPal system to validate use LWP::UserAgent; $ua = new LWP::UserAgent; $req = new HTTP::Request 'POST','http://www.paypal.com/cgi-bin/webscr'; $req->content_type('application/x-www-form-urlencoded'); $req->content($query); $res = $ua->request($req); # split posted variables into pairs @pairs = split(/&/, $query); $count = 0; foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $variable{$name} = $value; $count++; } # assign posted variables to local variables $item_name = $variable{'item_name'}; $item_number = $variable{'item_number'}; $payment_status = $variable{'payment_status'}; $payment_amount = $variable{'mc_gross'}; $payment_currency = $variable{'mc_currency'}; $txn_id = $variable{'txn_id'}; $receiver_email = $variable{'receiver_email'}; $payer_email = $variable{'payer_email'}; print "content-type: text/plain\n\n"; if ($res->is_error) { # HTTP error } elsif ($res->content eq 'VERIFIED') { print "PLEASE work"; # check the $payment_status=Completed # check that $txn_id has not been previously processed # check that $receiver_email is your Primary PayPal email # check that $payment_amount/$payment_currency are correct # process payment } elsif ($res->content eq 'INVALID') { # log for manual investigation print "INVALID"; } else { print "unknown error"; # error } --------------- Debug results: Original Post from PayPal: &cmd=_notify-validate Length of Post From PayPal = 0 ------- E N D O F P O S T ---------- PayPal Post Back Response: Post Back Query = HTTP::Request=HASH(0x1915624) ----------------- HTTP::Response=HASH(0x1bd9ba8) -------------------------- HTTP/1.1 200 OK Connection: close Date: Wed, 14 Apr 2004 07:32:46 GMT Server: Apache/1.3.27 (Unix) mod_ssl/2.8.12 OpenSSL/0.9.7a Content-Type: text/html; charset=windows-1252 Client-Date: Wed, 14 Apr 2004 07:32:58 GMT Client-Peer: 64.4.241.33:443 Client-Response-Num: 1 Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign Client-SSL-Cert-Subject: /C=US/ST=California/L=Palo Alto/O=Paypal, Inc./OU=Information Systems/OU=Terms of use at www.verisign.com/rpa (c)00/CN=www.paypal.com Client-SSL-Cipher: DHE-RSA-AES256-SHA Client-SSL-Warning: Peer certificate not verified Client-Transfer-Encoding: chunked Set-Cookie: cookie_check=yes; expires=Sat, 12-Apr-2014 07:32:46 GMT; path=/; domain=.paypal.com Set-Cookie: Apache=24.128.79.135.15051081927966453; path=/; expires=Fri, 07-Apr-34 07:32:46 GMT INVALID ------- E N D O F P O S T B A C K -------- ---------------- After a successful transaction, I get an e-mail with the purchase info-including the transaction ID. All seems to go well until it prints "INVALID". aahh It seems as if Paypal is not posting any variables or my script is not reading the variables being posted. As you can see it is " Length of Post From PayPal = 0" Can anyone give me suggestions on what I can do to debug ?? What can I be doing wrong? Thank you, Anthony
Sponsor  
 
atang00
#2 Posted : Thursday, April 15, 2004 11:35:13 AM
Rank: Starting Member

Groups: Registered

Joined: 4/13/2004
Posts: 6
Location: ,
I GOT IT WORKING


BOO YEAH

Problem : the url for my perl paypal script fowarded to another url, if anyone ever comes across this problem then try changing urls to the actual url the script is hosted on. this caused me headaches for days, so hope that prevents other people headaches.


btw everyone who uses this paypal sample code they give, i hope you know how to change it up so its more safer...because it has some real security risks that most of you may not be aware of. ;)


i'm willing to offer anyone advice on this subject just e-mail me.



Thank you,
Anthony
purple
#3 Posted : Friday, May 02, 2008 3:00:55 PM
Rank: Starting Member

Groups: Registered

Joined: 5/2/2008
Posts: 2
Location: ,
Anthony-

You may have just saved me 3-5 hours of fruitless figuring out. We were pointing to our alias (and eventual primary) domain and getting invalid responses.

3 minutes into trying to track this down I bumped into your post. After weeks of working on IPN, finding one aspect that was quick and easily solved was magic. Thank you for taking the time to post back the solution.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.178 seconds.