I have my own basket which is built up based on what the user buys obviously. This then gets passed over to paypal checkout once the user clicks on checkout. It all works successfully with the item information being displayed in the PayPal cart receipt on the left hand side.
However, I am having an issue with my vat charge cost. I have calculated vat charge (20%) for my basket which works (within my site), but I am not sure how to pass that cost over to Paypal. Currently, Paypal are just calculating the total by adding the items prices depending on their quantities. Any ideas for getting the vat charge to be included in Paypal?
Here is my code:
$product1 = mysql_fetch_assoc($sql1);?>
<input type='hidden' name='item_number_<?php echo $count; ?>' value="<?php echo $count; ?>">
<input type="hidden" name="item_name_<?php echo $count; ?>" value="<?php echo $product1['prod_name']; ?>">
<input type="hidden" name="amount_<?php echo $count; ?>" value="<?php echo $product1['price']; ?>">
<input type='hidden' name='quantity_<?php echo $count; ?>' value="<?php echo $item['quantity']?>">
<?php $count++; } ?>
And here is my shipping code for my basket:
$grand_total = isset($grand_total) ? $grand_total : 0;
$line_cost = $product['price'] * $item['quantity'];
$grand_total += $line_cost;
$charge = $grand_total /100 * 20;
$chargeincvat = $charge + $grand_total;
<tr><td colspan='6' align='right'>Charges (VAT 20%): £ <?=number_format($chargeincvat, 2);?></td></tr>
ADDED:
<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="derrysnurseries@hotmail.co.uk">
<input type='hidden' name='item_number_1' value="1">
<input type="hidden" name="item_name_1" value="Moment in Time">
<input type="hidden" name="amount_1" value="6.95">
<input type='hidden' name='quantity_1' value="1">
<input type='hidden' name='tax_cart' value="8.34">
You can use the following as thenameattribute of form elements :for example
to apply a
15.00total charge for shippingTo add tax / VAT to an item use
tax_#where#is the item number egthis will add
.15pto item number 2. To add a cart tax / VAT useSee page 263 of this doc and see page 294 of the same document to have the tax / VAT cost automatically calculated