Here is a function i wrote a while ago...
<?php
function WA_isValidPayPal() {
$retVal = false;
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);
if (!$fp) {
$retVal = false;
}
else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
$retVal = true;
}
else if (strcmp ($res, "INVALID") == 0) {
$retVal = false;
}
}
fclose ($fp);
}
return $retVal;
}
?>
You could add that and then just use the trigger:
if (WA_isValidPayPal()) {
// insert code here
}
But my code is similar to theirs so it might not work either. The missing field values are probably because you have your form values wrong for your POST. You can probably get those better with something like:
file_put_contents("test.txt",json_encode($_POST));
Then your test.txt file will have all of the form fields posted and their values so you can pick through and see what you need.