是否可以通过 PayPal 进行“立即购买”?带有 HTML 表单的按钮?

发布于 2024-11-30 04:26:44 字数 1322 浏览 0 评论 0原文

我的网站上有一个 Google Checkout“立即购买”按钮。非常简单,我所做的就是以 HTML 表单生成订单信息:

<form action="https://checkout.google.com/cws/v2/Merchant/xxxxxxxxxx/checkoutForm" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm">
    <input name="item_name_1" type="hidden" value="Some Stuff">
    <input name="item_description_1" type="hidden" value="Product">
    <input name="item_quantity_1" type="hidden" value="1">
    <input name="item_price_1" type="hidden" value="0.25">
    <input name="item_currency_1" type="hidden" value="GBP">


    <input name="item_name_2" type="hidden" value="Delivery">
    <input name="item_description_2" type="hidden" value="standard">
    <input name="item_quantity_2" type="hidden" value="1">
    <input name="item_price_2" type="hidden" value="2.5">
    <input name="item_currency_2" type="hidden" value="GBP">

    <input name="_charset_" type="hidden" value="utf-8">

    <input alt="" src="https://checkout.google.com/buttons/buy.gif?merchant_id=xxxxxxxxxx&amp;w=117&amp;h=48&amp;style=white&amp;variant=text&amp;loc=en_US" type="image">
</form>

该表单是由一些 PHP 生成的,组装起来相当简单。有没有办法以同样的方式创建 PayPal 按钮?有些客户提出了要求,但我没有时间深入研究复杂的 API,而且静态保存的按钮也不好(客户填写一个简短的订单表格,然后生成按钮)。

I have a Google Checkout 'Buy Now' button on my site. It's very simple, all I do is produce the order information in an HTML form thus:

<form action="https://checkout.google.com/cws/v2/Merchant/xxxxxxxxxx/checkoutForm" id="BB_BuyButtonForm" method="post" name="BB_BuyButtonForm">
    <input name="item_name_1" type="hidden" value="Some Stuff">
    <input name="item_description_1" type="hidden" value="Product">
    <input name="item_quantity_1" type="hidden" value="1">
    <input name="item_price_1" type="hidden" value="0.25">
    <input name="item_currency_1" type="hidden" value="GBP">


    <input name="item_name_2" type="hidden" value="Delivery">
    <input name="item_description_2" type="hidden" value="standard">
    <input name="item_quantity_2" type="hidden" value="1">
    <input name="item_price_2" type="hidden" value="2.5">
    <input name="item_currency_2" type="hidden" value="GBP">

    <input name="_charset_" type="hidden" value="utf-8">

    <input alt="" src="https://checkout.google.com/buttons/buy.gif?merchant_id=xxxxxxxxxx&w=117&h=48&style=white&variant=text&loc=en_US" type="image">
</form>

This form is generated by a bit of PHP, it's fairly trivial to put together. Is there a way of creating a PayPal button in the same way? Some customers have requested it, but I don't have time to delve into complex APIs, and static saved buttons are no good (the customer fills out a short order form, which then generates the button).

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

扫码二维码加入Web技术交流群
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文