public static void RestorePurchases() { CheckIfInitialised(); if (registeredProducts == null) { Console.LogError(Constants.kDebugTag, "[EditorStore] Restore purchases can be done only after getting products information from store."); return; } List <BillingTransaction> _restoredTransactions = new List <BillingTransaction>(); foreach (BillingProduct _curProduct in registeredProducts) { if (IsProductPurchased(_curProduct.ProductIdentifier)) { BillingTransaction _transaction = CreateTransactionObject(_curProduct.ProductIdentifier, eBillingTransactionState.RESTORED, null); // Add it to list of restored transactions _restoredTransactions.Add(_transaction); } } PostTransactionEvent(kRestoreFinishedEventName, _restoredTransactions.ToArray()); }
public static void RestoreCompletedTransactions() { CheckIfInitialised(); if (registeredProducts == null) { Console.LogError(Constants.kDebugTag, "[EditorStore] Restore purchases can be done only after getting products information from store."); return; } List <BillingTransaction> _restoredTransactions = new List <BillingTransaction>(); foreach (BillingProduct _curProduct in registeredProducts) { if (IsProductPurchased(_curProduct.ProductIdentifier)) { BillingTransaction _transaction = GetTransactionDetails(_curProduct.ProductIdentifier, eBillingTransactionState.RESTORED, null); // Add it to list of restored transactions _restoredTransactions.Add(_transaction); } } // Send callback SendFinishedTransactionCallback(_restoredTransactions.ToArray()); }
private static void CheckIfInitialised() { #if UNITY_ANDROID if (string.IsNullOrEmpty(NPSettings.Billing.Android.PublicKey)) { Console.LogError(Constants.kDebugTag, "[EditorStore] Please add public key in NPSettings for Billing to work on Android."); } #endif }
public static void CustomVerificationFinished(BillingTransaction _transaction) { Console.LogError(Constants.kDebugTag, Constants.kFeatureNotSupported); }