Paypal - Add Multiple Item in the Cart for Checkout

I have a requirement to add multiple items in a paypal cart at the same time and here's how I did it.


<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="czetsuya@gmail.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://www.czetsuya-tech.blogspot.com">

<input type="text" name="item_name_1" value="Macbook Pro">
<input type="hidden" name="item_number_1" value="001">
<input type="hidden" name="amount_1" value="10">
<input type="hidden" name="quantity_1" value="1">

<input type="hidden" name="item_name_2" value="Asus i7">
<input type="hidden" name="item_number_2" value="002">
<input type="hidden" name="amount_2" value="20">
<input type="hidden" name="quantity_2" value="1">

<input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it's fast, free and secure!">
</form>


Things you should notice, there are several input tags that have index "_x"
item_name, item_number, amount and quantity.

4 تعليقات

أحدث أقدم
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →