public Biller instantiate()
        {
            IBillingService svc = instantiateBillingSubsystem();

            var biller = new Biller(config, getTransactionDatabase(), svc, getLogger(), getHelp(), getMapper(), getCurrencyManager());
            instantiateAnalytics (biller);
            return biller;
        }
Exemple #2
0
        public static Biller instantiate() {
            IBillingService svc = instantiateBillingSubsystem();

            var biller = new Biller(getInventory(), getTransactionDatabase(), svc, getLogger(), getHelp(), getMapper());
            return biller;
        }
Exemple #3
0
    /// <summary>
    /// Visible only for unit testing.
    /// Do NOT call this method.
    /// </summary>
    public static void _internal_doInitialise(Biller biller, BillerFactory factory)
    {
        Unibiller.biller = biller;
        biller.onBillerReady += (success) => {
            if (onBillerReady != null) {
                if (success) {
                    // Download manager needs Unibill to be initialised to get purchase receipts.
                    downloadManager = factory.instantiateDownloadManager (biller);
                    downloadManager.onDownloadCompletedEvent += onDownloadCompletedEvent;
                    downloadManager.onDownloadFailedEvent += onDownloadFailedEvent;
                    downloadManager.onDownloadProgressedEvent += onDownloadProgressedEvent;

                    onBillerReady(biller.State == Unibill.Impl.BillerState.INITIALISED ? UnibillState.SUCCESS : UnibillState.SUCCESS_WITH_ERRORS);
                } else {
                    onBillerReady(UnibillState.CRITICAL_ERROR);
                }
            }
        };

        biller.onPurchaseCancelled += _onPurchaseCancelled;
        biller.onPurchaseComplete += _onPurchaseComplete;
        biller.onPurchaseFailed += _onPurchaseFailed;
        biller.onPurchaseRefunded += _onPurchaseRefunded;
        biller.onTransactionsRestored += _onTransactionsRestored;

        biller.Initialise();
    }
Exemple #4
0
    /// <summary>
    /// Visible only for unit testing.
    /// Do NOT call this method.
    /// </summary>
    public static void _internal_doInitialise (Biller biller) {
        Unibiller.biller = biller;
        biller.onBillerReady += (success) => {
            if (onBillerReady != null) {
                if (success) {
                    onBillerReady(biller.State == Unibill.Impl.BillerState.INITIALISED ? UnibillState.SUCCESS : UnibillState.SUCCESS_WITH_ERRORS);
                } else {
                    onBillerReady(UnibillState.CRITICAL_ERROR);
                }
            }
        };
        

        biller.onPurchaseCancelled += _onPurchaseCancelled;
        biller.onPurchaseComplete += _onPurchaseComplete;
        biller.onPurchaseFailed += _onPurchaseFailed;
        biller.onPurchaseRefunded += _onPurchaseRefunded;
        biller.onTransactionsRestored += _onTransactionsRestored;

        biller.Initialise();
    }
 public DownloadManager instantiateDownloadManager(Biller biller)
 {
     var result = new DownloadManager (biller, util, storage, new UnityURLFetcher (), logger, biller.InventoryDatabase.CurrentPlatform, biller.InventoryDatabase.UnibillAnalyticsAppSecret);
     util.InitiateCoroutine (result.monitorDownloads ());
     return result;
 }
 public void instantiateAnalytics(Biller biller)
 {
     if (!string.IsNullOrEmpty (config.UnibillAnalyticsAppId)) {
         new AnalyticsReporter (biller, config, platformProvider.getHTTPClient (util), getStorage (), util, platformProvider.getLevelLoadListener ());
     }
 }