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

Another IPN issue -help plz Options
alteredsanity
#1 Posted : Wednesday, April 07, 2004 2:35:51 AM
Rank: Starting Member

Groups: Registered

Joined: 4/2/2004
Posts: 4
Location: ,
Hi all, I made a signup.cgi page to catch the info coming from paypal but not having any luck. Heres my setup - 1. Have IPN turned on 2. sending rm=2 to paypal 3. <INPUT type=hidden value=_xclick-subscriptions name=redirect_cmd> 4. <INPUT type=hidden value=_ext-enter name=cmd> Button Code: ------------------------------------------------------------------ form code that goes to paypal: ------------------------------------------------------------------ <DIV align=center><TABLE height=150 width=441 align=center border=0> <TBODY> <TR> <TD width=101 bgColor=#00cc66 colSpan=2><B><FONT size=4>Features:</FONT></B></TD> <TD width=7> </TD> <TD style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid" vAlign=top borderColor=#669999 align=left width=162 rowSpan=6> <FORM action=https://www.paypal.com/cgi-bin/webscr method=post> <INPUT type=hidden value=_xclick-subscriptions name=redirect_cmd> <INPUT type=hidden value=_ext-enter name=cmd> <INPUT type=hidden value=2 name=rm> <INPUT type=hidden value="xxx_March 2004" name=on1> <INPUT type=hidden value=1 name=sra> <INPUT type=hidden value=1 name=src> <INPUT type=hidden value=M name=t3> <INPUT type=hidden value=1 name=p3> <INPUT type=hidden value=24.00 name=a3> <INPUT type=hidden value=sales@xxx.com name=business> <INPUT type=hidden value=http://www.xxx.com/cgi-bin/signup.cgi name=return> <INPUT type=hidden value="Host March '04 Monthly Package" name=item_name> <INPUT type=hidden value=USD name=currency_code> <TABLE width=162> <TBODY> <TR> <TD><INPUT type=hidden value="domain name" name=on0> <P align=center> <B>$24.00 month to month</B> <FONT face="Times New Roman">¥</FONT></P> <P align=center><B><FONT color=#000000>Domain name:</FONT></B><BR><INPUT maxLength=180 size=21 name=on0></P></TD></TR></TBODY></TABLE> <P align=center> <INPUT type=image alt="Make payments with PayPal - it's fast, free and secure!" src="https://www.paypal.com/images/x-click-but20.gif" border=0 name=submit></P></FORM> ------------------------------------------------------------------ info gets to paypal no prob, fills in form and customer pays, then gets redirected to my signup.cgi: ------------------------------------------------------------------ Signup.cgi Code: ------------------------------------------------------------------ #!/usr/bin/perl # 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++; } $item_name = $variable{'item_name'};# Package name $item_number = $variable{'item_number'}; $invoice = $variable{'invoice'}; $payer_email = $variable{'payer_email'};#users email $first_name = $variable{'first_name'}; $last_name = $variable{'last_name'}; $address_name = $variable{'address_name'}; $address_street = $variable{'address_street'}; $address_city = $variable{'address_city'}; $address_state = $variable{'address_state'}; $address_zip = $variable{'address_zip'}; $address_country = $variable{'address_country'}; $custom_a = $variable{'on0'};# domain name $plan = $variable{'on1'};# hosting package if ($res->is_error) { # HTTP error print("\ERROR - HTTP error\n"); } elsif ($res->content eq 'VERIFIED') { # check the payment_status=Completed # check that txn_id has not been previously processed # check that receiver_email is your Primary PayPal email # process payment } elsif ($res->content eq 'INVALID') { # log for manual investigation print("\nERROR - INVALID returned from paypal\n"); print("Query:$query \n"); } else { # error print("\nERROR - error 1 \n"); } #print "content-type: text/plain"; $whm = require '../config.pl'; print "Content-type: text/html\r\n\r\n"; # @PLANS = getplans ($whm); $plan = $variable{'on1'};# hosting package print <<EOM; <html> <!--my html code here---> <head></head> <body> <center> <h1> Account Signup Form </h1> </center> <center> All boxes must be filled out to complete order </center> <form action=dosignup.cgi method=POST> <pre> <b>Personal Information</b> <input TYPE="text" NAME="address" VALUE= '$address_street' SIZE="22"> EOM print <<EOM; <br> <br> <b>Comments</b> <textarea name="user_comments" rows=4 cols=48 wrap=virtual></text> </pre> <center> <input type=submit value=Submit> </center> </html> EOM -------------------------------------------------------- I used the example of making a ipn tool to test it locally thats found here in the forum and it works fine with that but not when a user uses it online. None of the variables are getting passed to the form, any help...i thought i had it after TONS of hours and testing locally and then went live and cried :( Help PLzzzzzzz Michael
Sponsor  
 
