Take a look on the vm2 and vm3 shipment/payment plugins. There you see as it should be. But vm3 was exactly necessary to clean up the customs. They are imho a lot easier to handle now.
If you want to have less stress for vm3.2 or vm4, use our API, use vRequest, vText, and the vmJsApi