4

I am receiving the following from a PayPal IPN script. Is it evident from the following what is causing the IPN transaction to fail? If not, how can I investigate the problem further?

[01/25/2010 7:49 PM] - FAIL: IPN Validation Failed.
IPN $_POST variables from PayPal:
mc_gross=25.00
protection_eligibility=Ineligible
address_status=unconfirmed
payer_id=AEVB83JZKDRCL
tax=0.00
address_street=1 Main Terrace
payment_date=10:49:52 Jan 25, 2010 PST
payment_status=Pending
charset=windows-1252
address_zip=W12 4LQ
first_name=Test
address_country_code=GB
address_name=Test User
notify_version=2.9
custom=
payer_status=unverified
address_country=United Kingdom
address_city=Wolverhampton
quantity=1
verify_sign=A0I1KzEZadt6mIDXxQkkIQCQKPTMAGvCuZ8RKXsOCujIi.RoMxAnbZXi
payer_email=test1_1263505944_per@example.com
txn_id=38A45069EV5838100
payment_type=instant
last_name=User
address_state=West Midlands
receiver_email=martin@example.com
pending_reason=unilateral
txn_type=web_accept
item_name=Ultimate Challenge UK Ressurection  Standard Seating (25.00 GBP)
mc_currency=GBP
item_number=
residence_country=GB
test_ipn=1
handling_amount=0.00
transaction_subject=Ultimate Challenge UK Ressurection  Standard Seating (25.00 GBP)
payment_gross=
shipping=0.00


IPN response from PayPal server:
 HTTP/1.1 200 OK
Date: Mon, 25 Jan 2010 18:49:56 GMT
Server: Apache
Set-Cookie: cwrClyrK4LoCV1fydGbAxiNL6iG=_hMqg4cipUMV6RnPhXQ-05S5HEZk2hx2Yc87bjkBg5dZZLYqHTsxqiYwvU9Hjas5YeKTg9jnkbQYomER3_bjuAIW9f15003nc2FYPzIYqFuCc-Jfz1B8byXHhtrJ6OHyiPlmo0%7cGRbawzJR-iAiebJ1pZJZ3DzypAO4untXvofHa07UaqPHkeOZNQTSoCfMobgODGnxgP6jHW%7cf29zaCIP63s4TuzaT12cEiU-aih_kOHju4cqZ4KPV18bl-LTNlFzFLLGmr_DOhyXznq--m%7c1264445397; domain=.paypal.com; path=/
Set-Cookie: cookie_check=yes; expires=Thu, 23-Jan-2020 18:49:57 GMT; domain=.paypal.com; path=/
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/
Set-Cookie: navlns=0; expires=Sun, 20-Jan-2030 18:49:57 GMT; domain=.paypal.com; path=/
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=92
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

7
INVALID
0
4

4 回答 4

5

任何使用 Micah Carrick 的 PHP Paypal IPN 集成类并遇到相同问题的人:IPN 变量和值必须以 cmd=_notify-validate 开头。在 paypal.class.php 文件中正好相反。

因此,只需将$post_string = '';第 179 行中的替换为
$post_string="cmd=_notify-validate";
replace
$post_string .= $field.'='.urlencode(stripslashes($value)).'&';

在第 181 行$post_string .= '&' . $field.'='.urlencode(stripslashes($value));

然后在第 184 行删除$post_string.="cmd=_notify-validate";,你的问题应该得到解决。

于 2010-07-22T20:53:36.717 回答
4

您是否尝试过IPN 测试工具来调查问题?

您可以使用它来重现您提交的表单并查看是否获得一致的结果。

如果您准确指定失败的上下文,您可能会得到更好的答案。

于 2010-01-25T18:59:06.463 回答
2

要连接到沙盒 Paypal,请使用此行:

$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); 

并不是 :$fp = fsockopen($url_parsed['host'],"80",$err_num,$err_str,30);

并且响应 IPN 发送单词“ VERIFIED

如果您正在通过 SSL 测试 Paypal IPN,则必须ssl://www.sandbox.paypal.comport 443

于 2012-07-02T13:07:05.930 回答
0

@Dominik,这似乎也解决了我的问题!我碰巧在使用Md Emran Hasan 的 PHP 类。并用这个问题把我的头发扯掉了大约一个星期!

所以我的编辑看起来像这样......$postString .="cmd=_notify-validate"; //曾经在while循环之后!这段代码被包装在一个validateIPN函数中。

    $postString .= "cmd=_notify-validate"; // append ipn command

    foreach ($_POST as $field=>$value)
    {
        $this->ipnData["$field"] = $value;
        $postString .= '&' . $field .'=' . urlencode(stripslashes($value));
    }
于 2011-11-30T00:22:38.637 回答