private void OnSkuDetailsQueryCompleted(Godot.Collections.Array arrSkuDetails) { ShowAlert(JSON.Print(arrSkuDetails)); var skuDetails = GooglePlayBillingUtils.ConvertSkuDetailsDictionaryArray(arrSkuDetails); foreach (var skuDetail in skuDetails) { GD.Print($"Sku {skuDetail.Sku}"); } }
private void OnGooglePlayBilling_SkuDetailsQueryCompleted(Godot.Collections.Array arrSkuDetails) { var skuDetails = GooglePlayBillingUtils.ConvertSkuDetailsDictionaryArray(arrSkuDetails); foreach (var sku in skuDetails) { switch (sku.Sku) { // our fake potion case "android.test.purchased": _buyPotionButton.Text = $"Buy {sku.Price}"; _buyPotionButton.Show(); break; } } }
private void OnGooglePlayBilling_PurchasesUpdated(Godot.Collections.Array arrPurchases) { _panel.Show(); _processLabel.Show(); _thanksLabel.Hide(); var purchases = GooglePlayBillingUtils.ConvertPurchaseDictionaryArray(arrPurchases); foreach (var purchase in purchases) { _purchases.Add(purchase.PurchaseToken, purchase.Sku); // We only expect this SKU if (purchase.Sku == "android.test.purchased") { _googlePlayBilling.AcknowledgePurchase(purchase.PurchaseToken); } } }
private void OnPurchasesUpdated(Godot.Collections.Array arrPurchases) { GD.Print($"Purchases updated: {JSON.Print(arrPurchases)}"); // See OnConnected var purchases = GooglePlayBillingUtils.ConvertPurchaseDictionaryArray(arrPurchases); foreach (var purchase in purchases) { if (!purchase.IsAcknowledged) { GD.Print($"Purchase {purchase.Sku} has not been acknowledged. Acknowledging..."); _payment.AcknowledgePurchase(purchase.PurchaseToken); } } if (purchases.Length > 0) { _testItemPurchaseToken = purchases.Last().PurchaseToken; } }