【问题标题】:automatically create buy now button paypal?自动创建立即购买按钮贝宝?
【发布时间】:2011-07-17 22:51:29
【问题描述】:

我想自动创建一个 paypal 立即购买按钮。

最简单的方法是什么?

【问题讨论】:

    标签: php paypal


    【解决方案1】:

    我还发现您可以像这样在 url 中传递信息:

    https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=herschelgomez@xyzzyu.com&item_name=Hot Sauce-12+oz.+Bottle&item_number=12345&amount=5%2e95&currency_code=USD
    

    你可以这样做:

    <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=herschelgomez@xyzzyu.com&item_name=Hot Sauce-12+oz.+Bottle&item_number=12345&amount=5%2e95&currency_code=USD">
    <img src="/buynow.png" />
    </a>
    

    【讨论】:

    • 太棒了,我不知道!
    • 这就是我需要的。谢谢。
    【解决方案2】:

    以下页面列出了“立即购买”按钮所需的最低信息。我已经包含了最简单的示例:

    https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_techview_outside

    <?php
    echo '<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="me@mybusiness.com">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="item_name" value="Teddy Bear">
    <input type="hidden" name="amount" value="12.99">
    <input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it\'s fast, free and secure!">
    </form>';
    

    不要忘记转义任何“'”字符(单引号)。

    【讨论】:

      【解决方案3】:

      添加一个简单的 paypal 立即购买按钮的 HTML 代码是这样的:

      <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
          <!-- Identify your business so that you can collect the payments. -->
          <input type="hidden" name="business" value="email@domain.com">
          <!-- Specify a Buy Now button. -->
          <input type="hidden" name="cmd" value="_xclick">
          <!-- Specify details about the item that buyers will purchase. -->
          <input type="hidden" name="item_name" value="Demo Ebook">
          <input type="hidden" name="amount" value="5">
          <input type="hidden" name="currency_code" value="USD">
          <!-- Display the payment button. -->
          <input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
          <img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif">
      </form>
      

      如果您想动态更改项目,只需更改 item_name 值。

      更多演示和下载链接可以在here找到

      【讨论】:

        【解决方案4】:

        我知道这已经有一段时间了,但这是最好的帮助:

        https://www.paypal.com/cgi-bin/webscr?cmd=_singleitem-intro-outside

        只需填写表格,PayPal 就会为您生成 HTML 表格。在左侧的按钮导航下,您还可以生成“立即购买”、“加入购物车”、“捐赠”、“购买礼券”和“订阅”的代码。

        【讨论】:

          猜你喜欢
          • 2013-03-25
          • 2017-08-15
          • 2017-12-21
          • 2016-11-21
          • 2013-04-29
          • 1970-01-01
          • 2012-04-07
          • 2013-06-18
          • 2013-07-20
          相关资源
          最近更新 更多