예제 #1
0
        public Biller instantiate()
        {
            IBillingService svc = instantiateBillingSubsystem();

            var biller = new Biller(config, getTransactionDatabase(), svc, getLogger(), getHelp(), getMapper(), getCurrencyManager());
            instantiateAnalytics (biller);
            return biller;
        }
예제 #2
0
파일: Biller.cs 프로젝트: nhhoang/shooting
        public static Biller instantiate() {
            IBillingService svc = instantiateBillingSubsystem();

            var biller = new Biller(getInventory(), getTransactionDatabase(), svc, getLogger(), getHelp(), getMapper());
            return biller;
        }
예제 #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();
    }
예제 #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();
    }
예제 #5
0
 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;
 }
예제 #6
0
 public void instantiateAnalytics(Biller biller)
 {
     if (!string.IsNullOrEmpty (config.UnibillAnalyticsAppId)) {
         new AnalyticsReporter (biller, config, platformProvider.getHTTPClient (util), getStorage (), util, platformProvider.getLevelLoadListener ());
     }
 }