public class DefaultCartOperationService extends Object implements CartOperationService
Modifier and Type | Class and Description |
---|---|
static class |
DefaultCartOperationService.BulkCartItemCreationResponse |
Constructor and Description |
---|
DefaultCartOperationService(CartOperationServiceProviders providers,
CartPricingService cartPricingService,
CartItemConfigurationService cartItemConfigurationService,
CartItemProductService cartItemProductService,
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,
com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayConfigurationProvider paymentGatewayConfigurationProvider,
com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayPaymentValidationProvider paymentValidationProvider) |
Modifier and Type | Method and Description |
---|---|
com.broadleafcommerce.cart.client.domain.Cart |
addAttributeToCart(@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 provided
Cart . |
protected boolean |
addCampaignForCodeIfExists(String code,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Adds a
code to the Cart if it belongs to a campaign. |
AddCodeToCartResponse |
addCodeToCart(@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 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)
|
protected 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,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Adds the list of
FreeGiftItems to cart, and then adds the ids of those
added free gift cart items to the qualifier cart items attributes. |
protected void |
addItemsToFulfillmentGroup(@NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.CartItem> cartItems,
@NonNull com.broadleafcommerce.cart.client.domain.FulfillmentGroup fulfillmentGroup,
@NonNull javax.money.CurrencyUnit expectedCurrency)
Deprecated.
|
protected void |
addItemsToFulfillmentGroup(@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.Cart |
addItemToCart(@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 provided
Cart based on the provided AddItemRequest . |
protected void |
addItemToFulfillmentGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
Deprecated.
|
protected void |
addItemToFulfillmentGroup(@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.
|
BulkAddToCartResponse |
addManyItemsToCart(@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 provided
Cart . |
protected boolean |
addOfferCodeIfUsable(String code,
boolean isForCampaign,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Adds the
code to Cart.getOfferCodes() if it's usable. |
AddCodeToCartResponse |
addOfferCodeToCart(@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 provided
Cart . |
com.broadleafcommerce.cart.client.domain.Cart |
addPaymentToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull AddPaymentRequest addPaymentRequest,
boolean price,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Add a
Payment to the cart based on the AddPaymentRequest payload. |
protected void |
addRemovedFreeGiftOfferToIgnoreList(com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)
Adds the offer id to
Cart's ignore list in Cart.getInternalAttributes()
whenever a free gift item is removed, so that the free gift item will not be added again. |
com.broadleafcommerce.cart.client.domain.Cart |
addToCart(@NonNull AddItemRequest addItemRequest,
com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.cart.client.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.Cart |
addUnassignedItemsToFulfillmentGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Identify
CartItems that have not been assigned to a FulfillmentGroup
& add them to the relevant FulfillmentGroup. |
protected AddCodeToCartResponse |
buildAddCodeToCartResponse(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String code,
boolean cartWasRepriced)
Builds an
AddCodeToCartResponse based on the provided cart, code, & whether or not
the cart was repriced |
protected AddItemRequest |
buildAddItemRequest(com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGiftItem)
Builds an
AddItemRequest from the given FreeGiftItem . |
protected com.broadleafcommerce.order.common.domain.CampaignRef |
buildCampaignRef(String code,
String trackingId) |
protected com.broadleafcommerce.cart.client.domain.CartItem |
buildCartItem(@NonNull AddItemRequest addItemRequest,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
|
protected com.broadleafcommerce.cart.client.domain.CartItem |
buildCartItem(@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 the
AddItemRequest . |
protected DefaultCartOperationService.BulkCartItemCreationResponse |
buildCartItems(@NonNull Collection<AddItemRequest> addItemRequests,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
|
protected DefaultCartOperationService.BulkCartItemCreationResponse |
buildCartItems(@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 the
AddItemRequests . |
protected String |
buildGroupReferenceNumber(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Builds a
FulfillmentGroup.getReferenceNumber() for a new group. |
protected String |
buildGroupReferenceNumber(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
String fulfillmentGroupId)
Builds a
FulfillmentGroup.getReferenceNumber() for the given cart and group ID. |
protected com.broadleafcommerce.cart.client.domain.ConfigError |
buildInventoryUnavailableError() |
protected Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> |
buildItemAttributeChoices(@NonNull Map<String,String> requestItemAttributeChoices) |
protected com.broadleafcommerce.order.common.domain.OfferItemDetail |
buildOfferItemDetails(com.broadleafcommerce.cart.client.domain.CartItem cartItem,
String offerId)
Builds an
OfferItemDetail from the given CartItem and offer id. |
protected com.broadleafcommerce.order.common.domain.OfferItemDetail |
buildOfferItemDetails(com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail offerItemDetail)
Builds an
OfferItemDetail from the given
OfferItemDetail . |
protected AddItemFailure |
buildValidationFailure(@NonNull AddItemRequest addItemRequest,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
Builds an
AddItemFailure based on the provided AddItemRequest &
CartItem representing an invalid add to cart request |
BulkAddToCartResponse |
bulkAddToCart(@NonNull Collection<AddItemRequest> addItemRequests,
com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.cart.client.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 int |
calculateDependentItemsQuantityWithSameSku(@NonNull com.broadleafcommerce.cart.client.domain.CartItem dependentCartItem,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
int parentQuantity) |
protected int |
calculateItemsQuantityWithSameSku(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) |
protected int |
calculateItemsQuantityWithSameSku(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
int parentItemQuantity) |
protected void |
checkDependentItemInternalInventoryAvailability(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem dependantCartItem,
@NonNull Product dependentProduct)
Checks the inventory-related fields in the catalog data to determine whether or not the
dependent item is available.
|
protected void |
checkInternalInventoryAvailability(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
@NonNull List<Product> products)
Checks the inventory-related fields in the catalog data to determine whether or not the item
is available.
|
protected void |
checkInventoryAvailability(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull Product product,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
|
protected void |
checkInventoryAvailability(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull Product product,
@NonNull List<Product> products,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Checks the inventory of the cart item.
|
protected void |
checkQuantityWithinThreshold(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.cart.client.domain.CartItem cartItem,
Product product)
Checks if the quantity of the item fits within the threshold.
|
com.broadleafcommerce.cart.client.domain.Cart |
createCart(@NonNull CartCreationRequest cartCreationRequest,
com.broadleafcommerce.cart.client.domain.CustomerRef customer,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
|
protected com.broadleafcommerce.cart.client.domain.CartAlert |
createCartAlert(String message) |
protected com.broadleafcommerce.cart.client.domain.CartItem |
createCartItem(@NonNull AddItemRequest addItemRequest)
Deprecated.
in favor of
createCartItem(AddItemRequest, CurrencyUnit) |
protected com.broadleafcommerce.cart.client.domain.CartItem |
createCartItem(@NonNull AddItemRequest addItemRequest,
javax.money.CurrencyUnit currencyUnit)
Creates a
CartItem based on the provided AddItemRequest |
protected com.broadleafcommerce.cart.client.domain.Cart |
createEmptyCart(com.broadleafcommerce.cart.client.domain.CustomerRef customer,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
|
protected com.broadleafcommerce.cart.client.domain.Cart |
createEmptyCart(com.broadleafcommerce.cart.client.domain.CustomerRef customer,
javax.money.CurrencyUnit currencyUnit,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Creates and returns an empty, unsaved
Cart with typical defaults. |
protected void |
createFulfillmentGroupForItems(@NonNull Collection<? extends com.broadleafcommerce.cart.client.domain.CartItem> cartItems,
@NonNull String fulfillmentType,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Deprecated.
|
protected void |
createFulfillmentGroupForItems(@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.Cart |
createItemAndAddToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull AddItemRequest addItemRequest,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
|
protected com.broadleafcommerce.cart.client.domain.Cart |
createItemAndAddToCart(@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 provided
Cart . |
protected BulkAddToCartResponse |
createItemsAndAddToCart(@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 provided
Cart . |
protected void |
defaultCartCurrency(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
in favor of
defaultCartCurrency(Cart, CurrencyUnit) |
protected void |
defaultCartCurrency(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
javax.money.CurrencyUnit currencyUnit) |
protected void |
defaultCartLocale(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) |
protected String |
determineDependentItemKey(@NonNull Product product,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem dependantCartItem)
Determines the item key for the dependent cart item.
|
protected String |
determineInventoryCheckStrategy(@NonNull Product product,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) |
protected boolean |
doesCartContainCampaignForCode(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
String code)
Determines whether the
Cart contains a CampaignRef that matches the
code . |
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils |
getAuthenticationUtils() |
protected CartItemConfigurationService |
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 CartItemProductService |
getCartItemProductService() |
protected CartPricingService |
getCartPricingService() |
protected javax.money.CurrencyUnit |
getCurrencyUnit(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 String |
getMessage(@NonNull String errorMessage,
Object... args) |
protected org.springframework.context.MessageSource |
getMessageSource() |
protected CartOperationServiceOfferUtils |
getOfferUtils() |
protected com.broadleafcommerce.order.common.domain.Payment |
getPayment(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
String paymentId) |
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayConfigurationProvider |
getPaymentGatewayConfigurationProvider() |
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayPaymentValidationProvider |
getPaymentValidationProvider() |
protected String |
getPricingChangeMessage(javax.money.MonetaryAmount oldCartPrice,
javax.money.MonetaryAmount latestCartPrice) |
protected Object |
getProductType(com.broadleafcommerce.cart.client.domain.CartItem cartItem) |
protected CartOperationServiceProperties |
getProperties() |
protected CartOperationServiceProviders |
getProviders() |
protected List<com.broadleafcommerce.order.common.domain.Adjustment> |
getRelatedAdjustments(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String code) |
protected Map<String,Integer> |
getRequestedQuantitiesPerSku(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull Product product)
Deprecated.
|
protected Map<String,Integer> |
getRequestedQuantitiesPerSku(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull Product product,
@NonNull List<Product> products) |
protected com.broadleafcommerce.cart.client.domain.CartItem |
getRequiredCartItem(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String cartItemId)
Gets a cart item from the cart by its ID.
|
protected StaleCartPricingResultHolder |
getStaleCartPricingResultHolder() |
protected TaxService |
getTaxService() |
protected com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
protected void |
invalidateFulfillmentGroupOverride(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem) |
protected boolean |
isPaymentGatewaySupported(String gatewayType)
Checks if
PaymentGatewayConfiguration has been registered for the payment's
Payment.getGatewayType() |
protected BulkAddToCartResponse |
newBulkAddToCartResponse()
Instantiates a new
BulkAddToCartResponse using the TypeFactory . |
protected com.broadleafcommerce.cart.client.domain.Cart |
newCart()
Uses the
TypeFactory to create a new Cart object. |
protected CartCreationRequest |
newCartCreationRequest() |
protected com.broadleafcommerce.cart.client.domain.CartPricing |
newCartPricing()
Uses the
TypeFactory to create a new CartPricing object. |
protected String |
newCartStatus(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Determines what status should be used when creating new carts.
|
protected boolean |
populateCartItemUpdates(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull UpdateItemRequest request)
Takes the changes from the
UpdateItemRequest and populates them onto the
CartItem . |
protected boolean |
populateCartUpdatesFromUpdateItemRequest(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull UpdateItemRequest request)
Takes the changes from the
UpdateItemRequest and populates them onto the
Cart . |
protected com.broadleafcommerce.cart.client.domain.CartItem |
populateFromRequest(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull AddItemRequest addItemRequest)
Deprecated.
|
protected com.broadleafcommerce.cart.client.domain.CartItem |
populateFromRequest(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull AddItemRequest addItemRequest,
javax.money.CurrencyUnit currencyUnit)
Populates the cart item fields based on the request.
|
protected com.broadleafcommerce.order.common.domain.Payment |
populatePayment(@NonNull com.broadleafcommerce.order.common.domain.Payment payment,
@NonNull AddPaymentRequest addPaymentRequest) |
protected com.broadleafcommerce.order.common.domain.Payment |
populatePaymentUpdates(@NonNull com.broadleafcommerce.order.common.domain.Payment payment,
@NonNull UpdatePaymentRequest updatePaymentRequest) |
com.broadleafcommerce.cart.client.domain.Cart |
priceCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
PriceCartRequest priceCartRequest,
boolean saveCart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Prices cart, processes free gift offers, and saves cart with the provided
PriceCartRequest if saveCart is true. |
com.broadleafcommerce.cart.client.domain.Cart |
priceCart(@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 provided
PriceCartRequest . |
com.broadleafcommerce.cart.client.domain.Cart |
priceCartWithCatalogPriceUpdates(@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 items
|
protected 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 of
FreeGiftItems to add to cart. |
protected void |
processFreeGiftItemsForRemoval(com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)
Processes free gift items whenever
CartItems are being removed. |
protected void |
processFreeGiftOffers(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Processes all free gift offers stored in
Cart.getInternalAttributes() . |
com.broadleafcommerce.cart.client.domain.Cart |
recalculateTaxesForCart(@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 provided
Cart . |
protected 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.
|
protected void |
removeAssociatedQualifierAndTargetDetails(com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)
Removes all qualifier and target
OfferItemDetails that are associated
with the give CartItems . |
com.broadleafcommerce.cart.client.domain.Cart |
removeAttributeFromCart(@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 provided
Cart . |
com.broadleafcommerce.cart.client.domain.Cart |
removeCartItems(@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 void |
removeExistingFreeGiftItemsFromCart(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 gift
CartItems from cart. |
protected com.broadleafcommerce.cart.client.domain.Cart |
removeFulfillmentItemsWithoutCartItems(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) |
com.broadleafcommerce.cart.client.domain.Cart |
removeItemFromCart(@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 provided
Cart matching the provided cart item ID. |
protected void |
removeItemsFromFulfillmentGroup(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems) |
com.broadleafcommerce.cart.client.domain.Cart |
removeManyItemsFromCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
Collection<String> cartItemIds,
boolean price,
boolean updateCart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Removes one or more items from the provided
Cart matching the provided cart item IDs. |
com.broadleafcommerce.cart.client.domain.Cart |
removeOfferAndCampaignCodesFromCart(@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.Cart |
removeOfferCodeFromCart(@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 provided
Cart , if it exists. |
com.broadleafcommerce.cart.client.domain.Cart |
removePaymentFromCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String paymentId,
boolean price,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Remove the payment from the
Cart . |
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 void |
resetFulfillmentGroupReferenceNumbers(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart) |
protected String |
resolveDefaultFulfillmentType(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
Determines the default
FulfillmentType for the provided CartItem |
protected String |
resolveTaxAddressSource(String fulfillmentType)
Determines the tax address source that should be used for
FulfillmentGroup.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> |
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> |
retrieveCustomerCartByStatus(String customerId,
String status,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieves a cart with the provided customer ID and status, if it exists
|
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.
|
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.Cart |
saveCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Helper method to encapsulate saving an existing Cart.
|
void |
setOfferUtils(CartOperationServiceOfferUtils offerUtils) |
com.broadleafcommerce.cart.client.domain.Cart |
updateAsNamedCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull String name,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Updates the provided
Cart with the DefaultCartStatuses.NAMED . |
com.broadleafcommerce.cart.client.domain.Cart |
updateCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
boolean allowPriceCart,
boolean wasCartModified,
boolean invalidatePrices,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Updates the provided
Cart based on the provided flags. |
protected com.broadleafcommerce.cart.client.domain.Cart |
updateCartAttributes(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull List<AddItemRequest> successfulAddItemRequests)
Update cart attributes based on the successful
AddItemRequests |
com.broadleafcommerce.cart.client.domain.Cart |
updateCartContactInfo(@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.Cart |
updateCartItem(@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.Cart |
updateContactInfoInCart(@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 provided
Cart . |
protected void |
updateExistingFreeGiftItemAndQualifierItems(com.broadleafcommerce.cart.client.domain.Cart cart,
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 gift
CartItem with the latest details from the given
FreeGiftItem , and update its qualifier CartItems to ensure that the
existing free gift CartItem is added into
CartItemAttributeConstants.Internal#TARGET_CART_ITEM_DETAILS . |
com.broadleafcommerce.cart.client.domain.Cart |
updateFulfillmentGroup(@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.Cart |
updateFulfillmentGroupInCart(@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 existing
FulfillmentGroup for the provided Cart . |
protected void |
updateFulfillmentItem(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
Updates the
FulfillmentItem corresponding to the CartItem , keeping them in
sync. |
com.broadleafcommerce.cart.client.domain.Cart |
updateItemInCart(@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 provided
Cart based on the provided
UpdateItemRequest . |
com.broadleafcommerce.cart.client.domain.Cart |
updatePayment(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull UpdatePaymentRequest updatePaymentRequest,
boolean allowPriceCart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Update a
Payment on the cart identified by the paymentId & based on the
UpdatePaymentRequest payload. |
com.broadleafcommerce.cart.client.domain.Cart |
updatePaymentInCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull UpdatePaymentRequest updatePaymentRequest,
boolean price,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Updates an existing
Payment in the cart based on the UpdatePaymentRequest
payload. |
protected void |
validateAddPaymentRequest(@NonNull com.broadleafcommerce.order.common.domain.Payment payment,
@NonNull AddPaymentRequest addPaymentRequest)
Check the validity of the provided
Payment that is to be added |
protected void |
validateCartItem(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull Product product,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
|
protected void |
validateCartItem(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull Product product,
@NonNull List<Product> products,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates that the
CartItem includes enough information to correctly represent the
product or one of the product's variants. |
protected void |
validateCartItemAfterUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
|
protected void |
validateCartItemAfterUpdate(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
@NonNull List<Product> products,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) |
protected void |
validateGatewayType(@NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Validate that the
Payment has a supported Payment.getGatewayType() value. |
protected void |
validatePaymentAmounts(@NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Validate that the
Payment amount is not a negative amount. |
protected void |
validatePaymentGatewayProperties(@NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Validate that the add payment request sufficiently represents a payment method for the
declared
Payment.gatewayType |
protected void |
validateRequestToSavePayment(@NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Validate that the
Payment can be saved to the customer's account for future use. |
protected void |
validateUpdatePaymentRequest(@NonNull com.broadleafcommerce.order.common.domain.Payment payment,
@NonNull UpdatePaymentRequest updatePaymentRequest)
Validate that the updates provided by the
UpdatePaymentRequest parameter will produce
a valid Payment . |
protected void |
verifySkuAvailability(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
@NonNull List<Product> products,
@NonNull Map<String,Boolean> availabilityMap) |
protected void |
verifySkuAvailability(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
@NonNull Map<String,Boolean> availabilityMap)
Deprecated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
priceCart, priceCart, removeManyItemsFromCart
public DefaultCartOperationService(CartOperationServiceProviders providers, CartPricingService cartPricingService, CartItemConfigurationService cartItemConfigurationService, CartItemProductService cartItemProductService, 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, com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayConfigurationProvider paymentGatewayConfigurationProvider, com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayPaymentValidationProvider paymentValidationProvider)
public Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
retrieveCartByCartId
in interface CartOperationService
cartId
- The id of the cart on which to perform the operation.contextInfo
- Context information around sandbox and multitenant state.public Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCustomerCartByStatus(String customerId, String status, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
retrieveCustomerCartByStatus
in interface CartOperationService
customerId
- the customer IDstatus
- the statuscontextInfo
- the context infopublic com.broadleafcommerce.cart.client.domain.Cart createCart(@NonNull @NonNull CartCreationRequest cartCreationRequest, @Nullable com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
Cart
for the provided CartCreationRequest
and
CustomerRef
. The CartCreationRequest
must contain
For guest customers, this will create a new guest cart
createCart
in interface CartOperationService
cartCreationRequest
- the cart creation requestcustomer
- the customercontextInfo
- the context infoprotected void processFreeGiftOffers(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart.getInternalAttributes()
. This will
automatically add free gift cart items to cart, update existing free gift items, and remove
existing free gift items, if necessary.cart
- the Cart
to process the free gift offers forcontextInfo
- the contextInfo for the requestprotected 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)
FreeGiftItems
to add to cart.cart
- the Cart
to process existing free gift items forupdatedCartItems
- a list of CartItems
whose quantities were updatedcontextInfo
- the contextInfo for the requestFreeGiftItems
to add to cartprotected void updateExistingFreeGiftItemAndQualifierItems(com.broadleafcommerce.cart.client.domain.Cart cart, 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)
CartItem
with the latest details from the given
FreeGiftItem
, and update its qualifier CartItems
to ensure that the
existing free gift CartItem
is added into
CartItemAttributeConstants.Internal#TARGET_CART_ITEM_DETAILS
.cart
- the Cart
to process existing free gift item and
Cart.getCartItems()
forexistingFreeGiftItem
- the existing free gift CartItem
to update the
FreeGiftItem
details forfreeGift
- the FreeGiftItem
to update the existing free gift CartItem
withupdatedCartItems
- a list of CartItems
whose quantities were updated,
used to ensure the FulfillmentItems
are updated as wellprotected com.broadleafcommerce.order.common.domain.OfferItemDetail buildOfferItemDetails(com.broadleafcommerce.promotion.offer.client.web.context.info.OfferItemDetail offerItemDetail)
OfferItemDetail
from the given
OfferItemDetail
.offerItemDetail
- the
OfferItemDetail
to build the OfferItemDetail
fromOfferItemDetail
from the given
OfferItemDetail
protected com.broadleafcommerce.order.common.domain.OfferItemDetail buildOfferItemDetails(com.broadleafcommerce.cart.client.domain.CartItem cartItem, String offerId)
OfferItemDetail
from the given CartItem
and offer id.cartItem
- the CartItem
to get the OfferItemDetail.getItemId()
and
OfferItemDetail.getQuantity()
fromofferId
- the offer id to get the OfferItemDetail.getOfferId()
fromOfferItemDetail
from the given CartItem
and offer idprotected 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)
FreeGiftItems
to cart, and then adds the ids of those
added free gift cart items to the qualifier cart items attributes.cart
- the Cart
to add the FreeGiftItems
tofreeGiftItemsToAdd
- a list of FreeGiftItems
to addupdatedCartItems
- a list of CartItems
whose attributes were updatedprotected 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)
CartItems
from cart.
Before removing existing free gift CartItems
, this removes the
CartItemAttributeConstants.Internal#IS_FREE_GIFT_ITEM
attribute to ensure that the
free gift offer is not added to the offer ignore list in
addRemovedFreeGiftOfferToIgnoreList(Cart, List)
.
cart
- the Cart
to remove the existing free gift items fromexistingFreeGiftItemsToRemove
- the existing free gift CartItems
to
removecontextInfo
- the contextInfo for the requestCartOperationService.removeManyItemsFromCart(Cart, Collection, boolean, ContextInfo)
,
processFreeGiftItemsForRemoval(Cart, List)
protected AddItemRequest buildAddItemRequest(com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem freeGiftItem)
AddItemRequest
from the given FreeGiftItem
.freeGiftItem
- FreeGiftItem
to build the AddItemRequest
forAddItemRequest
for the given FreeGiftItem
public com.broadleafcommerce.cart.client.domain.Cart updateCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean allowPriceCart, boolean wasCartModified, boolean invalidatePrices, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
Cart
based on the provided flags. wasCartModified
), this will price and update the cart
when the cart is not already priced (Cart.isPriced()
), regardless of
invalidatePrices
. If the cart was not modified and the cart is already priced, this
does nothing. allowPriceCart
) and if
not already already priced or if prices should be invalidated. updateCart
in interface CartOperationService
cart
- the cart to be updatedallowPriceCart
- whether the cart may be pricedwasCartModified
- whether the cart was actually modified by the callerinvalidatePrices
- whether to invalidate prices on the cart if changes were madepublic 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)
CartOperationService
Cart
with the DefaultCartStatuses.NAMED
. This method is
often used when transferring or creating new carts for a registered customer who already has
an in-progress cart.updateAsNamedCart
in interface CartOperationService
cart
- the cart to updatename
- the name for the cartcontextInfo
- the context infopublic 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)
CartOperationService
Cart
based on the provided AddItemRequest
.addItemToCart
in interface CartOperationService
cart
- the cartaddItemRequest
- the request to add an itemprice
- whether or not to re-price the cartcontextInfo
- the context infopublic 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)
CartOperationService
Cart
based on the provided
UpdateItemRequest
.updateItemInCart
in interface CartOperationService
cart
- the cartupdateItemRequest
- the request to update an itemprice
- whether or not to re-price the cartcontextInfo
- the context infopublic 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)
CartOperationService
Cart
matching the provided cart item ID.removeItemFromCart
in interface CartOperationService
cart
- the cartcartItemId
- the cart item IDprice
- whether or not to re-price the cartcontextInfo
- the context infopublic 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)
CartOperationService
Cart
.addManyItemsToCart
in interface CartOperationService
cart
- the cartaddItemRequests
- the add item requestsprice
- whether or not to re-price the cartcontextInfo
- the context infopublic com.broadleafcommerce.cart.client.domain.Cart removeManyItemsFromCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<String> cartItemIds, boolean price, boolean updateCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
Cart
matching the provided cart item IDs.removeManyItemsFromCart
in interface CartOperationService
cart
- the cartcartItemIds
- the cart item IDsprice
- whether or not to re-price the cartupdateCart
- whether or not to update Cart
pricing and save the cart after the
removalcontextInfo
- the context infoprotected void processFreeGiftItemsForRemoval(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)
CartItems
are being removed.cart
- the Cart
the items are being removed fromcartItemsBeingRemoved
- the list of CartItems
being removed from cartprotected void addRemovedFreeGiftOfferToIgnoreList(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)
Cart's
ignore list in Cart.getInternalAttributes()
whenever a free gift item is removed, so that the free gift item will not be added again.cart
- the Cart
to add the offer id ignore list tocartItemsBeingRemoved
- the list of CartItems
being removed from cartCartAttributeConstants.Internal#OFFER_IDS_TO_IGNORE
protected void removeAssociatedFreeGiftItems(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)
cart
- the Cart
to remove the free gift item fromcartItemsBeingRemoved
- the list of CartItems
being removed from cartprotected void removeAssociatedQualifierAndTargetDetails(com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItemsBeingRemoved)
OfferItemDetails
that are associated
with the give CartItems
.
This is useful whenever the given list of CartItems
are being removed from
Cart
, and needs to remove all their associated qualifier and target
OfferItemDetails
from the other CartItems
.
cart
- the Cart
where the CartItems
are fromcartItemsBeingRemoved
- a list of CartItems
being removed and to remove
the associated qualifier and target OfferItemDetails
forpublic 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)
CartOperationService
Cart
.
CampaignRef
addOfferCodeToCart
in interface CartOperationService
cart
- the cartaddOfferCodeRequest
- the add offer code requestprice
- whether or not to re-price the cartcontextInfo
- the context infoprotected AddCodeToCartResponse buildAddCodeToCartResponse(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String code, boolean cartWasRepriced)
AddCodeToCartResponse
based on the provided cart, code, & whether or not
the cart was repricedcart
- The updated Cart
, including the code and applicable adjustments
(discounts).code
- The offer code that was added to the cartcartWasRepriced
- Whether or not the cart was repriced after the code was addedprotected List<com.broadleafcommerce.order.common.domain.Adjustment> getRelatedAdjustments(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String code)
public 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)
CartOperationService
Cart
, if it exists.
CampaignRef
removeOfferCodeFromCart
in interface CartOperationService
cart
- cart cartofferCode
- the offer code to removeprice
- whether or not to re-price the cartcontextInfo
- the context infopublic 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)
CartOperationService
removeOfferAndCampaignCodesFromCart
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public 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)
CartOperationService
Cart
.addAttributeToCart
in interface CartOperationService
cart
- the cartaddAttributeRequest
- the add attribute requestprice
- whether to allow the cart to be priced after updatingcontextInfo
- the context infopublic 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)
CartOperationService
Cart
.removeAttributeFromCart
in interface CartOperationService
cart
- the cartkey
- the attribute keyprice
- whether to allow the cart to be priced after updatingcontextInfo
- the context infopublic 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)
CartOperationService
Cart
.updateContactInfoInCart
in interface CartOperationService
cart
- the cartcontactInfoRequest
- the contact info requestprice
- whether to allow the cart to be priced after updatingcontextInfo
- the context infopublic 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)
CartOperationService
FulfillmentGroup
for the provided Cart
.updateFulfillmentGroupInCart
in interface CartOperationService
cart
- the cartreferenceNumber
- the reference number of the fulfillment group to updateupdateFulfillmentGroupRequest
- the fulfillment group update requestprice
- whether to allow the cart to be priced after updatingcontextInfo
- the context infopublic com.broadleafcommerce.cart.client.domain.Cart addPaymentToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull AddPaymentRequest addPaymentRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
Payment
to the cart based on the AddPaymentRequest
payload.addPaymentToCart
in interface CartOperationService
cart
- the cartaddPaymentRequest
- the add payment requestprice
- whether to allow the cart to be priced after updatingcontextInfo
- the context infopublic com.broadleafcommerce.cart.client.domain.Cart updatePaymentInCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdatePaymentRequest updatePaymentRequest, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
Payment
in the cart based on the UpdatePaymentRequest
payload.updatePaymentInCart
in interface CartOperationService
cart
- the cartupdatePaymentRequest
- the update payment requestprice
- whether to allow the cart to be priced after updatingcontextInfo
- the context infopublic com.broadleafcommerce.cart.client.domain.Cart removePaymentFromCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String paymentId, boolean price, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
Cart
.removePaymentFromCart
in interface CartOperationService
cart
- the cartpaymentId
- the payment idprice
- whether to allow the cart to be priced after updatingcontextInfo
- the context infopublic 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)
CartOperationService
PriceCartRequest
.priceCart
in interface CartOperationService
cart
- the cartpriceCartRequest
- the price cart requestcontextInfo
- the context infopublic com.broadleafcommerce.cart.client.domain.Cart priceCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable PriceCartRequest priceCartRequest, boolean saveCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
PriceCartRequest
if saveCart
is true.priceCart
in interface CartOperationService
cart
- the cartpriceCartRequest
- the price cart requestsaveCart
- determines whether to save cart after pricingcontextInfo
- the context infopublic 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)
CartOperationService
priceCartWithCatalogPriceUpdates
in interface CartOperationService
cart
- The cart on which to perform the operation.contextInfo
- the context infopublic 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)
CartOperationService
Cart
.recalculateTaxesForCart
in interface CartOperationService
cart
- the cartestimated
- whether to calculate estimated taxesactual
- whether to calculate actual taxescontextInfo
- the context infoprotected javax.money.CurrencyUnit getCurrencyUnit(@Nullable PriceCartRequest priceCartRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
priceCartRequest
- the price cart request to look for currencycontextInfo
- the context info to look for currencyprotected 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)
cart
- the cartcontextInfo
- the context infoprotected com.broadleafcommerce.cart.client.domain.Cart removeFulfillmentItemsWithoutCartItems(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
protected com.broadleafcommerce.cart.client.domain.Cart createEmptyCart(@Nullable com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable javax.money.CurrencyUnit currencyUnit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
with typical defaults.customer
- the customercurrencyUnit
- the currency for the cartcontextInfo
- the context info@Deprecated protected com.broadleafcommerce.cart.client.domain.Cart createEmptyCart(@Nullable com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
createEmptyCart(CustomerRef, CurrencyUnit, ContextInfo)
Cart
with typical defaults.customer
- the customercontextInfo
- the context infoprotected void defaultCartLocale(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected void defaultCartCurrency(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable javax.money.CurrencyUnit currencyUnit)
@Deprecated protected void defaultCartCurrency(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
defaultCartCurrency(Cart, CurrencyUnit)
protected com.broadleafcommerce.cart.client.domain.Cart newCart()
TypeFactory
to create a new Cart
object.protected com.broadleafcommerce.cart.client.domain.CartPricing newCartPricing()
TypeFactory
to create a new CartPricing
object.protected CartCreationRequest newCartCreationRequest()
protected String newCartStatus(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
contextInfo
- the context infoprotected BulkAddToCartResponse newBulkAddToCartResponse()
BulkAddToCartResponse
using the TypeFactory
.protected 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)
Cart
.cart
- the cartaddItemRequest
- the add item requestcurrencyUnit
- the currency for the item(s)contextInfo
- the context info@Deprecated protected com.broadleafcommerce.cart.client.domain.Cart createItemAndAddToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull AddItemRequest addItemRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
createItemAndAddToCart(Cart, AddItemRequest, CurrencyUnit, ContextInfo)
Cart
.cart
- the cartaddItemRequest
- the add item requestcontextInfo
- the context infoprotected BulkAddToCartResponse createItemsAndAddToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, Collection<AddItemRequest> addItemRequests, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
.cart
- the cartaddItemRequests
- the add item requestcontextInfo
- the context infoprotected com.broadleafcommerce.cart.client.domain.Cart addUnassignedItemsToFulfillmentGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
CartItems
that have not been assigned to a FulfillmentGroup
& add them to the relevant FulfillmentGroup.
If the fulfillment type is FulfillmentType.VIRTUAL
,
CartOperationServiceProperties.getDefaultVirtualFulfillmentOptionName()
will be used
to identify the default fulfillment option.
cart
- The cart whose items may need to be assigned to a fulfillment groupprotected com.broadleafcommerce.cart.client.domain.Cart updateCartAttributes(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull List<AddItemRequest> successfulAddItemRequests)
AddItemRequests
cart
- The cart that was added tosuccessfulAddItemRequests
- List of AddItemRequests that were successfully processedprotected void updateFulfillmentItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
FulfillmentItem
corresponding to the CartItem
, keeping them in
sync.cart
- Cart
to which the items belongcartItem
- CartItem
with updates to be carried over to a FulfillmentItem
protected boolean populateCartItemUpdates(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull UpdateItemRequest request)
UpdateItemRequest
and populates them onto the
CartItem
.cartItem
- The CartItem
to be updated with changes from request
request
- The UpdateItemRequest
with changes for cartItem
cartItem
should be revalidated after updates are populated.protected boolean populateCartUpdatesFromUpdateItemRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdateItemRequest request)
UpdateItemRequest
and populates them onto the
Cart
.cart
- The Cart
to be updated with changes from request
request
- The UpdateItemRequest
with changes for cart
CartItem
referenced in request
should be revalidated after
updates are populated.protected void validateCartItemAfterUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
@Deprecated protected void validateCartItemAfterUpdate(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
validateCartItemAfterUpdate(Cart, CartItem, Product, List, ContextInfo)
protected void invalidateFulfillmentGroupOverride(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
protected boolean addCampaignForCodeIfExists(String code, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
code
to the Cart
if it belongs to a campaign.code
- Code to be added that might match a campaign.cart
- Cart to add the code
to.contextInfo
- the context infoCampaignRef.getCampaignTrackingId()
for the added campaign.protected boolean addOfferCodeIfUsable(String code, boolean isForCampaign, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
code
to Cart.getOfferCodes()
if it's usable.code
- The code to be addedisForCampaign
- Whether the code was used to add a CampaignRef
to the
cart
cart
- The cart to add the code
toAddCodeException
- 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 OfferRef
because 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.protected com.broadleafcommerce.order.common.domain.CampaignRef buildCampaignRef(String code, String trackingId)
protected final boolean doesCartContainCampaignForCode(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String code)
Cart
contains a CampaignRef
that matches the
code
.cart
- Cart with campaigns to match againstcode
- Code to match withprotected com.broadleafcommerce.order.common.domain.Payment populatePayment(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment, @NonNull @NonNull AddPaymentRequest addPaymentRequest)
protected void validateAddPaymentRequest(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment, @NonNull @NonNull AddPaymentRequest addPaymentRequest)
Payment
that is to be addedpayment
- The candidate payment to be added.addPaymentRequest
- The request to add a payment.InvalidAddPaymentRequestException
- if the add payment request produced an invalid
paymentprotected com.broadleafcommerce.order.common.domain.Payment getPayment(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String paymentId)
protected com.broadleafcommerce.order.common.domain.Payment populatePaymentUpdates(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment, @NonNull @NonNull UpdatePaymentRequest updatePaymentRequest)
protected void validateUpdatePaymentRequest(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment, @NonNull @NonNull UpdatePaymentRequest updatePaymentRequest)
UpdatePaymentRequest
parameter will produce
a valid Payment
.payment
- The payment that is to be updated.updatePaymentRequest
- The request to update a payment.InvalidUpdatePaymentRequestException
- if the update payment request produced an
invalid paymentprotected void validateGatewayType(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Payment
has a supported Payment.getGatewayType()
value.payment
- The candidate payment to be added.InvalidAddPaymentRequestException
- if the provided gatewayType is not supportedprotected boolean isPaymentGatewaySupported(@Nullable String gatewayType)
PaymentGatewayConfiguration
has been registered for the payment's
Payment.getGatewayType()
gatewayType
- The gateway type specified by a Payment
PaymentGatewayConfiguration
has been registered for the
payment's Payment.getGatewayType()
protected void validatePaymentAmounts(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Payment
amount is not a negative amount.payment
- The candidate payment to be added.InvalidAddPaymentRequestException
- if the provided payment amount is negativeprotected void validateRequestToSavePayment(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Payment
can be saved to the customer's account for future use.payment
- The candidate payment to be added.InvalidAddPaymentRequestException
- if the provided cannot be saved for future useprotected void validatePaymentGatewayProperties(@NonNull @NonNull com.broadleafcommerce.order.common.domain.Payment payment)
Payment.gatewayType
payment
- The candidate payment to be added.com.broadleafcommerce.paymentgateway.service.exception.InvalidPaymentConfigurationException
- if the payment doesn't include sufficient data
to execute transactions for the related gatewayprotected String getMessage(@NonNull @NonNull String errorMessage, @Nullable Object... args)
protected Supplier<com.broadleafcommerce.cart.client.domain.FulfillmentGroup> getFulfillmentGroupById(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId)
ID
and the index of the group in Cart.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.
cart
- The cart on which to find the fulfillment groupfulfillmentGroupId
- The ID for the fulfillment group to find. Usually defaults to the
index of the group in Cart.getFulfillmentGroups()
.protected com.broadleafcommerce.cart.client.domain.CartItem getRequiredCartItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull String cartItemId)
cart
- the cart to search the items ofcartItemId
- the item ID to look forcom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- when no item with the ID exists in the cartprotected 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)
AddItemRequest
. This will populate info from the
CatalogProvider
to 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.addItemRequest
- Request from which to populate new CartItems
.cart
- The cart of the new CartItems
currencyUnit
- the currency for the cart item(s)CartItems
.CartItemValidationException
- Thrown if the cart item is misconfigured based on the
related product's included products and product options.@Deprecated protected com.broadleafcommerce.cart.client.domain.CartItem buildCartItem(@NonNull @NonNull AddItemRequest addItemRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
buildCartItem(AddItemRequest, Cart, CurrencyUnit, ContextInfo)
AddItemRequest
. This will populate info from the
CatalogProvider
to 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.addItemRequest
- Request from which to populate new CartItems
.cart
- The cart of the new CartItems
CartItems
.CartItemValidationException
- Thrown if the cart item is misconfigured based on the
related product's included products and product options.protected 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)
AddItemRequests
. This will populate
info from the CatalogProvider
to 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.addItemRequests
- Request from which to populate new CartItems
.cart
- The cart of the new CartItems
currencyUnit
- the currency for the cart itemsCartItems
.CartItemValidationException
- Thrown if the cart item is misconfigured based on the
related product's included products and product options.@Deprecated protected DefaultCartOperationService.BulkCartItemCreationResponse buildCartItems(@NonNull @NonNull Collection<AddItemRequest> addItemRequests, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
buildCartItems(Collection, Cart, CurrencyUnit, ContextInfo)
AddItemRequests
. This will populate
info from the CatalogProvider
to 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.addItemRequests
- Request from which to populate new CartItems
.cart
- The cart of the new CartItems
CartItems
.CartItemValidationException
- Thrown if the cart item is misconfigured based on the
related product's included products and product options.protected com.broadleafcommerce.cart.client.domain.CartItem createCartItem(@NonNull @NonNull AddItemRequest addItemRequest, @Nullable javax.money.CurrencyUnit currencyUnit)
CartItem
based on the provided AddItemRequest
addItemRequest
- the request which contains the info to build a cart itemcurrencyUnit
- the currency for the cart item@Deprecated protected com.broadleafcommerce.cart.client.domain.CartItem createCartItem(@NonNull @NonNull AddItemRequest addItemRequest)
createCartItem(AddItemRequest, CurrencyUnit)
CartItem
based on the provided AddItemRequest
addItemRequest
- protected 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)
cartItem
- the cart item to populateaddItemRequest
- the request which contains the info to build a cart itemcurrencyUnit
- the currency for the cart item@Nullable protected Object getProductType(com.broadleafcommerce.cart.client.domain.CartItem cartItem)
@Deprecated protected com.broadleafcommerce.cart.client.domain.CartItem populateFromRequest(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull AddItemRequest addItemRequest)
populateFromRequest(CartItem, AddItemRequest, CurrencyUnit)
cartItem
- addItemRequest
- the request which contains the info to build a cart itemprotected Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> buildItemAttributeChoices(@NonNull @NonNull Map<String,String> requestItemAttributeChoices)
protected void validateCartItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartItem
includes enough information to correctly represent the
product or one of the product's variants.cartItem
- The CartItem that is being validatedcart
- The CartItem's owning cartproduct
- The product that this CartItem is intended to representcontextInfo
- The contextInfo for the request@Deprecated protected void validateCartItem(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Product product, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
validateCartItem(CartItem, Cart, Product, List, ContextInfo)
protected void checkInventoryAvailability(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
cartItem
- The cart item whose inventory is being checkedcart
- The cart for this cart item
product
- The product that this CartItem is intended to representproducts
- The list of products identified for this requestcontextInfo
- Context information about sandboxing and multitenant stateprotected void checkQuantityWithinThreshold(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.cart.client.domain.CartItem cartItem, Product product)
cart
- The cart for this cart item
cartItem
- The cart item whose quantity is being validatedproduct
- The product that this CartItem is intended to representprotected void checkInternalInventoryAvailability(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products)
cartItem
- The cart item whose inventory is being checkedproduct
- The product that this CartItem is intended to representproducts
- The list of products identified for this requestprotected void checkDependentItemInternalInventoryAvailability(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem dependantCartItem, @NonNull @NonNull Product dependentProduct)
cartItem
- The cart item whose inventory is being checkedproduct
- The product that this CartItem is intended to representdependantCartItem
- The dependent cart item whose inventory is being checkeddependentProduct
- The product that this dependent CartItem is intended to representprotected String determineDependentItemKey(@NonNull @NonNull Product product, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem dependantCartItem)
product
- The product of the parent cart itemdependantCartItem
- The dependent cart item whose item key is being determined@Deprecated protected void checkInventoryAvailability(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Product product, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
checkInventoryAvailability(CartItem, Cart, Product, List, ContextInfo)
protected Map<String,Integer> getRequestedQuantitiesPerSku(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products)
@Deprecated protected Map<String,Integer> getRequestedQuantitiesPerSku(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull Product product)
getRequestedQuantitiesPerSku(CartItem, Cart, Product, List)
protected String determineInventoryCheckStrategy(@NonNull @NonNull Product product, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
protected int calculateItemsQuantityWithSameSku(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
protected int calculateItemsQuantityWithSameSku(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, int parentItemQuantity)
protected int calculateDependentItemsQuantityWithSameSku(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem dependentCartItem, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, int parentQuantity)
protected void verifySkuAvailability(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products, @NonNull @NonNull Map<String,Boolean> availabilityMap)
@Deprecated protected void verifySkuAvailability(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @NonNull @NonNull Map<String,Boolean> availabilityMap)
verifySkuAvailability(CartItem, Product, List, Map)
protected com.broadleafcommerce.cart.client.domain.ConfigError buildInventoryUnavailableError()
protected AddItemFailure buildValidationFailure(@NonNull @NonNull AddItemRequest addItemRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
AddItemFailure
based on the provided AddItemRequest
&
CartItem
representing an invalid add to cart requestaddItemRequest
- The request that was used to build the CartItemcartItem
- The cart item that holds the validation failures@Deprecated protected 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)
createFulfillmentGroupForItems(Collection, String, Cart, CartItem)
protected 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)
protected String resolveTaxAddressSource(String fulfillmentType)
FulfillmentGroup.getTaxAddressSource()
for the given fulfillment type.fulfillmentType
- the fulfillment type from which to determine the tax address sourceprotected String buildGroupReferenceNumber(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
FulfillmentGroup.getReferenceNumber()
for a new group.cart
- Cart that owns the groupprotected String buildGroupReferenceNumber(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, String fulfillmentGroupId)
FulfillmentGroup.getReferenceNumber()
for the given cart and group ID.cart
- Cart that owns the groupfulfillmentGroupId
- ID of the fulfillment group for which to build a reference number.
Usually defaults to the index of the group in Cart.getFulfillmentGroups()
.@Deprecated protected 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)
addItemsToFulfillmentGroup(Collection, FulfillmentGroup, CurrencyUnit, CartItem)
protected 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)
@Deprecated protected void addItemToFulfillmentGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
addItemToFulfillmentGroup(Cart, CartItem, Set, CartItem)
protected 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)
DefaultProductType.BUNDLE
items.cart
- the cart whose items may need to be assigned to a fulfillment groupcartItem
- the cart item for which to create add the fulfillment itemassignedCartItemIds
- the set of the cart item ids for which the fulfillment item is
already existsparentCartItem
- the parent cart item for the specified cart item. Usually, this is the
item that has the dependent cart items@Nullable protected String resolveDefaultFulfillmentType(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem)
FulfillmentType
for the provided CartItem
cartItem
- The cart item whose default fulfillment type must be determinedprotected void removeItemsFromFulfillmentGroup(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)
protected Map<String,com.broadleafcommerce.cart.client.domain.CartItem> getCartItemIdsWithDependentItem(List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)
protected void resetFulfillmentGroupReferenceNumbers(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
protected 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)
optionalCart
- Cart to be checked and pricedcontextInfo
- The contextInfo for the requestprotected String getPricingChangeMessage(javax.money.MonetaryAmount oldCartPrice, javax.money.MonetaryAmount latestCartPrice)
protected com.broadleafcommerce.cart.client.domain.CartAlert createCartAlert(String message)
public Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveInProcessCartByCustomerIdAndApplicationId(@NonNull @NonNull String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
retrieveInProcessCartByCustomerIdAndApplicationId
in interface CartOperationService
customerId
- The id of the customer for which to perform the operation.contextInfo
- Context information around sandbox and multitenant state.public Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveInProcessCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
retrieveInProcessCartByCartId
in interface CartOperationService
cartId
- The id of the cart on which to perform the operation.contextInfo
- Context information around sandbox and multitenant state.public Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCsrCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
retrieveCsrCartByCartId
in interface CartOperationService
cartId
- The id of the cart on which to perform the operation.contextInfo
- Context information around sandbox and multitenant state.public Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveTestCartByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
retrieveTestCartByCartId
in interface CartOperationService
cartId
- The id of the cart on which to perform the operation.contextInfo
- Context information around sandbox and multitenant state.protected 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)
public Optional<com.broadleafcommerce.cart.client.domain.Cart> retrieveCsrOwnedCartByCustomerIdAndApplicationId(@NonNull @NonNull String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
retrieveCsrOwnedCartByCustomerIdAndApplicationId
in interface CartOperationService
customerId
- The id of the customer for which to perform the operation.contextInfo
- Context information around sandbox and multitenant state.public com.broadleafcommerce.cart.client.domain.Cart addToCart(@NonNull @NonNull AddItemRequest addItemRequest, @Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.cart.client.domain.CustomerRef customerRef, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
addToCart
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public BulkAddToCartResponse bulkAddToCart(@NonNull @NonNull Collection<AddItemRequest> addItemRequests, @Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.cart.client.domain.CustomerRef customerRef, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
bulkAddToCart
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public 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)
CartOperationService
updateCartItem
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public 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)
CartOperationService
removeCartItems
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public 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)
CartOperationService
updateCartContactInfo
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public 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)
CartOperationService
CampaignRef
addCodeToCart
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public 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)
CartOperationService
updateFulfillmentGroup
in interface CartOperationService
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 updatingcontextInfo
- Context information around sandbox and multitenant state.public com.broadleafcommerce.cart.client.domain.Cart updatePayment(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull UpdatePaymentRequest updatePaymentRequest, boolean allowPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartOperationService
Payment
on the cart identified by the paymentId & based on the
UpdatePaymentRequest
payload.updatePayment
in interface CartOperationService
cart
- The cart that should include the new payment.updatePaymentRequest
- The payload of the payment to update.allowPriceCart
- Whether to allow the cart to be priced after updatingcontextInfo
- Context information around sandbox and multitenant state.protected CartOperationServiceProviders getProviders()
protected CartPricingService getCartPricingService()
protected CartItemConfigurationService getCartItemConfigurationService()
protected CartItemProductService getCartItemProductService()
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
protected CartOperationServiceProperties getProperties()
protected CartItemMergingService<com.broadleafcommerce.cart.client.domain.CartItem> getCartItemMergingService()
protected org.springframework.context.MessageSource getMessageSource()
protected TaxService getTaxService()
protected StaleCartPricingResultHolder getStaleCartPricingResultHolder()
protected CartOperationServiceOfferUtils getOfferUtils()
@Autowired public void setOfferUtils(CartOperationServiceOfferUtils offerUtils)
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayConfigurationProvider getPaymentGatewayConfigurationProvider()
protected com.broadleafcommerce.paymentgateway.service.provider.PaymentGatewayPaymentValidationProvider getPaymentValidationProvider()
Copyright © 2021. All rights reserved.