Class ManageCartEndpoint
java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.ManageCartEndpoint
@FrameworkRestController
@FrameworkMapping("/cart")
@DataRouteByKey("cartoperation")
public class ManageCartEndpoint
extends Object
- Author:
- Nick Crum (ncrum)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionManageCartEndpoint
(CartResolverService cartResolverService, CartOperationService cartOperationService, CartTransferService cartTransferService, CartVersionValidationService cartVersionValidationService, GuestCartProtectionService guestCartProtectionService, GuestCartTokenValidator guestCartTokenValidator, ItemListAddToCartService itemListAddToCartService) -
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.cart.client.domain.Cart
addAttributeToCart
(String cartId, AddAttributeRequest addAttributeRequest, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) addItemListsToCart
(String cartId, AddItemListToCartRequest addItemListToCartRequest, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
addItemToCart
(String cartId, AddItemRequest addItemRequest, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) addManyItemsToCart
(String cartId, List<AddItemRequest> addItemRequests, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) addOfferCodeToCart
(String cartId, AddCodeRequest addCodeRequest, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected String
cartNotFoundMessage
(String cartId) com.broadleafcommerce.cart.client.domain.Cart
createCart
(CartCreationRequest cartCreationRequest, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
getCart
(String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Deprecated as of 1.7.0-GA.com.broadleafcommerce.cart.client.domain.Cart
getCart
(String cartId, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected CartOperationService
protected CartOperationServiceProperties
protected CartResolverService
protected CartTransferService
protected CartVersionValidationService
protected GuestCartProtectionService
protected GuestCartTokenValidator
protected ItemListAddToCartService
org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart>
getMyCarts
(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.extension.TypeFactory
com.broadleafcommerce.cart.client.domain.Cart
priceCart
(String cartId, PriceCartRequest priceCartRequest, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected <T> T
protectCartOperationForGuest
(Function<com.broadleafcommerce.cart.client.domain.Cart, T> operation, com.broadleafcommerce.cart.client.domain.Cart initialCart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Helper method to validate the guest token, protect the resolved cart, & execute the operation.protected com.broadleafcommerce.cart.client.domain.Cart
protectCartOperationForGuest
(Supplier<com.broadleafcommerce.cart.client.domain.Cart> operation, com.broadleafcommerce.cart.client.domain.Cart initialCart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Since 1.6.1, in favor ofprotectCartOperationForGuest(Function, Cart, String, ContextInfo)
protected <T> T
protectCartOperationForGuest
(Supplier<T> operation, com.broadleafcommerce.cart.client.domain.Cart initialCart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Function<T, com.broadleafcommerce.cart.client.domain.Cart> cartExtractor) Deprecated.Since 1.6.1, in favor ofprotectCartOperationForGuest(Function, Cart, String, ContextInfo)
protected void
protectGuestCartIfNecessary
(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken) Deprecated.protected com.broadleafcommerce.cart.client.domain.Cart
protectGuestCartIfNecessary
(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) If the provided cart is a guest cart, and there is no guest token, then this will produce a cloned guest cart, excluding any customer data.com.broadleafcommerce.cart.client.domain.Cart
releasePaymentFinalizationLock
(String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
removeAttributeFromCart
(String cartId, String attributeKey, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
removeFromCartInBulk
(String cartId, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Set<String> cartItemIds) com.broadleafcommerce.cart.client.domain.Cart
removeItemFromCart
(String cartId, String cartItemId, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
removeManyItemsFromCart
(String cartId, Collection<String> cartItemIds, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
removeOfferCodeFromCart
(String cartId, String offerCode, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCart
(String cartId, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCartForRead
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCartForUpdate
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.protected com.broadleafcommerce.cart.client.domain.Cart
resolveCartForUpdate
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, String workflow, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
setCartOperationServiceProperties
(CartOperationServiceProperties cartOperationServiceProperties) com.broadleafcommerce.cart.client.domain.Cart
setDefaultCart
(String cartId, Integer cartToMakeDefaultVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
setTypeFactory
(com.broadleafcommerce.common.extension.TypeFactory typeFactory) com.broadleafcommerce.cart.client.domain.Cart
transferCart
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
updateCartInfo
(String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, UpdateCartInfoRequest request) Endpoint to use to update certain basic information about a cart like its name or, if a quote, its expiration date.com.broadleafcommerce.cart.client.domain.Cart
updateItemInCart
(String cartId, String cartItemId, UpdateItemRequest updateItemRequest, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
updateStatus
(String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, UpdateCartStatusRequest request) protected void
validateGuestTokenIfNecessary
(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) If the provided cart is a guest cart, this will attempt to validate the guest token for the cart.
-
Field Details
-
BASE_URI
- See Also:
-
-
Constructor Details
-
ManageCartEndpoint
public ManageCartEndpoint(CartResolverService cartResolverService, CartOperationService cartOperationService, CartTransferService cartTransferService, CartVersionValidationService cartVersionValidationService, GuestCartProtectionService guestCartProtectionService, GuestCartTokenValidator guestCartTokenValidator, ItemListAddToCartService itemListAddToCartService)
-
-
Method Details
-
createCart
@FrameworkPostMapping(consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart createCart(@RequestBody CartCreationRequest cartCreationRequest, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getCart
@Deprecated public com.broadleafcommerce.cart.client.domain.Cart getCart(@PathVariable String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Deprecated as of 1.7.0-GA. UsegetCart(String, String, CustomerRef, ContextInfo)
. ThecartVersion
should not be included as it is irrelevant for reads. It's only relevant for cart-modification requests. -
getMyCarts
@Policy(permissionRoots={"CUSTOMER","CUSTOMER_PROFILE"}) @FrameworkGetMapping(params="all=true") public org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.Cart> getMyCarts(cz.jirutka.rsql.parser.ast.Node filters, @PageableDefault(size=50,sort="contextId",direction=ASC) org.springframework.data.domain.Pageable page, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getCart
-
transferCart
@FrameworkPostMapping("/{cartId}/transfer") public com.broadleafcommerce.cart.client.domain.Cart transferCart(@PathVariable String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
setDefaultCart
@FrameworkPostMapping("/{cartId}/make-default") public com.broadleafcommerce.cart.client.domain.Cart setDefaultCart(@PathVariable String cartId, Integer cartToMakeDefaultVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
priceCart
@FrameworkPostMapping(value="/{cartId}/pricing", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart priceCart(@PathVariable String cartId, @RequestBody PriceCartRequest priceCartRequest, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
addItemToCart
@FrameworkPostMapping(value="/{cartId}/items", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart addItemToCart(@PathVariable String cartId, @RequestBody AddItemRequest addItemRequest, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateItemInCart
@FrameworkPatchMapping(value="/{cartId}/items/{cartItemId}", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart updateItemInCart(@PathVariable String cartId, @PathVariable String cartItemId, @RequestBody UpdateItemRequest updateItemRequest, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateStatus
@FrameworkPatchMapping(value="/{cartId}/status", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart updateStatus(@PathVariable String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestBody UpdateCartStatusRequest request) -
updateCartInfo
@FrameworkPatchMapping(value="/{cartId}/info", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart updateCartInfo(@PathVariable String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestBody UpdateCartInfoRequest request) Endpoint to use to update certain basic information about a cart like its name or, if a quote, its expiration date. -
releasePaymentFinalizationLock
@FrameworkPatchMapping("/{cartId}/release-payment-finalization-lock") public com.broadleafcommerce.cart.client.domain.Cart releasePaymentFinalizationLock(@PathVariable String cartId, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
removeItemFromCart
@FrameworkDeleteMapping("/{cartId}/items/{cartItemId}") public com.broadleafcommerce.cart.client.domain.Cart removeItemFromCart(@PathVariable String cartId, @PathVariable String cartItemId, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
addManyItemsToCart
@FrameworkPostMapping(value="/{cartId}/bulk-items", consumes="application/json") public BulkAddToCartResponse addManyItemsToCart(@PathVariable String cartId, @RequestBody List<AddItemRequest> addItemRequests, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
removeManyItemsFromCart
@Deprecated @FrameworkDeleteMapping("/{cartId}/bulk-items") public com.broadleafcommerce.cart.client.domain.Cart removeManyItemsFromCart(@PathVariable String cartId, @RequestParam Collection<String> cartItemIds, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.UseremoveFromCartInBulk(String, boolean, Integer, String, CustomerRef, ContextInfo, Set)
. This will allow much longer lists of IDs without worrying about whether the URL is too long and corrects the HTTP method semantics by using POST since we're not actually deleting a resource at the URL. -
removeFromCartInBulk
@FrameworkPostMapping(value="/{cartId}/bulk-items/delete", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart removeFromCartInBulk(@PathVariable String cartId, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @RequestBody Set<String> cartItemIds) -
addItemListsToCart
@FrameworkPostMapping(value="/{cartId}/item-lists", consumes="application/json") public ItemListAddToCartResponse addItemListsToCart(@PathVariable String cartId, @RequestBody AddItemListToCartRequest addItemListToCartRequest, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
addOfferCodeToCart
@FrameworkPostMapping(value="/{cartId}/offer-codes", consumes="application/json") public AddCodeToCartResponse addOfferCodeToCart(@PathVariable String cartId, @RequestBody AddCodeRequest addCodeRequest, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
removeOfferCodeFromCart
@FrameworkDeleteMapping("/{cartId}/offer-codes/{offerCode}") public com.broadleafcommerce.cart.client.domain.Cart removeOfferCodeFromCart(@PathVariable String cartId, @PathVariable String offerCode, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
addAttributeToCart
@FrameworkPostMapping(value="/{cartId}/attributes", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart addAttributeToCart(@PathVariable String cartId, @RequestBody AddAttributeRequest addAttributeRequest, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
removeAttributeFromCart
@FrameworkDeleteMapping("/{cartId}/attributes/{attributeKey}") public com.broadleafcommerce.cart.client.domain.Cart removeAttributeFromCart(@PathVariable String cartId, @PathVariable String attributeKey, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
resolveCartForRead
-
resolveCartForUpdate
@Deprecated(since="1.8.0", forRemoval=true) protected com.broadleafcommerce.cart.client.domain.Cart resolveCartForUpdate(String cartId, @Nullable Integer cartVersion, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version. -
resolveCartForUpdate
@NonNull protected com.broadleafcommerce.cart.client.domain.Cart resolveCartForUpdate(String cartId, @Nullable Integer cartVersion, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable String workflow, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
resolveCart
protected com.broadleafcommerce.cart.client.domain.Cart resolveCart(@NonNull String cartId, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
protectCartOperationForGuest
@Deprecated protected <T> T protectCartOperationForGuest(Supplier<T> operation, com.broadleafcommerce.cart.client.domain.Cart initialCart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, Function<T, com.broadleafcommerce.cart.client.domain.Cart> cartExtractor) Deprecated.Since 1.6.1, in favor ofprotectCartOperationForGuest(Function, Cart, String, ContextInfo)
Helper method to validate the guest token, execute the operation, extract the resulting cart, protect the resulting cart, and finally returning the response.- Type Parameters:
T
- the response type- Parameters:
operation
- the operation to execute as a supplierinitialCart
- the initial cartguestToken
- the guest tokencontextInfo
- the context infocartExtractor
- extracts the cart from the result- Returns:
- the response
-
protectCartOperationForGuest
@Deprecated protected com.broadleafcommerce.cart.client.domain.Cart protectCartOperationForGuest(Supplier<com.broadleafcommerce.cart.client.domain.Cart> operation, com.broadleafcommerce.cart.client.domain.Cart initialCart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Since 1.6.1, in favor ofprotectCartOperationForGuest(Function, Cart, String, ContextInfo)
Delegates toprotectCartOperationForGuest(Supplier, Cart, String, ContextInfo, Function)
with the expectation that the operation returns aCart
and the extractor is a simple identity function.- Parameters:
operation
- the operation to execute as a supplierinitialCart
- the initial cartguestToken
- the guest tokencontextInfo
- the context info- Returns:
- the response
-
protectCartOperationForGuest
protected <T> T protectCartOperationForGuest(Function<com.broadleafcommerce.cart.client.domain.Cart, T> operation, com.broadleafcommerce.cart.client.domain.Cart initialCart, String guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Helper method to validate the guest token, protect the resolved cart, & execute the operation.- Type Parameters:
T
- the response type- Parameters:
operation
- the operation to execute as a functioninitialCart
- the initial cartguestToken
- the guest tokencontextInfo
- the context info- Returns:
- the response
-
validateGuestTokenIfNecessary
protected void validateGuestTokenIfNecessary(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) If the provided cart is a guest cart, this will attempt to validate the guest token for the cart.- Parameters:
cart
- the cartguestToken
- the guest tokencontextInfo
- the context info
-
protectGuestCartIfNecessary
@Deprecated protected void protectGuestCartIfNecessary(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken) Deprecated.If the provided cart is a guest cart, and there is no guest token, this will clear out any customer information from the cart.Note, this method does not persist the changes to the cart, and is only intended to be used as a last step before returning the cart object.
- Parameters:
cart
- the cartguestToken
- the guest token
-
protectGuestCartIfNecessary
protected com.broadleafcommerce.cart.client.domain.Cart protectGuestCartIfNecessary(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) If the provided cart is a guest cart, and there is no guest token, then this will produce a cloned guest cart, excluding any customer data.- Parameters:
cart
- the cartguestToken
- the guest tokencontextInfo
- the context info- Returns:
- the protected cart
-
cartNotFoundMessage
-
getCartResolverService
-
getCartOperationService
-
getCartTransferService
-
getCartVersionValidationService
-
getGuestCartProtectionService
-
getGuestCartTokenValidator
-
getItemListAddToCartService
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
getCartOperationServiceProperties
-
setCartOperationServiceProperties
@Autowired public void setCartOperationServiceProperties(CartOperationServiceProperties cartOperationServiceProperties)
-