PayPal 返回URL - 是否可以使用 GET 参数?

4

这是我用来测试Paypal网站支付标准上传功能的简单代码。

我的返回URL是http://mysite/index.php?module=store&show=order_confirm 我进行付款过程,当我到达最后并返回页面时,它只会将我返回到index.php(即没有额外的参数)。

有人知道这是怎么回事吗?

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">

    <input type="hidden" name="cmd" value="_cart" />

    <input type="hidden" name="upload" value="1">
    <input type="hidden" name="return" value="http://mysite/index.php?module=store&amp;show=order_confirm" />
    <input type="hidden" name="currency_code" value="EUR" />

    <input type="hidden" name="business" value="b.coug_1277121937_biz@gmail.com">

            <input type="hidden" name="item_name_1" value="adaddada" />
            <input type="hidden" name="amount_1" value="30.00" />

            <input type="hidden" name="quantity_1" value="1" />
                            <input type="hidden" name="item_name_2" value="wuiui" />
            <input type="hidden" name="amount_2" value="50.00" />
            <input type="hidden" name="quantity_2" value="1" />


    <input type="hidden" name="custom" value="19" />

    <input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="PayPal - The safer, easier way to pay online">

</form>
3个回答

3
我不确定Paypal为什么要这样做,但我猜测他们想添加自己的GET参数可能会覆盖你的参数。如果您有mod_rewrite或类似的工具,可以尝试以下方法:
编写一个规则来更改此内容:
http://mysite/store/order_confirm/?merchant_return_link=Test+Store

转换为:

http://mysite/index.php?merchant_return_link=Test+Store&module=store&show=order_confirm

谢谢,最终我的解决方案是让它返回到一个简单的PHP文件paypalreturn.php,该文件重定向到我想要前往的页面。 - bcoughlan

3

另一种解决方案是将PayPal的“rm”[返回方法]变量设置为“2”,这样PayPal就会将所有自己的返回变量作为POST变量发送,而不是作为GET变量发送。


3

尝试在返回URL中转义问号和&符号,将它们改为%3F和%26。


好主意,我应该说一下当它返回到index.php时,它还会附加"?merchant_return_link=Test+Store"到末尾,这样它就不起作用了。 - bcoughlan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接