通过 PayPal(一次)支付多件商品

发布于 2024-09-11 14:47:42 字数 1601 浏览 4 评论 0原文

我有一个产品列表,我想在其中添加“立即付款”按钮,以便我可以允许我的客户通过 Paypal 付款。

我已经浏览了文档,但找不到如何执行此操作。 我可以添加多个项目,但这并不方便,因为我已经有了要处理的项目列表。 我还需要结帐流程来逐项列出订单,因此 1 个价格的“立即购买”也不好。

任何帮助感谢大家,我尝试过(但没有运气):

<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="[email protected]">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="test 1">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="item_name2" value="test 2">
<input type="hidden" name="item_number2" value="2">
<input type="hidden" name="item_name3" value="test 3">
<input type="hidden" name="item_number3" value="3">
<input type="hidden" name="amount" value="99.00">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<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.paypal.com/en_GB/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.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

I have a list of products that I'd like to add a "pay now" button to so that I can allow my customers to pay via Paypal.

I've gone through the documentation and can't find how to do this.
I can add multiple items, but this is not going to be handy as I already have the list of items to process.
I also need the checkout process to itemize the order, so a "buy now" with 1 price is no good either.

Any help appreciated guys, I tried (with no luck):

<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="[email protected]">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="test 1">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="item_name2" value="test 2">
<input type="hidden" name="item_number2" value="2">
<input type="hidden" name="item_name3" value="test 3">
<input type="hidden" name="item_number3" value="3">
<input type="hidden" name="amount" value="99.00">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<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.paypal.com/en_GB/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.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

痴者 2024-09-18 14:47:42

请参阅此示例并对您的示例进行相应的更改。基本上在数字之前添加下划线到项目名称,并使用下划线和数字为金额提供唯一的名称。

您必须根据购物车总数为每件商品指定金额。

<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 protected]">
<input type="hidden" name="currency_code" value="USD">

<input type="hidden" name="item_name_1" value="beach ball">
<input type="hidden" name="amount_1" value="15">

<input type="hidden" name="item_name_2" value="towel">
<input type="hidden" name="amount_2" value="20">

<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

指定数量(可选)

<input type="hidden" name="quantity_1" value="1">

有关购物车的更多参考:Paypal 购物车

See this sample and make the changes to yours accordingly. Basically add underscore to item name before number and give unique name to amount also with underscore and number.

You have to give amount to each item based on your carts totals.

<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 protected]">
<input type="hidden" name="currency_code" value="USD">

<input type="hidden" name="item_name_1" value="beach ball">
<input type="hidden" name="amount_1" value="15">

<input type="hidden" name="item_name_2" value="towel">
<input type="hidden" name="amount_2" value="20">

<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

Specify Quantity(optional)

<input type="hidden" name="quantity_1" value="1">

for more reference about cart: Paypal Cart

海风掠过北极光 2024-09-18 14:47:42

<input type="hidden" name="cmd" value="_xclick-subscriptions">

如果您知道定期付款方式中的多项目付款选项或我可以通过此方法加税的任何方式,请更新我

it will not work in

<input type="hidden" name="cmd" value="_xclick-subscriptions">

please update me if you know multiple item payment option in recurrent payment method or in any ways i can add tax in this method.

但可醉心 2024-09-18 14:47:42

PayPal“添加到购物车”按钮可帮助您接受多件商品的付款。按钮 HTML 将如下所示。

<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="item_name" value="PHP Book">
<input type="hidden" name="item_number" value="PB123">
<input type="hidden" name="amount" value="25">
<input type="hidden" name="currency_code" value="USD">
<input type='hidden' name='cancel_return' value='http://www.example.com/cancel.php'>
<input type='hidden' name='return' value='http://www.example.com/success.php'>
<input type="image" name="submit"
src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_addtocart_120x26.png"
alt="Add to Cart">
<img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>

PayPal Add to Cart button helps you to accept payment for multiple items. The button HTML will like the following.

<form target="_self" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="item_name" value="PHP Book">
<input type="hidden" name="item_number" value="PB123">
<input type="hidden" name="amount" value="25">
<input type="hidden" name="currency_code" value="USD">
<input type='hidden' name='cancel_return' value='http://www.example.com/cancel.php'>
<input type='hidden' name='return' value='http://www.example.com/success.php'>
<input type="image" name="submit"
src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_addtocart_120x26.png"
alt="Add to Cart">
<img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文