Philip,
A further fix that I corrected that you may want to also correct: Currently your code only sends over the last name of the customer as part of the customer data. For shipping purposes this may or may not matter, but the fix is really easy, to include first name and last name. Currently the code uses:
<BillTo>
<Name><![CDATA[' . $address->address_lastname . ']]></Name>
</BillTo>
<ShipTo>
<Name><![CDATA[' . $address->address_lastname . ']]></Name>
In my corrected version, I use:
<BillTo>
<Name><![CDATA[' . $address->address_firstname . ' ' . $address->address_lastname . ']]></Name>
</BillTo>
<ShipTo>
<Name><![CDATA[' . $address->address_firstname . ' ' . $address->address_lastname . ']]></Name>