diciamo che non avevo scritto tutta la funzione... pensavo non servisse... la scrivo tutta allora 
Codice PHP:
private function isVerifiedIPN(){
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value){
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
$this->r=$req;
//Modificando la costante SIMULATION nel file di configurazione
//è possibile passare dall'ambiente di simulazione a quello di produzione
if(SIMULATION){
$url = SIMULATION_URL;
}else{
$url = PRODUCTION_URL;
}
//echo("Indirizzo: ".$url."
");
$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Host: $url:443\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ("ssl://$url", 443, $errno, $errstr, 30);
if (!$fp){
// HTTP ERROR
// $errstr - $errno
$this->sendReport(1);
return FALSE;
}else{
fputs ($fp, $header . $req);
while (!feof($fp)){
$res = fgets ($fp, 1024);
if (strcmp($res, "VERIFIED") == 0){
fclose ($fp);
return TRUE;
}else if (strcmp ($res, "INVALID") == 0){
//se la procedura non è legittima invia un email all'amministratore
$this->sendReport(0,$res);
fclose ($fp);
return FALSE;
}else{
echo("
RES: ".$res."
");
}
}
}
}
Non mi sembra diverso da quello che hai scritto tu