예제 #1
0
        public ServiceResult DeleteShoppingCartItem(string cartUUID, string cartItemUUID)
        {
            if (string.IsNullOrWhiteSpace(cartItemUUID))
            {
                return(ServiceResponse.Error("Invalid cart item id."));
            }

            StoreManager  storeManager = new StoreManager(Globals.DBConnectionKey, this.GetAuthToken(Request));
            ServiceResult res          = storeManager.DeleteCartItem(cartItemUUID);

            if (res.Code != 200)
            {
                return(res);
            }

            ShoppingCart cart = storeManager.GetCart(cartUUID);

            if (cart == null)
            {
                return(ServiceResponse.Error("Could not retrieve cart."));
            }

            return(ServiceResponse.OK("", cart));
        }