0

これは、paypal api の私のコードです。両方のアカウントが確認され、支払いも行われました...しかし、まだ失敗のメールが届きます..理解できない理由は何ですか...

<?php
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value)
{
    $value = urlencode(stripslashes($value));
    $req .= "&$key=$value";
}

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

    $mode = $paymod_data['MODULE_PAYMENT_PAYPAL_TESTMODE'];

if ($mode == 'test')
{
    $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
}
else
{
    $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
}

if (!$fp)
{
    // HTTP ERROR
     die ("Error");
}
else 
{   
    fputs ($fp, $header . $req);
    while (!feof($fp)) {
        $res = fgets ($fp, 1024);
        if (strcmp (trim($res), "VERIFIED") == 0) {
            // check the payment_status is Completed
            // check that txn_id has not been previously processed
            // check that receiver_email is your Primary PayPal email
            // check that payment_amount/payment_currency are correct
            // process payment
            echo strcmp ($res, "VERIFIED");
            echo strcmp (trim($res), "INVALID");
            mail("aks0130@gmail.com","sucess","aa gyi mail","From: demo2312@gmail.com");
        }
        else if (strcmp ($res, "INVALID") == 0) {
            // log for manual investigation
            echo strcmp (trim($res), "INVALID");
            echo strcmp (trim($res), "VERIFIED");
            mail("aks0130@gmail.com","fail","nahi aa gyi mail","From: demo2312@gmail.com");
        }
    }
fclose ($fp);
}
?>

私はそれを適切に行うために3〜4日以来試みてきましたが、静脈..だから私はstackoverflowに戻ります

4

1 に答える 1