Esempio n. 1
0
        public void GetStockItems(StoreProductType productType, List <long> productIds = null, List <StoreProductFilter> productFilters = null, long purchaseForId = 0, Action <BackendResult <VKList <StockItem>, ResultCode> > callback = null)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>()
            {
                {
                    "type",
                    productType.ToString()
                },
                {
                    "merchant",
                    "microsoft"
                },
                {
                    "no_inapp",
                    "1"
                }
            };

            if (productIds != null && productIds.Count > 0)
            {
                parameters["product_ids"] = string.Join <long>(",", (IEnumerable <long>)productIds);
            }
            if (productFilters != null && productFilters.Count > 0)
            {
                parameters["filters"] = string.Join(",", productFilters.Select <StoreProductFilter, string>((Func <StoreProductFilter, string>)(filter => filter.ToString().ToLowerInvariant())));
            }
            if (purchaseForId > 0L)
            {
                parameters["purchase_for"] = purchaseForId.ToString();
            }
            VKRequestsDispatcher.DispatchRequestToVK <VKList <StockItem> >("store.getStockItems", parameters, callback, null, false, true, new CancellationToken?(), null);
        }
Esempio n. 2
0
 public StoreBuyProductParams(StoreProductType productType, int productId)
 {
     this.ProductType = productType;
     this.ProductId   = productId;
 }