使用php一次提交多个项目到paypal购物车
我有一些有 2 级和 3 级自定义的待售商品.设置后,用户会将它们添加到我的现场购物车中.问题是,我如何在结账时将每件商品发送到贝宝?我为动态按钮找到的唯一代码仅支持单个项目.
I have some items for sale that have 2 and 3 levels of customization. Once set the user adds them to my onsite cart. Problem is, how can i send each item to paypal on checkout? The only code ive found for dynamic buttons supports only a single item.
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="business" value="EMAIL">
<input type="hidden" name="item_name" value="Item #1">
<input type="hidden" name="item_number" value="123456">
<input type="hidden" name="amount" value="7.00">
<input type="hidden" name="shipping" value="0">
<input type="hidden" name="shipping2" value="0">
<input type="hidden" name="handling" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
<input type="hidden" name="undefined_quantity" 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>
我尝试添加
<input type="hidden" name="item_name_2" value="Item #1">
<input type="hidden" name="item_number_2" value="123456">
<input type="hidden" name="amount_2" value="7.00">
但没有阳性结果.
有什么想法吗?
推荐答案
这里是解决方案
<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="email@email.com">
<input type="hidden" name="item_name_1" value="Item #1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item #2">
<input type="hidden" name="amount_2" value="2.00">
<input type="submit" value="PayPal">
</form>
相关文章