简体   繁体   English

贝宝返回网址与哈希标签?

[英]Paypal return url with hash tag?

I've got a PayPal form which has return url with hashtag. 我有一个PayPal表单,该表单具有带有标签的返回URL。 When the payment is ready and the user press their link return to the page the link is with %23 insted #, is there a way to fix that? 付款准备好后,用户按其链接即可返回该页面,该链接带有%23插入的#,是否可以解决该问题? I need that hash tag to show the correct tab. 我需要该哈希标签以显示正确的标签。

I know the question is a bit out of programming, and it may is a some PayPal api issue but maybe I'm doing something wrong. 我知道问题出在编程上,可能是PayPal api出现问题,但也许我做错了。

For the protocol, I've tried with urlencode straight into my form, but the problem is still there, it seems that paypal encode that url and when is returned my browser can't decode it again. 对于该协议,我已经尝试将urlencode直接插入表单中,但是问题仍然存在,似乎paypal对该URL进行了编码,当返回时,我的浏览器无法再次对其进行解码。

Hashtag should work fine in the return url: Hashtag在返回网址中应该可以正常运行:

    <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>

and on jsfiddle . 并在jsfiddle上 I also tried with ExpressCheckout and it works as well, however using standard anchors this may not work as the hashtag may be in the wrong place. 我还尝试了ExpressCheckout,它也可以正常工作,但是使用标准锚点可能不起作用,因为井号标签可能放置在错误的位置。 Also, if you are trying to put it at the end of a GET variable it will think it is part of the variable and encode it: 另外,如果您尝试将其放在GET变量的末尾,它将认为它是该变量的一部分并对其进行编码:

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM