我正在尝试将 PayPal
按钮集成到网站中。制作如此多的按钮是一项非常艰巨的工作,但我知道它是如何做到的,但现在我看到它们中的一些可以工作,而另一些则不能(并转到 PayPal 的
主页。)我无法确定导致此错误的问题所在。
代码非常大,不适合放在这里,所以我分享到表单,第一个有效而第二个无效。
<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>
请帮帮我。谢谢
最佳答案
您已经更改了第二种形式中输入字段的名称。这些是发送到 PayPal 的变量。这意味着您现在正在发布其他变量;例如,PayPal 不理解 cmd2
,但它理解 cmd
。因此,将第二个表单中的输入字段重命名为 cmd, business, lc, item_name
.. 等等,它应该可以工作。
顺便说一句,在 html 标签中使用重复的名称 并不违法,只是不允许重复的ID。
成功!
关于html - 将 PayPal 按钮集成到站点中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8664704/