public void initialise (IBillingServiceCallback callback) {
            this.callback = callback;
            if (null == publicKey || publicKey.Equals ("[Your key]")) {
                callback.logError (UnibillError.GOOGLEPLAY_PUBLICKEY_NOTCONFIGURED, publicKey);
                callback.onSetupComplete (false);
                return;
            }

            var encoder = new Hashtable ();
            encoder.Add ("publicKey", this.publicKey);
            ArrayList products = new ArrayList ();
            foreach (var item in db.AllPurchasableItems) {
                Hashtable product = new Hashtable ();
                product.Add ("productId", remapper.mapItemIdToPlatformSpecificId (item));
                product.Add ("consumable", item.PurchaseType == PurchaseType.Consumable);
                products.Add (product);
            }
            encoder.Add("products", products);

            var json = encoder.toJson();
            rawInterface.initialise(this, json);
        }
 public static string getPurchaseResponse(string productId) {
     var h = new Hashtable ();
     h.Add ("productId", productId);
     h.Add ("purchaseToken", "TOKEN");
     return h.toJson ();
 }
Example #3
0
 public void purchase (string product) {
     Hashtable response = new Hashtable ();
     response.Add ("productId", product);
     response.Add ("signature", "signature");
     callback.onPurchaseSucceeded(response.toJson());
 }