FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass address info to PayPal?
#1
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?
Reply
#2
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?
Reply
#3
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.
Reply
#4
Thank you for the good advice.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)