【发布时间】:2014-04-24 19:17:19
【问题描述】:
我也有类似PayPal Instant Payment Notification Warning 的问题。我有两个网站。我在 paypal 帐户中将 ipn url 设置为 site1。但我正在为当前站点以贝宝形式发送 notify_url。我在两个网站上的验证码:
public function paymentCheck()
{
$request = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$request .= "&$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($request) . "\r\n\r\n";
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
if (!$fp)
return false;
else {
fputs ($fp, $header . $request);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "INVALID") == 0) {
return false;
}
}
fclose ($fp);
}
return true;
}
我的网站处理 ipn。一切正常。但是一些贝宝消息失败了,他们把它关掉了。你有什么想法,什么会导致警告?
【问题讨论】:
标签: php paypal paypal-ipn