public RawBillingPlatformProvider(UnibillConfiguration config, GameObject o)
 {
     #if UNITY_ANDROID
     this.config = config;
     #endif
     this.gameObject = o;
 }
 public UnibillCurrencyEditor(UnibillConfiguration config)
 {
     this.config = config;
     foreach (var currency in config.currencies) {
         this.currencies.Add (new EditableCurrency (currency));
     }
 }
Пример #3
0
 public RemoteConfigManager(IResourceLoader loader, IStorage storage, ILogger logger, RuntimePlatform platform)
 {
     this.storage = storage;
     logger.prefix = "Unibill.RemoteConfigManager";
     this.XML = loader.openTextFile ("unibillInventory.json").ReadToEnd ();
     Config = new UnibillConfiguration(XML, platform, logger);
     if (Config.UseHostedConfig) {
         string val = storage.GetString (CACHED_CONFIG_PATH, string.Empty);
         if (string.IsNullOrEmpty (val)) {
             logger.Log ("No cached config available. Using bundled");
         } else {
             logger.Log ("Cached config found, attempting to parse");
             try {
                 Config = new UnibillConfiguration(val, platform, logger);
                 if (Config.inventory.Count == 0) {
                     logger.LogError ("No purchasable items in cached config, ignoring.");
                     Config = new UnibillConfiguration (XML, platform, logger);
                 } else {
                     logger.Log (string.Format ("Using cached config with {0} purchasable items", Config.inventory.Count));
                     XML = val;
                 }
             } catch (Exception e) {
                 logger.LogError ("Error parsing inventory: {0}", e.Message);
                 Config = new UnibillConfiguration(XML, platform, logger);
             }
         }
         refreshCachedConfig (Config.HostedConfigUrl, logger);
     } else {
         logger.Log ("Not using cached inventory, using bundled.");
         Config = new UnibillConfiguration(XML, platform, logger);
     }
 }
Пример #4
0
 public AppleAppStoreBillingService(UnibillConfiguration db, ProductIdRemapper mapper, IStoreKitPlugin storekit)
 {
     this.storekit = storekit;
     this.remapper = mapper;
     storekit.initialise(this);
     products = new HashSet <PurchasableItem>(db.AllPurchasableItems);
 }
Пример #5
0
 public BillerFactory(IResourceLoader resourceLoader, ILogger logger, IStorage storage, IRawBillingPlatformProvider platformProvider, UnibillConfiguration config) {
     this.loader = resourceLoader;
     this.logger = logger;
     this.storage = storage;
     this.platformProvider = platformProvider;
     this.config = config;
 }
 public SamsungAppsBillingService(UnibillConfiguration config, ProductIdRemapper remapper, IRawSamsungAppsBillingService rawSamsung, ILogger logger)
 {
     this.config = config;
     this.remapper = remapper;
     this.rawSamsung = rawSamsung;
     this.logger = logger;
 }
 public AppleAppStoreBillingService(UnibillConfiguration db, ProductIdRemapper mapper, IStoreKitPlugin storekit)
 {
     this.storekit = storekit;
     this.remapper = mapper;
     storekit.initialise(this);
     products = new HashSet<PurchasableItem>(db.AllPurchasableItems);
 }
Пример #8
0
    public void OnEnable () {
		items = new List<GUIPurchasable> ();
		toRemove = new List<GUIPurchasable> ();
		InventoryPostProcessor.CreateInventoryIfNecessary ();
		AndroidManifestGenerator.CreateManifestIfNecessary ();
        using (TextReader reader = File.OpenText(InventoryPostProcessor.UNIBILL_JSON_INVENTORY_PATH)) {
            config = new UnibillConfiguration(reader.ReadToEnd(), Application.platform, new Uniject.Impl.UnityLogger());
        }
        for (int t = 0; t < androidBillingPlatforms.Count(); t++) {
            if (androidBillingPlatforms[t] == config.AndroidBillingPlatform.ToString()) {
                androidBillingPlatform = t;
                break;
            }
        }
        foreach (PurchasableItem element in config.inventory) {

            List<IPlatformEditor> editors = new List<IPlatformEditor>();
            editors.Add(new GooglePlayEditor(element));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.AmazonAppstore));
            editors.Add(new AppleAppStoreEditor(element));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.MacAppStore));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.WindowsPhone8));
            editors.Add(new DefaultPlatformEditor(element, BillingPlatform.Windows8_1));
			editors.Add (new DefaultPlatformEditor (element, BillingPlatform.SamsungApps));
            items.Add(new GUIPurchasable(element, editors));
        }

		currencyEditor = new UnibillCurrencyEditor (config);
    }
