public void FetchPurchases(Action <List <GooglePurchase> > onQueryPurchaseSucceed)
 {
     if (m_IsConnectedToGoogle)
     {
         m_GoogleQueryPurchasesService.QueryPurchases(onQueryPurchaseSucceed);
     }
     else
     {
         m_OnPurchaseSucceededQueue.Enqueue(onQueryPurchaseSucceed);
     }
 }
Ejemplo n.º 2
0
 public void FetchPurchases(Action <List <GooglePurchase> > onQueryPurchaseSucceed)
 {
     if (m_GoogleConnectionState == GoogleBillingConnectionState.Connected)
     {
         m_GoogleQueryPurchasesService.QueryPurchases(onQueryPurchaseSucceed);
     }
     else
     {
         m_OnPurchaseSucceededQueue.Enqueue(onQueryPurchaseSucceed);
     }
 }
 public void FinishTransaction(ProductDefinition product, string purchaseToken, Action <ProductDefinition, GooglePurchase, IGoogleBillingResult, string> onConsume, Action <ProductDefinition, GooglePurchase, IGoogleBillingResult> onAcknowledge)
 {
     m_GoogleQueryPurchasesService.QueryPurchases(purchases =>
     {
         foreach (var purchase in purchases.Where(PurchaseToFinishTransaction(product)))
         {
             if (product.type == ProductType.Consumable)
             {
                 m_BillingClient.ConsumeAsync(purchaseToken, product, purchase, onConsume);
             }
             else if (!purchase.IsAcknowledged())
             {
                 m_BillingClient.AcknowledgePurchase(purchaseToken, product, purchase, onAcknowledge);
             }
         }
     });
 }