1

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

我的沙盒帐户已通过验证,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

4

4 回答 4

2

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

于 2012-08-09T14:46:32.533 回答
0

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

I recently experienced this problem, going from a code base that hadn't changed and was working correctly on the Paypal sandbox.

If you can provide more information was to what is occuring, i can point you more in the right direction. I'd suggest doing what's been talked about in that post first. Which is simply adding the new header.

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

Just be aware not to have this header on a production system.

Hope this helps. If it doesn't resolve your issue, use var_dump line 39 to see what the responses are.

I've posted a more detail response in a different topic which outlines debugging in an easier manner : Paypal IPN Integration into PHP

于 2012-08-09T01:44:24.457 回答
0

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

于 2012-08-09T02:30:37.257 回答
0

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

于 2014-03-18T07:19:28.093 回答