【问题标题】:Is it possible to specify the PayPal fixed donation amount in the querystring parameters?是否可以在查询字符串参数中指定 PayPal 固定捐赠金额?
【发布时间】:2015-11-17 15:31:44
【问题描述】:

假设我们有一个<input> 元素,用户可以在其中输入数字(例如500)。

当单击某个按钮左右时,我希望用户被重定向到 PayPal 捐赠页面,他们可以在其中指定金额,但将默认值设置为输入中设置的数字(在这种情况下为500) .

PayPal url 是否允许这样的选项(可能通过查询字符串参数)?

【问题讨论】:

    标签: html url paypal query-string donations


    【解决方案1】:

    是的,这是可能的。您需要创建一个开源捐赠按钮,以便让您的捐赠者从您创建的表格中添加捐赠金额,而不是在 PayPal 托管页面上。

    您需要将此添加到您的捐赠按钮代码中

    <input type="text"   name="amount" size=10><br /><br />
    

    以下是完整的捐赠按钮示例代码。

    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    <input type="hidden" name="cmd" value="_donations">
     <!-- Update to Your PayPal Email or Merchant ID -->
    <input type="hidden" name="business" value="youremail@email.com">
    <input type="hidden" name="lc" value="US">
     <!-- Update the Value to the Donation Name -->
    <input type="hidden" name="item_name" value="Test Donations"><p>Please Enter an Amount</p>
     <!-- The below will allow your customers to enter an amount and this gets passed to PayPal -->
    <input type="text"   name="amount" size=10><br /><br />
     <!-- The rest is the normal PayPal Donation button Info -->
    <input type="hidden" name="no_note" value="0">
    <input type="hidden" name="cn" value="Add special instructions to the seller:">
    <input type="hidden" name="no_shipping" value="2">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted">
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_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">
    </form>
    

    Creating Donation Buttons

    【讨论】:

    • 太棒了!是否可以具有相同的功能但使用查询字符串参数? PayPal 会进行一些重定向。接受,因为这是一个很好的解决方案。 :) 谢谢!
    • 可以获取该信息并将其放入查询字符串并传入金额,或者将其留空并让客户在 PayPal 中输入金额。
    猜你喜欢
    • 2021-10-25
    • 2012-01-22
    • 2014-05-16
    • 2013-07-20
    • 1970-01-01
    • 1970-01-01
    • 2021-05-29
    • 2015-11-22
    • 2017-07-29
    相关资源
    最近更新 更多