PayPal_Dave
#2 Posted : Wednesday, April 07, 2004 12:04:40 PM
Rank: Starting Member

Groups: Registered

Joined: 2/13/2004
Posts: 109
Location: ,
What problem are you having? Is it just a matter of the "address" not showing up with a value in the line below? Do your web server logs say the script is executing without errors?

&lt;input TYPE="text" NAME="address" VALUE= '$address_street' SIZE="22"&gt;


Dave Burchell
PayPal Technical Support
PayPal, an eBay company
alteredsanity
#3 Posted : Wednesday, April 07, 2004 2:48:31 PM
Rank: Starting Member

Groups: Registered

Joined: 4/2/2004
Posts: 4
Location: ,
These are the variables that i need to be passed from Paypal to my signup.cgi. I just had the address_street in the previous post as a example to just to shorten the post :)


$item_name = $variable{'item_name'};# Package name
$item_number = $variable{'item_number'};
$invoice = $variable{'invoice'};

$payer_email = $variable{'payer_email'};#users email
$first_name = $variable{'first_name'};
$last_name = $variable{'last_name'};
$address_name = $variable{'address_name'};
$address_street = $variable{'address_street'};
$address_city = $variable{'address_city'};
$address_state = $variable{'address_state'};
$address_zip = $variable{'address_zip'};
$address_country = $variable{'address_country'};

$custom_a = $variable{'on0'};# domain name
$plan = $variable{'on1'};# hosting package


None of the above are making it to my signup.cgi so i can finish processing their order.

It works using the example by paypal_pb http://www.paypaldev.org/topic.asp?TOPIC_ID=1658
but not live.

I just noticed that i have &lt;FORM action=https://www.paypal.com/cgi-bin/webscr method=post&gt;
in the form i send to paypal and &lt;FORM action=http://www.paypal.com/cgi-bin/webscr method=post&gt;
to read incoming data from to my signup.cgi, could that be the reason no variables are being passed back? Else im stumped...



Michael
alteredsanity
#4 Posted : Wednesday, April 07, 2004 11:09:45 PM
Rank: Starting Member

Groups: Registered

Joined: 4/2/2004
Posts: 4
Location: ,
This is the error that is at the top of the page when signup.cgi is pointed to from Paypal:


ERROR - INVALID returned from paypal Query:&cmd=_notify-validate Content-type: text/html


and the boxes that should be filled in on the page are blank.

My subscribers are getting signed up ok will Paypal and the variables are there because the email i get about the subscription has them in it.
Anyone have ideas?


Michael
PayPal_Dave
#5 Posted : Thursday, April 08, 2004 1:43:28 PM
Rank: Starting Member

Groups: Registered

Joined: 2/13/2004
Posts: 109
Location: ,
It appears you are setting "return" to the URL "http://www.xxx.com/cgi-bin/signup.cgi" and that script, signup.cgi, is the one you posted. The error "ERROR - INVALID returned from paypal Query" is occurring when your customers are directed back to the signup.cgi script after making their payment. Is this correct?

If so, then you should not expect to get a VERIFIED response from the PayPal system because that is for IPN, not for a "return" script. You can't verify the "return" data like you can the IPN data.

Try setting your "return" variable to another script, one that does not try to post the data back to PayPal. Use the signup.cgi script just for handling IPN data, such as updating your database with payment info.

Dave Burchell
PayPal Technical Support
PayPal, an eBay company
alteredsanity
#6 Posted : Saturday, April 10, 2004 2:27:18 AM
Rank: Starting Member

Groups: Registered

Joined: 4/2/2004
Posts: 4
Location: ,
I just tested the code with 'http://www.eliteweaver.co.uk/testing/ipntest.php' and http://www.belahost.com/pp and both came back verified and posted to my signup.cgi... why cant do it live with Paypal..anyone have any ideas.

Michael
sarahgindin
#7 Posted : Tuesday, September 18, 2007 5:16:22 PM
Rank: Starting Member

Groups: Registered

Joined: 6/28/2007
Posts: 16
Location: ,
I have visited your site 435-times
sarahgindin
#8 Posted : Tuesday, September 18, 2007 5:17:23 PM
Rank: Starting Member

Groups: Registered

Joined: 6/28/2007
Posts: 16
Location: ,
I could not find this site in the Search Engines index
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.332 seconds.