Search in sources :

Example 6 with ShoppingCart

use of org.apache.ofbiz.order.shoppingcart.ShoppingCart in project ofbiz-framework by apache.

the class OrderServices method runSubscriptionAutoReorders.

public static Map<String, Object> runSubscriptionAutoReorders(DispatchContext dctx, Map<String, ? extends Object> context) {
    LocalDispatcher dispatcher = dctx.getDispatcher();
    Delegator delegator = dctx.getDelegator();
    GenericValue userLogin = (GenericValue) context.get("userLogin");
    Locale locale = (Locale) context.get("locale");
    int count = 0;
    Map<String, Object> result = null;
    boolean beganTransaction = false;
    List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("automaticExtend", EntityOperator.EQUALS, "Y"), EntityCondition.makeCondition("orderId", EntityOperator.NOT_EQUAL, null), EntityCondition.makeCondition("productId", EntityOperator.NOT_EQUAL, null));
    try {
        beganTransaction = TransactionUtil.begin();
    } catch (GenericTransactionException e1) {
        Debug.logError(e1, "[Delegator] Could not begin transaction: " + e1.toString(), module);
    }
    try (EntityListIterator eli = EntityQuery.use(delegator).from("Subscription").where(exprs).queryIterator()) {
        if (eli != null) {
            GenericValue subscription;
            while (((subscription = eli.next()) != null)) {
                Calendar endDate = Calendar.getInstance();
                endDate.setTime(UtilDateTime.nowTimestamp());
                // Check if today date + cancel period (if provided) is earlier than the thrudate
                int field = Calendar.MONTH;
                if (subscription.get("canclAutmExtTime") != null && subscription.get("canclAutmExtTimeUomId") != null) {
                    if ("TF_day".equals(subscription.getString("canclAutmExtTimeUomId"))) {
                        field = Calendar.DAY_OF_YEAR;
                    } else if ("TF_wk".equals(subscription.getString("canclAutmExtTimeUomId"))) {
                        field = Calendar.WEEK_OF_YEAR;
                    } else if ("TF_mon".equals(subscription.getString("canclAutmExtTimeUomId"))) {
                        field = Calendar.MONTH;
                    } else if ("TF_yr".equals(subscription.getString("canclAutmExtTimeUomId"))) {
                        field = Calendar.YEAR;
                    } else {
                        Debug.logWarning("Don't know anything about canclAutmExtTimeUomId [" + subscription.getString("canclAutmExtTimeUomId") + "], defaulting to month", module);
                    }
                    endDate.add(field, Integer.parseInt(subscription.getString("canclAutmExtTime")));
                }
                Calendar endDateSubscription = Calendar.getInstance();
                endDateSubscription.setTime(subscription.getTimestamp("thruDate"));
                if (endDate.before(endDateSubscription)) {
                    // nor expired yet.....
                    continue;
                }
                result = dispatcher.runSync("loadCartFromOrder", UtilMisc.toMap("orderId", subscription.get("orderId"), "userLogin", userLogin));
                if (ServiceUtil.isError(result)) {
                    return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
                }
                ShoppingCart cart = (ShoppingCart) result.get("shoppingCart");
                // remove former orderId from cart (would cause duplicate entry).
                // orderId is set by order-creation services (including store-specific prefixes, e.g.)
                cart.setOrderId(null);
                // only keep the orderitem with the related product.
                List<ShoppingCartItem> cartItems = cart.items();
                for (ShoppingCartItem shoppingCartItem : cartItems) {
                    if (!subscription.get("productId").equals(shoppingCartItem.getProductId())) {
                        cart.removeCartItem(shoppingCartItem, dispatcher);
                    }
                }
                CheckOutHelper helper = new CheckOutHelper(dispatcher, delegator, cart);
                // store the order
                Map<String, Object> createResp = helper.createOrder(userLogin);
                if (createResp != null && ServiceUtil.isError(createResp)) {
                    Debug.logError("Cannot create order for shopping list - " + subscription, module);
                } else {
                    String orderId = (String) createResp.get("orderId");
                    // authorize the payments
                    Map<String, Object> payRes = null;
                    try {
                        payRes = helper.processPayment(ProductStoreWorker.getProductStore(cart.getProductStoreId(), delegator), userLogin);
                    } catch (GeneralException e) {
                        Debug.logError(e, module);
                    }
                    if (payRes != null && ServiceUtil.isError(payRes)) {
                        Debug.logError("Payment processing problems with shopping list - " + subscription, module);
                    }
                    // remove the automatic extension flag
                    subscription.put("automaticExtend", "N");
                    subscription.store();
                    // send notification
                    if (orderId != null) {
                        dispatcher.runAsync("sendOrderPayRetryNotification", UtilMisc.toMap("orderId", orderId));
                    }
                    count++;
                }
            }
        }
    } catch (GenericServiceException e) {
        Debug.logError("Could call service to create cart", module);
        return ServiceUtil.returnError(e.toString());
    } catch (CartItemModifyException e) {
        Debug.logError("Could not modify cart: " + e.toString(), module);
        return ServiceUtil.returnError(e.toString());
    } catch (GenericEntityException e) {
        try {
            // only rollback the transaction if we started one...
            TransactionUtil.rollback(beganTransaction, "Error creating subscription auto-reorders", e);
        } catch (GenericEntityException e2) {
            Debug.logError(e2, "[Delegator] Could not rollback transaction: " + e2.toString(), module);
        }
        Debug.logError(e, "Error while creating new shopping list based automatic reorder" + e.toString(), module);
        return ServiceUtil.returnError(UtilProperties.getMessage(resource, "OrderShoppingListCreationError", UtilMisc.toMap("errorString", e.toString()), locale));
    } finally {
        try {
            // only commit the transaction if we started one... this will throw an exception if it fails
            TransactionUtil.commit(beganTransaction);
        } catch (GenericEntityException e) {
            Debug.logError(e, "Could not commit transaction for creating new shopping list based automatic reorder", module);
        }
    }
    return ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "OrderRunSubscriptionAutoReorders", UtilMisc.toMap("count", count), locale));
}
Also used : Locale(java.util.Locale) GenericValue(org.apache.ofbiz.entity.GenericValue) LocalDispatcher(org.apache.ofbiz.service.LocalDispatcher) GeneralException(org.apache.ofbiz.base.util.GeneralException) Calendar(com.ibm.icu.util.Calendar) CheckOutHelper(org.apache.ofbiz.order.shoppingcart.CheckOutHelper) Delegator(org.apache.ofbiz.entity.Delegator) ShoppingCart(org.apache.ofbiz.order.shoppingcart.ShoppingCart) CartItemModifyException(org.apache.ofbiz.order.shoppingcart.CartItemModifyException) GenericEntityException(org.apache.ofbiz.entity.GenericEntityException) GenericTransactionException(org.apache.ofbiz.entity.transaction.GenericTransactionException) ShoppingCartItem(org.apache.ofbiz.order.shoppingcart.ShoppingCartItem) GenericServiceException(org.apache.ofbiz.service.GenericServiceException) EntityListIterator(org.apache.ofbiz.entity.util.EntityListIterator) EntityExpr(org.apache.ofbiz.entity.condition.EntityExpr)

