function printError($client, $response)
{
    echo '<h2>Error returned in processing transaction</h2>';
    echo "\n";
    printNotifications($response->Notifications);
    printRequestResponse($client, $response);
}
function printNotifications($notes)
{
    foreach ($notes as $noteKey => $note) {
        if (is_string($note)) {
            echo $noteKey . ': ' . $note . Newline;
        } else {
            printNotifications($note);
        }
    }
    echo Newline;
}