public interface CartResolverService
Carts
.Modifier and Type | Method and Description |
---|---|
Optional<com.broadleafcommerce.cart.client.domain.Cart> |
resolveCartById(String cartId,
com.broadleafcommerce.cart.client.domain.CustomerRef customer,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Resolves a
Cart given the cart ID, customer, and context. |
Optional<com.broadleafcommerce.cart.client.domain.Cart> |
resolveCartByStatus(@NonNull Collection<String> status,
com.broadleafcommerce.cart.client.domain.CustomerRef customer,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Resolves the
Cart with the first matching status for the given customer and context. |
default Optional<com.broadleafcommerce.cart.client.domain.Cart> |
resolveCartByStatus(@NonNull String status,
com.broadleafcommerce.cart.client.domain.CustomerRef customer,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Resolves the
Cart with the first matching status for the given customer and context. |
default Optional<com.broadleafcommerce.cart.client.domain.Cart> |
resolveInProcessCart(com.broadleafcommerce.cart.client.domain.CustomerRef customer,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Resolves the current in-progress
Cart given the customer and context. |
Optional<com.broadleafcommerce.cart.client.domain.Cart> resolveCartById(String cartId, @Nullable com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
given the cart ID, customer, and context.
If the provided CustomerRef
is not registered, this will resolve a guest cart for the
given ID and context. If the cart is found to be a customer cart, this will return as empty,
because an anonymous customer can only access guest carts.
If the provided CustomerRef
is registered, this will resolve a customer cart for the
given customer, ID, and context. If the cart is found to be a guest cart, this will return as
empty.
If no cart is found, this will return an empty optional.
cartId
- the cart IDcustomer
- the customercontextInfo
- the context infoOptional<com.broadleafcommerce.cart.client.domain.Cart> resolveCartByStatus(@NonNull @NonNull Collection<String> status, @NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
with the first matching status for the given customer and context.
This method will iterate through each status, in given order, and attempt to retrieve a cart for that status. The first accessible cart retrieved for a status will be returned.
If no cart is found, this will return an empty optional.
status
- the statuses to checkcustomer
- the customercontextInfo
- the context infodefault Optional<com.broadleafcommerce.cart.client.domain.Cart> resolveCartByStatus(@NonNull @NonNull String status, @NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
with the first matching status for the given customer and context.
This method will iterate through each status, in given order, and attempt to retrieve a cart for that status. The first accessible cart retrieved for a status will be returned.
If no cart is found, this will return an empty optional.
status
- the status to checkcustomer
- the customercontextInfo
- the context infodefault Optional<com.broadleafcommerce.cart.client.domain.Cart> resolveInProcessCart(com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
given the customer and context.
If no cart is found, this will return an empty optional.
customer
- the customercontextInfo
- the context infoCopyright © 2021. All rights reserved.