Example 7 with ShoppingCart

use of org.apache.ofbiz.order.shoppingcart.ShoppingCart in project ofbiz-framework by apache.

the class OrderServices method updateShipGroupShipInfo.

/**
 * This service runs when you update shipping method of Order from order view page.
 */
public static Map<String, Object> updateShipGroupShipInfo(DispatchContext dctx, Map<String, ? extends Object> context) {
    LocalDispatcher dispatcher = dctx.getDispatcher();
    Delegator delegator = dctx.getDelegator();
    Locale locale = (Locale) context.get("locale");
    GenericValue userLogin = (GenericValue) context.get("userLogin");
    String orderId = (String) context.get("orderId");
    String shipGroupSeqId = (String) context.get("shipGroupSeqId");
    String contactMechId = (String) context.get("contactMechId");
    String oldContactMechId = (String) context.get("oldContactMechId");
    String shipmentMethod = (String) context.get("shipmentMethod");
    // load cart from order to update new shipping method or address
    ShoppingCart shoppingCart = null;
    try {
        shoppingCart = loadCartForUpdate(dispatcher, delegator, userLogin, orderId);
    } catch (GeneralException e) {
        Debug.logError(e, module);
    }
    String message = null;
    if (UtilValidate.isNotEmpty(shipGroupSeqId)) {
        OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
        List<GenericValue> shippingMethods = null;
        String shipmentMethodTypeId = null;
        String carrierPartyId = null;
        // get shipment method from OrderItemShipGroup, if not available in parameters
        if (UtilValidate.isNotEmpty(shipmentMethod)) {
            String[] arr = shipmentMethod.split("@");
            shipmentMethodTypeId = arr[0];
            carrierPartyId = arr[1];
        } else {
            GenericValue orderItemshipGroup = orh.getOrderItemShipGroup(shipGroupSeqId);
            shipmentMethodTypeId = orderItemshipGroup.getString("shipmentMethodTypeId");
            carrierPartyId = orderItemshipGroup.getString("carrierPartyId");
        }
        int groupIdx = Integer.parseInt(shipGroupSeqId);
        /* check whether new selected contact address is same as old contact.
               If contact address is different, get applicable ship methods for changed contact */
        if (UtilValidate.isNotEmpty(oldContactMechId) && oldContactMechId.equals(contactMechId)) {
            shoppingCart.setShipmentMethodTypeId(groupIdx - 1, shipmentMethodTypeId);
            shoppingCart.setCarrierPartyId(groupIdx - 1, carrierPartyId);
        } else {
            Map<String, BigDecimal> shippableItemFeatures = orh.getFeatureIdQtyMap(shipGroupSeqId);
            BigDecimal shippableTotal = orh.getShippableTotal(shipGroupSeqId);
            BigDecimal shippableWeight = orh.getShippableWeight(shipGroupSeqId);
            List<BigDecimal> shippableItemSizes = orh.getShippableSizes(shipGroupSeqId);
            GenericValue shippingAddress = orh.getShippingAddress(shipGroupSeqId);
            shippingMethods = ProductStoreWorker.getAvailableStoreShippingMethods(delegator, orh.getProductStoreId(), shippingAddress, shippableItemSizes, shippableItemFeatures, shippableWeight, shippableTotal);
            boolean isShippingMethodAvailable = false;
            // search shipping method for ship group is applicable to new address or not.
            for (GenericValue shippingMethod : shippingMethods) {
                isShippingMethodAvailable = shippingMethod.getString("partyId").equals(carrierPartyId) && shippingMethod.getString("shipmentMethodTypeId").equals(shipmentMethodTypeId);
                if (isShippingMethodAvailable) {
                    shoppingCart.setShipmentMethodTypeId(groupIdx - 1, shipmentMethodTypeId);
                    shoppingCart.setCarrierPartyId(groupIdx - 1, carrierPartyId);
                    break;
                }
            }
            // set first shipping method from list, if shipping method for ship group is not applicable to new ship address.
            if (!isShippingMethodAvailable) {
                shoppingCart.setShipmentMethodTypeId(groupIdx - 1, shippingMethods.get(0).getString("shipmentMethodTypeId"));
                shoppingCart.setCarrierPartyId(groupIdx - 1, shippingMethods.get(0).getString("carrierPartyId"));
                String newShipMethTypeDesc = null;
                String shipMethTypeDesc = null;
                try {
                    shipMethTypeDesc = EntityQuery.use(delegator).from("ShipmentMethodType").where("shipmentMethodTypeId", shipmentMethodTypeId).queryOne().getString("description");
                    newShipMethTypeDesc = EntityQuery.use(delegator).from("ShipmentMethodType").where("shipmentMethodTypeId", shippingMethods.get(0).getString("shipmentMethodTypeId")).queryOne().getString("description");
                } catch (GenericEntityException e) {
                    Debug.logError(e, module);
                }
                // message to notify user for not applicability of shipping method
                message = "Shipping Method " + carrierPartyId + " " + shipMethTypeDesc + " is not applicable to shipping address. " + shippingMethods.get(0).getString("carrierPartyId") + " " + newShipMethTypeDesc + " has been set for shipping address.";
            }
            shoppingCart.setShippingContactMechId(groupIdx - 1, contactMechId);
        }
    }
    // save cart after updating shipping method and shipping address.
    Map<String, Object> changeMap = new HashMap<>();
    try {
        saveUpdatedCartToOrder(dispatcher, delegator, shoppingCart, locale, userLogin, orderId, changeMap, true, false);
    } catch (GeneralException e) {
        Debug.logError(e, module);
    }
    if (UtilValidate.isNotEmpty(message)) {
        return ServiceUtil.returnSuccess(message);
    }
    return ServiceUtil.returnSuccess();
}
Also used : Locale(java.util.Locale) GenericValue(org.apache.ofbiz.entity.GenericValue) LocalDispatcher(org.apache.ofbiz.service.LocalDispatcher) GeneralException(org.apache.ofbiz.base.util.GeneralException) HashMap(java.util.HashMap) BigDecimal(java.math.BigDecimal) Delegator(org.apache.ofbiz.entity.Delegator) ShoppingCart(org.apache.ofbiz.order.shoppingcart.ShoppingCart) GenericEntityException(org.apache.ofbiz.entity.GenericEntityException)

