Class CheckoutCartEndpoint
java.lang.Object
com.broadleafcommerce.cartoperation.web.endpoint.CheckoutCartEndpoint
@FrameworkRestController
@FrameworkMapping("/checkout")
@DataRouteByKey("cartoperation")
public class CheckoutCartEndpoint
extends Object
- Author:
- Nick Crum (ncrum)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCheckoutCartEndpoint
(CartResolverService cartResolverService, CartOperationService cartOperationService, CartVersionValidationService cartVersionValidationService, GuestCartProtectionService guestCartProtectionService, GuestCartTokenValidator guestCartTokenValidator, CartValidationProperties cartValidationProperties, CheckoutService checkoutService, Optional<FulfillmentPricingService> fulfillmentPricingService, FulfillmentOptionRequestService fulfillmentOptionRequestService) -
Method Summary
Modifier and TypeMethodDescriptionprotected CheckoutProcessDto
buildCheckoutProcessDto
(@NonNull CheckoutProcessRequest processRequest, @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customerRef) com.broadleafcommerce.cart.client.domain.Cart
bulkUpdateFulfillmentGroupsInCart
(String cartId, List<UpdateFulfillmentGroupRequest> updateFulfillmentGroupsRequests, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected String
cartNotFoundMessage
(String cartId) protected boolean
cartOwnershipMatchWithCustomerRef
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, com.broadleafcommerce.order.common.domain.CustomerRef customerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the givenCart.getCustomerRef()
matches with the givenCustomerRef
.protected boolean
customerMatches
(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer) Whether the customer matches the cart's owner.generateGuestTokenForCart
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected CartOperationService
protected CartResolverService
protected CartValidationProperties
protected CartVersionValidationService
getCheckoutPaymentMethodOptions
(String cartId, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected CheckoutPaymentMethodService
protected CheckoutService
protected FulfillmentOptionRequestService
List<com.broadleafcommerce.shipping.domain.FulfillmentOptionPricedResponse>
getFulfillmentOptionsForCart
(String cartId, String referenceNumber, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected Optional<FulfillmentPricingService>
Deprecated.protected GuestCartProtectionService
protected GuestCartTokenValidator
com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse
getPricedFulfillmentOptionsForCart
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.common.extension.TypeFactory
org.springframework.http.ResponseEntity<CheckoutResponse>
processCheckout
(String cartId, CheckoutProcessRequest checkoutProcessRequest, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
recalculateTaxesForCart
(String cartId, boolean estimated, boolean actual, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
recalculateTaxesForCart
(String cartId, boolean estimated, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCart
(String cartId, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCartForRead
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCartForUpdate
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.broadleafcommerce.cart.client.domain.Cart
resolveCartForUpdate
(String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, String workflow, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) void
setCheckoutPaymentMethodService
(CheckoutPaymentMethodService checkoutPaymentMethodService) void
setTypeFactory
(com.broadleafcommerce.common.extension.TypeFactory typeFactory) com.broadleafcommerce.cart.client.domain.Cart
updateContactInfoInCart
(String cartId, ContactInfoRequest contactInfoRequest, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) com.broadleafcommerce.cart.client.domain.Cart
updateFulfillmentGroupInCart
(String cartId, String referenceNumber, UpdateFulfillmentGroupRequest fulfillmentGroupRequest, boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) validateGuestTokenForCart
(String cartId, Integer cartVersion, String guestTokenString, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected void
validateGuestTokenIfNecessary
(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
-
Field Details
-
BASE_URI
- See Also:
-
-
Constructor Details
-
CheckoutCartEndpoint
public CheckoutCartEndpoint(CartResolverService cartResolverService, CartOperationService cartOperationService, CartVersionValidationService cartVersionValidationService, GuestCartProtectionService guestCartProtectionService, GuestCartTokenValidator guestCartTokenValidator, CartValidationProperties cartValidationProperties, CheckoutService checkoutService, Optional<FulfillmentPricingService> fulfillmentPricingService, FulfillmentOptionRequestService fulfillmentOptionRequestService)
-
-
Method Details
-
generateGuestTokenForCart
@FrameworkPostMapping("/{cartId}/guest-token") public GuestTokenResponse generateGuestTokenForCart(@PathVariable String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
validateGuestTokenForCart
@FrameworkPostMapping("/{cartId}/guest-token/validate") public GuestTokenValidationResponse validateGuestTokenForCart(@PathVariable String cartId, Integer cartVersion, @RequestBody String guestTokenString, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateContactInfoInCart
@FrameworkPostMapping(value="/{cartId}/contact-info", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart updateContactInfoInCart(@PathVariable String cartId, @RequestBody ContactInfoRequest contactInfoRequest, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
updateFulfillmentGroupInCart
@FrameworkPatchMapping(value="/{cartId}/fulfillment-groups/{referenceNumber}", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart updateFulfillmentGroupInCart(@PathVariable String cartId, @PathVariable String referenceNumber, @RequestBody UpdateFulfillmentGroupRequest fulfillmentGroupRequest, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
bulkUpdateFulfillmentGroupsInCart
@FrameworkPatchMapping(value="/{cartId}/fulfillment-groups/bulk-update", consumes="application/json") public com.broadleafcommerce.cart.client.domain.Cart bulkUpdateFulfillmentGroupsInCart(@PathVariable String cartId, @RequestBody List<UpdateFulfillmentGroupRequest> updateFulfillmentGroupsRequests, @RequestParam(defaultValue="true") boolean price, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getFulfillmentOptionsForCart
@Deprecated(since="1.9") @FrameworkGetMapping("/{cartId}/fulfillment-options/{referenceNumber}") public List<com.broadleafcommerce.shipping.domain.FulfillmentOptionPricedResponse> getFulfillmentOptionsForCart(@PathVariable String cartId, @PathVariable String referenceNumber, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This method works with shipping-common and shipping-services, which has been deprecated in 1.9. UsegetPricedFulfillmentOptionsForCart(java.lang.String, java.lang.Integer, com.broadleafcommerce.order.common.domain.CustomerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo)
with fulfillment-common instead. -
getPricedFulfillmentOptionsForCart
@FrameworkGetMapping("/{cartId}/fulfillment-options") public com.broadleafcommerce.fulfillment.common.domain.FulfillmentOptionResponse getPricedFulfillmentOptionsForCart(@PathVariable String cartId, Integer cartVersion, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
recalculateTaxesForCart
@FrameworkPostMapping("/{cartId}/recalculate-tax") public com.broadleafcommerce.cart.client.domain.Cart recalculateTaxesForCart(@PathVariable String cartId, @RequestParam(defaultValue="false") boolean estimated, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
recalculateTaxesForCart
@Deprecated public com.broadleafcommerce.cart.client.domain.Cart recalculateTaxesForCart(@PathVariable String cartId, @RequestParam(defaultValue="true") boolean estimated, @RequestParam(defaultValue="true") boolean actual, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getCheckoutPaymentMethodOptions
@FrameworkGetMapping(value="/{cartId}/payment-method-options", produces="application/json") public List<CheckoutPaymentMethodOption> getCheckoutPaymentMethodOptions(@PathVariable String cartId, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
processCheckout
@FrameworkPostMapping(value="/{cartId}/process", consumes="application/json") public org.springframework.http.ResponseEntity<CheckoutResponse> processCheckout(@PathVariable String cartId, @RequestBody CheckoutProcessRequest checkoutProcessRequest, Integer cartVersion, String guestToken, com.broadleafcommerce.order.common.domain.CustomerRef customer, @ContextOperation com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
resolveCartForRead
-
resolveCartForUpdate
-
resolveCartForUpdate
@NonNull protected com.broadleafcommerce.cart.client.domain.Cart resolveCartForUpdate(String cartId, @Nullable Integer cartVersion, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable String workflow, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
resolveCart
@NonNull protected com.broadleafcommerce.cart.client.domain.Cart resolveCart(@NonNull String cartId, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
validateGuestTokenIfNecessary
protected void validateGuestTokenIfNecessary(com.broadleafcommerce.cart.client.domain.Cart cart, String guestToken, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
cartNotFoundMessage
-
buildCheckoutProcessDto
protected CheckoutProcessDto buildCheckoutProcessDto(@NonNull @NonNull CheckoutProcessRequest processRequest, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customerRef) -
cartOwnershipMatchWithCustomerRef
protected boolean cartOwnershipMatchWithCustomerRef(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customerRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the givenCart.getCustomerRef()
matches with the givenCustomerRef
.- Parameters:
cart
- theCart
to check the ownershipcustomerRef
- theCustomerRef
to check against- Returns:
- true if the cart ownership matches with the given
CustomerRef
, otherwise false
-
customerMatches
protected boolean customerMatches(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.order.common.domain.CustomerRef customer) Whether the customer matches the cart's owner.- Parameters:
cart
- The cart being resolvedcustomer
- The customer requested the cart- Returns:
- Whether the customer matches the cart's owner.
-
getCartResolverService
-
getCartOperationService
-
getCartVersionValidationService
-
getGuestCartProtectionService
-
getGuestCartTokenValidator
-
getCartValidationProperties
-
getCheckoutService
-
getFulfillmentPricingService
Deprecated. -
getFulfillmentOptionRequestService
-
getCheckoutPaymentMethodService
-
setCheckoutPaymentMethodService
@Autowired public void setCheckoutPaymentMethodService(CheckoutPaymentMethodService checkoutPaymentMethodService) -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
getPricedFulfillmentOptionsForCart(java.lang.String, java.lang.Integer, com.broadleafcommerce.order.common.domain.CustomerRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo)