public class DefaultCartTransferService extends Object implements CartTransferService
Constructor and Description |
---|
DefaultCartTransferService(CartOperationService cartOperationService,
CartProvider cartProvider,
com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils,
com.broadleafcommerce.common.extension.TypeFactory typeFactory,
TransferCartTokenEncoder transferCartTokenEncoder,
TransferCartTokenDecoder transferCartTokenDecoder) |
Modifier and Type | Method and Description |
---|---|
TransferCartToken |
createTransferCartToken(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Creates a new
TransferCartToken that can be exchanged for proof of access to transfer
a particular cart. |
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils |
getAuthenticationUtils() |
protected CartOperationService |
getCartOperationService() |
protected CartProvider |
getCartProvider() |
protected TransferCartTokenDecoder |
getTransferCartTokenDecoder() |
protected TransferCartTokenEncoder |
getTransferCartTokenEncoder() |
protected com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
protected void |
moveCustomerCartForCsrTransfer(String customerId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) |
protected void |
setNewCartOwnership(com.broadleafcommerce.cart.client.domain.Cart cart) |
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)
Transfer the provided anonymous CSR cart to be in-process for the current customer or
anonymous user.
|
com.broadleafcommerce.cart.client.domain.Cart |
transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart,
com.broadleafcommerce.cart.client.domain.CustomerRef customer,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Transfer the provided anonymous CSR cart to be in-process for the provided customer
|
com.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.
|
protected com.broadleafcommerce.cart.client.domain.Cart |
updateCart(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) |
TransferCartToken |
validateTransferCartToken(String tokenString)
Attempts to decode and validate the provided token string into a
TransferCartToken . |
public DefaultCartTransferService(CartOperationService cartOperationService, CartProvider cartProvider, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, TransferCartTokenEncoder transferCartTokenEncoder, TransferCartTokenDecoder transferCartTokenDecoder)
public com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartTransferService
transferAnonymousCartOwnership
in interface CartTransferService
anonymousCart
- The anonymous cart to transfer ownershipcontextInfo
- Context information around sandbox and multitenant state.public 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)
CartTransferService
transferAnonymousCartOwnership
in interface CartTransferService
anonymousCart
- The anonymous cart to transfer ownershipregisteredCustomerCart
- The pre-existing customer's cartcontextInfo
- Context information around sandbox and multitenant state.protected void setNewCartOwnership(com.broadleafcommerce.cart.client.domain.Cart cart)
public com.broadleafcommerce.cart.client.domain.Cart transferCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartTransferService
transferCsrCartToInProcess
in interface CartTransferService
csrCart
- The CSR-owned cart to replace the customer's in-process cartcontextInfo
- Context information around sandbox and multitenant state.public TransferCartToken createTransferCartToken(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
CartTransferService
TransferCartToken
that can be exchanged for proof of access to transfer
a particular cart.createTransferCartToken
in interface CartTransferService
cart
- the cart which can be transferred using this tokenpublic TransferCartToken validateTransferCartToken(String tokenString) throws TransferCartTokenParseException
CartTransferService
TransferCartToken
.
This is used to provide a way to check that a token is valid and to extract the contents.validateTransferCartToken
in interface CartTransferService
tokenString
- the encoded token stringTransferCartTokenParseException
public com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartTransferService
transferAnonymousCsrCartToInProcess
in interface CartTransferService
csrCart
- The anonymous CSR-owned cart to transfercontextInfo
- Context information around sandbox and multitenant state.public com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.cart.client.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartTransferService
transferAnonymousCsrCartToInProcess
in interface CartTransferService
csrCart
- the CSR cartcustomer
- the customercontextInfo
- the context infoprotected void moveCustomerCartForCsrTransfer(@Nullable String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected com.broadleafcommerce.cart.client.domain.Cart updateCart(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected CartOperationService getCartOperationService()
protected CartProvider getCartProvider()
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
protected TransferCartTokenEncoder getTransferCartTokenEncoder()
protected TransferCartTokenDecoder getTransferCartTokenDecoder()
Copyright © 2021. All rights reserved.