I want to add have tax set on individual items with Paypal. For example, I want "One $1" to have tax # 12% whilst the remaining "Two $2", "Three $3", "Four $4" and "Five $5" to have tax at 5%.
<option value="">--- Or Select a Type of Service ---</option>
<option name="tax_1" value="One $1">Hello $20</option>
<option value="Two $2">Bye $30</option>
<option value="Three $3">Tata $45</option>
<option value="Four $4">Bonjour $40</option>
<option value="Five $5">Au Rrevoir $30</option>
Therefore, I use on the form action:
<input type="hidden" name="tax_rate" value="12">
<input type="hidden" name="tax_1" value="6">
But it doesn't work for 6% tax for "One $1". How would I be able to make it work?
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="pointblanc#hotmail.com">
<input type="hidden" name="item_name" value="<?php if($tutorial_type!="") echo $tutorial_amount_arr[0]; else echo "Gift Certificate" ?>">
<input type="hidden" name="item_number" value="Gift Certificate">
<input type="hidden" name="amount" value="<?php if($amountfull="") echo $tutorial_amount_arr[1]; else echo $tutorialamnt; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="tax_rate" value="12">
<input type="hidden" name="tax_1" value="6">
<input type="hidden" name="return" value="http://www.testtest.com/thankyou.php">
<input type="hidden" name="cancel_return" value="http://www.testtest.com">
<input type="hidden" name="notify_url" value="http://www.testtest.com/ipn.php"/>
<input type="image" border="0" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" align="center" style="margin-right:7px; margin-left:150px">
<input type="hidden" name="custom" value="<?php echo $allcontens; ?>"/>
</form>
Related
I am trying to generate a PayPal donation button with a price drop down and a Yes-No drop down. Button is working fine but the amount/price is going empty. Below is the html generated from PayPal's website. Could anyone please help? Thanks!
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="my#email.com">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="IICC">
<input type="hidden" name="item_number" value="GT7">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="http://website.org/">
<input type="hidden" name="cancel_return" value="http://website.org/">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<table>
<tr><td><input type="hidden" name="on0" value="Select a donation category">Select a donation category</td></tr><tr><td><select name="os0">
<option value="Red">Red £50.00 GBP</option>
<option value="Bronze">Bronze £100.00 GBP</option>
<option value="Silver">Silver £200.00 GBP</option>
<option value="Gold">Gold £300.00 GBP</option>
<option value="Platinum">Platinum £500.00 GBP</option>
<option value="Diamond">Diamond £1,000.00 GBP</option>
</select> </td></tr>
<tr><td><input type="hidden" name="on1" value="Do you agree?">Do you agree?</td></tr><tr><td><select name="os1">
<option value="NO">NO</option>
<option value="YES">YES</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="option_select0" value="Red">
<input type="hidden" name="option_amount0" value="50.00">
<input type="hidden" name="option_select1" value="Bronze">
<input type="hidden" name="option_amount1" value="100.00">
<input type="hidden" name="option_select2" value="Silver">
<input type="hidden" name="option_amount2" value="200.00">
<input type="hidden" name="option_select3" value="Gold">
<input type="hidden" name="option_amount3" value="300.00">
<input type="hidden" name="option_select4" value="Platinum">
<input type="hidden" name="option_amount4" value="500.00">
<input type="hidden" name="option_select5" value="Diamond">
<input type="hidden" name="option_amount5" value="1000.00">
<input type="hidden" name="option_index" value="0">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
AFAIK, option_index is not supported by donation buttons (cmd = _donations). You may try to use a BuyNow button (cmd = _xclick) instead, or change the amount field into a drop down menu, like
<select name="amount">
<option value="50">Red</option>
<option value="100">Bronze</option>
<option value="200">Silver</option>
...
</select>
this is my code (form subscription):
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="enrique.sevilla.11#gmail.com ">
<input type="hidden" name="custom" value="<? echo $user; ?>">
<input type="hidden" name="lc" value="ES">
<input type="hidden" name="item_name" value="Pago mensual Monetiza.me">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="39">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="button_subtype" value="Servicios">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="<?php echo $urlPredeterminada; ?>pago/ok">
<input type="hidden" name="cancel_return" value="<?php echo $urlPredeterminada; ?>pago/ko">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="image_url" value="http://www.monetiza.me/images/logo-monetiza.png">
<input type="hidden" name="notify_url" value="<?php echo $urlPredeterminada; ?>ipn.php">
<input type="hidden" name="suscripcion" value="si">
<input type="hidden" name="a3" value="39">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
This form records the payment and subscription, but after a few minutes the subscription is canceled and get an email confirming that has been canceled. How do I prevent self unsubscribe?
Sorry for my English, i am a peruvian developer :(
You need to include src=1 to indicate that the payments will recur on a monthly basis:
<input type="hidden" name="src" value="1">
I know how to code related select fields, e.g., color and size for a product, but not sure how to have 2 select fields (dropdowns) for 2 different products. Do I have to code two separate forms? or is there a way to put both in the same form. Here I show the later option, but no dice. Thoughts?
Also, trying to figure out how to code an empty first option as "Select..."
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="buy#mycompany.com">
<input type="hidden" name="bn" value="MyCompany_BuyNow_Annual_US">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="item_name" value="Annual Subscription">
<input type="hidden" name="return" value="http://www.mycompany.com"">
<input type="hidden" name="cancel_return" value="http://www.mycompany.com"">
<input type="hidden" name="currency_code" value="USD">
<p>U.S. Subscription</p>
<select name="os0">
<option value="">Select a Subscription</option>
<option value="One year">One year: $26</option>
<option value="Two years">Two years: $52</option>
</select>
<input type="hidden" name="on0" value="Length of Subscription">
<input type="hidden" name="option_select0" value="Sorry, no selection">
<input type="hidden" name="option_amount0" value="0">
<input type="hidden" name="option_select1" value="One year">
<input type="hidden" name="option_amount1" value="26.00">
<input type="hidden" name="option_select2" value="Two years">
<input type="hidden" name="option_amount2" value="52.00">
<input type="hidden" name="option_index" value="0">
<input type="submit" name="submit" class="button" value="Subscribe US">
<p>U.S. Renewals</p>
<select name="os1">
<option value="">Select a Renewal</option>
<option value="One year">One year: $26</option>
<option value="Two years">Two years: $52</option>
</select>
<input type="hidden" name="on1" value="Length of Subscription">
<input type="hidden" name="option_select0" value="Sorry, no selection">
<input type="hidden" name="option_amount0" value="0">
<input type="hidden" name="option_select1" value="One year">
<input type="hidden" name="option_amount1" value="18.00">
<input type="hidden" name="option_select2" value="Two years">
<input type="hidden" name="option_amount2" value="36.00">
<input type="hidden" name="option_index" value="0">
<input type="submit" name="submit" class="button" value="Renew US">
</form>
There are several ways to do this, but given the minimal sophistication, I would code that as two forms:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="seller_1312096880_biz#test.com">
<input type="hidden" name="bn" value="MyCompany_BuyNow_Annual_US">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="item_name" value="Annual Subscription">
<input type="hidden" name="return" value="http://www.mycompany.com">
<input type="hidden" name="cancel_return" value="http://www.mycompany.com">
<input type="hidden" name="currency_code" value="USD">
<p>U.S. Subscription</p>
<select name="os0">
<option value="">Select a Subscription</option>
<option value="One year">One year: $26</option>
<option value="Two years">Two years: $52</option>
</select>
<input type="hidden" name="on0" value="Length of Subscription">
<input type="hidden" name="option_select0" value="Sorry, no selection">
<input type="hidden" name="option_amount0" value="0">
<input type="hidden" name="option_select1" value="One year">
<input type="hidden" name="option_amount1" value="26.00">
<input type="hidden" name="option_select2" value="Two years">
<input type="hidden" name="option_amount2" value="52.00">
<input type="hidden" name="option_index" value="0">
<input type="submit" name="submit" class="button" value="Subscribe US">
</form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="seller_1312096880_biz#test.com">
<input type="hidden" name="bn" value="MyCompany_BuyNow_Annual_US">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="item_name" value="Annual Renewal">
<input type="hidden" name="return" value="http://www.mycompany.com">
<input type="hidden" name="cancel_return" value="http://www.mycompany.com">
<input type="hidden" name="currency_code" value="USD">
<p>U.S. Renewals</p>
<select name="os0">
<option value="">Select a Renewal</option>
<option value="One year">One year: $18</option>
<option value="Two years">Two years: $36</option>
</select>
<input type="hidden" name="on0" value="Length of Subscription">
<input type="hidden" name="option_select0" value="Sorry, no selection">
<input type="hidden" name="option_amount0" value="0">
<input type="hidden" name="option_select1" value="One year">
<input type="hidden" name="option_amount1" value="18.00">
<input type="hidden" name="option_select2" value="Two years">
<input type="hidden" name="option_amount2" value="36.00">
<input type="hidden" name="option_index" value="0">
<input type="submit" name="submit" class="button" value="Renew US">
</form>
I am trying to figure this one out, but I need some help.
I want to offer multiple products in the select list for a customer to choose and buy one.
<FORM action="https://www.paypal.com/cgi-bin/webscr" method="post">
<INPUT TYPE="hidden" name="cmd" value="_xclick"/>
<INPUT TYPE="hidden" name="charset" value="utf-8"/>
<INPUT TYPE="hidden" NAME="return" value="http://www.albertamomentummassage.com/gift-certificate-thank-you/"/>
<INPUT TYPE="hidden" NAME="rm" value="2"/>
<INPUT TYPE="hidden" NAME="currency_code" value="CAD"/>
<INPUT TYPE="hidden" NAME="business" value="daniel_1329709715_biz#gmail.com"/>
<select name="os_0" value="Therapeutic Massage">
<option value="2 Hour Masssage">2 Hour Massage $160.00 CAD</option>
<option value="90 Minute Massage">90 Minute Massage $120.00 CAD</option>
</select>
<input type="hidden" name="option_amount0" value="160"/>
<input type="hidden" name="option_amount1" value="120"/>
<input type="submit" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" />
</FORM>
Once I got redirected to PayPal I am missing, both, item description and item price.
You'll still need to send along an item_name field. The drop down list acts as a modifier for an item to add to the cart. In addition to the drop down list itself, you'll also need to send option_select(n) and option_amount(n) in your form. Check out the example below, it's from the Paypal button generator and should get you rolling.
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="Yourbiz#gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Massage service">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<table>
<tr><td><input type="hidden" name="on0" value="Duration">Duration</td></tr>
<tr><td>
<select name="os0">
<option value="90 minutes">90 minutes $120.00 CAD</option>
<option value="2 hours">2 hours $160.00 CAD</option>
</select>
</td></tr>
</table>
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="option_select0" value="90 minutes">
<input type="hidden" name="option_amount0" value="120.00">
<input type="hidden" name="option_select1" value="2 hours">
<input type="hidden" name="option_amount1" value="160.00">
<input type="hidden" name="option_index" value="0">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
I want to send multiple item names and item prices to PayPal but I am unable to post my item name and price with below code can you please help me?
<form method="post" name="cart" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="navive_1295939206_biz#gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="notify_url" value="http://newzonemedia.com/henry/ipn.php" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="return" value="http://www.example.com/thank_you_kindly.html" />
<?php
//select items for table
$srowcart_dtl = mysql_num_rows($srscart_dtl);
if($srowcart_dtl > 0) {
$cnt=1;
while($srscart_dtl1 = mysql_fetch_assoc($srscart_dtl)) {
?>
<input type="hidden" name="item_name[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iname']; ?>">
<input type="hidden" name="amount[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iprc']; ?>">
<?php
$cnt++;
}
}
?>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Create your code like this:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart"> <!-- change _xclick to _cart -->
<input type="hidden" name="upload" value="1"> <!-- add this line in your code -->
<input type="hidden" name="business" value="your_seller_account">
<input type="hidden" name="item_name_1" value="Item Name 1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item Name 2">
<input type="hidden" name="amount_2" value="2.00">
<input type="submit" value="PayPal">
</form>
In addition to the changes suggested by devilprince, the underscores are missing from the line item input tags' name attributes, and also the tags are not proper self-closing tags because the closing / is missing. Correct like so:
<form method="post" name="cart" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="navive_1295939206_biz#gmail.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="notify_url" value="http://newzonemedia.com/henry/ipn.php" />
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="return" value="http://www.mysite.org/thank_you_kindly.html" />
<?php
// select items for table
$srowcart_dtl = mysql_num_rows($srscart_dtl);
if($srowcart_dtl > 0)
{
$cnt=1;
while($srscart_dtl1 = mysql_fetch_assoc($srscart_dtl))
{
?>
<input type="hidden" name="item_name_[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iname']; ?>"/>
<input type="hidden" name="amount_[<?php echo $cnt ?>]" value="<?php echo $srscart_dtl1['cart_iprc']; ?>"/>
<?php
$cnt++;
}
}
?>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
(You may also want to escape special characters in the value attribute, at least for the " character in case it shows up in your item name data.)
Just had to figure this out today for a client. Besides item_name_N and amount_N I also used quantity_N, tax_N, and shipping_N (where N is the line item number, starting with 1).
This page has a list of all parameters: PayPal HTML Form Variables, but the question & answers given here are a better real-world example than the trivial examples on the PayPal site.