Double amountToCharge = (Double) context.get("captureAmount");
if (amountToCharge == null || amountToCharge == 0) {
amountToCharge = order.getDouble("grandTotal"); // captureAmount 0 means capture all??
}
if (amountToCharge > 0) {
ChargeOrderRequest cor = new ChargeOrderRequest(mInfo, externalId, amountToCharge.floatValue());
try {
cor.send();
} catch (CheckoutException e) {
Debug.logError(e, module);
}
}
}