【问题标题】:Paypal return URL - using GET parameters?贝宝返回 URL - 使用 GET 参数?
【发布时间】:2011-03-06 21:13:00
【问题描述】:

这是我用来测试 Paypal 网站付款标准上传的一些简单代码。

我的返回网址是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>

【问题讨论】:

    标签: php paypal


    【解决方案1】:

    尝试转义 ?和返回 URL 中的 &;将它们更改为 %3F 和 %26。

    【讨论】:

    • 好主意,我应该说,当它返回 index.php 时,它还会在末尾附加“?merchant_return_link=Test+Store”,所以它不起作用
    【解决方案2】:

    我不确定 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
    

    【讨论】:

    • 谢谢,我最终的解决方案是让它返回一个名为 paypalreturn.php 的简单 PHP 文件,该文件重定向到我想去的页面。
    【解决方案3】:

    另一种答案是将 paypal 'rm' [return method] 变量设置为“2”,这样 paypal 将 POST 它自己的所有返回变量,而不是将它们作为 GET 变量发送

    【讨论】:

      猜你喜欢
      • 2015-01-03
      • 2015-10-31
      • 2017-02-26
      • 1970-01-01
      • 2013-05-23
      • 2011-09-10
      • 2015-10-16
      • 2010-12-25
      • 2014-08-29
      相关资源
      最近更新 更多