}
cart.setItemShipGroupEstimate(shippingTotal, gi);
}
// calc the sales tax
CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart);
if (calcTax) {
try {
coh.calcAndAddTax();
} catch (GeneralException e) {
Debug.logError(e, module);
throw new GeneralException(e.getMessage());
}
}
// get the new orderItems, adjustments, shipping info, payments and order item attributes from the cart
List<Map<String, Object>> modifiedItems = FastList.newInstance();
List<GenericValue> toStore = new LinkedList<GenericValue>();
List<GenericValue> toAddList = new ArrayList<GenericValue>();
toAddList.addAll(cart.makeAllAdjustments());
cart.clearAllPromotionAdjustments();
ProductPromoWorker.doPromotions(cart, dispatcher);
// validate the payment methods
Map<String, Object> validateResp = coh.validatePaymentMethods();
if (ServiceUtil.isError(validateResp)) {
throw new GeneralException(ServiceUtil.getErrorMessage(validateResp));
}
// handle OrderHeader fields