PHP: Get the status of a letter with GetLetterStatusV2()

<?php
 
/************* Settings  Begin ****************/
 
$username = '********';
$password = '********';
$id = 99999999; // ID of transaction being queried
 
/************* Settings  End ******************/
 
$soapclient = new SoapClient('https://api.postalmethods.com/PostalWS.asmx?WSDL');
$result = $soapclient->GetLetterStatusV2(array('Username'    => $username,
                                               'Password'    => $password,
                                               'ID'          => $id));
 
// print_r($result);
 
$result_code = $result->GetLetterStatusV2Result->ResultCode;
 
if ($result_code == -3000) { 
	$status      = $result->GetLetterStatusV2Result->Status;
	$description = $result->GetLetterStatusV2Result->Description;
	$lastupdated = $result->GetLetterStatusV2Result->LastUpdateTime;
 
	echo "Letter ID: $id <br>";
	echo "Status: $status <br>";
	echo "Status Description: $description <br>";
	echo "Last Updated: $lastupdated <br>";
 
} else {
    // System returns error message
    echo "Error: <a href=\"http://www.postalmethods.com/resources/reference/status-codes\">$result_code</a><br>";
}
 
?>