示例#1
0
        public void queryPurchasesSucceeded(string jsonStr)
        {
            JSONNode dataNode = JSON.Parse(jsonStr);

            JSONArray purchasesJsonArray = dataNode.AsArray;
            var       purchases          = BazaarPurchase.fromJsonArray(purchasesJsonArray);

            queryPurchasesSucceededEvent.SafeInvoke(purchases);
        }
示例#2
0
        public void consumePurchaseSucceeded(string jsonStr)
        {
            JSONNode       dataNode       = JSON.Parse(jsonStr);
            BazaarPurchase bazaarPurchase = new BazaarPurchase();

            bazaarPurchase.fromJson(dataNode.AsObject);

            consumePurchaseSucceededEvent.SafeInvoke(bazaarPurchase);
        }
示例#3
0
        public void queryInventorySucceeded(string jsonStr)
        {
            JSONNode dataNode = JSON.Parse(jsonStr);

            JSONArray purchasesJsonArray = dataNode["purchases"].AsArray;
            var       purchases          = BazaarPurchase.fromJsonArray(purchasesJsonArray);

            JSONArray skusJsonArray = dataNode["skus"].AsArray;
            var       skus          = BazaarSkuInfo.fromJsonArray(skusJsonArray);

            queryInventorySucceededEvent.SafeInvoke(purchases, skus);
        }
        public static List <BazaarPurchase> fromJsonArray(JSONArray items)
        {
            var purchases = new List <BazaarPurchase>();

            foreach (JSONNode item in items.AsArray)
            {
                BazaarPurchase bPurchase = new BazaarPurchase();
                bPurchase.fromJson(item.AsObject);
                purchases.Add(bPurchase);
            }

            return(purchases);
        }