The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.28 (Linux)
|
How to pass address info to PayPal? - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: How to pass address info to PayPal? (/showthread.php?tid=1085) |
How to pass address info to PayPal? - trodat - Feb 15th, 2011 I've been trying to pass the address information over to PayPal sandbox (and a live account) by Form Tools API but only the first name, last name, email address and amount are passed... I read the FormTools docs and PayPal docs and tried what paypal said about changing: <input type="hidden" name="cmd" value="_xclick"> to: <input type="hidden" name="cmd" value="_ext-enter"> <input type="hidden" name="redirect_cmd" value="_xclick"> I tried putting that directly in the form and tried playing around with config.inc.php like this: from: $paypal["cmd"] = "_xclick"; to: $paypal["cmd"] = "_ext-enter"; $paypal["redirect_cmd"] = "_xclick"; This is the form I'm sending: <form action="<?php echo $_SERVER["PHP_SELF"]?>" method="post"> <INPUT TYPE="hidden" NAME="item_name" VALUE="Player Registration"> <INPUT TYPE="hidden" NAME="firstname" VALUE="<?=@$fields['First_Name']?>"> <INPUT TYPE="hidden" NAME="lastname" VALUE="<?=@$fields['Last_Name']?>"> <INPUT TYPE="hidden" NAME="email" VALUE="<?=@$fields['Email_Address']?>"> <INPUT TYPE="hidden" NAME="address1" VALUE="<?=@$fields['Address1']?>"> <INPUT TYPE="hidden" NAME="address2" VALUE="<?=@$fields['Address2']?>"> <INPUT TYPE="hidden" NAME="city" VALUE="<?=@$fields['City']?>"> <INPUT TYPE="hidden" NAME="state" VALUE="<?=@$fields['State']?>"> <INPUT TYPE="hidden" NAME="zip" VALUE="<?=@$fields['ZipCode']?>"> <INPUT TYPE="hidden" NAME="country" VALUE="US"> <INPUT TYPE="hidden" NAME="currency_code" VALUE="USD"> <INPUT TYPE="hidden" NAME="amount" VALUE="<?php if (@$fields["Registered_Players"]==1) echo "25.00"; if (@$fields["Registered_Players"]==2) echo "50.00"; if (@$fields["Registered_Players"]==3) echo "75.00"; ?>"> <BR> <label> <input type="submit" name="Registration2" id="Registration2" value=" Proceed to Payment " style="font-weight: bold;"> </label><BR><BR></form> When I look at the source, all the values are there and the form completes successfully. Can anyone shed some light please? RE: How to pass address info to PayPal? - trodat - Feb 18th, 2011 Ok, so I figured out that global_config.inc.php sends the hidden fields, so I took out all the address information from the form and updated the global_config.inc.php file by adding this line under the cmd line: <input type="hidden" name="redirect_cmd" value="<?php echo @$paypal[redirect_cmd]?>" /> I thought I was onto something, but that did not work. The global_config.inc.php has everything defined, so why isn't this working? RE: How to pass address info to PayPal? - trodat - Feb 18th, 2011 It turns out that the US State has to be the abbreviation. At least that's what seemed to fix it. I thought if they were doing full validation on the address and maybe they do check zip code, city, etc.. but it's now working! Hope this helps someone. RE: How to pass address info to PayPal? - Desy231 - Dec 4th, 2017 Thank you for the good advice. |