I'm close to finishing a php script for Paypal's Instant Payment Notification Service. 
 Here is what I have so far.

I grapped this function off of the php documentation and added the last line.  This 
forms the response to be posted back to Paypal.
*******************************************************************
// Function to convert posted array to a string.

while(list($key, $val) = each($HTTP_POST_VARS)) { 
$key = stripslashes($key); 
$val = stripslashes($val); 
$key = urlencode($key); 
$val = urlencode($val); 
$postString .= "$key=$val&";

// Add cmd=_notify-validate;
$postString .= "cmd=notify_validate";
}
*******************************************************************

Next, I used Rasmus Lerdorf's PostToHost function to send the post.  

http://pgfsun.ucdavis.edu/php-stuff/post_to_host.inc.txt

My problem (due to my lack of fundemental understanding) is that I don't know how to 
read Paypal's response to the post.  Paypal describes the response like this, 

    "PayPal will respond to the post with a single word,             'VERIFIED' or 
'INVALID', in the body of the response."

How do I receive and handle this response?  Is this the $return_result variable in the 
PostToHost function?

Once this is received, the data can be processed however one pleases.

-Randall

Reply via email to