<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
include('PaymentProcessor.php');
switch ($_GET['action'])
{
    case 'success':
    case 'cancel';
        echo '<pre>'; print_r($_POST); echo '</pre>';
        break;
    case 'ipn';
    {
        $processor = new PayPalStandard();
        $processor->testMode = true;
        $response = $processor->notifyValidateIPN();
        $text = date('d-m-Y H:i:s - IPN (SISSL) - ');
        $text .= $response->rawResponse;
        $f = fopen('ipn.log', 'ab');
        fwrite($f, $text);
        fclose($f);
    }
}
?>
