2012-08-09 93 views
1

任何人都可以帮助我解决这个错误。我收到来自PayPal沙箱的无效回复。PayPal IPN帮助...从沙盒获取无效响应

我的沙箱帐户已验证,IPN在我的帐户上,我也在我的沙盒帐户中设置了通知网址。

这里是我的按钮代码

<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="[email protected]"> 
<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

回答

0

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

最近,我遇到过这个问题,从一个代码库去说没有改变,并在Paypal沙箱上正常工作。

如果你可以提供更多的信息是什么发生,我可以指出你更正确的方向。我会建议你先完成那篇文章中讨论过的内容。这只是添加新的标题。

$ header。=“Host:www.sandbox.paypal.com \ r \ n”;

请注意,生产系统上不要包含此标题。

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

我已经张贴在一个不同的主题更详细的响应,其概述了一个更容易的方式进行调试:Paypal IPN Integration into PHP

2

您的IPN内启用OpenSSL,您正在打开一个套接字www.paypal.com而不是www.sandbox.paypal.com

+0

谢谢你这...它解决了我的问题.. – kebyang 2013-04-09 08:02:49