Class DefaultGuestCartTokenValidator
java.lang.Object
com.broadleafcommerce.cartoperation.web.validator.DefaultGuestCartTokenValidator
- All Implemented Interfaces:
GuestCartTokenValidator
- Author:
- Nick Crum (ncrum)
-
Constructor Summary
ConstructorDescriptionDefaultGuestCartTokenValidator
(GuestCartProtectionService guestCartProtectionService, CartValidationProperties cartValidationProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected CartValidationProperties
protected GuestCartProtectionService
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 Details
-
DefaultGuestCartTokenValidator
public DefaultGuestCartTokenValidator(GuestCartProtectionService guestCartProtectionService, CartValidationProperties cartValidationProperties)
-
-
Method Details
-
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
-
guestTokenRequiredMessage
-
getGuestCartProtectionService
-
getCartValidationProperties
-