The JS SDK is updated to the latest (that supports hiding the iframe, rather than destroying it)
I added a null check when determining the shipping amount - with the old version, if you tried to invoice an order that didn't have a shipping address, the capture method would throw an exception