【问题标题】:Paypal return url with hash tag?带有哈希标签的贝宝返回网址?
【发布时间】:2014-05-13 21:34:25
【问题描述】:

我有一个 PayPal 表单,其中包含带有标签的返回 url。当付款准备好并且用户按下他们的链接返回到链接是 %23 insted # 的页面时,有没有办法解决这个问题?我需要那个井号标签来显示正确的标签。

我知道这个问题有点超出编程范围,可能是某个 PayPal api 问题,但也许我做错了什么。

对于协议,我已经尝试将 urlencode 直接输入我的表单,但问题仍然存在,似乎 paypal 对该 url 进行了编码,当返回时,我的浏览器无法再次解码。

【问题讨论】:

    标签: php paypal paypal-ipn returnurl


    【解决方案1】:

    Hashtag 在返回 url 中应该可以正常工作:

        <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" target="paypal" method="post">
        <input type="hidden" name="cmd" value="_xclick" />
        <input type="hidden" name="business" value="hbsawnhdglv@paypal.com" />
        <input type="hidden" name="item_name" value="item" />
        <input type="hidden" name="currency" value="USD" />
        <input type="hidden" name="amount" value="0" />
        <input type="hidden" name="return" value="http://localhost/test.php#test" />
        <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_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_US/i/scr/pixel.gif" width="1" height="1" />
        </form>
    

    jsfiddle 上。我也尝试过使用 ExpressCheckout,它也可以正常工作,但是使用标准锚点可能无法正常工作,因为主题标签可能位于错误的位置。此外,如果您尝试将其放在 GET 变量的末尾,它会认为它是变量的一部分并对其进行编码:

        <input type="hidden" name="return" value="http://localhost/test.php?v=1#test" />
    

    产生:http://localhost/test.php?v=1%23test

    【讨论】:

    • get 后的 var 是问题所在,但是我删除了该哈希标签,现在我正在使用另外一个 var,它建议必须打开哪个选项卡。但总是很高兴知道是什么导致了这个问题。再次感谢。
    猜你喜欢
    • 2010-12-25
    • 1970-01-01
    • 2012-10-13
    • 2012-03-09
    • 2012-07-13
    • 1970-01-01
    • 1970-01-01
    • 2014-11-04
    • 1970-01-01
    相关资源
    最近更新 更多