Copy this code and paste it in your HTML
define('PAYPAL_TOKEN', '123456981723dasdas_paypal_token'); define('PAYPAL_URL', 'https://www.paypal.com/cgi-bin/webscr');
$tx = (isset($_GET['tx'])) ?
$_GET['tx'] : '';
// Send POST for data response
curl_setopt($ch, CURLOPT_POSTFIELDS
,'cmd=_notify-synch&tx='.$tx.'&at='.PAYPAL_TOKEN
); curl_setopt($ch, CURLOPT_HEADER
, 0); // DO NOT RETURN HTTP HEADERS curl_setopt($ch, CURLOPT_RETURNTRANSFER
, 1); // RETURN THE CONTENTS OF THE CALL
// Log response
$fp = fopen(PATH
.'/log/paypal.log', 'a');
// Parse response
$processed = (strcmp($lines[0], "SUCCESS") == 0) ?
true : false; foreach ($lines as $line)
{
}
if ($processed && $keyarray['payment_status'] == 'Completed') {
echo "OK";
} else {
echo "Something went wrong.<br /> PayPal response: <br />".$res;
}