Interface CartTransferService
- All Known Implementing Classes:
DefaultCartTransferService
public interface CartTransferService
Service for performing ownership transfers between anonymous, CSR, and customer-owned carts.
-
Method Summary
Modifier and TypeMethodDescriptioncreateTransferCartToken
(com.broadleafcommerce.cart.client.domain.Cart cart) Creates a newTransferCartToken
that can be exchanged for proof of access to transfer a particular cart.com.broadleafcommerce.cart.client.domain.Cart
setCartAsDefault
(com.broadleafcommerce.cart.client.domain.Cart cartToMakeDefault, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided cart to be the default/implicit cart for the provided customer.com.broadleafcommerce.cart.client.domain.Cart
transferAnonymousCartOwnership
(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, com.broadleafcommerce.cart.client.domain.Cart registeredCustomerCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided anonymous cart to be in-process for the currently authenticated customer.com.broadleafcommerce.cart.client.domain.Cart
transferAnonymousCartOwnership
(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided anonymous cart to be in-process for the currently authenticated customer.com.broadleafcommerce.cart.client.domain.Cart
transferAnonymousCsrCartToInProcess
(com.broadleafcommerce.cart.client.domain.Cart csrCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.com.broadleafcommerce.cart.client.domain.Cart
transferAnonymousCsrCartToInProcess
(com.broadleafcommerce.cart.client.domain.Cart csrCart, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided anonymous CSR cart to be in-process for the provided customercom.broadleafcommerce.cart.client.domain.Cart
transferCsrCartToInProcess
(com.broadleafcommerce.cart.client.domain.Cart csrCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided CSR cart to be in-process for its customer.validateTransferCartToken
(String tokenString) Attempts to decode and validate the provided token string into aTransferCartToken
.
-
Method Details
-
transferAnonymousCartOwnership
com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided anonymous cart to be in-process for the currently authenticated customer.- Parameters:
anonymousCart
- The anonymous cart to transfer ownershipcontextInfo
- Context information around sandbox and multitenant state.- Returns:
- The cart now owned by the customer
-
createTransferCartToken
Creates a newTransferCartToken
that can be exchanged for proof of access to transfer a particular cart.- Parameters:
cart
- the cart which can be transferred using this token- Returns:
- a transfer cart token object with an encoded token that is used to prove access to transfer the cart
-
transferAnonymousCartOwnership
com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, @Nullable com.broadleafcommerce.cart.client.domain.Cart registeredCustomerCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided anonymous cart to be in-process for the currently authenticated customer.- Parameters:
anonymousCart
- The anonymous cart to transfer ownershipregisteredCustomerCart
- The pre-existing customer's cartcontextInfo
- Context information around sandbox and multitenant state.- Returns:
- The cart now owned by the customer
-
transferCsrCartToInProcess
com.broadleafcommerce.cart.client.domain.Cart transferCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided CSR cart to be in-process for its customer.- Parameters:
csrCart
- The CSR-owned cart to replace the customer's in-process cartcontextInfo
- Context information around sandbox and multitenant state.- Returns:
- The in-process cart transferred to the customer
-
validateTransferCartToken
TransferCartToken validateTransferCartToken(String tokenString) throws TransferCartTokenParseException Attempts to decode and validate the provided token string into aTransferCartToken
. This is used to provide a way to check that a token is valid and to extract the contents.- Parameters:
tokenString
- the encoded token string- Returns:
- a transfer cart token object
- Throws:
TransferCartTokenParseException
-
transferAnonymousCsrCartToInProcess
@Deprecated com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Transfer the provided anonymous CSR cart to be in-process for the current customer or anonymous user.- Parameters:
csrCart
- The anonymous CSR-owned cart to transfercontextInfo
- Context information around sandbox and multitenant state.- Returns:
- The in-process cart transferred to the customer or anonymous user
-
transferAnonymousCsrCartToInProcess
com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided anonymous CSR cart to be in-process for the provided customer- Parameters:
csrCart
- the CSR cartcustomer
- the customercontextInfo
- the context info- Returns:
- the transferred cart
-
setCartAsDefault
com.broadleafcommerce.cart.client.domain.Cart setCartAsDefault(com.broadleafcommerce.cart.client.domain.Cart cartToMakeDefault, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Transfer the provided cart to be the default/implicit cart for the provided customer.By default, implicit cart refers to a cart with no name and status of
DefaultCartStatuses.IN_PROCESS
.- Parameters:
cartToMakeDefault
- the cart to make defaultcustomer
- the current authenticated customercontextInfo
- Context information around sandbox and multitenant state.- Returns:
- the cart that is set to default
-
transferAnonymousCsrCartToInProcess(Cart, CustomerRef, ContextInfo)