我已經使用的代碼https://github.com/Quixotix/PHP-PayPal-IPN貝寶IPN成功發送
但是建立一個簡單的IPN當我運行以下
<?php
include('ipnlistener.php');
$listener = new IpnListener();
$listener->use_sandbox = true;
try {
$verified = $listener->processIpn();
} catch (Exception $e) {
// fatal error trying to process IPN.
exit(0);
}
if ($verified) {
if ($verified) {
mail('[email protected]', 'Verified IPN', $listener->getTextReport());
}
else {
/*
An Invalid IPN *may* be caused by a fraudulent transaction attempt. It's
a good idea to have a developer or sys admin manually investigate any
invalid IPN.
*/
mail('[email protected]', 'Invalid IPN', $listener->getTextReport());
}
}
?>
我沒有收到從我的服務器說它從得到的IPN任何郵件Paypal
爲什麼你有'if($ verified)'兩次?通過你在代碼中的邏輯,那個內部的'else'塊永遠不會發生,因此當IPN無法驗證時,你永遠不會收到電子郵件。 –