我的Paypal IPN脚本正确吗?

我的Paypal IPN脚本正确吗?,paypal,paypal-ipn,Paypal,Paypal Ipn,我在paypals IPN中不断遇到重试错误。我没有编写这个脚本,我的开发人员编写了,我们都无法理解。以下是脚本: ifisset$\u POST['item\u name'],$\u POST['item\u number']{ $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $pa

我在paypals IPN中不断遇到重试错误。我没有编写这个脚本,我的开发人员编写了,我们都无法理解。以下是脚本:

ifisset$\u POST['item\u name'],$\u POST['item\u number']{

$item_name        = $_POST['item_name'];
$item_number      = $_POST['item_number'];
$payment_status   = $_POST['payment_status'];
$payment_amount   = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id           = $_POST['txn_id'];
$receiver_email   = $_POST['receiver_email'];
$payer_email      = $_POST['payer_email'];

$req = 'cmd=_notify-validate';

foreach($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= "&key={$value}";
}

$header  = "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";

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

fputs($fp, $header, $req);

while(!feof($fp)) {

    $res=fgets($fp,1024);

    if(strcmp($res, "VERIFIED") == 0) {

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, 'http://www.dollarboot.com/paypal/ipn_success.php');
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, 'item_name=' . $item_name . '&item_number=' . $item_number);
        curl_exec($curl);
        curl_close($curl);

    }

}

}

您的IPN日志中的响应是什么基本上只是说重试,也就是说应该说响应代码,还可以尝试一个IPN测试仪,它允许您查看脚本中的响应。