我已经尝试过一切,但不断被同行重置"在尝试验证/验证时..
<?php
header('HTTP/1.1 200 OK');
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) // $_POST looks OK to me..
$req .= "&$key=".urlencode(stripslashes($value));
$fp = fsockopen("ssl://www.sandbox.paypal.com", 443, $errno, $errstr, 60); // true
$header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Conection: Close\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
fputs ($fp, $header . $req);
while (!feof($fp))
{
$res = fgets ($fp, 1024); // CONNECTION RESET BY PEER : (
if ($res === "VERIFIED") $response = "VERIFIED";
if ($res === "INVALID") $response = "INVALID";
}
fclose($fp);
为什么他们不跟我说话?!?
答案 0 :(得分:1)
行。找到了一些示例代码,让我了解了所有内容:
https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php
- 收到&#34; VERIFIED&#34;后,我可以使用3年前的代码:)