Example 8 with ShoppingCart

use of org.apache.ofbiz.order.shoppingcart.ShoppingCart in project ofbiz-framework by apache.

the class OrderServices method checkCreateDropShipPurchaseOrders.

public static Map<String, Object> checkCreateDropShipPurchaseOrders(DispatchContext ctx, Map<String, ? extends Object> context) {
    Delegator delegator = ctx.getDelegator();
    LocalDispatcher dispatcher = ctx.getDispatcher();
    // TODO (use the "system" user)
    GenericValue userLogin = (GenericValue) context.get("userLogin");
    String orderId = (String) context.get("orderId");
    Locale locale = (Locale) context.get("locale");
    OrderReadHelper orh = new OrderReadHelper(delegator, orderId);
    try {
        // if sales order
        if ("SALES_ORDER".equals(orh.getOrderTypeId())) {
            // get the order's ship groups
            for (GenericValue shipGroup : orh.getOrderItemShipGroups()) {
                if (UtilValidate.isNotEmpty(shipGroup.getString("supplierPartyId"))) {
                    // This ship group is a drop shipment: we create a purchase order for it
                    String supplierPartyId = shipGroup.getString("supplierPartyId");
                    // Set supplier preferred currency for drop-ship (PO) order to support multi currency
                    GenericValue supplierParty = EntityQuery.use(delegator).from("Party").where("partyId", supplierPartyId).queryOne();
                    String currencyUomId = supplierParty.getString("preferredCurrencyUomId");
                    // If supplier currency not found then set currency of sales order
                    if (UtilValidate.isEmpty(currencyUomId)) {
                        currencyUomId = orh.getCurrency();
                    }
                    // create the cart
                    ShoppingCart cart = new ShoppingCart(delegator, orh.getProductStoreId(), null, currencyUomId);
                    cart.setOrderType("PURCHASE_ORDER");
                    // Company
                    cart.setBillToCustomerPartyId(cart.getBillFromVendorPartyId());
                    cart.setBillFromVendorPartyId(supplierPartyId);
                    cart.setOrderPartyId(supplierPartyId);
                    cart.setAgreementId(shipGroup.getString("supplierAgreementId"));
                    // Get the items associated to it and create po
                    List<GenericValue> items = orh.getValidOrderItems(shipGroup.getString("shipGroupSeqId"));
                    if (UtilValidate.isNotEmpty(items)) {
                        for (GenericValue item : items) {
                            try {
                                int itemIndex = cart.addOrIncreaseItem(item.getString("productId"), // amount
                                null, item.getBigDecimal("quantity"), // reserv
                                null, // reserv
                                null, // reserv
                                null, item.getTimestamp("shipBeforeDate"), item.getTimestamp("shipAfterDate"), null, null, null, null, null, null, null, dispatcher);
                                ShoppingCartItem sci = cart.findCartItem(itemIndex);
                                sci.setAssociatedOrderId(orderId);
                                sci.setAssociatedOrderItemSeqId(item.getString("orderItemSeqId"));
                                sci.setOrderItemAssocTypeId("DROP_SHIPMENT");
                            } catch (CartItemModifyException | ItemNotFoundException e) {
                                return ServiceUtil.returnError(UtilProperties.getMessage(resource, "OrderOrderCreatingDropShipmentsError", UtilMisc.toMap("orderId", orderId, "errorString", e.getMessage()), locale));
                            }
                        }
                    }
                    // If there are indeed items to drop ship, then create the purchase order
                    if (UtilValidate.isNotEmpty(cart.items())) {
                        // resolve supplier promotion
                        ProductPromoWorker.doPromotions(cart, dispatcher);
                        // set checkout options
                        cart.setDefaultCheckoutOptions(dispatcher);
                        // the shipping address is the one of the customer
                        cart.setAllShippingContactMechId(shipGroup.getString("contactMechId"));
                        // associate ship groups of sales and purchase orders
                        ShoppingCart.CartShipInfo cartShipInfo = cart.getShipGroups().get(0);
                        cartShipInfo.setAssociatedShipGroupSeqId(shipGroup.getString("shipGroupSeqId"));
                        // create the order
                        CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart);
                        coh.createOrder(userLogin);
                    } else {
                        // if there are no items to drop ship, then clear out the supplier partyId
                        Debug.logWarning("No drop ship items found for order [" + shipGroup.getString("orderId") + "] and ship group [" + shipGroup.getString("shipGroupSeqId") + "] and supplier party [" + shipGroup.getString("supplierPartyId") + "].  Supplier party information will be cleared for this ship group", module);
                        shipGroup.set("supplierPartyId", null);
                        shipGroup.store();
                    }
                }
            }
        }
    } catch (GenericEntityException exc) {
        // TODO: imporve error handling
        return ServiceUtil.returnError(UtilProperties.getMessage(resource, "OrderOrderCreatingDropShipmentsError", UtilMisc.toMap("orderId", orderId, "errorString", exc.getMessage()), locale));
    }
    return ServiceUtil.returnSuccess();
}
Also used : Locale(java.util.Locale) GenericValue(org.apache.ofbiz.entity.GenericValue) LocalDispatcher(org.apache.ofbiz.service.LocalDispatcher) CheckOutHelper(org.apache.ofbiz.order.shoppingcart.CheckOutHelper) Delegator(org.apache.ofbiz.entity.Delegator) ShoppingCart(org.apache.ofbiz.order.shoppingcart.ShoppingCart) CartItemModifyException(org.apache.ofbiz.order.shoppingcart.CartItemModifyException) GenericEntityException(org.apache.ofbiz.entity.GenericEntityException) ShoppingCartItem(org.apache.ofbiz.order.shoppingcart.ShoppingCartItem) ItemNotFoundException(org.apache.ofbiz.order.shoppingcart.ItemNotFoundException)

