Class DefaultGuestCartTokenValidator
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.web.validator.DefaultGuestCartTokenValidator
-
- All Implemented Interfaces:
GuestCartTokenValidator
public class DefaultGuestCartTokenValidator extends Object implements GuestCartTokenValidator
- Author:
- Nick Crum (ncrum)
-
-
Constructor Summary
Constructors Constructor Description DefaultGuestCartTokenValidator(GuestCartProtectionService guestCartProtectionService, CartValidationProperties cartValidationProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CartValidationProperties
getCartValidationProperties()
protected GuestCartProtectionService
getGuestCartProtectionService()
protected String
guestTokenRequiredMessage(String cartId)
void
validateGuestTokenForCheckout(String cartId, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates the provided guest token string for the given cart ID during checkout.void
validateGuestTokenForOperation(String cartId, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Validates the provided guest token string for the given cart ID during a cart operation.
-
-
-
Constructor Detail
-
DefaultGuestCartTokenValidator
public DefaultGuestCartTokenValidator(GuestCartProtectionService guestCartProtectionService, CartValidationProperties cartValidationProperties)
-
-
Method Detail
-
validateGuestTokenForCheckout
public void validateGuestTokenForCheckout(String cartId, @Nullable String guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:GuestCartTokenValidator
Validates the provided guest token string for the given cart ID during checkout. This method will throw a runtime exception if the guest token is found to be invalid. Typically, this method will require the guest token to be non-null and valid.- Specified by:
validateGuestTokenForCheckout
in interfaceGuestCartTokenValidator
- Parameters:
cartId
- the cart IDguestToken
- the guest tokencontextInfo
- the context info
-
validateGuestTokenForOperation
public void validateGuestTokenForOperation(String cartId, @Nullable String guestToken, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Description copied from interface:GuestCartTokenValidator
Validates the provided guest token string for the given cart ID during a cart operation. This method will throw a runtime exception if the guest token is found to be invalid. Typically, this method will treat a null guest token as valid.- Specified by:
validateGuestTokenForOperation
in interfaceGuestCartTokenValidator
- Parameters:
cartId
- the cart IDguestToken
- the guest tokencontextInfo
- the context info
-
getGuestCartProtectionService
protected GuestCartProtectionService getGuestCartProtectionService()
-
getCartValidationProperties
protected CartValidationProperties getCartValidationProperties()
-
-