【问题标题】:Paypal IPN Help... Getting Invalid response from SandboxPaypal IPN 帮助...从 Sandbox 获得无效响应
【发布时间】:2012-08-06 05:11:57
【问题描述】:

谁能帮我解决这个错误。我收到来自贝宝沙盒的无效响应。

我的沙盒账户已经过验证,IPN 在我的账户中开启,我还在我的沙盒账户中设置了通知 url。

这是我的按钮代码

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr"  method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="myverifiedpaypalemail@gmail.com">
<input type="hidden" name="item_name" value="My Business">
<input type="hidden" name="item_number" value="10101">
<input type="hidden" name="amount" value="101.35">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="http://www.mydomain.com/wp-content/themes/MiniMeCity/images/paypalbutton.jpg" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="return" value="http://www.mydomain.com/payment-confirmation/"> 
<input type="hidden" name="cancel_return" value="http://www.mydomain.com/">
<input type="hidden" name="rm" value="2"> 
<input type="hidden" name="notify_url" value="http://www.mydomain.com/paypalipn.php" /> 
</form>

这是我的 IPN 代码: http://codepad.org/Xu0rhDBY

【问题讨论】:

    标签: php paypal sandbox paypal-ipn


    【解决方案1】:

    我也有同样的问题,但我使用的是 paypal 新的更安全的按钮和来自https://developer.paypal.com/docs/classic/ipn/gs_IPN/ 的 ipn API。 汤姆正如你所说,我使用了 var_dump 并且响应是 string(7) "INVALID"

    【讨论】:

      【解决方案2】:

      在您的 IPN 中,您正在打开一个指向 www.paypal.com 而不是 www.sandbox.paypal.com 的套接字

      【讨论】:

        【解决方案3】:

        您需要在您的 php 配置中启用 OpenSSL

        【讨论】:

          【解决方案4】:

          https://www.paypal-community.com/t5/Selling-on-your-website/IPN-response-problem/m-p/521312#M2445

          我最近遇到了这个问题,从一个没有改变并且在 Paypal 沙盒上正常工作的代码库。

          如果你能提供更多关于正在发生的事情的信息,我可以为你指出更多正确的方向。我建议先做那篇文章中谈到的事情。这只是添加新标题。

          $header .= "主机:www.sandbox.paypal.com\r\n";

          请注意不要在生产系统上使用此标头。

          希望这会有所帮助。如果它不能解决您的问题,请使用 var_dump 第 39 行查看响应是什么。

          我在另一个主题中发布了更详细的回复,以更简单的方式概述了调试:Paypal IPN Integration into PHP

          【讨论】:

            猜你喜欢
            • 2011-01-19
            • 2015-02-11
            • 2016-10-21
            • 2012-04-26
            • 1970-01-01
            • 2018-08-09
            • 2013-08-12
            • 1970-01-01
            • 2017-11-03
            相关资源
            最近更新 更多