Integration Guide

Table Of Contents
Website Payments Standard Checkout Integration Guide November 2005 83
Multiple-Item Payment: Shopping Cart
Adding PayPal to Your Third-party Shopping Cart
4
item_name_2, amount_2, and quantity_2; the third item with variables like
item_name_3, amount_3, and quantity_3; and so on.
IMPORTANT:The _x values must increment by one continuously in order to be recognized.
If you skip from item #1 to item #3 without defining an item #2, the third item
will be ignored.
The minimum required HTML for your post to PayPal looks similar to the following.
EXAMPLE 4.1 HTML for Passing Individual Item Detail to PayPal
<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post”>
<input type=”hidden” name=”cmd” value=”_cart”>
<input type=”hidden” name=”upload” value=”1”>
<input type=”hidden” name=”business” value=”seller@designerfotos.com”>
<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>
Setting Currency in the Cart
All monetary variables (amount_x., shipping_x., shipping2_x, handling_x, tax_x.,
and tax_cart) are interpreted in the currency designated by the currency_code variable
posted with the payment. Because currency_code is not item-specific, there is no need to
append _
x to the currency_code variable name. If no currency_code variable is posted,
all monetary values default to U.S. Dollars.
Setting Tax on Individual Items
Use the tax_x variable to specify the tax for a particular item in the cart. For example, the
following line specifies that the tax on item 2 in the cart is 15 cents:
<INPUT TYPE=”hidden” name=”tax_2” value=”.15”>
Setting the Tax for the Entire Cart
Use the tax_cart variable to specify a tax amount that applies to the entire purchase, rather
than to individual items. The tax_cart variable overrides any per-item tax amount specified
with tax_x.
Passing the Aggregate Shopping Cart Amount to PayPal
You can aggregate your entire shopping cart and pass the total amount to PayPal. You must
post a single item_name_1 for the entire cart and the total price of the cart’s contents in
amount_1 as though it were a purchase of a single item.