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).
$amount = 20.44;
$transaction = Pencepay_Transaction::capture('transaction_uid', $amount);
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.