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 Details

  • Constructor Details

  • 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. Use getPricedFulfillmentOptionsForCart(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

      @NonNull protected com.broadleafcommerce.cart.client.domain.Cart resolveCartForRead(@NonNull String cartId, @Nullable Integer cartVersion, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • resolveCartForUpdate

      @NonNull protected com.broadleafcommerce.cart.client.domain.Cart resolveCartForUpdate(String cartId, @Nullable Integer cartVersion, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • 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

      protected String cartNotFoundMessage(String cartId)
    • 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 given Cart.getCustomerRef() matches with the given CustomerRef.
      Parameters:
      cart - the Cart to check the ownership
      customerRef - the CustomerRef 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 resolved
      customer - The customer requested the cart
      Returns:
      Whether the customer matches the cart's owner.
    • getCartResolverService

      protected CartResolverService getCartResolverService()
    • getCartOperationService

      protected CartOperationService getCartOperationService()
    • getCartVersionValidationService

      protected CartVersionValidationService getCartVersionValidationService()
    • getGuestCartProtectionService

      protected GuestCartProtectionService getGuestCartProtectionService()
    • getGuestCartTokenValidator

      protected GuestCartTokenValidator getGuestCartTokenValidator()
    • getCartValidationProperties

      protected CartValidationProperties getCartValidationProperties()
    • getCheckoutService

      protected CheckoutService getCheckoutService()
    • getFulfillmentPricingService

      @Deprecated protected Optional<FulfillmentPricingService> getFulfillmentPricingService()
      Deprecated.
    • getFulfillmentOptionRequestService

      protected FulfillmentOptionRequestService getFulfillmentOptionRequestService()
    • getCheckoutPaymentMethodService

      protected CheckoutPaymentMethodService 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)