【问题标题】:How do I setup Auto Return URL for a PayPal Buy Button?如何为 PayPal Buy Button 设置自动返回 URL?
【发布时间】:2016-04-09 13:09:45
【问题描述】:

我正在使用简单的 Paypal 购买按钮的 html 代码,但想知道是否可以设置一个自动返回 url 而不必通过我自己的 Paypal 帐户来设置?

我不能那样做,因为它是一个 localhost 网站(无法验证真实网站),而且我没有通过我的销售工具创建按钮。

  <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@email.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">
                    <input type="hidden" name="amount" value="0.01">
                    <input type="hidden" name="currency_code" value="GBP">
                    <input type="hidden" name="return" value="~/">
                    <!-- 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>

【问题讨论】:

    标签: url button paypal return


    【解决方案1】:

    是的,您可以设置自己的返回 URL。 HTML Special Variables。您可以将此代码添加到您的表单中。

    &lt;input type="hidden" name="return" value="http://localhost" /&gt;

    在您的 html 中,您定义了一个到您的主目录的相对路径,但您需要一个 HTTP 或 HTTPS url 才能使其工作。这是因为paypal结账所在的页面不在你的根目录下,所以需要一个特定的位置。

    【讨论】:

      猜你喜欢
      • 2013-02-27
      • 2017-12-13
      • 2021-05-17
      • 2018-10-28
      • 2014-07-28
      • 1970-01-01
      • 2018-03-28
      • 2020-05-26
      • 2016-11-25
      相关资源
      最近更新 更多