Php 贝宝IPN帮助。。。从沙盒获取无效响应

Php 贝宝IPN帮助。。。从沙盒获取无效响应,php,paypal,sandbox,paypal-ipn,Php,Paypal,Sandbox,Paypal Ipn,有人能帮我解决这个错误吗。我从paypal sandbox收到无效响应 我的沙盒帐户已验证,我的帐户已启用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=

有人能帮我解决这个错误吗。我从paypal sandbox收到无效响应

我的沙盒帐户已验证,我的帐户已启用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代码:

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

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

$header.=“主机:www.sandbox.paypal.com\r\n”

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

希望这有帮助。如果无法解决您的问题,请使用var_dump第39行查看响应


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

您需要在您的IPN内部的php配置中启用,您正在打开一个指向www.paypal.com的套接字,而不是www.sandbox.paypal.com

我也有同样的问题,但我使用了paypal new more secure按钮和来自的IPN API。 Tom,正如您所说,我使用了var_dump,响应为字符串(7)“无效”