Class DefaultCartOperationService
- java.lang.Object
- 
- com.broadleafcommerce.cartoperation.service.DefaultCartOperationService
 
- 
- All Implemented Interfaces:
- CartOperationService
 
 public class DefaultCartOperationService extends Object implements CartOperationService - Author:
- Chad Harchar (charchar)
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDefaultCartOperationService.BulkCartItemCreationResponse
 - 
Field SummaryFields Modifier and Type Field Description protected static StringCOD_DESELECTEDprotected static StringIS_FEE_REFUNDABLEprotected static SecureRandomSECURE_RANDOM
 - 
Constructor SummaryConstructors Constructor Description DefaultCartOperationService(CartOperationServiceProviders providers, CartPricingService cartPricingService, CartItemConfigurationService<? extends CatalogItem> cartItemConfigurationService, CartItemCatalogInformationService<? extends CatalogItem> cartItemCatalogInformationService, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, CartOperationServiceProperties properties, CartItemMergingService<com.broadleafcommerce.cart.client.domain.CartItem> cartItemMergingService, org.springframework.context.MessageSource messageSource, TaxService taxService, StaleCartPricingResultHolder staleCartPricingResultHolder)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.broadleafcommerce.cart.client.domain.CartaddAttributeToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull AddAttributeRequest addAttributeRequest, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Adds an attribute to the providedCart.protected booleanaddCampaignCodeIfExistsOnCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String code, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Deprecated.Deprecated as of 1.8, if using OfferService 2.0, this method is not usedprotected booleanaddCampaignForCodeIfExists(String code, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Deprecated.Deprecated as of 1.8, if using OfferService 2.0, this method is not usedAddCodeToCartResponseaddCodeToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull AddCodeRequest codeRequest, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the cart Determine if the code is valid as a campaign tracking code If so, add it to the cart as aCampaignRefDetermine if the code is valid as a shared code If so, add it to the cart Update the cart Price the cart, using offers and price lists (optional) Update the cart and its items (optional)protected voidaddFreeGiftItemsToCart(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> freeGiftItemsToAdd, List<com.broadleafcommerce.cart.client.domain.CartItem> updatedCartItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Adds the list ofFreeGiftItemsto cart, and then adds the ids of those added free gift cart items to the qualifier cart items attributes.protected voidaddItemsToFulfillmentGroup(@NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.CartItem> cartItems, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull javax.money.CurrencyUnit expectedCurrency, com.broadleafcommerce.cart.client.domain.CartItem parentCartItem)com.broadleafcommerce.cart.client.domain.CartaddItemToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull AddItemRequest addItemRequest, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Adds a single item to the providedCartbased on the providedAddItemRequest.protected voidaddItemToFulfillmentGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, Set<String> assignedCartItemIds, com.broadleafcommerce.cart.client.domain.CartItem parentCartItem)Assigns the cart item and its dependent cart items to the fulfillment group.BulkAddToCartResponseaddManyItemsToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull Collection<AddItemRequest> addItemRequests, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Adds one or more items to the providedCart.protected booleanaddOfferCodeIfUsable(String code, boolean isForCampaign, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Adds thecodetoCart.getOfferCodes()if it's usable.AddCodeToCartResponseaddOfferCodeToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull AddCodeRequest addOfferCodeRequest, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Adds an offer code to the providedCart.protected voidaddRemovedFreeGiftOfferToIgnoreList(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)Adds the offer id toCart'signore list inCart.getInternalAttributes()whenever a free gift item is removed, so that the free gift item will not be added again.com.broadleafcommerce.cart.client.domain.CartaddToCart(@NonNull AddItemRequest addItemRequest, com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Add an item to the customer's current cart based on the provided untrusted information.protected com.broadleafcommerce.cart.client.domain.CartaddUnassignedItemsToFulfillmentGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)IdentifyCartItemsthat have not been assigned to aFulfillmentGroup& add them to the relevant FulfillmentGroup.protected PaymentSummaryallocateCartTotalToPayment(@NonNull PaymentSummary paymentSummary, @NonNull javax.money.MonetaryAmount cartTotal, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to automatically reallocate the cart total to the cart's single payment.protected PaymentSummaryallocateCartTotalToPayment(@NonNull PaymentSummary paymentSummary, @NonNull javax.money.MonetaryAmount cartTotal, String lockToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to automatically reallocate the cart total to the cart's single payment.protected AddCodeToCartResponsebuildAddCodeToCartResponse(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String code, boolean cartWasRepriced)Builds anAddCodeToCartResponsebased on the provided cart, code, & whether or not the cart was repricedprotected AddItemRequestbuildAddItemRequest(com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGiftItem)Builds anAddItemRequestfrom the givenFreeGiftItem.protected com.broadleafcommerce.order.common.domain.AdjustmentbuildAdjustment(com.broadleafcommerce.promotion.offer.client.web.context.info.Adjustment offerAdjustment)Builds anAdjustmentbased on the givenAdjustment.protected com.broadleafcommerce.order.common.domain.CampaignRefbuildCampaignRef(String code, String trackingId)Deprecated.Deprecated as of 1.8, if using OfferService 2.0, this method is not usedprotected com.broadleafcommerce.cart.client.domain.CartActionAuditbuildCartActionAuditForAccountCartUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String actionType, String userType)Builds aCartActionAuditfor cart modification if the givenCartwas modified by an account member.protected com.broadleafcommerce.cart.client.domain.CartActionAuditbuildCartActionAuditForApproverCartUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)Builds aCartActionAuditfor cart modification if the givenCartwas modified by an account approver.protected com.broadleafcommerce.cart.client.domain.CartItembuildCartItem(@NonNull AddItemRequest addItemRequest, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, javax.money.CurrencyUnit currencyUnit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Populates a new cart item from theAddItemRequest.protected DefaultCartOperationService.BulkCartItemCreationResponsebuildCartItems(@NonNull Collection<AddItemRequest> addItemRequests, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, javax.money.CurrencyUnit currencyUnit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Populates new cart items from theAddItemRequests.protected CatalogItemRequestbuildCatalogItemRequest(@NonNull AddItemRequest addItemRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to create theCatalogItemRequestand populate any additional attributes that should be passed to theCatalogProviderwhen fetching the catalog representation for adding the cart item.protected CatalogItemRequestbuildCatalogItemRequest(@NonNull UpdateItemRequest updateItemRequest, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to build theCatalogItemRequestand populate any additional attributes that should be passed to theCatalogProviderwhen fetching the catalog representation for updating the cart item.protected Collection<CatalogItemRequest>buildCatalogItemRequestsForAdd(@NonNull Collection<AddItemRequest> addItemRequests, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected Collection<CatalogItemRequest>buildCatalogItemRequestsForUpdate(@NonNull Collection<UpdateItemRequest> updateItemRequests, @NonNull Collection<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected com.broadleafcommerce.cart.client.domain.CartItembuildCODFeeCartItem(CheckoutPaymentMethodOption.FeeDto fee)protected StringbuildGroupReferenceNumber(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)Builds aFulfillmentGroup.getReferenceNumber()for a new group.protected StringbuildGroupReferenceNumber(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId)Builds aFulfillmentGroup.getReferenceNumber()for the given cart and group ID.protected Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue>buildItemAttributeChoices(@NonNull Map<String,String> requestItemAttributeChoices)protected com.broadleafcommerce.order.common.domain.OfferItemDetailbuildOfferItemDetails(com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail offerItemDetail)Builds anOfferItemDetailfrom the givenOfferItemDetail.protected UpdateCartRequestbuildUpdateCartRequestWithCartActionAudit(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)Builds anUpdateCartRequestwith aCartActionAuditif the given accountCartwas modified by an account approver.protected AddItemFailurebuildValidationFailure(@NonNull AddItemRequest addItemRequest, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)Builds anAddItemFailurebased on the providedAddItemRequest&CartItemrepresenting an invalid add to cart requestBulkAddToCartResponsebulkAddToCart(@NonNull Collection<AddItemRequest> addItemRequests, com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Add a list of items to the customer's current cart based on the provided untrusted information.protected javax.money.MonetaryAmountcalculateMerchandiseTotalAmountForFulfillmentItemUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.CartItem fulfillmentCartItem, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, int totalQuantity)Calculates theFulfillmentItem.getMerchandiseTotalAmount()for the cart item.protected booleancatalogItemRequestAlreadyExist(@NonNull Set<CatalogItemRequest> catalogItemRequests, @NonNull AddItemRequest addItemRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to prevent duplicateCatalogItemRequestsfrom being built based on theAddItemRequest.protected booleancatalogItemRequestAlreadyExist(@NonNull Set<CatalogItemRequest> catalogItemRequests, @NonNull UpdateItemRequest updateItemRequest, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to prevent duplicateCatalogItemRequestsfrom being built based on theCartItemandUpdateItemRequest.com.broadleafcommerce.cart.client.domain.CartcreateCart(@NonNull CartCreationRequest cartCreationRequest, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected com.broadleafcommerce.cart.client.domain.CartAlertcreateCartAlert(String message)protected com.broadleafcommerce.cart.client.domain.CartItemcreateCartItem(@NonNull AddItemRequest addItemRequest, javax.money.CurrencyUnit currencyUnit)Creates aCartItembased on the providedAddItemRequestprotected com.broadleafcommerce.cart.client.domain.CartcreateEmptyCart(com.broadleafcommerce.order.common.domain.CustomerRef customer, javax.money.CurrencyUnit currencyUnit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Creates and returns an empty, unsavedCartwith typical defaults.protected voidcreateFulfillmentGroupForItems(@NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.CartItem> cartItems, @NonNull String fulfillmentType, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem parentCartItem)protected com.broadleafcommerce.cart.client.domain.CartcreateItemAndAddToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull AddItemRequest addItemRequest, javax.money.CurrencyUnit currencyUnit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Creates a new item and adds it to the providedCart.protected BulkAddToCartResponsecreateItemsAndAddToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<AddItemRequest> addItemRequests, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Creates new items and adds them to the providedCart.protected voiddefaultCartCurrency(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, javax.money.CurrencyUnit currencyUnit)protected voiddefaultCartLocale(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected booleandoesCartContainCampaignForCode(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String code)Deprecated.protected booleandoFulfillmentExclusionsPassForCOD(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)protected booleandoFulfillmentInclusionsPassForCOD(@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)protected voiddoSoftInventoryReservationIfNecessary(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)If any of the supplied cart items have a reservation strategy of ADD_TO_CART, a soft reservation is performed.protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtilsgetAuthenticationUtils()protected CartItemCatalogInformationService<? extends CatalogItem>getCartItemCatalogInformationService()protected CartItemConfigurationService<? extends CatalogItem>getCartItemConfigurationService()protected Map<String,com.broadleafcommerce.cart.client.domain.CartItem>getCartItemIdsWithDependentItem(List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)protected CartItemMergingService<com.broadleafcommerce.cart.client.domain.CartItem>getCartItemMergingService()protected CartPricingServicegetCartPricingService()protected StringgetCartTotalChangeMessage(javax.money.MonetaryAmount latestCartPrice)protected StringgetCatalogItemKeyForMissingEntities(AddItemRequest addItemRequest)Hook point to determine what the missing entities map is keyed on from theAddItemRequest.protected CheckoutPaymentMethodServicegetCheckoutPaymentMethodService()protected CheckoutPaymentMethodOptiongetCODCheckoutPaymentMethodOption(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected javax.money.CurrencyUnitgetCurrencyUnit(PriceCartRequest priceCartRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Call utility method to determine currency.protected Supplier<com.broadleafcommerce.cart.client.domain.FulfillmentGroup>getFulfillmentGroupById(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId)Gets the fulfillment group by the provided ID.protected InventoryAvailabilityService<CatalogItem>getInventoryAvailabilityService()protected StringgetMessage(@NonNull String errorMessage, Object... args)protected org.springframework.context.MessageSourcegetMessageSource()protected CartOperationServiceOfferUtilsgetOfferUtils()protected PaymentProvider<PaymentSummary>getPaymentProvider()protected ObjectgetProductType(com.broadleafcommerce.cart.client.domain.CartItem cartItem)protected CartOperationServicePropertiesgetProperties()protected CartOperationServiceProvidersgetProviders()protected List<com.broadleafcommerce.order.common.domain.Adjustment>getRelatedAdjustments(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String code)protected com.broadleafcommerce.cart.client.domain.CartItemgetRequiredCartItem(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String cartItemId)Gets a cart item from the cart by its ID.protected com.broadleafcommerce.rulesengine.expression.service.SpelRuleEvaluationServicegetSpelRuleEvaluationService()protected StaleCartItemsServicegetStaleCartItemsService()protected StaleCartPricingResultHoldergetStaleCartPricingResultHolder()protected TaxServicegetTaxService()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()protected booleanhandleCODStatusChange(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)Handles when Collect on Delivery is selected or de-selected.protected booleanhandleDeSelectCODBeforeUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Handles when Collect on Delivery is selected or de-selected.protected booleanhandleSelectCODBeforeUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Handles when Collect on Delivery is selected.protected voidhandleSetDeselectedCODAttribute(@NonNull UpdateFulfillmentGroupRequest updateFulfillmentGroupRequest, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fgToUpdate)Sets a temporary attribute on the fullfillment group if theCOD status attributehas gone from selected to not selected.protected booleanhasDeselectedCOD(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)protected List<AddItemRequest>identifyAddItemRequestsForCatalogItems(@NonNull Collection<AddItemRequest> addItemRequests, @NonNull CatalogItemList<? extends CatalogItem> catalogItemList)protected Optional<? extends CatalogItem>identifyCatalogItemForCartItem(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull CatalogItemList<? extends CatalogItem> catalogItemList)protected CatalogItemList<? extends CatalogItem>identifyCatalogItemsForAddItemRequests(@NonNull Collection<AddItemRequest> addItemRequests, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected CatalogItemList<? extends CatalogItem>identifyCatalogItemsForUpdateItemRequest(@NonNull UpdateItemRequest updateItemRequest, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidinsertItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> itemsToAdd, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidinvalidateFulfillmentGroupOverride(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)protected booleanisCartItemCODFee(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)protected booleanisCartMaxTotalAllowedForCOD(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)protected booleanisCartMinTotalAllowedForCOD(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)protected booleanisItemElegibleForRemoval(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)Hook point to prevent removal of cart items that should not be removed through the cart management endpoints.protected booleanisPaymentReallocationRequired(javax.money.MonetaryAmount previousCartTotal, javax.money.MonetaryAmount newCartTotal)protected booleanisUsingCollectOnDelivery(com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)protected BulkAddToCartResponsenewBulkAddToCartResponse()Instantiates a newBulkAddToCartResponseusing theTypeFactory.protected com.broadleafcommerce.cart.client.domain.CartnewCart()Uses theTypeFactoryto create a newCartobject.protected CartCreationRequestnewCartCreationRequest()protected com.broadleafcommerce.cart.client.domain.CartPricingnewCartPricing()Uses theTypeFactoryto create a newCartPricingobject.protected StringnewCartStatus(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Determines what status should be used when creating new carts.protected booleanpopulateCartItemUpdates(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull UpdateItemRequest request)Takes the changes from theUpdateItemRequestand populates them onto theCartItem.protected booleanpopulateCartUpdatesFromUpdateItemRequest(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull UpdateItemRequest request)Takes the changes from theUpdateItemRequestand populates them onto theCart.protected com.broadleafcommerce.cart.client.domain.CartItempopulateFromRequest(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull AddItemRequest addItemRequest, javax.money.CurrencyUnit currencyUnit)Populates the cart item fields based on the request.com.broadleafcommerce.cart.client.domain.CartpriceCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, boolean saveCart, Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Prices cart, processes free gift offers, and saves cart with the providedPriceCartRequestifsaveCartis true.com.broadleafcommerce.cart.client.domain.CartpriceCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, PriceCartRequest priceCartRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Prices and saves the cart with the providedPriceCartRequest.com.broadleafcommerce.cart.client.domain.CartpriceCartWithCatalogPriceUpdates(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Reprice the cart, including applying the latest catalog-based prices for each of its itemsprotected List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem>processExistingFreeGiftItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> updatedCartItems, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Updates existing free gift items quantities and remove existing free gift items if necessary, and then return a list ofFreeGiftItemsto add to cart.protected voidprocessFreeGiftItemsForRemoval(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)Processes free gift items wheneverCartItemsare being removed.protected voidprocessFreeGiftOffers(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Processes all free gift offers stored inCart.getInternalAttributes().protected voidreallocateCartTotalAmongstPayments(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull javax.money.MonetaryAmount newCartTotal, @NonNull Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)List<PaymentSummary>reallocateCartTotalAmongstPayments(@NonNull javax.money.MonetaryAmount newCartTotal, @NonNull List<PaymentSummary> paymentSummaries, @NonNull Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Reallocate the cart total among the cart's paymentsprotected List<PaymentSummary>reallocateCartTotalMultiplePayments(@NonNull javax.money.MonetaryAmount cartTotal, @NonNull List<PaymentSummary> paymentSummaries, Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to automatically reallocate the cart total amongst the cart's payments.com.broadleafcommerce.cart.client.domain.CartrecalculateTaxesForCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, boolean actual, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Recalculates the taxes for the providedCart.protected voidremoveAssociatedFreeGiftItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)Removes the associated free gift item if the offer qualifier item is removed.com.broadleafcommerce.cart.client.domain.CartremoveAttributeFromCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String key, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes an attribute to the providedCart.com.broadleafcommerce.cart.client.domain.CartremoveCartItems(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<String> cartItemIds, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Remove items from the cart.protected voidremoveExistingFreeGiftItemsFromCart(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> existingFreeGiftItemsToRemove, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Remove existing free giftCartItemsfrom cart.protected com.broadleafcommerce.cart.client.domain.CartremoveFulfillmentItemsWithoutCartItems(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)com.broadleafcommerce.cart.client.domain.CartremoveItemFromCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String cartItemId, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes a single item from the providedCartmatching the provided cart item ID.protected voidremoveItemsFromFulfillmentGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)com.broadleafcommerce.cart.client.domain.CartremoveManyItemsFromCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<String> cartItemIds, boolean price, boolean updateCart, Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes one or more items from the providedCartmatching the provided cart item IDs.com.broadleafcommerce.cart.client.domain.CartremoveOfferAndCampaignCodesFromCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, List<String> codes, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes the provided offer and campaign codes from the cart and then updates the cart.com.broadleafcommerce.cart.client.domain.CartremoveOfferCodeFromCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String offerCode, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Removes an offer code from the providedCart, if it exists.protected com.broadleafcommerce.cart.client.domain.CartremoveStaleCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected Optional<com.broadleafcommerce.cart.client.domain.Cart>repriceCartIfPricingIsStale(Optional<com.broadleafcommerce.cart.client.domain.Cart> optionalCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Called during cart resolution to check if the catalog prices on the cart are stale, and if so, updates those prices and resets the time since they were last changed.protected voidresetFulfillmentGroupReferenceNumbers(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)protected StringresolveDefaultFulfillmentType(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)Determines the defaultFulfillmentTypefor the providedCartItemprotected StringresolveTaxAddressSource(String fulfillmentType)Determines the tax address source that should be used forFulfillmentGroup.getTaxAddressSource()for the given fulfillment type.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCartByCartId(@NonNull String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the cart for the provided id.protected Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCartByCartIdWithStatus(@NonNull String cartId, com.broadleafcommerce.cart.client.domain.enums.CartStatus status, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCartByStatus(String customerId, String accountId, String status, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieves a customer or account cart with the provided customer ID, account ID, and status, if it exists.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCartByStatusAndName(String customerId, String status, String name, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieves a customer or account cart with the provided customer ID, account ID, and status, if it exists.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCsrCartByCartId(@NonNull String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the cart for the provided id, as long as it is CSR-owned.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveCsrOwnedCartByCustomerIdAndApplicationId(@NonNull String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the CSR-owned cart for the provided customer.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveImplicitCart(String customerId, String accountId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Resolves the implicit cart for the given customer id and account id.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveInProcessCartByCartId(@NonNull String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the cart for the provided id, as long as it is in-process.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveInProcessCartByCustomerIdAndApplicationId(@NonNull String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the in-process cart for the provided customer.org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart>retrieveMyCarts(@NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)Retrieves all of a customer's carts that have not been locked, archived, or submitted.Optional<com.broadleafcommerce.cart.client.domain.Cart>retrieveTestCartByCartId(@NonNull String cartId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Retrieve the cart for the provided id, as long as it is a test cart.protected com.broadleafcommerce.cart.client.domain.CartsaveCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Helper method to encapsulate saving an existing Cart.protected com.broadleafcommerce.cart.client.domain.CartsaveCart(@NonNull UpdateCartRequest updateCartRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Helper method to encapsulate saving an existing Cart.voidsetCheckoutPaymentMethodService(CheckoutPaymentMethodService checkoutPaymentMethodService)voidsetInventoryAvailabilityService(InventoryAvailabilityService<CatalogItem> inventoryAvailabilityService)voidsetOfferUtils(CartOperationServiceOfferUtils offerUtils)voidsetPaymentProvider(PaymentProvider<PaymentSummary> paymentProvider)voidsetSpelRuleEvaluationService(com.broadleafcommerce.rulesengine.expression.service.SpelRuleEvaluationService spelRuleEvaluationService)voidsetStaleCartItemsService(StaleCartItemsService staleCartItemsService)com.broadleafcommerce.cart.client.domain.CartupdateAsNamedCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String name, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Updates the providedCartwith the given name.com.broadleafcommerce.cart.client.domain.CartupdateCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean allowPriceCart, boolean wasCartModified, boolean invalidatePrices, Map<String,String> paymentLockTokens, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Updates the providedCartbased on the provided flags.protected com.broadleafcommerce.cart.client.domain.CartupdateCartAttributes(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull List<AddItemRequest> successfulAddItemRequests)Update cart attributes based on the successfulAddItemRequestscom.broadleafcommerce.cart.client.domain.CartupdateCartContactInfo(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull ContactInfoRequest contactInfoRequest, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Update contact information to allow business users to contact the customer if needed.com.broadleafcommerce.cart.client.domain.CartupdateCartItem(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull UpdateItemRequest updateItemRequest, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Update the cart item.com.broadleafcommerce.cart.client.domain.CartupdateCartStatus(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull UpdateCartStatusRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Updates thecart's status.com.broadleafcommerce.cart.client.domain.CartupdateContactInfoInCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull ContactInfoRequest contactInfoRequest, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Updates the contact info for the providedCart.protected voidupdateExistingFreeGiftItem(com.broadleafcommerce.cart.client.domain.CartItem existingFreeGiftItem, com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGift, List<com.broadleafcommerce.cart.client.domain.CartItem> updatedCartItems)Updates existing free giftCartItemwith the latest details from the givenFreeGiftItemand update itsAdjustment.com.broadleafcommerce.cart.client.domain.CartupdateFulfillmentGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId, @NonNull UpdateFulfillmentGroupRequest fulfillmentGroupRequest, boolean allowPriceCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Update the fulfillment group.com.broadleafcommerce.cart.client.domain.CartupdateFulfillmentGroupInCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull String referenceNumber, @NonNull UpdateFulfillmentGroupRequest updateFulfillmentGroupRequest, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Updates an existingFulfillmentGroupfor the providedCart.protected voidupdateFulfillmentItem(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)Updates theFulfillmentItemcorresponding to theCartItem, keeping them in sync.com.broadleafcommerce.cart.client.domain.CartupdateItemInCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull UpdateItemRequest updateItemRequest, boolean price, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Updates a single item in the providedCartbased on the providedUpdateItemRequest.protected voidupdatesForBundleFulfillmentItems(com.broadleafcommerce.cart.client.domain.CartItem parentCartItem, com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem)protected voidvalidateCartItem(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull CatalogItemList<? extends CatalogItem> catalogItemList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Validates that theCartItemincludes enough information to correctly represent the product or one of the product's variants.protected voidvalidateCartItemAfterUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull CatalogItemList<? extends CatalogItem> catalogItemList, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidvalidateCartItemBeforeUpdate(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull UpdateItemRequest updateItemRequest)Validates theCartItembeing updated againstUpdateItemRequestbefore the actual cart item update.protected voidvalidateCartStatusChangeRequest(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull UpdateCartStatusRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Takes aUpdateCartStatusRequestand validates that the targeted cart can have its status changed.protected voidvalidateCollectOnDeliverySelection(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Validates that Collect on Delivery is still applicable given the updated cart state.protected voidvalidateCollectOnDeliverySelection(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)protected voidvalidateFreeGiftItemForUpdate(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull UpdateItemRequest updateItemRequest)If the givenCartItemis a free gift item, validates that its quantity is not being changed.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.broadleafcommerce.cartoperation.service.CartOperationServicepriceCart, priceCart, priceCart, priceCart, removeManyItemsFromCart, removeManyItemsFromCart, retrieveCustomerCartByStatus, updateCart
 
- 
 
- 
- 
- 
Field Detail- 
IS_FEE_REFUNDABLEprotected static final String IS_FEE_REFUNDABLE - See Also:
- Constant Field Values
 
 - 
COD_DESELECTEDprotected static final String COD_DESELECTED - See Also:
- Constant Field Values
 
 - 
SECURE_RANDOMprotected static final SecureRandom SECURE_RANDOM 
 
- 
 - 
Constructor Detail- 
DefaultCartOperationServicepublic DefaultCartOperationService(CartOperationServiceProviders providers, CartPricingService cartPricingService, CartItemConfigurationService<? extends CatalogItem> cartItemConfigurationService, CartItemCatalogInformationService<? extends CatalogItem> cartItemCatalogInformationService, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, CartOperationServiceProperties properties, CartItemMergingService<com.broadleafcommerce.cart.client.domain.CartItem> cartItemMergingService, org.springframework.context.MessageSource messageSource, TaxService taxService, StaleCartPricingResultHolder staleCartPricingResultHolder) 
 
- 
 - 
Method Detail- 
retrieveMyCartspublic org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart> retrieveMyCarts(@NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)Description copied from interface:CartOperationServiceRetrieves all of a customer's carts that have not been locked, archived, or submitted.- Specified by:
- retrieveMyCartsin interface- CartOperationService
- Parameters:
- customer- The customer who owns the carts
- filters- Additional RSQL filters
- page- Pagination params
- context- Additional sandbox and multitenant info
- Returns:
- All of a customer's carts that have not been locked, archived, or submitted.
 
 - 
retrieveCartByCartIdpublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieve the cart for the provided id.- Specified by:
- retrieveCartByCartIdin interface- CartOperationService
- Parameters:
- cartId- The id of the cart on which to perform the operation.
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The cart for the provided id.
 
 - 
retrieveCartByStatuspublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartByStatus(String customerId, @Nullable String accountId, String status, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieves a customer or account cart with the provided customer ID, account ID, and status, if it exists. Customer cart will automatically be retrieved if the givenaccountIdis null.- Specified by:
- retrieveCartByStatusin interface- CartOperationService
- Parameters:
- customerId- the customer ID
- accountId- the id of the account that the- Cartbelong to, null can be passed in to retrieve customer- Cart
- status- the status
- contextInfo- the context info
- Returns:
- the cart, if it exists
 
 - 
retrieveCartByStatusAndNamepublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartByStatusAndName(String customerId, String status, @Nullable String name, @Nullable String accountId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieves a customer or account cart with the provided customer ID, account ID, and status, if it exists. Customer cart will automatically be retrieved if the givenaccountIdis null.- Specified by:
- retrieveCartByStatusAndNamein interface- CartOperationService
- Parameters:
- customerId- the customer ID
- status- the status
- name- the name of the cart or null for a cart with no name
- accountId- the id of the account that the- Cartbelong to, null can be passed in to retrieve customer- Cart
- contextInfo- the context info
- Returns:
- the cart, if it exists
 
 - 
retrieveImplicitCartpublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveImplicitCart(String customerId, @Nullable String accountId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceResolves the implicit cart for the given customer id and account id.Out of the box, a default/implicit cart means an DefaultCartStatuses.IN_PROCESSwithnullname, and there should only be one default/implicit cart per user.- Specified by:
- retrieveImplicitCartin interface- CartOperationService
- Parameters:
- customerId- the customer ID
- accountId- the id of the account that the- Cartbelong to, null can be passed in to retrieve customer- Cart
- contextInfo- the context info
- Returns:
- the registered customer's implicit cart
 
 - 
createCartpublic com.broadleafcommerce.cart.client.domain.Cart createCart(@NonNull @NonNull CartCreationRequest cartCreationRequest, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceCreates a new, in-progressCartfor the providedCartCreationRequestandCustomerRef. TheCartCreationRequestmust containFor guest customers, this will create a new guest cart - Specified by:
- createCartin interface- CartOperationService
- Parameters:
- cartCreationRequest- the cart creation request
- customer- the customer
- contextInfo- the context info
- Returns:
- the newly created cart
 
 - 
processFreeGiftOffersprotected void processFreeGiftOffers(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Processes all free gift offers stored inCart.getInternalAttributes(). This will automatically add free gift cart items to cart, update existing free gift items, and remove existing free gift items, if necessary.- Parameters:
- cart- the- Cartto process the free gift offers for
- contextInfo- the contextInfo for the request
 
 - 
processExistingFreeGiftItemsprotected List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> processExistingFreeGiftItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> updatedCartItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Updates existing free gift items quantities and remove existing free gift items if necessary, and then return a list ofFreeGiftItemsto add to cart.- Parameters:
- cart- the- Cartto process existing free gift items for
- updatedCartItems- a list of- CartItemswhose quantities were updated
- contextInfo- the contextInfo for the request
- Returns:
- a list of FreeGiftItemsto add to cart
 
 - 
updateExistingFreeGiftItemprotected void updateExistingFreeGiftItem(com.broadleafcommerce.cart.client.domain.CartItem existingFreeGiftItem, com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGift, List<com.broadleafcommerce.cart.client.domain.CartItem> updatedCartItems)Updates existing free giftCartItemwith the latest details from the givenFreeGiftItemand update itsAdjustment.- Parameters:
- existingFreeGiftItem- the existing free gift- CartItemto update the- FreeGiftItemdetails for
- freeGift- the- FreeGiftItemto update the existing free gift- CartItemwith
- updatedCartItems- a list of- CartItemswhose quantities were updated, used to ensure the- FulfillmentItemsare updated as well
 
 - 
buildAdjustmentprotected com.broadleafcommerce.order.common.domain.Adjustment buildAdjustment(com.broadleafcommerce.promotion.offer.client.web.context.info.Adjustment offerAdjustment) Builds anAdjustmentbased on the givenAdjustment.- Parameters:
- offerAdjustment- the- Adjustmentto build it from
- Returns:
- an Adjustmentbased on the givenAdjustment
 
 - 
buildOfferItemDetailsprotected com.broadleafcommerce.order.common.domain.OfferItemDetail buildOfferItemDetails(com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail offerItemDetail) Builds anOfferItemDetailfrom the givenOfferItemDetail.- Parameters:
- offerItemDetail- the- OfferItemDetailto build the- OfferItemDetailfrom
- Returns:
- an OfferItemDetailfrom the givenOfferItemDetail
 
 - 
addFreeGiftItemsToCartprotected void addFreeGiftItemsToCart(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> freeGiftItemsToAdd, List<com.broadleafcommerce.cart.client.domain.CartItem> updatedCartItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Adds the list ofFreeGiftItemsto cart, and then adds the ids of those added free gift cart items to the qualifier cart items attributes.- Parameters:
- cart- the- Cartto add the- FreeGiftItemsto
- freeGiftItemsToAdd- a list of- FreeGiftItemsto add
- updatedCartItems- a list of- CartItemswhose attributes were updated
 
 - 
removeExistingFreeGiftItemsFromCartprotected void removeExistingFreeGiftItemsFromCart(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> existingFreeGiftItemsToRemove, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Remove existing free giftCartItemsfrom cart.Before removing existing free gift CartItems, this removes theCartItemAttributeConstants.Internal.IS_FREE_GIFT_ITEMattribute to ensure that the free gift offer is not added to the offer ignore list inaddRemovedFreeGiftOfferToIgnoreList(Cart, List).- Parameters:
- cart- the- Cartto remove the existing free gift items from
- existingFreeGiftItemsToRemove- the existing free gift- CartItemsto remove
- contextInfo- the contextInfo for the request
- See Also:
- CartOperationService.removeManyItemsFromCart(Cart, Collection, boolean, ContextInfo),- processFreeGiftItemsForRemoval(Cart, List)
 
 - 
buildAddItemRequestprotected AddItemRequest buildAddItemRequest(com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGiftItem) Builds anAddItemRequestfrom the givenFreeGiftItem.- Parameters:
- freeGiftItem-- FreeGiftItemto build the- AddItemRequestfor
- Returns:
- the AddItemRequestfor the givenFreeGiftItem
 
 - 
updateCartpublic com.broadleafcommerce.cart.client.domain.Cart updateCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean allowPriceCart, boolean wasCartModified, boolean invalidatePrices, Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdates the providedCartbased on the provided flags.
 
 If the cart was not modified (wasCartModified), this will price and update the cart when the cart is not already priced (Cart.isPriced()), regardless ofinvalidatePrices. If the cart was not modified and the cart is already priced, this does nothing.
 If the cart was modified, the cart will be priced if allowed (allowPriceCart) and if not already already priced or if prices should be invalidated.
 
 Note: It is intentional that no overloaded methods are provided with default values for these parameters. Callers must consider carefully whether their operation modifies the cart or requires price invalidation.- Specified by:
- updateCartin interface- CartOperationService
- Parameters:
- cart- the cart to be updated
- allowPriceCart- whether the cart may be priced
- wasCartModified- whether the cart was actually modified by the caller
- invalidatePrices- whether to invalidate prices on the cart if changes were made
- paymentLockTokens- Tokens that grant this service access to act upon the payment. The presence of these tokens indicates that this execution flow owns the lock.
- Returns:
- synced version of the cart with the cart service
 
 - 
buildUpdateCartRequestWithCartActionAuditprotected UpdateCartRequest buildUpdateCartRequestWithCartActionAudit(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Builds anUpdateCartRequestwith aCartActionAuditif the given accountCartwas modified by an account approver.- Parameters:
- cart- the- Cartto update
- Returns:
- an UpdateCartRequestwith aCartActionAuditif the given accountCartwas modified by an account approver.
 
 - 
buildCartActionAuditForApproverCartUpdateprotected com.broadleafcommerce.cart.client.domain.CartActionAudit buildCartActionAuditForApproverCartUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)Builds aCartActionAuditfor cart modification if the givenCartwas modified by an account approver.- Parameters:
- cart- the account- Cartthat was modified
 
 - 
buildCartActionAuditForAccountCartUpdateprotected com.broadleafcommerce.cart.client.domain.CartActionAudit buildCartActionAuditForAccountCartUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String actionType, String userType)Builds aCartActionAuditfor cart modification if the givenCartwas modified by an account member.- Parameters:
- cart- the account- Cartthat was modified
- actionType- An- action type
- userType- A- user type
 
 - 
updateCartStatuspublic com.broadleafcommerce.cart.client.domain.Cart updateCartStatus(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdateCartStatusRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdates thecart's status.- Specified by:
- updateCartStatusin interface- CartOperationService
- Parameters:
- cart- The cart to update
- request- The status request with the status to update to, see- DefaultCartStatuses.
- contextInfo- Additional multitenant and sandbox info
- Returns:
- The updated cart.
 
 - 
updateAsNamedCartpublic com.broadleafcommerce.cart.client.domain.Cart updateAsNamedCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String name, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdates the providedCartwith the given name. This method is often used when transferring or creating new carts for a registered customer who already has an implicit/default cart.Prior to 1.8.0, named carts are represented by the DefaultCartStatuses.NAMED. After 1.8.0, named carts simply mean a cart with a name. Named carts are different from the implicit/default cart, implicit/default cart areDefaultCartStatuses.IN_PROCESSwithnullname, and there can be only one per user.- Specified by:
- updateAsNamedCartin interface- CartOperationService
- Parameters:
- cart- the cart to update
- name- the name for the cart
- contextInfo- the context info
- Returns:
- the newly named cart
 
 - 
addItemToCartpublic com.broadleafcommerce.cart.client.domain.Cart addItemToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull AddItemRequest addItemRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceAdds a single item to the providedCartbased on the providedAddItemRequest.- Specified by:
- addItemToCartin interface- CartOperationService
- Parameters:
- cart- the cart
- addItemRequest- the request to add an item
- price- whether or not to re-price the cart
- contextInfo- the context info
- Returns:
- the cart with item added
 
 - 
updateItemInCartpublic com.broadleafcommerce.cart.client.domain.Cart updateItemInCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdateItemRequest updateItemRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdates a single item in the providedCartbased on the providedUpdateItemRequest.- Specified by:
- updateItemInCartin interface- CartOperationService
- Parameters:
- cart- the cart
- updateItemRequest- the request to update an item
- price- whether or not to re-price the cart
- contextInfo- the context info
- Returns:
- the cart with item updated
 
 - 
identifyCatalogItemForCartItemprotected Optional<? extends CatalogItem> identifyCatalogItemForCartItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList) Attempts to identify theCartItem'srelatedCatalogItemfrom the providedCatalogItemList.By default, this identifies the catalog item by the product ID. - Parameters:
- cartItem- The- CartItemwhose- CatalogItemwe're attempting to find.
- catalogItemList- The- CatalogItemListthat we expect to contain the- CartItem's- CatalogItem.
- Returns:
- the CartItem'srelatedCatalogItem.
 
 - 
removeStaleCartItemprotected com.broadleafcommerce.cart.client.domain.Cart removeStaleCartItem(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
 - 
removeItemFromCartpublic com.broadleafcommerce.cart.client.domain.Cart removeItemFromCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String cartItemId, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceRemoves a single item from the providedCartmatching the provided cart item ID.- Specified by:
- removeItemFromCartin interface- CartOperationService
- Parameters:
- cart- the cart
- cartItemId- the cart item ID
- price- whether or not to re-price the cart
- contextInfo- the context info
- Returns:
- the cart without the provided item
 
 - 
addManyItemsToCartpublic BulkAddToCartResponse addManyItemsToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Collection<AddItemRequest> addItemRequests, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceAdds one or more items to the providedCart.- Specified by:
- addManyItemsToCartin interface- CartOperationService
- Parameters:
- cart- the cart
- addItemRequests- the add item requests
- price- whether or not to re-price the cart
- contextInfo- the context info
- Returns:
- a response with the cart and any item failures
 
 - 
removeManyItemsFromCartpublic com.broadleafcommerce.cart.client.domain.Cart removeManyItemsFromCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<String> cartItemIds, boolean price, boolean updateCart, Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceRemoves one or more items from the providedCartmatching the provided cart item IDs.- Specified by:
- removeManyItemsFromCartin interface- CartOperationService
- Parameters:
- cart- the cart
- cartItemIds- the cart item IDs
- price- whether or not to re-price the cart
- updateCart- whether or not to update- Cartpricing and save the cart after the removal
- paymentLockTokens- Tokens that grant this service access to act upon the payment. The presence of these tokens indicates that this execution flow owns the lock.
- contextInfo- the context info
- Returns:
- the cart without the provided item
 
 - 
isItemElegibleForRemovalprotected boolean isItemElegibleForRemoval(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)Hook point to prevent removal of cart items that should not be removed through the cart management endpoints. By default, we prevent COD fees from being removed.- Parameters:
- cartItem- the cart item to be removed
- Returns:
- true, if the cart item can be removed
 
 - 
processFreeGiftItemsForRemovalprotected void processFreeGiftItemsForRemoval(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)Processes free gift items wheneverCartItemsare being removed.- Parameters:
- cart- the- Cartthe items are being removed from
- cartItemsBeingRemoved- the list of- CartItemsbeing removed from cart
 
 - 
addRemovedFreeGiftOfferToIgnoreListprotected void addRemovedFreeGiftOfferToIgnoreList(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)Adds the offer id toCart'signore list inCart.getInternalAttributes()whenever a free gift item is removed, so that the free gift item will not be added again.- Parameters:
- cart- the- Cartto add the offer id ignore list to
- cartItemsBeingRemoved- the list of- CartItemsbeing removed from cart
- See Also:
- CartAttributeConstants.Internal.OFFER_IDS_TO_IGNORE
 
 - 
removeAssociatedFreeGiftItemsprotected void removeAssociatedFreeGiftItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)Removes the associated free gift item if the offer qualifier item is removed.- Parameters:
- cart- the- Cartto remove the free gift item from
- cartItemsBeingRemoved- the list of- CartItemsbeing removed from cart
 
 - 
addOfferCodeToCartpublic AddCodeToCartResponse addOfferCodeToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull AddCodeRequest addOfferCodeRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceAdds an offer code to the providedCart.- Determine if the code is valid as a campaign tracking code
- If so, add it to the cart as a CampaignRef
- Determine if the code is valid as a shared code
- If so, add it to the cart
 - Specified by:
- addOfferCodeToCartin interface- CartOperationService
- Parameters:
- cart- the cart
- addOfferCodeRequest- the add offer code request
- price- whether or not to re-price the cart
- contextInfo- the context info
- Returns:
- An AddCodeToCartResponse describing the results of adding the offer code to the cart
 
 - 
buildAddCodeToCartResponseprotected AddCodeToCartResponse buildAddCodeToCartResponse(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String code, boolean cartWasRepriced) Builds anAddCodeToCartResponsebased on the provided cart, code, & whether or not the cart was repriced- Parameters:
- cart- The updated- Cart, including the code and applicable adjustments (discounts).
- code- The offer code that was added to the cart
- cartWasRepriced- Whether or not the cart was repriced after the code was added
- Returns:
- An AddCodeToCartResponse describing the results of adding the offer code to the cart
 
 - 
getRelatedAdjustmentsprotected List<com.broadleafcommerce.order.common.domain.Adjustment> getRelatedAdjustments(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String code) 
 - 
removeOfferCodeFromCartpublic com.broadleafcommerce.cart.client.domain.Cart removeOfferCodeFromCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String offerCode, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceRemoves an offer code from the providedCart, if it exists.- Determine if the code exists as a tracking code on the cart
- If so, remove the corresponding CampaignRef
- Determine if the offer code exists on the cart
- If so, remove it
 - Specified by:
- removeOfferCodeFromCartin interface- CartOperationService
- Parameters:
- cart- cart cart
- offerCode- the offer code to remove
- price- whether or not to re-price the cart
- contextInfo- the context info
- Returns:
- the cart without the offer code
 
 - 
removeOfferAndCampaignCodesFromCartpublic com.broadleafcommerce.cart.client.domain.Cart removeOfferAndCampaignCodesFromCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, List<String> codes, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceRemoves the provided offer and campaign codes from the cart and then updates the cart.- Specified by:
- removeOfferAndCampaignCodesFromCartin interface- CartOperationService
- Parameters:
- cart- The id of the cart on which to perform the operation.
- codes- The codes to remove from the cart.
- allowPriceCart- Whether to allow the cart to be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The cart with the codes removed.
 
 - 
addAttributeToCartpublic com.broadleafcommerce.cart.client.domain.Cart addAttributeToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull AddAttributeRequest addAttributeRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceAdds an attribute to the providedCart.- Specified by:
- addAttributeToCartin interface- CartOperationService
- Parameters:
- cart- the cart
- addAttributeRequest- the add attribute request
- price- whether to allow the cart to be priced after updating
- contextInfo- the context info
- Returns:
- the cart with the attribute added
 
 - 
removeAttributeFromCartpublic com.broadleafcommerce.cart.client.domain.Cart removeAttributeFromCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String key, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceRemoves an attribute to the providedCart.- Specified by:
- removeAttributeFromCartin interface- CartOperationService
- Parameters:
- cart- the cart
- key- the attribute key
- price- whether to allow the cart to be priced after updating
- contextInfo- the context info
- Returns:
- the cart without the attribute
 
 - 
updateContactInfoInCartpublic com.broadleafcommerce.cart.client.domain.Cart updateContactInfoInCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull ContactInfoRequest contactInfoRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdates the contact info for the providedCart.- Specified by:
- updateContactInfoInCartin interface- CartOperationService
- Parameters:
- cart- the cart
- contactInfoRequest- the contact info request
- price- whether to allow the cart to be priced after updating
- contextInfo- the context info
- Returns:
- the cart with contact info updated
 
 - 
updateFulfillmentGroupInCartpublic com.broadleafcommerce.cart.client.domain.Cart updateFulfillmentGroupInCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String referenceNumber, @NonNull @NonNull UpdateFulfillmentGroupRequest updateFulfillmentGroupRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdates an existingFulfillmentGroupfor the providedCart.- Specified by:
- updateFulfillmentGroupInCartin interface- CartOperationService
- Parameters:
- cart- the cart
- referenceNumber- the reference number of the fulfillment group to update
- updateFulfillmentGroupRequest- the fulfillment group update request
- price- whether to allow the cart to be priced after updating
- contextInfo- the context info
- Returns:
- the cart with an updated fulfillment group
 
 - 
priceCartpublic com.broadleafcommerce.cart.client.domain.Cart priceCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable PriceCartRequest priceCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServicePrices and saves the cart with the providedPriceCartRequest.- Specified by:
- priceCartin interface- CartOperationService
- Parameters:
- cart- the cart
- priceCartRequest- the price cart request
- contextInfo- the context info
- Returns:
- the priced cart
 
 - 
priceCartpublic com.broadleafcommerce.cart.client.domain.Cart priceCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable PriceCartRequest priceCartRequest, boolean saveCart, Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServicePrices cart, processes free gift offers, and saves cart with the providedPriceCartRequestifsaveCartis true.- Specified by:
- priceCartin interface- CartOperationService
- Parameters:
- cart- the cart
- priceCartRequest- the price cart request
- saveCart- determines whether to save cart after pricing
- paymentLockTokens- Tokens that grant this service access to act upon the payment. The presence of these tokens indicates that this execution flow owns the lock.
- contextInfo- the context info
- Returns:
- the priced cart
 
 - 
reallocateCartTotalAmongstPaymentspublic List<PaymentSummary> reallocateCartTotalAmongstPayments(@NonNull @NonNull javax.money.MonetaryAmount newCartTotal, @NonNull @NonNull List<PaymentSummary> paymentSummaries, @NonNull @NonNull Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceReallocate the cart total among the cart's payments- Specified by:
- reallocateCartTotalAmongstPaymentsin interface- CartOperationService
- paymentLockTokens- Tokens that grant this service access to act upon the payment. The presence of these tokens indicates that this execution flow owns the lock.
- contextInfo- the context info
 
 - 
isPaymentReallocationRequiredprotected boolean isPaymentReallocationRequired(@Nullable javax.money.MonetaryAmount previousCartTotal, @Nullable javax.money.MonetaryAmount newCartTotal)
 - 
reallocateCartTotalAmongstPaymentsprotected void reallocateCartTotalAmongstPayments(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull javax.money.MonetaryAmount newCartTotal, @NonNull @NonNull Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
 - 
allocateCartTotalToPaymentprotected PaymentSummary allocateCartTotalToPayment(@NonNull @NonNull PaymentSummary paymentSummary, @NonNull @NonNull javax.money.MonetaryAmount cartTotal, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to automatically reallocate the cart total to the cart's single payment. Note: if a payment makes use of a single-use token and a successful transaction has already been executed, then the amount cannot be changed. In that case, the payment will need to be redefined.- Parameters:
- paymentSummary- A summary of the cart's single payment
- cartTotal- The total price of the cart
- contextInfo- the contextInfo for the request
 
 - 
allocateCartTotalToPaymentprotected PaymentSummary allocateCartTotalToPayment(@NonNull @NonNull PaymentSummary paymentSummary, @NonNull @NonNull javax.money.MonetaryAmount cartTotal, @Nullable String lockToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to automatically reallocate the cart total to the cart's single payment. Note: if a payment makes use of a single-use token and a successful transaction has already been executed, then the amount cannot be changed. In that case, the payment will need to be redefined.- Parameters:
- paymentSummary- A summary of the cart's single payment
- cartTotal- The total price of the cart
- lockToken- the token that owns the payment lock
- contextInfo- the contextInfo for the request
 
 - 
reallocateCartTotalMultiplePaymentsprotected List<PaymentSummary> reallocateCartTotalMultiplePayments(@NonNull @NonNull javax.money.MonetaryAmount cartTotal, @NonNull @NonNull List<PaymentSummary> paymentSummaries, @Nullable Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to automatically reallocate the cart total amongst the cart's payments. Note: if a payment makes use of a single-use token and a successful transaction has already been executed, then the amount cannot be changed. In that case, the payment will need to be redefined.- Parameters:
- paymentSummaries- Summaries of the cart's payments
- cartTotal- The total price of the cart
- paymentLockTokens- Tokens that grant this service access to act upon the payment. The presence of these tokens indicates that this execution flow owns the lock.
- contextInfo- the contextInfo for the request
- Returns:
- an updated list of PaymentSummaries
 
 - 
priceCartWithCatalogPriceUpdatespublic com.broadleafcommerce.cart.client.domain.Cart priceCartWithCatalogPriceUpdates(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceReprice the cart, including applying the latest catalog-based prices for each of its items- Specified by:
- priceCartWithCatalogPriceUpdatesin interface- CartOperationService
- Parameters:
- cart- The cart on which to perform the operation.
- contextInfo- the context info
- Returns:
- the priced cart
 
 - 
recalculateTaxesForCartpublic com.broadleafcommerce.cart.client.domain.Cart recalculateTaxesForCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean estimated, boolean actual, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceRecalculates the taxes for the providedCart.- Specified by:
- recalculateTaxesForCartin interface- CartOperationService
- Parameters:
- cart- the cart
- estimated- whether to calculate estimated taxes
- actual- whether to calculate actual taxes
- contextInfo- the context info
- Returns:
- the cart with taxes updated
 
 - 
getCurrencyUnitprotected javax.money.CurrencyUnit getCurrencyUnit(@Nullable PriceCartRequest priceCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Call utility method to determine currency.- Parameters:
- priceCartRequest- the price cart request to look for currency
- contextInfo- the context info to look for currency
- Returns:
- the currency to be used for the request
 
 - 
saveCartprotected com.broadleafcommerce.cart.client.domain.Cart saveCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Helper method to encapsulate saving an existing Cart.- Parameters:
- cart- the cart
- contextInfo- the context info
- Returns:
- the saved cart
 
 - 
saveCartprotected com.broadleafcommerce.cart.client.domain.Cart saveCart(@NonNull @NonNull UpdateCartRequest updateCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Helper method to encapsulate saving an existing Cart.- Parameters:
- updateCartRequest- the- UpdateCartRequest
- contextInfo- the context info
- Returns:
- the saved cart
 
 - 
removeFulfillmentItemsWithoutCartItemsprotected com.broadleafcommerce.cart.client.domain.Cart removeFulfillmentItemsWithoutCartItems(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
 - 
createEmptyCartprotected com.broadleafcommerce.cart.client.domain.Cart createEmptyCart(@Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable javax.money.CurrencyUnit currencyUnit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Creates and returns an empty, unsavedCartwith typical defaults.- Parameters:
- customer- the customer
- currencyUnit- the currency for the cart
- contextInfo- the context info
- Returns:
- the new empty cart
 
 - 
defaultCartLocaleprotected void defaultCartLocale(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
 - 
defaultCartCurrencyprotected void defaultCartCurrency(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable javax.money.CurrencyUnit currencyUnit)
 - 
newCartprotected com.broadleafcommerce.cart.client.domain.Cart newCart() Uses theTypeFactoryto create a newCartobject.- Returns:
- the new cart
 
 - 
newCartPricingprotected com.broadleafcommerce.cart.client.domain.CartPricing newCartPricing() Uses theTypeFactoryto create a newCartPricingobject.- Returns:
- the new cart pricing
 
 - 
newCartCreationRequestprotected CartCreationRequest newCartCreationRequest() 
 - 
newCartStatusprotected String newCartStatus(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines what status should be used when creating new carts.- Parameters:
- contextInfo- the context info
- Returns:
- the status to be used for a new cart
 
 - 
newBulkAddToCartResponseprotected BulkAddToCartResponse newBulkAddToCartResponse() Instantiates a newBulkAddToCartResponseusing theTypeFactory.- Returns:
- a new bulk add to cart response
 
 - 
createItemAndAddToCartprotected com.broadleafcommerce.cart.client.domain.Cart createItemAndAddToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull AddItemRequest addItemRequest, @Nullable javax.money.CurrencyUnit currencyUnit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Creates a new item and adds it to the providedCart.- Parameters:
- cart- the cart
- addItemRequest- the add item request
- currencyUnit- the currency for the item(s)
- contextInfo- the context info
 
 - 
doSoftInventoryReservationIfNecessaryprotected void doSoftInventoryReservationIfNecessary(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)If any of the supplied cart items have a reservation strategy of ADD_TO_CART, a soft reservation is performed.- Parameters:
- cart- The cart
- cartItems- The cart items to check
 
 - 
createItemsAndAddToCartprotected BulkAddToCartResponse createItemsAndAddToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<AddItemRequest> addItemRequests, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates new items and adds them to the providedCart.- Parameters:
- cart- the cart
- addItemRequests- the add item request
- contextInfo- the context info
 
 - 
identifyCatalogItemsForUpdateItemRequestprotected CatalogItemList<? extends CatalogItem> identifyCatalogItemsForUpdateItemRequest(@NonNull @NonNull UpdateItemRequest updateItemRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
 - 
buildCatalogItemRequestsForUpdateprotected Collection<CatalogItemRequest> buildCatalogItemRequestsForUpdate(@NonNull @NonNull Collection<UpdateItemRequest> updateItemRequests, @NonNull @NonNull Collection<com.broadleafcommerce.cart.client.domain.CartItem> cartItems, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
 - 
catalogItemRequestAlreadyExistprotected boolean catalogItemRequestAlreadyExist(@NonNull @NonNull Set<CatalogItemRequest> catalogItemRequests, @NonNull @NonNull UpdateItemRequest updateItemRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to prevent duplicateCatalogItemRequestsfrom being built based on theCartItemandUpdateItemRequest.By default, we filter on the product ID. - Parameters:
- catalogItemRequests- the list of requests to pass to the- CatalogProvider
- updateItemRequest- the- UpdateItemRequestcontaining the details for the update
- cartItem- the- CartItemto build the- CatalogItemRequest
- contextInfo- context information around sandbox and multitenant state
- Returns:
- true if building a new CatalogItemRequestwould be a duplicate of an existing request incatalogItemRequests
 
 - 
buildCatalogItemRequestprotected CatalogItemRequest buildCatalogItemRequest(@NonNull @NonNull UpdateItemRequest updateItemRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to build theCatalogItemRequestand populate any additional attributes that should be passed to theCatalogProviderwhen fetching the catalog representation for updating the cart item.- Parameters:
- updateItemRequest- the- UpdateItemRequestcontaining the details for the update
- cartItem- the- CartItembeing updated
- contextInfo- context information around sandbox and multitenant state
- Returns:
- the populated CatalogItemRequestfor theUpdateItemRequest
 
 - 
addUnassignedItemsToFulfillmentGroupprotected com.broadleafcommerce.cart.client.domain.Cart addUnassignedItemsToFulfillmentGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)IdentifyCartItemsthat have not been assigned to aFulfillmentGroup& add them to the relevant FulfillmentGroup.If the fulfillment type is FulfillmentType.VIRTUAL,CartOperationServiceProperties.getDefaultVirtualFulfillmentOptionName()will be used to identify the default fulfillment option.- Parameters:
- cart- The cart whose items may need to be assigned to a fulfillment group
- Returns:
- The updated cart whose items are all assigned to fulfillment groups
 
 - 
updateCartAttributesprotected com.broadleafcommerce.cart.client.domain.Cart updateCartAttributes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull List<AddItemRequest> successfulAddItemRequests)Update cart attributes based on the successfulAddItemRequests- Parameters:
- cart- The cart that was added to
- successfulAddItemRequests- List of AddItemRequests that were successfully processed
- Returns:
- The updated cart
 
 - 
updateFulfillmentItemprotected void updateFulfillmentItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)Updates theFulfillmentItemcorresponding to theCartItem, keeping them in sync.- Parameters:
- cart-- Cartto which the items belong
- cartItem-- CartItemwith updates to be carried over to a- FulfillmentItem
 
 - 
calculateMerchandiseTotalAmountForFulfillmentItemUpdateprotected javax.money.MonetaryAmount calculateMerchandiseTotalAmountForFulfillmentItemUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem fulfillmentCartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem, int totalQuantity)Calculates theFulfillmentItem.getMerchandiseTotalAmount()for the cart item. ThetotalQuantitydivided by theitem.getQuantity()is used to calculate the total amount for the fulfillment item when we have a bundle product with a dependent item whose quantity is greater than one. Take for example the below scenario:- bundle item quantity = 3
- bundle price = $9.99
- dependent item price = $15
- dependent item quantity = 4
 - Parameters:
- cart-- Cartto which the items belong
- fulfillmentCartItem- the- CartItemwhich has been updated
- fulfillmentItem- the- FulfillmentItemwhich we are trying to price
- totalQuantity- the total quantity of the dependent item
- Returns:
- the merchandise total for the FulfillmentItem
 
 - 
addCampaignCodeIfExistsOnCart@Deprecated protected boolean addCampaignCodeIfExistsOnCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String code, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Deprecated as of 1.8, if using OfferService 2.0, this method is not used
 - 
addCampaignForCodeIfExists@Deprecated protected boolean addCampaignForCodeIfExists(String code, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Deprecated as of 1.8, if using OfferService 2.0, this method is not usedAdds acodeto theCartif it belongs to a campaign.- Parameters:
- code- Code to be added that might match a campaign.
- cart- Cart to add the- codeto.
- contextInfo- the context info
- Returns:
- The CampaignRef.getCampaignTrackingId()for the added campaign.
 
 - 
populateCartItemUpdatesprotected boolean populateCartItemUpdates(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull UpdateItemRequest request)Takes the changes from theUpdateItemRequestand populates them onto theCartItem.- Parameters:
- cartItem- The- CartItemto be updated with changes from- request
- request- The- UpdateItemRequestwith changes for- cartItem
- Returns:
- Whether cartItemshould be revalidated after updates are populated.
 
 - 
populateCartUpdatesFromUpdateItemRequestprotected boolean populateCartUpdatesFromUpdateItemRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdateItemRequest request)Takes the changes from theUpdateItemRequestand populates them onto theCart.- Parameters:
- cart- The- Cartto be updated with changes from- request
- request- The- UpdateItemRequestwith changes for- cart
- Returns:
- Whether CartItemreferenced inrequestshould be revalidated after updates are populated.
 
 - 
validateCartItemBeforeUpdateprotected void validateCartItemBeforeUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull UpdateItemRequest updateItemRequest)Validates theCartItembeing updated againstUpdateItemRequestbefore the actual cart item update.By default, the CartItembeing updated is only being validated against free gift requirements.- Parameters:
- cartItem- the- CartItembeing updated
- updateItemRequest- the- UpdateItemRequestcontaining the details for the update
 
 - 
validateFreeGiftItemForUpdateprotected void validateFreeGiftItemForUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull UpdateItemRequest updateItemRequest)If the givenCartItemis a free gift item, validates that its quantity is not being changed.By default, the quantity of a free gift item can only be changed by the system. This is because free gift items have their own specific behaviors, and the details of free gift items should only be modified by the system internally. - Parameters:
- cartItem- the- CartItemto validate
- updateItemRequest- the- UpdateItemRequestcontaining the details for the update
 
 - 
validateCartItemAfterUpdateprotected void validateCartItemAfterUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
 - 
invalidateFulfillmentGroupOverrideprotected void invalidateFulfillmentGroupOverride(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
 - 
addOfferCodeIfUsableprotected boolean addOfferCodeIfUsable(String code, boolean isForCampaign, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Adds thecodetoCart.getOfferCodes()if it's usable.- Parameters:
- code- The code to be added
- cart- The cart to add the- codeto
- Returns:
- Whether the code was added.
- Throws:
- AddCodeException- if the code cannot be added for any reason. This is usually because the code is invalid or has already been used the maximum number of times. Note that if the code matched a- CampaignRef, then no exception is thrown here even if the code is not usable for the purpose of adding an- OfferRefbecause it was still usable in a general sense to add the campaign.- AddCodeException.getReasonType()will typically match the code's- CodeUsabilityInfo.getCodeUsabilityType()and can be used on the frontend to determine messaging.
 
 - 
buildCampaignRef@Deprecated protected com.broadleafcommerce.order.common.domain.CampaignRef buildCampaignRef(String code, String trackingId) Deprecated.Deprecated as of 1.8, if using OfferService 2.0, this method is not used
 - 
doesCartContainCampaignForCode@Deprecated protected final boolean doesCartContainCampaignForCode(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String code) Deprecated.Determines whether theCartcontains aCampaignRefthat matches thecode.- Parameters:
- cart- Cart with campaigns to match against
- code- Code to match with
- Returns:
- Whether the cart contains a campaign for the code
 
 - 
getMessageprotected String getMessage(@NonNull @NonNull String errorMessage, @Nullable Object... args) 
 - 
getFulfillmentGroupByIdprotected Supplier<com.broadleafcommerce.cart.client.domain.FulfillmentGroup> getFulfillmentGroupById(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId) Gets the fulfillment group by the provided ID. By default this will be the owning Cart'sIDand the index of the group inCart.getFulfillmentGroups(). You can simply provide the index for the fulfillment group to perform the operation.Example: Cart has id "12345", so the first fulfillment group has id "12345-0". If you want to find the fulfillment group, you can provide "0" to this method along with the cart to get it. - Parameters:
- cart- The cart on which to find the fulfillment group
- fulfillmentGroupId- The ID for the fulfillment group to find. Usually defaults to the index of the group in- Cart.getFulfillmentGroups().
- Returns:
- The corresponding FulfillmentGroup for the given cart and relative number.
 
 - 
getRequiredCartItemprotected com.broadleafcommerce.cart.client.domain.CartItem getRequiredCartItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String cartItemId)Gets a cart item from the cart by its ID. Throws an error if the item could not be found.- Parameters:
- cart- the cart to search the items of
- cartItemId- the item ID to look for
- Returns:
- the item with the given cart ID
- Throws:
- com.broadleafcommerce.data.tracking.core.exception.EntityMissingException- when no item with the ID exists in the cart
 
 - 
buildCartItemprotected com.broadleafcommerce.cart.client.domain.CartItem buildCartItem(@NonNull @NonNull AddItemRequest addItemRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable javax.money.CurrencyUnit currencyUnit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Populates a new cart item from theAddItemRequest. This will populate info from theCatalogProviderto ensure that all the important catalog info is present on the item and is correct. After that population, the cart item will be validated based on the product's included products and product options.- Parameters:
- addItemRequest- Request from which to populate new- CartItems.
- cart- The cart of the new- CartItems
- currencyUnit- the currency for the cart item(s)
- Returns:
- Populated CartItems.
- Throws:
- CartItemValidationException- Thrown if the cart item is misconfigured based on the related product's included products and product options.
 
 - 
buildCartItemsprotected DefaultCartOperationService.BulkCartItemCreationResponse buildCartItems(@NonNull @NonNull Collection<AddItemRequest> addItemRequests, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable javax.money.CurrencyUnit currencyUnit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Populates new cart items from theAddItemRequests. This will populate info from theCatalogProviderto ensure that all the important catalog info is present on the item and is correct. After that population, the cart item will be validated based on the product's included products and product options.- Parameters:
- addItemRequests- Request from which to populate new- CartItems.
- cart- The cart of the new- CartItems
- currencyUnit- the currency for the cart items
- Returns:
- Populated CartItems.
- Throws:
- CartItemValidationException- Thrown if the cart item is misconfigured based on the related product's included products and product options.
 
 - 
buildCatalogItemRequestsForAddprotected Collection<CatalogItemRequest> buildCatalogItemRequestsForAdd(@NonNull @NonNull Collection<AddItemRequest> addItemRequests, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
 - 
catalogItemRequestAlreadyExistprotected boolean catalogItemRequestAlreadyExist(@NonNull @NonNull Set<CatalogItemRequest> catalogItemRequests, @NonNull @NonNull AddItemRequest addItemRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Hook point to prevent duplicateCatalogItemRequestsfrom being built based on theAddItemRequest.By default, we filter on the product ID. - Parameters:
- catalogItemRequests- the list of requests to pass to the- CatalogProvider
- addItemRequest- the- AddItemRequestcontaining the details for the new cart item
- contextInfo- context information around sandbox and multitenant state
- Returns:
- true if building a new CatalogItemRequestwould be a duplicate of an existing request incatalogItemRequests
 
 - 
buildCatalogItemRequestprotected CatalogItemRequest buildCatalogItemRequest(@NonNull @NonNull AddItemRequest addItemRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to create theCatalogItemRequestand populate any additional attributes that should be passed to theCatalogProviderwhen fetching the catalog representation for adding the cart item.- Parameters:
- addItemRequest- the- AddItemRequestcontaining the details for the new cart item
- contextInfo- context information around sandbox and multitenant state
- Returns:
- the populated CatalogItemRequestfor theAddItemRequest
 
 - 
identifyCatalogItemsForAddItemRequestsprotected CatalogItemList<? extends CatalogItem> identifyCatalogItemsForAddItemRequests(@NonNull @NonNull Collection<AddItemRequest> addItemRequests, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
 - 
identifyAddItemRequestsForCatalogItemsprotected List<AddItemRequest> identifyAddItemRequestsForCatalogItems(@NonNull @NonNull Collection<AddItemRequest> addItemRequests, @NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList) Attempts to identify theAddItemRequest'srelatedCatalogItemfrom the providedCatalogItemList.By default, this identifies the catalog item by the product ID. - Parameters:
- addItemRequests- The list of- AddItemRequestswhose- CatalogItemwe're attempting to find.
- catalogItemList- The- CatalogItemListthat we expect to contain the- CartItem's- CatalogItem.
- Returns:
- the CartItem'srelatedCatalogItem.
 
 - 
createCartItemprotected com.broadleafcommerce.cart.client.domain.CartItem createCartItem(@NonNull @NonNull AddItemRequest addItemRequest, @Nullable javax.money.CurrencyUnit currencyUnit)Creates aCartItembased on the providedAddItemRequest- Parameters:
- addItemRequest- the request which contains the info to build a cart item
- currencyUnit- the currency for the cart item
- Returns:
- the newly created cart item
 
 - 
populateFromRequestprotected com.broadleafcommerce.cart.client.domain.CartItem populateFromRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull AddItemRequest addItemRequest, @Nullable javax.money.CurrencyUnit currencyUnit)Populates the cart item fields based on the request.- Parameters:
- cartItem- the cart item to populate
- addItemRequest- the request which contains the info to build a cart item
- currencyUnit- the currency for the cart item
- Returns:
- the populated cart item
 
 - 
getProductType@Nullable protected Object getProductType(com.broadleafcommerce.cart.client.domain.CartItem cartItem) 
 - 
buildItemAttributeChoicesprotected Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> buildItemAttributeChoices(@NonNull @NonNull Map<String,String> requestItemAttributeChoices) 
 - 
validateCartItemprotected void validateCartItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull CatalogItemList<? extends CatalogItem> catalogItemList, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Validates that theCartItemincludes enough information to correctly represent the product or one of the product's variants.- Parameters:
- cartItem- The- CartItemthat is being validated
- cart- The- CartItem'sowning cart
- catalogItemList- The- CatalogItemListthat should contain the- CartItem'srelated- CatalogItem
- contextInfo- The contextInfo for the request
 
 - 
buildValidationFailureprotected AddItemFailure buildValidationFailure(@NonNull @NonNull AddItemRequest addItemRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Builds anAddItemFailurebased on the providedAddItemRequest&CartItemrepresenting an invalid add to cart request- Parameters:
- addItemRequest- The request that was used to build the CartItem
- cartItem- The cart item that holds the validation failures
- Returns:
- an AddItemFailure based on the provided AddItemRequest & CartItem
 
 - 
getCatalogItemKeyForMissingEntitiesprotected String getCatalogItemKeyForMissingEntities(AddItemRequest addItemRequest) Hook point to determine what the missing entities map is keyed on from theAddItemRequest.By default, this is set to the product ID. - Parameters:
- addItemRequest- the request which contains the info to build a cart item
- Returns:
- the key for the catalog item missing entities map
 
 - 
createFulfillmentGroupForItemsprotected void createFulfillmentGroupForItems(@NonNull @NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.CartItem> cartItems, @NonNull @NonNull String fulfillmentType, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.cart.client.domain.CartItem parentCartItem)
 - 
resolveTaxAddressSourceprotected String resolveTaxAddressSource(String fulfillmentType) Determines the tax address source that should be used forFulfillmentGroup.getTaxAddressSource()for the given fulfillment type.- Parameters:
- fulfillmentType- the fulfillment type from which to determine the tax address source
- Returns:
- the tax address source that should be used
 
 - 
buildGroupReferenceNumberprotected String buildGroupReferenceNumber(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart) Builds aFulfillmentGroup.getReferenceNumber()for a new group.- Parameters:
- cart- Cart that owns the group
- Returns:
- The new reference number
 
 - 
buildGroupReferenceNumberprotected String buildGroupReferenceNumber(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId) Builds aFulfillmentGroup.getReferenceNumber()for the given cart and group ID.- Parameters:
- cart- Cart that owns the group
- fulfillmentGroupId- ID of the fulfillment group for which to build a reference number. Usually defaults to the index of the group in- Cart.getFulfillmentGroups().
- Returns:
- The new reference number
 
 - 
addItemsToFulfillmentGroupprotected void addItemsToFulfillmentGroup(@NonNull @NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.CartItem> cartItems, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull @NonNull javax.money.CurrencyUnit expectedCurrency, @Nullable com.broadleafcommerce.cart.client.domain.CartItem parentCartItem)
 - 
updatesForBundleFulfillmentItemsprotected void updatesForBundleFulfillmentItems(com.broadleafcommerce.cart.client.domain.CartItem parentCartItem, com.broadleafcommerce.cart.client.domain.FulfillmentItem fulfillmentItem)
 - 
insertItemsprotected void insertItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> itemsToAdd, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
 - 
addItemToFulfillmentGroupprotected void addItemToFulfillmentGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, Set<String> assignedCartItemIds, @Nullable com.broadleafcommerce.cart.client.domain.CartItem parentCartItem)Assigns the cart item and its dependent cart items to the fulfillment group. If the fulfillment group doesn't exist it will be created. This method doesn't create the fulfillment item for theDefaultProductType.BUNDLEitems.- Parameters:
- cart- the cart whose items may need to be assigned to a fulfillment group
- cartItem- the cart item for which to create add the fulfillment item
- assignedCartItemIds- the set of the cart item ids for which the fulfillment item is already exists
- parentCartItem- the parent cart item for the specified cart item. Usually, this is the item that has the dependent cart items
 
 - 
resolveDefaultFulfillmentType@Nullable protected String resolveDefaultFulfillmentType(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) Determines the defaultFulfillmentTypefor the providedCartItem- Parameters:
- cartItem- The cart item whose default fulfillment type must be determined
- Returns:
- The default fulfillment type for the provided cart item
 
 - 
removeItemsFromFulfillmentGroupprotected void removeItemsFromFulfillmentGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)
 - 
getCartItemIdsWithDependentItemprotected Map<String,com.broadleafcommerce.cart.client.domain.CartItem> getCartItemIdsWithDependentItem(List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems) 
 - 
resetFulfillmentGroupReferenceNumbersprotected void resetFulfillmentGroupReferenceNumbers(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
 - 
repriceCartIfPricingIsStaleprotected Optional<com.broadleafcommerce.cart.client.domain.Cart> repriceCartIfPricingIsStale(Optional<com.broadleafcommerce.cart.client.domain.Cart> optionalCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Called during cart resolution to check if the catalog prices on the cart are stale, and if so, updates those prices and resets the time since they were last changed. Also sets the values for `staleCartPricingResultHolder` for checkout validation.- Parameters:
- optionalCart- Cart to be checked and priced
- contextInfo- The contextInfo for the request
- Returns:
 
 - 
getCartTotalChangeMessageprotected String getCartTotalChangeMessage(javax.money.MonetaryAmount latestCartPrice) 
 - 
createCartAlertprotected com.broadleafcommerce.cart.client.domain.CartAlert createCartAlert(String message) 
 - 
retrieveInProcessCartByCustomerIdAndApplicationIdpublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveInProcessCartByCustomerIdAndApplicationId(@NonNull @NonNull String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieve the in-process cart for the provided customer.- Specified by:
- retrieveInProcessCartByCustomerIdAndApplicationIdin interface- CartOperationService
- Parameters:
- customerId- The id of the customer for which to perform the operation.
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The in-process cart for the provided customer.
 
 - 
retrieveInProcessCartByCartIdpublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveInProcessCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieve the cart for the provided id, as long as it is in-process.- Specified by:
- retrieveInProcessCartByCartIdin interface- CartOperationService
- Parameters:
- cartId- The id of the cart on which to perform the operation.
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The in-process cart for the provided id.
 
 - 
retrieveCsrCartByCartIdpublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCsrCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieve the cart for the provided id, as long as it is CSR-owned.- Specified by:
- retrieveCsrCartByCartIdin interface- CartOperationService
- Parameters:
- cartId- The id of the cart on which to perform the operation.
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The CSR-owned cart for the provided id.
 
 - 
retrieveTestCartByCartIdpublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveTestCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieve the cart for the provided id, as long as it is a test cart.- Specified by:
- retrieveTestCartByCartIdin interface- CartOperationService
- Parameters:
- cartId- The id of the cart on which to perform the operation.
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The test cart for the provided id.
 
 - 
retrieveCartByCartIdWithStatusprotected Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartByCartIdWithStatus(@NonNull @NonNull String cartId, com.broadleafcommerce.cart.client.domain.enums.CartStatus status, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
 - 
retrieveCsrOwnedCartByCustomerIdAndApplicationIdpublic Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCsrOwnedCartByCustomerIdAndApplicationId(@NonNull @NonNull String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceRetrieve the CSR-owned cart for the provided customer.- Specified by:
- retrieveCsrOwnedCartByCustomerIdAndApplicationIdin interface- CartOperationService
- Parameters:
- customerId- The id of the customer for which to perform the operation.
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The CSR-owned cart for the provided customer.
 
 - 
addToCartpublic com.broadleafcommerce.cart.client.domain.Cart addToCart(@NonNull @NonNull AddItemRequest addItemRequest, @Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customerRef, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceAdd an item to the customer's current cart based on the provided untrusted information. By default, this includes the following steps:- Retrieve catalog information for the item
- Check inventory
- Create item and add it to the cart (un-priced)
- Price the item and cart, using offers and price lists (optional)
- Update the cart and it's items (optional)
 - Specified by:
- addToCartin interface- CartOperationService
- Parameters:
- addItemRequest- Add an item to the customer's current cart based on the provided untrusted information.
- cart- The cart to be added to. If not provided, then a new cart will be produced.
- customerRef- The cart's owning customer. Can be null if anonymous.
- allowPriceCart- Whether to allow the cart to be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The cart with the item added.
 
 - 
bulkAddToCartpublic BulkAddToCartResponse bulkAddToCart(@NonNull @NonNull Collection<AddItemRequest> addItemRequests, @Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customerRef, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationServiceAdd a list of items to the customer's current cart based on the provided untrusted information. By default, this includes the following steps:- Retrieve catalog information for the items
- Check inventory
- Create item and add it to the cart (un-priced)
- Price the item and cart, using offers and price lists (optional)
- Update the cart and it's items (optional)
 - Specified by:
- bulkAddToCartin interface- CartOperationService
- Parameters:
- addItemRequests- Add a list of items to the customer's current cart based on the provided untrusted information.
- cart- The id of the cart to be added to. If not provided, then a new cart will be produced.
- customerRef- The cart's owning customer. Can be null if anonymous.
- allowPriceCart- Whether the cart should be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The cart with the items added.
 
 - 
updateCartItempublic com.broadleafcommerce.cart.client.domain.Cart updateCartItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdateItemRequest updateItemRequest, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdate the cart item.- Specified by:
- updateCartItemin interface- CartOperationService
- Parameters:
- cart- The id of the cart on which to perform the operation.
- updateItemRequest- The cart item to use to update the details of the current cart item.
- allowPriceCart- Whether to allow the cart to be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The cart with the updated item.
 
 - 
removeCartItemspublic com.broadleafcommerce.cart.client.domain.Cart removeCartItems(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<String> cartItemIds, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceRemove items from the cart.- Specified by:
- removeCartItemsin interface- CartOperationService
- Parameters:
- cart- The id of the cart on which to perform the operation.
- cartItemIds- The ids of the cart items on which to perform the operation.
- allowPriceCart- Whether to allow the cart to be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The cart with the item removed.
 
 - 
updateCartContactInfopublic com.broadleafcommerce.cart.client.domain.Cart updateCartContactInfo(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull ContactInfoRequest contactInfoRequest, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdate contact information to allow business users to contact the customer if needed.- Specified by:
- updateCartContactInfoin interface- CartOperationService
- Parameters:
- cart- The cart that hold the contact info.
- contactInfoRequest- The contact info that is to be added to the cart.
- allowPriceCart- Whether to allow the cart to be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The cart with updated contact info.
 
 - 
addCodeToCartpublic AddCodeToCartResponse addCodeToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull AddCodeRequest codeRequest, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartOperationService- Retrieve the cart
- Determine if the code is valid as a campaign tracking code
- If so, add it to the cart as a CampaignRef
- Determine if the code is valid as a shared code
- If so, add it to the cart
- Update the cart
- Price the cart, using offers and price lists (optional)
- Update the cart and its items (optional)
 - Specified by:
- addCodeToCartin interface- CartOperationService
- Parameters:
- cart- The id of the cart on which to perform the operation.
- codeRequest- The payload of the request to add a code to the cart.
- allowPriceCart- Whether to allow the cart to be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- An AddCodeToCartResponse describing the results of adding the offer code to the cart
 
 - 
updateFulfillmentGrouppublic com.broadleafcommerce.cart.client.domain.Cart updateFulfillmentGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId, @NonNull @NonNull UpdateFulfillmentGroupRequest fulfillmentGroupRequest, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Description copied from interface:CartOperationServiceUpdate the fulfillment group.- Specified by:
- updateFulfillmentGroupin interface- CartOperationService
- Parameters:
- cart- The id of the cart on which to perform the operation.
- fulfillmentGroupId- The id of the fulfillment group on which to perform the operation.
- fulfillmentGroupRequest- The fulfillment group updates to be applied to the existing fulfillment group.
- allowPriceCart- Whether to allow the cart to be priced after updating
- contextInfo- Context information around sandbox and multitenant state.
- Returns:
- The Cart for which the updated fulfillment group is a part.
 
 - 
validateCartStatusChangeRequestprotected void validateCartStatusChangeRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdateCartStatusRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Takes aUpdateCartStatusRequestand validates that the targeted cart can have its status changed. By default, the only valid statuses that can be changed areDefaultCartStatuses.IN_PROCESS,DefaultCartStatuses.REJECTED, andDefaultCartStatuses.REQUIRES_APPROVAL.- Parameters:
- cart- The cart to be changed
- request- The request with the details of how to change the cart status
- contextInfo- Additional sandbox and multitenant info
 
 - 
isUsingCollectOnDeliveryprotected boolean isUsingCollectOnDelivery(@Nullable com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
 - 
hasDeselectedCODprotected boolean hasDeselectedCOD(@Nullable com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)
 - 
handleCODStatusChangeprotected boolean handleCODStatusChange(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @Nullable com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup)Handles when Collect on Delivery is selected or de-selected. This will validate updates as to the cart as well that may cause Collect on Delivery to become invalid based on the cart price, fulfillment option, etc. If COD was de-selected, this will archive COD payments and remove Fee cart items related to COD.- Parameters:
- cart- Cart to be updated
- paymentLockTokens- Lock tokens to lock payment if needing to archive any when COD is de-selected
- contextInfo- Additional sandbox or multitenant info
- fulfillmentGroup- The fulfillment group marked as using COD
- Returns:
- Whether one or more CartItemswere added representing a COD fee if selected or whether such items were removed because COD was de-selected.
- Throws:
- CODPaymentMethodNotApplicableException- When COD is selected but the update to be performed on the cart would invalidate its usage. This allows the user to change be alerted and change their mind before losing COD.
 
 - 
handleDeSelectCODBeforeUpdateprotected boolean handleDeSelectCODBeforeUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @Nullable Map<String,String> paymentLockTokens, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Handles when Collect on Delivery is selected or de-selected. This will validate updates as to the cart as well that may cause Collect on Delivery to become invalid based on the cart price, fulfillment option, etc.- Parameters:
- cart- Cart to be updated
- fulfillmentGroup- The fulfillment group marked as using COD
- paymentLockTokens- Lock tokens to lock payment if needing to archive any when COD is de-selected
- contextInfo- Additional sandbox or multitenant info
- Returns:
- Whether one or more CartItemsrepresenting a COD fee were removed.
 
 - 
handleSelectCODBeforeUpdateprotected boolean handleSelectCODBeforeUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Handles when Collect on Delivery is selected. This will validate updates as to the cart as well that may cause Collect on Delivery to become invalid based on the cart price, fulfillment option, etc.- Parameters:
- cart- Cart to be updated
- fulfillmentGroup- The fulfillment group marked as using COD
- contextInfo- Additional sandbox or multitenant info
- Returns:
- Whether a new CartItemwas added representing a COD fee.
- Throws:
- CODPaymentMethodNotApplicableException- When COD is selected but the update to be performed on the cart would invalidate its usage. This allows the user to change be alerted and change their mind before losing COD.
 
 - 
getCODCheckoutPaymentMethodOptionprotected CheckoutPaymentMethodOption getCODCheckoutPaymentMethodOption(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) 
 - 
validateCollectOnDeliverySelectionprotected void validateCollectOnDeliverySelection(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
 - 
validateCollectOnDeliverySelectionprotected void validateCollectOnDeliverySelection(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)Validates that Collect on Delivery is still applicable given the updated cart state.- Parameters:
- cart- Cart to be updated
- fulfillmentGroup- Fulfillment group marked as using COD
- codCheckoutPaymentMethodOption- COD- CheckoutPaymentMethodOption
- contextInfo- Additional multitenant or sandbox info.
- Throws:
- CODPaymentMethodNotApplicableException- When COD is no longer valid for the requested updates to the cart.
 
 - 
doFulfillmentExclusionsPassForCODprotected boolean doFulfillmentExclusionsPassForCOD(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)
 - 
doFulfillmentInclusionsPassForCODprotected boolean doFulfillmentInclusionsPassForCOD(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup, @NonNull @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)
 - 
isCartMaxTotalAllowedForCODprotected boolean isCartMaxTotalAllowedForCOD(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)
 - 
isCartMinTotalAllowedForCODprotected boolean isCartMinTotalAllowedForCOD(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull CheckoutPaymentMethodOption codCheckoutPaymentMethodOption)
 - 
buildCODFeeCartItemprotected com.broadleafcommerce.cart.client.domain.CartItem buildCODFeeCartItem(CheckoutPaymentMethodOption.FeeDto fee) 
 - 
isCartItemCODFeeprotected boolean isCartItemCODFee(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
 - 
handleSetDeselectedCODAttributeprotected void handleSetDeselectedCODAttribute(@NonNull @NonNull UpdateFulfillmentGroupRequest updateFulfillmentGroupRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fgToUpdate)Sets a temporary attribute on the fullfillment group if theCOD status attributehas gone from selected to not selected. This informs the update logic later on that related payments should be archived and fee cart items for COD should be removed.- Parameters:
- updateFulfillmentGroupRequest- Request to update a fulfillment group
- fgToUpdate- Fulfillment group to update
 
 - 
getProvidersprotected CartOperationServiceProviders getProviders() 
 - 
getCartPricingServiceprotected CartPricingService getCartPricingService() 
 - 
getCartItemConfigurationServiceprotected CartItemConfigurationService<? extends CatalogItem> getCartItemConfigurationService() 
 - 
getCartItemCatalogInformationServiceprotected CartItemCatalogInformationService<? extends CatalogItem> getCartItemCatalogInformationService() 
 - 
getAuthenticationUtilsprotected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils() 
 - 
getTypeFactoryprotected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() 
 - 
getPropertiesprotected CartOperationServiceProperties getProperties() 
 - 
getCartItemMergingServiceprotected CartItemMergingService<com.broadleafcommerce.cart.client.domain.CartItem> getCartItemMergingService() 
 - 
getMessageSourceprotected org.springframework.context.MessageSource getMessageSource() 
 - 
getTaxServiceprotected TaxService getTaxService() 
 - 
getStaleCartPricingResultHolderprotected StaleCartPricingResultHolder getStaleCartPricingResultHolder() 
 - 
getOfferUtilsprotected CartOperationServiceOfferUtils getOfferUtils() 
 - 
setOfferUtils@Autowired public void setOfferUtils(CartOperationServiceOfferUtils offerUtils) 
 - 
getStaleCartItemsServiceprotected StaleCartItemsService getStaleCartItemsService() 
 - 
setStaleCartItemsService@Autowired public void setStaleCartItemsService(StaleCartItemsService staleCartItemsService) 
 - 
getPaymentProviderprotected PaymentProvider<PaymentSummary> getPaymentProvider() 
 - 
setPaymentProvider@Autowired public void setPaymentProvider(PaymentProvider<PaymentSummary> paymentProvider) 
 - 
getCheckoutPaymentMethodServiceprotected CheckoutPaymentMethodService getCheckoutPaymentMethodService() 
 - 
setCheckoutPaymentMethodService@Autowired public void setCheckoutPaymentMethodService(CheckoutPaymentMethodService checkoutPaymentMethodService) 
 - 
getSpelRuleEvaluationServiceprotected com.broadleafcommerce.rulesengine.expression.service.SpelRuleEvaluationService getSpelRuleEvaluationService() 
 - 
setSpelRuleEvaluationService@Autowired public void setSpelRuleEvaluationService(com.broadleafcommerce.rulesengine.expression.service.SpelRuleEvaluationService spelRuleEvaluationService) 
 - 
setInventoryAvailabilityService@Autowired public void setInventoryAvailabilityService(InventoryAvailabilityService<CatalogItem> inventoryAvailabilityService) 
 - 
getInventoryAvailabilityServiceprotected InventoryAvailabilityService<CatalogItem> getInventoryAvailabilityService() 
 
- 
 
-