Пример #9
0
 public SamsungAppsBillingService(UnibillConfiguration config, ProductIdRemapper remapper, IRawSamsungAppsBillingService rawSamsung, ILogger logger)
 {
     this.config     = config;
     this.remapper   = remapper;
     this.rawSamsung = rawSamsung;
     this.logger     = logger;
 }
Пример #10
0
 public BillerFactory(IResourceLoader resourceLoader, ILogger logger, IStorage storage, IRawBillingPlatformProvider platformProvider, UnibillConfiguration config)
 {
     this.loader           = resourceLoader;
     this.logger           = logger;
     this.storage          = storage;
     this.platformProvider = platformProvider;
     this.config           = config;
 }
Пример #11
0
 public AmazonAppStoreBillingService(IRawAmazonAppStoreBillingInterface amazon, ProductIdRemapper remapper, UnibillConfiguration db, TransactionDatabase tDb, ILogger logger) {
     this.remapper = remapper;
     this.db = db;
     this.logger = logger;
     logger.prefix = "UnibillAmazonBillingService";
     this.amazon = amazon;
     this.tDb = tDb;
 }
Пример #12
0
 public AmazonAppStoreBillingService(IRawAmazonAppStoreBillingInterface amazon, ProductIdRemapper remapper, UnibillConfiguration db, TransactionDatabase tDb, ILogger logger)
 {
     this.remapper = remapper;
     this.db       = db;
     this.logger   = logger;
     logger.prefix = "UnibillAmazonBillingService";
     this.amazon   = amazon;
     this.tDb      = tDb;
 }
Пример #13
0
 public GooglePlayBillingService (IRawGooglePlayInterface rawInterface,
                                  UnibillConfiguration config,
                                  ProductIdRemapper remapper,
                                  ILogger logger) {
     this.rawInterface = rawInterface;
     this.publicKey = config.GooglePlayPublicKey;
     this.remapper = remapper;
     this.db = config;
     this.logger = logger;
 }
Пример #14
0
 public WP8BillingService(IWindowsIAP wp8,
                          UnibillConfiguration config,
                          ProductIdRemapper remapper,
                          TransactionDatabase tDb,
                          ILogger logger) {
     this.wp8 = wp8;
     this.db = config;
     this.tDb = tDb;
     this.remapper = remapper;
     this.logger = logger;
 }
Пример #15
0
 public GooglePlayBillingService(IRawGooglePlayInterface rawInterface,
                                 UnibillConfiguration config,
                                 ProductIdRemapper remapper,
                                 ILogger logger)
 {
     this.rawInterface = rawInterface;
     this.publicKey    = config.GooglePlayPublicKey;
     this.remapper     = remapper;
     this.db           = config;
     this.logger       = logger;
 }
Пример #16
0
        public Biller (UnibillConfiguration config, TransactionDatabase tDb, IBillingService billingSubsystem, ILogger logger, HelpCentre help, ProductIdRemapper remapper, CurrencyManager currencyManager) {
            this.InventoryDatabase = config;
            this.transactionDatabase = tDb;
            this.billingSubsystem = billingSubsystem;
            this.logger = logger;
            logger.prefix = "UnibillBiller";
            this.help = help;
            this.Errors = new List<UnibillError> ();
            this.remapper = remapper;
			this.currencyManager = currencyManager;
        }
Пример #17
0
 public BillerFactory(IResourceLoader resourceLoader, Uniject.ILogger logger,
                      IStorage storage, IRawBillingPlatformProvider platformProvider,
                      UnibillConfiguration config, IUtil util, IUnityAnalytics analytics)
 {
     this.loader           = resourceLoader;
     this.logger           = logger;
     this.storage          = storage;
     this.platformProvider = platformProvider;
     this.config           = config;
     this.util             = util;
     this.analytics        = analytics;
 }
Пример #18
0
 public WP8BillingService(IWindowsIAP wp8,
                          UnibillConfiguration config,
                          ProductIdRemapper remapper,
                          TransactionDatabase tDb,
                          ILogger logger)
 {
     this.wp8      = wp8;
     this.db       = config;
     this.tDb      = tDb;
     this.remapper = remapper;
     this.logger   = logger;
 }
        public RawAmazonAppStoreBillingInterface(UnibillConfiguration config)
        {
            if (config.CurrentPlatform == BillingPlatform.AmazonAppstore && config.AmazonSandboxEnabled)
            {
                string json = ((TextAsset)Resources.Load("amazon.sdktester.json")).text;
                File.WriteAllText("/sdcard/amazon.sdktester.json", json);
            }

            using (var pluginClass = new AndroidJavaClass("com.outlinegames.unibillAmazon.Unibill")) {
                amazon = pluginClass.CallStatic <AndroidJavaObject> ("instance");
            }
        }
        public RawAmazonAppStoreBillingInterface(UnibillConfiguration config)
        {
            #if UNITY_ANDROID
            if (config.CurrentPlatform == BillingPlatform.AmazonAppstore && config.AmazonSandboxEnabled) {
                string json = ((TextAsset)Resources.Load ("amazon.sdktester.json")).text;
                File.WriteAllText ("/sdcard/amazon.sdktester.json", json);
            }

            using (var pluginClass = new AndroidJavaClass("com.outlinegames.unibillAmazon.Unibill" )) {
                amazon = pluginClass.CallStatic<AndroidJavaObject> ("instance");
            }
            #endif
        }