Example 9 with ShoppingCart

use of org.apache.ofbiz.order.shoppingcart.ShoppingCart in project ofbiz-framework by apache.

the class OrderServices method saveUpdatedCartToOrder.

public static Map<String, Object> saveUpdatedCartToOrder(DispatchContext dctx, Map<String, ? extends Object> context) {
    LocalDispatcher dispatcher = dctx.getDispatcher();
    Delegator delegator = dctx.getDelegator();
    String orderId = (String) context.get("orderId");
    GenericValue userLogin = (GenericValue) context.get("userLogin");
    ShoppingCart cart = (ShoppingCart) context.get("shoppingCart");
    Map<String, Object> changeMap = UtilGenerics.checkMap(context.get("changeMap"));
    Locale locale = (Locale) context.get("locale");
    Boolean deleteItems = (Boolean) context.get("deleteItems");
    Boolean calcTax = (Boolean) context.get("calcTax");
    if (calcTax == null) {
        calcTax = Boolean.TRUE;
    }
    Map<String, Object> result = null;
    try {
        saveUpdatedCartToOrder(dispatcher, delegator, cart, locale, userLogin, orderId, changeMap, calcTax, deleteItems);
        result = ServiceUtil.returnSuccess();
    } catch (GeneralException e) {
        Debug.logError(e, module);
        result = ServiceUtil.returnError(e.getMessage());
    }
    result.put("orderId", orderId);
    return result;
}
Also used : Locale(java.util.Locale) GenericValue(org.apache.ofbiz.entity.GenericValue) LocalDispatcher(org.apache.ofbiz.service.LocalDispatcher) GeneralException(org.apache.ofbiz.base.util.GeneralException) Delegator(org.apache.ofbiz.entity.Delegator) ShoppingCart(org.apache.ofbiz.order.shoppingcart.ShoppingCart)

