Ejemplo n.º 1
0
        /// <summary>
        /// Generate paging based on the itemcount and the items per page
        /// </summary>
        /// <param name="itemCount">The item count.</param>
        /// <param name="itemsPerPage">The items per page.</param>
        /// <returns>
        /// Paging Object
        /// </returns>
        public static XPathNavigator GetPages(int itemCount, int itemsPerPage)
        {
            // todo: test is this even possible?
            var item = Paging.GetPages(itemCount, itemsPerPage);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetPages", item, true)).CreateNavigator());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets all payment providers.
        /// </summary>
        /// <param name="storeAlias">The store alias.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <returns></returns>
        public static XPathNavigator GetAllPaymentProviders(string storeAlias = null, string currencyCode = null)
        {
            var dictionary = new Dictionary <string, object>();
            var item       = API.Providers.GetAllPaymentProviders(storeAlias, currencyCode);

            dictionary.Add("PaymentProvider", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetAllPaymentProviders", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets all stores.
        /// </summary>
        /// <returns></returns>
        public static XPathNavigator GetAllStores()
        {
            var dictionary = new Dictionary <string, object>();

            var item = API.Store.GetAllStores();

            dictionary.Add("Store", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetAllStores", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the fulfillment providers. (ie shipping/pickup/etc)
        /// </summary>
        /// <param name="useZone">if set to <c>true</c> use zone/countries.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <returns></returns>
        public static XPathNavigator GetFulfillmentProviders(bool useZone = true, string storeAlias = null,string currencyCode = null)
        {
            var dictionary = new Dictionary<string, object>();

            var item = API.Basket.GetFulfillmentProviders(useZone, storeAlias, currencyCode);

            dictionary.Add("FillmentProvider", item);

            return XDocument.Parse(JSONXMLRender.RenderOutput("GetFulfillmentProviders", dictionary, true)).CreateNavigator();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets all order discounts.
        /// </summary>
        /// <returns></returns>
        public static XPathNavigator GetAllOrderDiscounts(string storeAlias = null, string currencyCode = null)
        {
            var dictionary = new Dictionary<string, object>();

            var item = API.Basket.GetAllOrderDiscounts(storeAlias, currencyCode);

            dictionary.Add("OrderDiscount", item);

            return XDocument.Parse(JSONXMLRender.RenderOutput("GetAllOrderDiscounts", dictionary, true)).CreateNavigator();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Gets the customers by spending.
        /// </summary>
        /// <param name="amountInCents">The amount in cents.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <returns></returns>
        public static XPathNavigator GetCustomersBySpending(int amountInCents, string storeAlias = null)
        {
            var dictionary = new Dictionary <string, object>();

            var item = API.Customers.GetCustomersBySpending(amountInCents, storeAlias);

            dictionary.Add("Customer", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetCustomersBySpending", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Gets the orders.
        /// </summary>
        /// <param name="days">The days.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <returns></returns>
        public static XPathNavigator GetOrdersByDays(int days, string storeAlias = null)
        {
            var dictionary = new Dictionary <string, object>();

            var item = API.Orders.GetOrders(days, storeAlias);

            dictionary.Add("Order", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetOrders", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Gets the categories recursive.
        /// </summary>
        /// <param name="categoryId">The category unique identifier.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <returns></returns>
        public static XPathNavigator GetCategoriesRecursive(int categoryId, string storeAlias = null, string currencyCode = null)
        {
            var dictionary = new Dictionary <string, object>();

            var item = API.Catalog.GetCategoriesRecursive(categoryId, storeAlias, currencyCode);

            dictionary.Add("Category", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetCategoriesRecursive", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Gets the customers.
        /// </summary>
        /// <param name="group">The group.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <returns></returns>
        public static XPathNavigator GetCustomers(string group)
        {
            var dictionary = new Dictionary <string, object>();

            var item = API.Customers.GetCustomers(group);

            dictionary.Add("Customer", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetCustomers", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets the wishlists.
        /// </summary>
        /// <param name="userName">Name of the usern.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <returns></returns>
        public static XPathNavigator GetWishlists(string userName, string storeAlias = null)
        {
            var dictionary = new Dictionary <string, object>();

            var item = API.Customers.GetWishlists(userName, storeAlias);

            dictionary.Add("Wishlist", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetWishlists", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Gets the discount for product variant.
        /// </summary>
        /// <param name="variantId">The variant unique identifier.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <returns></returns>
        public static XPathNavigator GetDiscountForProductVariant(int variantId, string storeAlias = null, string currencyCode = null)
        {
            var dictionary = new Dictionary <string, object>();

            var item = API.Discounts.GetDiscountForProductVariant(variantId, storeAlias, currencyCode);

            dictionary.Add("Discount", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetDiscountForProductVariant", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 12
0
        public static void JSON(string classAndFuction)
        {
            string qs = null;

            if (HttpContext.Current.Request.QueryString.AllKeys.Any())
            {
                qs = HttpContext.Current.Request.QueryString[0];
            }

            JSONXMLRender.RenderAndOutput(classAndFuction, qs);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Gets the orders.
        /// </summary>
        /// <param name="status">The status.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <returns></returns>
        public static XPathNavigator GetOrdersByStatus(string status, string storeAlias = null)
        {
            var orderstatus = OrderStatus.Confirmed;

            Enum.TryParse(status, out orderstatus);

            var dictionary = new Dictionary <string, object>();

            var item = API.Orders.GetOrders(orderstatus, storeAlias);

            dictionary.Add("Order", item);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetOrders", dictionary, true)).CreateNavigator());
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Gets the basket.
        /// </summary>
        /// <param name="guidAsString">The unique identifier.</param>
        /// <returns></returns>
        public static XPathNavigator GetBasket(string guidAsString)
        {
            var basket = API.Basket.GetBasket(guidAsString);

            return XDocument.Parse(JSONXMLRender.RenderOutput("GetBasket", basket, true)).CreateNavigator();
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Gets the order by transaction unique identifier.
        /// </summary>
        /// <param name="transactionId">The transaction unique identifier.</param>
        /// <returns></returns>
        public static XPathNavigator GetOrderByTransactionId(string transactionId)
        {
            var item = API.Orders.GetOrderByTransactionId(transactionId);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetOrderByTransactionId", item, true)).CreateNavigator());
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Gets the order.
        /// </summary>
        /// <param name="guidAsString">The unique identifier.</param>
        /// <returns></returns>
        public static XPathNavigator GetOrder(string guidAsString)
        {
            var item = API.Orders.GetOrder(guidAsString);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetOrder", item, true)).CreateNavigator());
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Get the current localization
        /// </summary>
        /// <returns></returns>
        public static XPathNavigator GetCurrentLocalization()
        {
            var item = API.Store.GetCurrentLocalization();

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetCurrentLocalization", item, true)).CreateNavigator());
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Gets the wishlist for the current membership user, or the current guest
        /// </summary>
        /// <param name="userName">Name of the usern.</param>
        /// <param name="wishlistName">Name of the wishlist.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <returns></returns>
        public static XPathNavigator GetWishlist(string wishlistName = null, string storeAlias = null)
        {
            var item = API.Customers.GetWishlist(wishlistName, storeAlias);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetWishlist", item, true)).CreateNavigator());
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Gets the current basket or create a new basket if basket was confirmed.
        /// Use case: customer clicks back button on payment provider
        /// </summary>
        /// <returns></returns>
        public static XPathNavigator GetCurrentOrNewBasket()
        {
            var basket = API.Basket.GetCurrentOrNewBasket();

            return XDocument.Parse(JSONXMLRender.RenderOutput("GetCurrentOrNewBasket", basket, true)).CreateNavigator();
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Gets the product variant.
        /// </summary>
        /// <param name="variantId">The variant unique identifier.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <returns></returns>
        public static XPathNavigator GetProductVariant(int variantId, string storeAlias = null, string currencyCode = null)
        {
            var item = API.Catalog.GetProductVariant(variantId, storeAlias, currencyCode);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetProductVariant", item, true)).CreateNavigator());
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Gets the category.
        /// </summary>
        /// <param name="categoryId">The category unique identifier.</param>
        /// <param name="storeAlias">The store alias.</param>
        /// <param name="currencyCode">The currency code.</param>
        /// <returns></returns>
        public static XPathNavigator GetCategory(int categoryId = 0, string storeAlias = null, string currencyCode = null)
        {
            var item = API.Catalog.GetCategory(categoryId, storeAlias, currencyCode);

            return(XDocument.Parse(JSONXMLRender.RenderOutput("GetCategory", item, true)).CreateNavigator());
        }