Reputation:
I am trying to integrate PayPal
buttons to a website. It was a really tough job making such a big number of buttons but I some how did it, but now I see that some of them work while some of them do not(and go to PayPal's
homepage.) I am unable to determine what would have gone wrong which has caused this error.
The code was very big to fit in here so I am sharing to forms, the first one works while the second does not.
<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="xxxxx">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Sumission Order 1- 3 articles ">
<input type="hidden" name="amount" value="xxx">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="tax_rate" value="0.000">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<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"></p>
</form> </p>
<p>Sumission Order 2- <strong>5 articles</strong></p>
<p>
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd3" value="_cart">
<input type="hidden" name="business2" value="xxxxx">
<input type="hidden" name="lc2" value="US">
<input type="hidden" name="item_name2" value="Sumission Order 2- 5 articles">
<input type="hidden" name="amount2" value="xxxx">
<input type="hidden" name="currency_code2" value="USD">
<input type="hidden" name="button_subtype2" value="products">
<input type="hidden" name="no_note2" value="0">
<input type="hidden" name="tax_rate2" value="0.000">
<input type="hidden" name="shipping2" value="0.00">
<input type="hidden" name="add2" value="1">
<input type="hidden" name="bn2" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit2" 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"></p>
</form>
Please help me out. Thanks
Upvotes: 1
Views: 579
Reputation: 9266
Since your buttons are in different forms, you don't need to mark your input's name with number at the end. This violates PayPal's convention. Change cmd2
to cmd
, etc.
Upvotes: 1
Reputation: 10163
You have changed the names of the inputfields in the second form. These are the variables that are send to PayPal. This means you are now posting other variables; PayPal does not understand cmd2
for example, but it understands cmd
. So rename the inputfields inside the second form to cmd, business, lc, item_name
.. etc and it should work.
BTW It is not illegal to have duplicate names in html-tags, only duplicate ID's are not allowed.
Success!
Upvotes: 3