Example 10 with ShoppingCart

use of org.apache.ofbiz.order.shoppingcart.ShoppingCart in project ofbiz-framework by apache.

the class ProductStoreCartAwareEvents method setSessionProductStore.

public static void setSessionProductStore(String productStoreId, HttpServletRequest request) {
    if (productStoreId == null) {
        return;
    }
    HttpSession session = request.getSession();
    String oldProductStoreId = (String) session.getAttribute("productStoreId");
    if (productStoreId.equals(oldProductStoreId)) {
        // great, nothing to do, bye bye
        return;
    }
    Delegator delegator = (Delegator) request.getAttribute("delegator");
    // get the ProductStore record, make sure it's valid
    GenericValue productStore = ProductStoreWorker.getProductStore(productStoreId, delegator);
    if (productStore == null) {
        throw new IllegalArgumentException("Cannot set session ProductStore, passed productStoreId [" + productStoreId + "] is not valid/not found.");
    }
    // make sure ProductStore change is allowed for the WebSite
    GenericValue webSite = WebSiteWorker.getWebSite(request);
    if (webSite == null) {
        throw new IllegalArgumentException("Cannot set session ProductStore, could not find WebSite record based on web.xml setting.");
    }
    String allowProductStoreChange = webSite.getString("allowProductStoreChange");
    if (!"Y".equals(allowProductStoreChange)) {
        throw new IllegalArgumentException("Cannot set session ProductStore, changing ProductStore not allowed for WebSite [" + webSite.getString("webSite") + "].");
    }
    // set the productStoreId in the session (we know is different by this point)
    session.setAttribute("productStoreId", productStoreId);
    // have set the new store, now need to clear out the current catalog so the default for the new store will be used
    session.removeAttribute("CURRENT_CATALOG_ID");
    // if there is no locale, timezone, or currencyUom in the session, set the defaults from the store, but don't do so through the CommonEvents methods setSessionLocale and setSessionCurrencyUom because we don't want these to be put on the UserLogin entity
    // note that this is different from the normal default setting process because these will now override the settings on the UserLogin; this is desired when changing stores and the user should be given a chance to change their personal settings after the store change
    UtilHttp.setCurrencyUomIfNone(session, productStore.getString("defaultCurrencyUomId"));
    UtilHttp.setLocaleIfNone(session, productStore.getString("defaultLocaleString"));
    UtilHttp.setTimeZoneIfNone(session, productStore.getString("defaultTimeZoneString"));
    // if a shoppingCart exists in the session and the productStoreId on it is different,
    // - leave the old cart as-is (don't clear it, want to leave the auto-save list intact)
    // - but create a new cart (which will load from auto-save list if applicable) and put it in the session
    ShoppingCart cart = ShoppingCartEvents.getCartObject(request);
    // this should always be different given the previous session productStoreId check, but just in case...
    if (!productStoreId.equals(cart.getProductStoreId())) {
        // this is a really simple operation now that we have prepared all of the data, as done above in this method
        cart = new WebShoppingCart(request);
        session.setAttribute("shoppingCart", cart);
    }
}
Also used : GenericValue(org.apache.ofbiz.entity.GenericValue) Delegator(org.apache.ofbiz.entity.Delegator) ShoppingCart(org.apache.ofbiz.order.shoppingcart.ShoppingCart) WebShoppingCart(org.apache.ofbiz.order.shoppingcart.WebShoppingCart) HttpSession(javax.servlet.http.HttpSession) WebShoppingCart(org.apache.ofbiz.order.shoppingcart.WebShoppingCart)

