Class CartsController
- java.lang.Object
-
- de.hybris.platform.ycommercewebservices.v2.controller.BaseController
-
- de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
-
- de.hybris.platform.ycommercewebservices.v2.controller.CartsController
-
@Controller @RequestMapping("/{baseSiteId}/users/{userId}/carts") public class CartsController extends BaseCommerceController
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
API_COMPATIBILITY_B2C_CHANNELS
-
Fields inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseController
BASIC_FIELD_SET, DEFAULT_CURRENT_PAGE, DEFAULT_FIELD_SET, DEFAULT_PAGE_SIZE, HEADER_TOTAL_COUNT, INVALID_REQUEST_BODY_ERROR_MESSAGE
-
-
Constructor Summary
Constructors Constructor Description CartsController()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected CartModificationWsDTOaddCartEntryInternal(java.lang.String baseSiteId, java.lang.String code, long qty, java.lang.String pickupStore, java.lang.String fields)CartWsDTOcreateCart(java.lang.String oldCartId, java.lang.String toMergeCartGuid, java.lang.String fields)AddressWsDTOcreateCartDeliveryAddress(AddressWsDTO address, java.lang.String fields)AddressWsDTOcreateCartDeliveryAddress(javax.servlet.http.HttpServletRequest request, java.lang.String fields)Deprecated, for removal: This API element is subject to removal in a future version.since 2005.CartModificationWsDTOcreateCartEntry(java.lang.String baseSiteId, OrderEntryWsDTO entry, java.lang.String fields)CartModificationWsDTOcreateCartEntry(java.lang.String baseSiteId, java.lang.String code, long qty, java.lang.String pickupStore, java.lang.String fields)Deprecated, for removal: This API element is subject to removal in a future version.since 2005.PaymentDetailsWsDTOcreateCartPaymentDetails(PaymentDetailsWsDTO paymentDetails, java.lang.String fields)PaymentDetailsWsDTOcreateCartPaymentDetails(javax.servlet.http.HttpServletRequest request, java.lang.String fields)Deprecated, for removal: This API element is subject to removal in a future version.since 2005.voiddoApplyCartPromotion(java.lang.String promotionId)voiddoApplyCartVoucher(java.lang.String voucherId)CartWsDTOgetCart(java.lang.String fields)DeliveryModeWsDTOgetCartDeliveryMode(java.lang.String fields)DeliveryModeListWsDTOgetCartDeliveryModes(java.lang.String fields)OrderEntryListWsDTOgetCartEntries(java.lang.String fields)OrderEntryWsDTOgetCartEntry(long entryNumber, java.lang.String fields)protected static OrderEntryDatagetCartEntry(CartData cart, java.lang.String productCode, java.lang.String pickupStore)protected static OrderEntryDatagetCartEntryForNumber(CartData cart, long number)PromotionResultListWsDTOgetCartPromotion(java.lang.String promotionId, java.lang.String fields)PromotionResultListWsDTOgetCartPromotions(java.lang.String fields)CartListWsDTOgetCarts(java.lang.String fields, boolean savedCartsOnly, int currentPage, int pageSize, java.lang.String sort)VoucherListWsDTOgetCartVouchers(java.lang.String fields)protected booleanisCartAnonymous(java.lang.String cartGuid)protected booleanisUserCart(java.lang.String toMergeCartGuid)protected static CartModificationDatamergeCartModificationData(CartModificationData cmd1, CartModificationData cmd2)voidremoveCart()voidremoveCartDeliveryAddress()voidremoveCartDeliveryMode()voidremoveCartEntry(long entryNumber)voidremoveCartPromotion(java.lang.String promotionId)voidremoveCartVoucher(java.lang.String voucherId)voidreplaceCartDeliveryAddress(java.lang.String addressId)voidreplaceCartDeliveryMode(java.lang.String deliveryModeId)CartModificationWsDTOreplaceCartEntry(java.lang.String baseSiteId, long entryNumber, OrderEntryWsDTO entry, java.lang.String fields)CartModificationWsDTOreplaceCartEntry(java.lang.String baseSiteId, long entryNumber, java.lang.Long qty, java.lang.String pickupStore, java.lang.String fields)Deprecated, for removal: This API element is subject to removal in a future version.since 2005.voidreplaceCartGuestUser(java.lang.String email)voidreplaceCartPaymentDetails(java.lang.String paymentDetailsId)CartModificationWsDTOupdateCartEntry(java.lang.String baseSiteId, long entryNumber, OrderEntryWsDTO entry, java.lang.String fields)CartModificationWsDTOupdateCartEntry(java.lang.String baseSiteId, long entryNumber, java.lang.Long qty, java.lang.String pickupStore, java.lang.String fields)Deprecated, for removal: This API element is subject to removal in a future version.since 2005.protected CartModificationWsDTOupdateCartEntryInternal(java.lang.String baseSiteId, CartData cart, OrderEntryData orderEntry, java.lang.Long qty, java.lang.String pickupStore, java.lang.String fields, boolean putMode)protected voidvalidateCartEntryForReplace(OrderEntryData oryginalEntry, OrderEntryWsDTO entry)protected static voidvalidateForAmbiguousPositions(CartData currentCart, OrderEntryData currentEntry, java.lang.String newPickupStore)protected voidvalidateIfProductIsInStockInPOS(java.lang.String baseSiteId, java.lang.String productCode, java.lang.String storeName, java.lang.Long entryNumber)protected voidvalidateIfProductIsInStockOnline(java.lang.String baseSiteId, java.lang.String productCode, java.lang.Long entryNumber)protected voidvalidatePayment(PaymentDetailsWsDTO paymentDetails)-
Methods inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseCommerceController
addPaymentDetailsInternal, addPaymentDetailsInternal, applyVoucherForCartInternal, createAddressInternal, createAddressInternal, getAddressDTOValidator, getAddressValidator, getCartFacade, getCcPaymentInfoValidator, getCheckoutFacade, getDeliveryAddressValidator, getHttpRequestAddressDataPopulator, getHttpRequestPaymentInfoPopulator, getPaymentDetailsDTOValidator, getSessionCart, getUserFacade, getVoucherFacade, setAddressDTOValidator, setAddressValidator, setCartDeliveryAddressInternal, setCartDeliveryModeInternal, setCartFacade, setCcPaymentInfoValidator, setCheckoutFacade, setDeliveryAddressValidator, setHttpRequestAddressDataPopulator, setHttpRequestPaymentInfoPopulator, setPaymentDetailsDTOValidator, setPaymentDetailsInternal, setUserFacade, setVoucherFacade, validateCartForPlaceOrder, validateStatusesEnumValue
-
Methods inherited from class de.hybris.platform.ycommercewebservices.v2.controller.BaseController
addPaginationField, getDataMapper, handleDuplicateUidException, handleErrorInternal, handleHttpMessageNotReadableException, handleModelNotFoundException, logParam, logParam, logValue, sanitize, setDataMapper, setTotalCountHeader, setTotalCountHeader, validate
-
-
-
-
Method Detail
-
mergeCartModificationData
protected static CartModificationData mergeCartModificationData(CartModificationData cmd1, CartModificationData cmd2)
-
getCartEntryForNumber
protected static OrderEntryData getCartEntryForNumber(CartData cart, long number)
-
getCartEntry
protected static OrderEntryData getCartEntry(CartData cart, java.lang.String productCode, java.lang.String pickupStore)
-
validateForAmbiguousPositions
protected static void validateForAmbiguousPositions(CartData currentCart, OrderEntryData currentEntry, java.lang.String newPickupStore)
-
getCarts
@RequestMapping(method=GET) @ResponseBody public CartListWsDTO getCarts(@RequestParam(defaultValue="DEFAULT") java.lang.String fields, @RequestParam(defaultValue="false") boolean savedCartsOnly, @RequestParam(defaultValue="0") int currentPage, @RequestParam(defaultValue="20") int pageSize, @RequestParam(required=false) java.lang.String sort)
-
getCart
@RequestMapping(value="/{cartId}", method=GET) @ResponseBody public CartWsDTO getCart(@RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
createCart
@RequestMapping(method=POST) @ResponseStatus(CREATED) @ResponseBody public CartWsDTO createCart(@RequestParam(required=false) java.lang.String oldCartId, @RequestParam(required=false) java.lang.String toMergeCartGuid, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
isUserCart
protected boolean isUserCart(java.lang.String toMergeCartGuid)
-
isCartAnonymous
protected boolean isCartAnonymous(java.lang.String cartGuid)
-
removeCart
@RequestMapping(value="/{cartId}", method=DELETE) @ResponseStatus(OK) public void removeCart()
-
replaceCartGuestUser
@Secured({"ROLE_CLIENT","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/email", method=PUT) @ResponseStatus(OK) public void replaceCartGuestUser(@RequestParam java.lang.String email) throws DuplicateUidException- Throws:
DuplicateUidException
-
getCartEntries
@RequestMapping(value="/{cartId}/entries", method=GET) @ResponseBody public OrderEntryListWsDTO getCartEntries(@RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
createCartEntry
@Deprecated(since="2005", forRemoval=true) @RequestMapping(value="/{cartId}/entries", method=POST) @ResponseBody @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2c.channels") public CartModificationWsDTO createCartEntry(@PathVariable java.lang.String baseSiteId, @RequestParam java.lang.String code, @RequestParam(defaultValue="1") long qty, @RequestParam(required=false) java.lang.String pickupStore, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws CommerceCartModificationExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 2005. Please usecreateCartEntry(String, OrderEntryWsDTO, String)instead.
-
addCartEntryInternal
protected CartModificationWsDTO addCartEntryInternal(java.lang.String baseSiteId, java.lang.String code, long qty, java.lang.String pickupStore, java.lang.String fields) throws CommerceCartModificationException
-
createCartEntry
@RequestMapping(value="/{cartId}/entries", method=POST, consumes={"application/json","application/xml"}) @ResponseBody @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2c.channels") public CartModificationWsDTO createCartEntry(@PathVariable java.lang.String baseSiteId, @RequestBody OrderEntryWsDTO entry, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws CommerceCartModificationException
-
getCartEntry
@RequestMapping(value="/{cartId}/entries/{entryNumber}", method=GET) @ResponseBody public OrderEntryWsDTO getCartEntry(@PathVariable long entryNumber, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
replaceCartEntry
@Deprecated(since="2005", forRemoval=true) @RequestMapping(value="/{cartId}/entries/{entryNumber}", method=PUT) @ResponseBody @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2c.channels") public CartModificationWsDTO replaceCartEntry(@PathVariable java.lang.String baseSiteId, @PathVariable long entryNumber, @RequestParam java.lang.Long qty, @RequestParam(required=false) java.lang.String pickupStore, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws CommerceCartModificationExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 2005. Please usereplaceCartEntry(String, long, OrderEntryWsDTO, String)instead.
-
updateCartEntryInternal
protected CartModificationWsDTO updateCartEntryInternal(java.lang.String baseSiteId, CartData cart, OrderEntryData orderEntry, java.lang.Long qty, java.lang.String pickupStore, java.lang.String fields, boolean putMode) throws CommerceCartModificationException
-
replaceCartEntry
@RequestMapping(value="/{cartId}/entries/{entryNumber}", method=PUT, consumes={"application/json","application/xml"}) @ResponseBody public CartModificationWsDTO replaceCartEntry(@PathVariable java.lang.String baseSiteId, @PathVariable long entryNumber, @RequestBody OrderEntryWsDTO entry, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws CommerceCartModificationException
-
validateCartEntryForReplace
protected void validateCartEntryForReplace(OrderEntryData oryginalEntry, OrderEntryWsDTO entry)
-
updateCartEntry
@Deprecated(since="2005", forRemoval=true) @RequestMapping(value="/{cartId}/entries/{entryNumber}", method=PATCH) @ResponseBody public CartModificationWsDTO updateCartEntry(@PathVariable java.lang.String baseSiteId, @PathVariable long entryNumber, @RequestParam(required=false) java.lang.Long qty, @RequestParam(required=false) java.lang.String pickupStore, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws CommerceCartModificationExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 2005. Please useupdateCartEntry(String, long, OrderEntryWsDTO, String)instead.
-
updateCartEntry
@RequestMapping(value="/{cartId}/entries/{entryNumber}", method=PATCH, consumes={"application/json","application/xml"}) @ResponseBody public CartModificationWsDTO updateCartEntry(@PathVariable java.lang.String baseSiteId, @PathVariable long entryNumber, @RequestBody OrderEntryWsDTO entry, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws CommerceCartModificationException
-
removeCartEntry
@RequestMapping(value="/{cartId}/entries/{entryNumber}", method=DELETE) @ResponseStatus(OK) public void removeCartEntry(@PathVariable long entryNumber) throws CommerceCartModificationException
-
createCartDeliveryAddress
@Deprecated(since="1905", forRemoval=true) @Secured({"ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_GUEST","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/addresses/delivery", method=POST) @ResponseStatus(CREATED) @ResponseBody public AddressWsDTO createCartDeliveryAddress(javax.servlet.http.HttpServletRequest request, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)Deprecated, for removal: This API element is subject to removal in a future version.since 2005. Please usecreateCartDeliveryAddress(AddressWsDTO, String)instead.
-
createCartDeliveryAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_GUEST","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/addresses/delivery", method=POST, consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) @ResponseBody public AddressWsDTO createCartDeliveryAddress(@RequestBody AddressWsDTO address, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
replaceCartDeliveryAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/addresses/delivery", method=PUT) @ResponseStatus(OK) @SiteChannelRestriction(allowedSiteChannelsProperty="api.compatibility.b2c.channels") public void replaceCartDeliveryAddress(@RequestParam java.lang.String addressId)
-
removeCartDeliveryAddress
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/addresses/delivery", method=DELETE) @ResponseStatus(OK) public void removeCartDeliveryAddress()
-
getCartDeliveryMode
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/deliverymode", method=GET) @ResponseBody public DeliveryModeWsDTO getCartDeliveryMode(@RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
replaceCartDeliveryMode
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/deliverymode", method=PUT) @ResponseStatus(OK) public void replaceCartDeliveryMode(@RequestParam(required=true) java.lang.String deliveryModeId) throws UnsupportedDeliveryModeException- Throws:
UnsupportedDeliveryModeException
-
removeCartDeliveryMode
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/deliverymode", method=DELETE) @ResponseStatus(OK) public void removeCartDeliveryMode()
-
getCartDeliveryModes
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/deliverymodes", method=GET) @ResponseBody public DeliveryModeListWsDTO getCartDeliveryModes(@RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
createCartPaymentDetails
@Deprecated(since="2005", forRemoval=true) @Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/paymentdetails", method=POST) @ResponseStatus(CREATED) @ResponseBody public PaymentDetailsWsDTO createCartPaymentDetails(javax.servlet.http.HttpServletRequest request, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws InvalidPaymentInfoException, NoCheckoutCartException, UnsupportedRequestExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 2005. Please usecreateCartPaymentDetails(PaymentDetailsWsDTO, String)instead.
-
createCartPaymentDetails
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/paymentdetails", method=POST, consumes={"application/json","application/xml"}) @ResponseStatus(CREATED) @ResponseBody public PaymentDetailsWsDTO createCartPaymentDetails(@RequestBody PaymentDetailsWsDTO paymentDetails, @RequestParam(defaultValue="DEFAULT") java.lang.String fields) throws InvalidPaymentInfoException, NoCheckoutCartException, UnsupportedRequestException
-
validatePayment
protected void validatePayment(PaymentDetailsWsDTO paymentDetails) throws NoCheckoutCartException
- Throws:
NoCheckoutCartException
-
replaceCartPaymentDetails
@Secured({"ROLE_CUSTOMERGROUP","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/paymentdetails", method=PUT) @ResponseStatus(OK) public void replaceCartPaymentDetails(@RequestParam java.lang.String paymentDetailsId) throws InvalidPaymentInfoException- Throws:
InvalidPaymentInfoException
-
getCartPromotions
@Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/promotions", method=GET) @ResponseBody public PromotionResultListWsDTO getCartPromotions(@RequestParam(required=false,defaultValue="DEFAULT") java.lang.String fields)
-
getCartPromotion
@Secured({"ROLE_CUSTOMERGROUP","ROLE_CLIENT","ROLE_GUEST","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT"}) @RequestMapping(value="/{cartId}/promotions/{promotionId}", method=GET) @ResponseBody public PromotionResultListWsDTO getCartPromotion(@PathVariable java.lang.String promotionId, @RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
doApplyCartPromotion
@Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(value="/{cartId}/promotions", method=POST) @ResponseStatus(OK) public void doApplyCartPromotion(@RequestParam(required=true) java.lang.String promotionId) throws CommercePromotionRestrictionException
-
removeCartPromotion
@Secured("ROLE_TRUSTED_CLIENT") @RequestMapping(value="/{cartId}/promotions/{promotionId}", method=DELETE) @ResponseStatus(OK) public void removeCartPromotion(@PathVariable java.lang.String promotionId) throws CommercePromotionRestrictionException
-
getCartVouchers
@Secured({"ROLE_CLIENT","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT","ROLE_GUEST"}) @RequestMapping(value="/{cartId}/vouchers", method=GET) @ResponseBody public VoucherListWsDTO getCartVouchers(@RequestParam(defaultValue="DEFAULT") java.lang.String fields)
-
doApplyCartVoucher
@Secured({"ROLE_CLIENT","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT","ROLE_GUEST"}) @RequestMapping(value="/{cartId}/vouchers", method=POST) @ResponseStatus(OK) public void doApplyCartVoucher(@RequestParam java.lang.String voucherId) throws NoCheckoutCartException, VoucherOperationException
-
removeCartVoucher
@Secured({"ROLE_CLIENT","ROLE_CUSTOMERGROUP","ROLE_CUSTOMERMANAGERGROUP","ROLE_TRUSTED_CLIENT","ROLE_GUEST"}) @RequestMapping(value="/{cartId}/vouchers/{voucherId}", method=DELETE) @ResponseStatus(OK) public void removeCartVoucher(@PathVariable java.lang.String voucherId) throws NoCheckoutCartException, VoucherOperationException
-
validateIfProductIsInStockInPOS
protected void validateIfProductIsInStockInPOS(java.lang.String baseSiteId, java.lang.String productCode, java.lang.String storeName, java.lang.Long entryNumber)
-
validateIfProductIsInStockOnline
protected void validateIfProductIsInStockOnline(java.lang.String baseSiteId, java.lang.String productCode, java.lang.Long entryNumber)
-
-