Как упоминалось в одном из комментариев в ответе ниже, я пытался следовать этому руководству . Итак, теперь у меня есть следующее:
Файл ipn.php:
$url,
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => http_build_query(array('cmd' => '_notify-validate') + $ipn_post_data),
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HEADER => FALSE,
CURLOPT_SSL_VERIFYPEER => TRUE,
CURLOPT_CAINFO => 'cacert.pem',
));
// Execute request and get response and status code
$response = curl_exec($request);
$status = curl_getinfo($request, CURLINFO_HTTP_CODE);
// Close connection
curl_close($request);
if($status == 200 && $response == 'VERIFIED')
{
$subject = "valid";
$message = "good";
}
else
{
$subject = "invalid";
$message = "bad";
}
$to = "oshirowanen@mail.com";
$from = "me@desktop.com";
$header = 'MIME-Version: 1.0'. "\r\n";
$header.= 'Content-type: text/html; charset=iso-8859-1'. "\r\n";
$header.= 'To: Oshirowanen '. "\r\n";
$header.= 'From: Me '. "\r\n";
mail($to,$subject,$message,$header);
?>
Полученное письмо:
Subject "invalid"
Message "bad"