Aggregations

ShoppingCart (org.apache.ofbiz.order.shoppingcart.ShoppingCart)37 Delegator (org.apache.ofbiz.entity.Delegator)28 GenericValue (org.apache.ofbiz.entity.GenericValue)28 LocalDispatcher (org.apache.ofbiz.service.LocalDispatcher)23 GenericEntityException (org.apache.ofbiz.entity.GenericEntityException)18 Locale (java.util.Locale)17 GeneralException (org.apache.ofbiz.base.util.GeneralException)14 GenericServiceException (org.apache.ofbiz.service.GenericServiceException)13 BigDecimal (java.math.BigDecimal)9 CartItemModifyException (org.apache.ofbiz.order.shoppingcart.CartItemModifyException)9 HashMap (java.util.HashMap)8 CheckOutHelper (org.apache.ofbiz.order.shoppingcart.CheckOutHelper)8 ShoppingCartItem (org.apache.ofbiz.order.shoppingcart.ShoppingCartItem)7 Timestamp (java.sql.Timestamp)6 LinkedList (java.util.LinkedList)5 ItemNotFoundException (org.apache.ofbiz.order.shoppingcart.ItemNotFoundException)5 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 GenericTransactionException (org.apache.ofbiz.entity.transaction.GenericTransactionException)4 NVPEncoder (com.paypal.sdk.core.nvp.NVPEncoder)3 PayPalException (com.paypal.sdk.exceptions.PayPalException)3