Esempio n. 1
0
 public void purchase(string item, string developerPayload)
 {
     purchaseCalled = true;
     // Our billing systems should only keep track of non consumables.
     if (remapper.getPurchasableItemFromPlatformSpecificId(item).PurchaseType == PurchaseType.NonConsumable)
     {
         purchasedItems.Add(item);
     }
     biller.onPurchaseReceiptRetrieved(item, "fake receipt");
     this.biller.onPurchaseSucceeded(item, "{ \"this\" : \"is a fake receipt\" }");
 }
        public void onPollForConsumablesFinished(string json)
        {
            logger.Log("Finished poll for consumables, completing init.");
            Dictionary <string, object> response = (Dictionary <string, object>)Unibill.Impl.MiniJSON.jsonDecode(json);

            if (null != response)
            {
                var ownedSubscriptions = response.getStringList("ownedSubscriptions");
                if (null != ownedSubscriptions)
                {
                    callback.onActiveSubscriptionsRetrieved(ownedSubscriptions);
                }

                var ownedItems = response.getHash("ownedItems");
                if (null != ownedItems)
                {
                    foreach (var item in ownedItems)
                    {
                        callback.onPurchaseReceiptRetrieved(item.Key, item.Value.ToString());
                    }
                }
            }
            callback.onSetupComplete(true);
        }