Exemplo n.º 1
0
        private async void BillingHandlerOnProductPurchased(int response, Purchase purchase, string purchaseData, string purchaseSignature)
        {
            var ershPurchase = PurchaseCreator.Create(purchase.ProductId);

            if (!ershPurchase.IsAll && GetPurchasesContainesKey(ershPurchase.OrdiginalId).Count() + 1 == GetProductsContainesKey(ershPurchase.OrdiginalId).Count())
            {
                GaService.TrackAppEvent(StringConst.TrackEventCardsAreEnds, string.Format("{0}", ershPurchase.OrdiginalId));
            }

            await Rep.DatabaseHelper.AddProductAsync(ershPurchase);
        }
 async Task RefreshPurchaseItems()
 {
     try
     {
         var purchased     = _serviceConnection.BillingHandler.GetPurchases(ItemType.Product);
         var ershPurchases = purchased == null ? new List <ErshPurchase>() : purchased.Where(purchase => purchase.PurchaseState == 0).Select(purchase => PurchaseCreator.Create(purchase.ProductId)).ToList();
         await Rep.DatabaseHelper.CheckAndRefreshPurshases(ershPurchases, _serviceConnection.Connected);
     }
     catch (Exception ex)
     {
         GaService.TrackAppException(this.Class, "RefreshPurchaseItems", ex, false);
     }
 }
Exemplo n.º 3
0
 private void RefreshPurchasedItems()
 {
     try
     {
         var purchases = _billingHandler.GetPurchases(ItemType.Product);
         _purchases = purchases == null
             ? new List <ErshPurchase>()
             : purchases.Where(purchase => purchase.PurchaseState == 0).Select(purchase => PurchaseCreator.Create(purchase.ProductId)).ToList();
     }
     catch (Exception exception)
     {
         GaService.TrackAppException(this.Class, "RefreshPurchasedItem", exception, false);
     }
 }