Пример #21
0
 public GooglePlayBillingService(IRawGooglePlayInterface rawInterface,
                                 UnibillConfiguration config,
                                 ProductIdRemapper remapper,
                                 ILogger logger)
 {
     this.rawInterface = rawInterface;
     this.publicKey    = config.GooglePlayPublicKey;
     this.remapper     = remapper;
     this.db           = config;
     this.logger       = logger;
     #if UNITY_ANDROID
     this.cryptoProvider = PEMKeyLoader.CryptoServiceProviderFromPublicKeyInfo(publicKey);
     #endif
 }
Пример #22
0
 public AnalyticsReporter(Biller biller, UnibillConfiguration config, IHTTPClient client, IStorage storage, IUtil util, ILevelLoadListener listener)
 {
     this.config = config;
     this.client = client;
     this.util   = util;
     this.userId = getUserId(storage);
     biller.onPurchaseComplete        += onSucceeded;
     biller.onPurchaseCancelled       += (PurchasableItem obj) => onEvent(EventType.purchase_cancelled, obj, null);
     biller.onPurchaseRefunded        += (PurchasableItem obj) => onEvent(EventType.purchase_refunded, obj, null);
     biller.onTransactionRestoreBegin += (bool obj) => restoreInProgress = true;
     biller.onTransactionsRestored    += (bool obj) => restoreInProgress = false;
     listener.registerListener(() => onLevelLoad());
     onEvent(EventType.new_session, null, null);
     this.levelName     = util.loadedLevelName();
     this.levelLoadTime = DateTime.UtcNow;
 }
Пример #23
0
 public AnalyticsReporter(Biller biller, UnibillConfiguration config, IHTTPClient client, IStorage storage, IUtil util, ILevelLoadListener listener)
 {
     this.config = config;
     this.client = client;
     this.util = util;
     this.userId = getUserId (storage);
     biller.onPurchaseComplete += onSucceeded;
     biller.onPurchaseCancelled += (PurchasableItem obj) => onEvent(EventType.purchase_cancelled, obj, null);
     biller.onPurchaseRefunded += (PurchasableItem obj) => onEvent(EventType.purchase_refunded, obj, null);
     biller.onTransactionRestoreBegin += (bool obj) =>  restoreInProgress = true;
     biller.onTransactionsRestored += (bool obj) => restoreInProgress = false;
     listener.registerListener (() => onLevelLoad ());
     onEvent (EventType.new_session, null, null);
     this.levelName = util.loadedLevelName ();
     this.levelLoadTime = DateTime.UtcNow;
 }
Пример #24
0
    public static void mergeManifest() {

        if (!Directory.Exists("Assets/Plugins/Android")) {
            AssetDatabase.CreateFolder("Assets/Plugins", "Android");
        }

        if (!File.Exists (AndroidManifestPath)) {
            AssetDatabase.CopyAsset("Assets/Plugins/unibill/static/Manifest.xml", AndroidManifestPath);
            AssetDatabase.ImportAsset(AndroidManifestPath);
        }
        
        UnibillConfiguration config = new UnibillConfiguration(new UnityResourceLoader(), new UnibillXmlParser(new Mono.Xml.SmallXmlParser(), new UnityResourceLoader()), new UnityUtil(), new UnityLogger());
        XDocument doc = XDocument.Load(AndroidManifestPath);
        doc = new AndroidManifestMerger().merge(doc, config.CurrentPlatform, config.AmazonSandboxEnabled);
        doc.Save(AndroidManifestPath);
        AssetDatabase.ImportAsset(AndroidManifestPath);
    }
