Class DefaultCartTransferService
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.service.csr.DefaultCartTransferService
-
- All Implemented Interfaces:
CartTransferService
public class DefaultCartTransferService extends Object implements CartTransferService
-
-
Constructor Summary
Constructors Constructor Description DefaultCartTransferService(CartOperationService cartOperationService, CartProvider cartProvider, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, TransferCartTokenEncoder transferCartTokenEncoder, TransferCartTokenDecoder transferCartTokenDecoder, PaymentProvider<PaymentSummary> paymentProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TransferCartToken
createTransferCartToken(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Creates a newTransferCartToken
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 PaymentProvider<PaymentSummary>
getPaymentProvider()
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.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.protected com.broadleafcommerce.cart.client.domain.Cart
updateCart(com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected void
updatePaymentManagementStatuses(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.TransferCartToken
validateTransferCartToken(String tokenString)
Attempts to decode and validate the provided token string into aTransferCartToken
.
-
-
-
Constructor Detail
-
DefaultCartTransferService
public DefaultCartTransferService(CartOperationService cartOperationService, CartProvider cartProvider, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, TransferCartTokenEncoder transferCartTokenEncoder, TransferCartTokenDecoder transferCartTokenDecoder, PaymentProvider<PaymentSummary> paymentProvider)
-
-
Method Detail
-
transferAnonymousCartOwnership
public com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CartTransferService
Transfer the provided anonymous cart to be in-process for the currently authenticated customer.- Specified by:
transferAnonymousCartOwnership
in interfaceCartTransferService
- Parameters:
anonymousCart
- The anonymous cart to transfer ownershipcontextInfo
- Context information around sandbox and multitenant state.- Returns:
- The cart now owned by the customer
-
transferAnonymousCartOwnership
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)
Description copied from interface:CartTransferService
Transfer the provided anonymous cart to be in-process for the currently authenticated customer.- Specified by:
transferAnonymousCartOwnership
in interfaceCartTransferService
- 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
-
setNewCartOwnership
protected void setNewCartOwnership(com.broadleafcommerce.cart.client.domain.Cart cart)
-
transferCsrCartToInProcess
public com.broadleafcommerce.cart.client.domain.Cart transferCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CartTransferService
Transfer the provided CSR cart to be in-process for its customer.- Specified by:
transferCsrCartToInProcess
in interfaceCartTransferService
- 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
-
createTransferCartToken
public TransferCartToken createTransferCartToken(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart)
Description copied from interface:CartTransferService
Creates a newTransferCartToken
that can be exchanged for proof of access to transfer a particular cart.- Specified by:
createTransferCartToken
in interfaceCartTransferService
- 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
-
validateTransferCartToken
public TransferCartToken validateTransferCartToken(String tokenString) throws TransferCartTokenParseException
Description copied from interface:CartTransferService
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.- Specified by:
validateTransferCartToken
in interfaceCartTransferService
- Parameters:
tokenString
- the encoded token string- Returns:
- a transfer cart token object
- Throws:
TransferCartTokenParseException
-
transferAnonymousCsrCartToInProcess
public com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:CartTransferService
Transfer the provided anonymous CSR cart to be in-process for the current customer or anonymous user.- Specified by:
transferAnonymousCsrCartToInProcess
in interfaceCartTransferService
- 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
public 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)
Description copied from interface:CartTransferService
Transfer the provided anonymous CSR cart to be in-process for the provided customer- Specified by:
transferAnonymousCsrCartToInProcess
in interfaceCartTransferService
- Parameters:
csrCart
- the CSR cartcustomer
- the customercontextInfo
- the context info- Returns:
- the transferred cart
-
moveCustomerCartForCsrTransfer
protected void moveCustomerCartForCsrTransfer(@Nullable String customerId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
updateCart
protected com.broadleafcommerce.cart.client.domain.Cart updateCart(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
updatePaymentManagementStatuses
@Deprecated protected void updatePaymentManagementStatuses(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Deprecated.
-
getCartOperationService
protected CartOperationService getCartOperationService()
-
getCartProvider
protected CartProvider getCartProvider()
-
getAuthenticationUtils
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
getTransferCartTokenEncoder
protected TransferCartTokenEncoder getTransferCartTokenEncoder()
-
getTransferCartTokenDecoder
protected TransferCartTokenDecoder getTransferCartTokenDecoder()
-
getPaymentProvider
protected PaymentProvider<PaymentSummary> getPaymentProvider()
-
-