有详细的,细节的实现流程代码?问的比较无耻,不好意思的。。
只需要和PAYPAL相关的必要的,其它请隐藏或者更改,跪求~

解决方案 »

  1.   

    <?php
    // read the post from PayPal system and add 'cmd'
    $req = 'cmd=_notify-validate';foreach ($_POST as $key => $value) {
    $value = urlencode(stripslashes($value));
    $req .= "&$key=$value";
    }// post back to PayPal system to validate
    $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";
    $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);// assign posted variables to local variables
    $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'];
    if (!$fp) {
        // HTTP ERROR
    }else {
        fputs ($fp, $header . $req);
        while (!feof($fp)) {
            $res = fgets ($fp, 1024);
            if (strcmp ($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
            }
            else if (strcmp ($res, "INVALID") == 0) {
            // log for manual investigation
            }
        }
        fclose ($fp);
    }
    ?>
    POST回Paypal的接口地址,如果数据正确,那么Paypal返回字符串VERIFIED,否则为INVALID,如果结果为VERIFIED,那么你的程序就可以使用这些数据进行操作。
      

  2.   

    希望对你有帮助:里面有资源下载,没全部上传,如有需要请在文章处留下联方式,我发你邮箱http://blog.csdn.net/yw1386/archive/2010/04/10/5471258.aspx
      

  3.   

    小弟也急需paypal的资料,请发我,[email protected]