Domanda

I am creating an e-shop builder, i.e. a site where a user creates their site and e-shop. The products are entered into my custom CMS by the person who builds the e-shop. I ask the shop builder to link the shop to their PayPal account by entering their e-mail.

I am currently trying to create a checkout button for my cart.

Problem is, multiple products might have different tax rates, for instance alcoholic beverages might have a 13% tax rate whereas other products have 23%. Is there a way to incorporate this in the post request?

Ideally what I would like to do is this:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">

    <input type="hidden" name="item_name_1" value="Some product">
    <input type="hidden" name="item_number_1" value="1">
    <input type="hidden" name="amount_1" value="20.00" />
    <input type="hidden" name="tax_rate_1" value="23">

    <input type="hidden" name="item_name_2" value="Some alcoholic product">
    <input type="hidden" name="item_number_2" value="1">
    <input type="hidden" name="amount_2" value="15.00" />
    <input type="hidden" name="tax_rate_2" value="13">

    <!-- other fields omitted for brevity -->
</form>

The tax_rate_1 and tax_rate_2 fields are hypothetical, I don't know if something like this is possible.

If I RTFM'ed correctly, setting per-item tax rates should be possible if you register the products yourself in the PayPal website interface. This is exactly what I am trying to avoid, because the products are entered by the end user on my CMS.

If what I want isn't possible with a Website Payments Standard button, I would also welcome other ideas on how to forward such orders to PayPal. I am trying to avoid the Express Checkout payment product because if I understand correctly I won't have full control of the cart. I want to have a custom cart and later be able to offer more payment options besides PayPal.

Please help in any way you can! I am a total noob with PayPal.

È stato utile?

Soluzione

To answer my own question, what I want is indeed possible and is described in the manual. In my situation where I have built a custom shopping cart, I want to use the Cart upload command of the Website Payments Standard product.

To do a "cart upload" I've set the following fields:

<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">

The variables are tax_1, tax_2, etc. They need to be specified as currency, not percentage.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top