Capturing a transaction

For credit card transactions which were authorized (funds on the card were reserved only on Transaction.create) you need to call the capture method to actually charge the card.

Capture

To capture a transaction, just provide a transaction UID and the amount. Amount can be the same as the authorized amount, or lower (e.g. in case when you can delivery only part of the order to the customer).

Transaction txn = gw.transaction().capture("txn_8rCKriXE8TBBAC", new BigDecimal("10.99"));

Errors

If you attempt to capture a transaction which cannot be captured (i.e. which does not have an AUTHORIZED status) library will raise an Exception.