Пример #25
0
    public static IKernel _get () {
        BillingPlatform platform = new UnibillConfiguration(new UnityResourceLoader(), new UnibillXmlParser(new Mono.Xml.SmallXmlParser(), new UnityResourceLoader()), new UnityUtil(), new UnityLogger()).CurrentPlatform;
        NinjectModule module = null;
        switch (platform) {
        case BillingPlatform.AppleAppStore:
		case BillingPlatform.MacAppStore:
            module = new StorekitModule(Application.isEditor);
        break;
        case BillingPlatform.AmazonAppstore:
            module = new AmazonModule(Application.isEditor);
            break;
        case BillingPlatform.GooglePlay:
            module = new GooglePlayModule(Application.isEditor);
            break;
        }
        return new StandardKernel (new UnityNinjectSettings (), new Ninject.Modules.INinjectModule[] {
            new UnityModule (),
            module,
        } );
    }
Пример #26
0
 public RemoteConfigManager(IResourceLoader loader, IStorage storage, ILogger logger, RuntimePlatform platform)
 {
     this.storage  = storage;
     logger.prefix = "Unibill.RemoteConfigManager";
     this.XML      = loader.openTextFile("unibillInventory.json").ReadToEnd();
     Config        = new UnibillConfiguration(XML, platform, logger);
     if (Config.UseHostedConfig)
     {
         string val = storage.GetString(CACHED_CONFIG_PATH, string.Empty);
         if (string.IsNullOrEmpty(val))
         {
             logger.Log("No cached config available. Using bundled");
         }
         else
         {
             logger.Log("Cached config found, attempting to parse");
             try {
                 Config = new UnibillConfiguration(val, platform, logger);
                 if (Config.inventory.Count == 0)
                 {
                     logger.LogError("No purchasable items in cached config, ignoring.");
                     Config = new UnibillConfiguration(XML, platform, logger);
                 }
                 else
                 {
                     logger.Log(string.Format("Using cached config with {0} purchasable items", Config.inventory.Count));
                     XML = val;
                 }
             } catch (Exception e) {
                 logger.LogError("Error parsing inventory: {0}", e.Message);
                 Config = new UnibillConfiguration(XML, platform, logger);
             }
         }
         refreshCachedConfig(Config.HostedConfigUrl, logger);
     }
     else
     {
         logger.Log("Not using cached inventory, using bundled.");
         Config = new UnibillConfiguration(XML, platform, logger);
     }
 }
Пример #27
0
 public ProductIdRemapper(UnibillConfiguration config)
 {
     this.db = config;
     initialiseForPlatform(config.CurrentPlatform);
 }
 public StorekitMassImportTemplateGenerator(UnibillConfiguration config, IEditorUtil util)
 {
     this.config = config;
     this.util = util;
 }
Пример #29
0
 public StorekitMassImportTemplateGenerator(UnibillConfiguration config, IEditorUtil util)
 {
     this.config = config;
     this.util   = util;
 }
Пример #30
0
 public RawBillingPlatformProvider(UnibillConfiguration config) {
     this.config = config;
 }
Пример #31
0
 public GooglePlayCSVGenerator(IEditorUtil util, UnibillConfiguration config)
 {
     this.util   = util;
     this.config = config;
 }
Пример #32
0
 private static UnibillConfiguration getConfig () {
     if (_config == null) {
         _config = new UnibillConfiguration(getResourceLoader(), getParser(), getUtil(), getLogger());
     }
     return _config;
 }
Пример #33
0
 public AmazonJSONGenerator(UnibillConfiguration config)
 {
     this.config = config;
 }
Пример #34
0
 public ProductIdRemapper(UnibillConfiguration config)
 {
     this.db = config;
     initialiseForPlatform(config.CurrentPlatform);
 }
Пример #35
0
 public ProductIdRemapper (InventoryDatabase db, UnibillXmlParser parser, UnibillConfiguration config) {
     this.db = db;
     this.parser = parser;
     initialiseForPlatform(config.CurrentPlatform);
 }
Пример #36
0
 public RawBillingPlatformProvider(UnibillConfiguration config)
 {
     this.config = config;
 }
Пример #37
0
 public CurrencyManager(UnibillConfiguration config, IStorage storage)
 {
     this.storage = storage;
     this.config  = config;
     Currencies   = config.currencies.Select <VirtualCurrency, string>(x => x.currencyId).ToArray();
 }
 public RawBillingPlatformProvider(UnibillConfiguration config)
 {
     this.config = config;
     this.gameObject = new GameObject ();
 }
 public GooglePlayCSVGenerator(IEditorUtil util, UnibillConfiguration config)
 {
     this.util = util;
     this.config = config;
 }
 public RawBillingPlatformProvider(UnibillConfiguration config)
 {
     this.config     = config;
     this.gameObject = new GameObject();
 }
Пример #41
0
 public SamsungAppsBillingService(UnibillConfiguration config, IRawSamsungAppsBillingService rawSamsung)
 {
     this.config     = config;
     this.rawSamsung = rawSamsung;
 }