Reputation: 3064
I am trying to add a deposit automatically to this paypal form as ideally a separate item on the bill. From other forums, support groups and whatever I have acertained that the below should be correct. It however is not, PayPal only detects item_name_1 based values and not item_name_2 based ones. Any ideas greatly appreciated.
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name_1" value="<?php echo $item_name; ?>">
<input type="hidden" name="amount_1" value="<?php echo $thePriceToPay; ?>">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="item_name_2" value="Deposit">
<input type="hidden" name="amount_2" value="<?php echo $depositToPay; ?>">
<input type="hidden" name="quantity_2" value="1">
<input type="hidden" name="currency_code" value="<?php echo $currencyCodes; ?>">
<INPUT TYPE="hidden" NAME="return" value="<?php echo get_bloginfo('url'); ?>/order-processing/">
<INPUT TYPE="hidden" NAME="first_name" VALUE="<?php echo $nameExplode[0]; ?>">
<INPUT TYPE="hidden" NAME="last_name" VALUE="<?php echo $nameExplode[1].' '.$nameExplode[2].' '.$nameExplode[3]; ?>">
<INPUT TYPE="hidden" NAME="address1" VALUE="<?php echo $yourAddress; ?>">
<INPUT TYPE="hidden" NAME="city" VALUE="<?php echo $yourTown; ?>">
<INPUT TYPE="hidden" NAME="state" VALUE="<?php echo $yourState; ?>">
<INPUT TYPE="hidden" NAME="zip" VALUE="<?php echo $yourPostCode; ?>">
<INPUT TYPE="hidden" NAME="email" VALUE="<?php echo $yourEmail; ?>">
Upvotes: 0
Views: 1480
Reputation: 7319
This is because you are using a code for a buy now button, which only supports a single item. You need to use a cart upload button, where you upload all of the items.
You need to remove the following line:
<input type="hidden" name="cmd" value="_xclick">
Then you need to add these two lines instead.
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
Upvotes: 5