/// <summary> /// 切换状态(切换状态后,在Update中将被执行一次). /// </summary> /// <param name="iState">状态.</param> /// <param name="iErrorMessageID">错误消息ID.</param> protected void SwitchState(IAPState iState) { this.Info("SwitchState(): -> ::{0}", iState); if (IAPState.Failed == iState) { } this.State = iState; }
public InAppPurchases() { foreach (Settings.InAppPurchase iap in Kiln.API.Settings.IAPs) { var product = new Product(); product.ID = iap.Id; product.Price = iap.Price.ToString(); product.Type = iap.Type; product.CurrencyCode = Kiln.API.Settings.CurrencyCode; product.ImageURI = iap.ImageURI; product.Description = iap.Description; _products.Add(product); } _state = new IAPState(); Load(); }
/// <summary> /// /// </summary> private void Load() { if (File.Exists(_storagePath)) { _state = JsonUtility.FromJson <IAPState>(File.ReadAllText(_storagePath)); foreach (string purchaseID in _state.Purchases) { Purchase p = new Purchase(); p.ProductID = purchaseID; _purchases.Add(p); } foreach (IAPState.PendingPurchase pending in _state.NonConsumed) { Purchase p = new Purchase(); p.ProductID = pending.ProductID; p.PurchaseToken = pending.PurchaseToken; _nonConsumedPurchases.Add(p); } } }
public static void RegisterAndroidInAppPurchase(IAPState purchaseState, string purchaseToken, string productId, string orderId, long purchaseTime, string developerPayload, double price, string currency) { }
public static void RegisterIOSInAppPurchase(string productId, string transactionId, byte[] transactionReceipt, IAPState transactionState) { productId = productId ?? string.Empty; transactionId = transactionId ?? string.Empty; FuseLog("RegisterInAppPurchase(" + productId + "," + transactionReceipt.Length + "," + transactionState + ")"); Native_RegisterInAppPurchase(productId, transactionId, transactionReceipt, transactionReceipt.Length, (int)transactionState); }
public static void RegisterIOSInAppPurchase(string productId, string transactionId, byte[] transactionReceipt, IAPState transactionState) { }
public static void RegisterAndroidInAppPurchase(IAPState purchaseState, string purchaseToken, string productId, string orderId, long purchaseTime, string developerPayload, double price, string currency) { FuseLog("RegisterInAppPurchase(" + purchaseState.ToString() + "," + purchaseToken + "," + productId + "," + orderId + "," + purchaseTime + "," + developerPayload + "," + price + "," + currency + ")"); _fuseUnityPlugin.CallStatic("registerInAppPurchase", purchaseState.ToString(), purchaseToken, productId, orderId, purchaseTime, developerPayload, (float)price, currency); }
public static void RegisterAndroidInAppPurchase(IAPState purchaseState, string purchaseToken, string productId, string orderId, DateTime purchaseTime, string developerPayload, double price, string currency) { RegisterAndroidInAppPurchase(purchaseState, purchaseToken, productId, orderId, purchaseTime.ToUnixTimestamp(), developerPayload, price, currency); }
/// <summary>Records an iOS in-app purchase in the Fuse system when the price and currency are known.</summary> /// <remarks> /// If your app is using the Prime31 or Unibill plugin you do not need to call these functions manually. /// Simply make sure the correct options are checked on the FuseSDK object. /// </remarks> /// <param name="productId">The product ID of the purchased item.</param> /// <param name="transactionId">The transaction ID of the purchase supplied by Apple.</param> /// <param name="transactionReceipt">The data payload associated with the purchase, supplied by Apple.</param> /// <param name="transactionState">The transaction state of the purchase.</param> public static void RegisterIOSInAppPurchase(string productId, string transactionId, byte[] transactionReceipt, IAPState transactionState) { //OnPurchaseVerification(verified, transactionId, originalTransactionId); }
/// <summary> /// 根据状态刷新商店UI界面(遮罩除外). /// </summary> /// <param name="iState">状态.</param> /// <param name="iParams">备用参数.</param> protected abstract void RefreshUIByState(IAPState iState, params object[] iParams);
/// <summary> /// Returns a JSON string with an valid empty IAP State /// </summary> /// <returns></returns> public static string GetEmptyState() { IAPState state = new IAPState(); return(JsonUtility.ToJson(state)); }
private void Callback(IAPState state, string errmsg) { if(state == IAPState.Processing) Popup.ShowBlank(Localization.Get("PROCESSING")); else if(state == IAPState.Failed || state == IAPState.Cancelled) Popup.ShowBlank(Localization.Get("RESTORE_FAILED"),2f); else if(state == IAPState.Success) { Popup.ShowBlank(Localization.Get("RESTORE_SUCCESS"), 2f); #if IAP_IMPLEMENTED foreach(IAPProduct product in IAPHelper.ProductsRestored) { if(OnProductRestored != null) OnProductRestored(product); } #endif } }
private void Callback(IAPState state, string errmsg) { if(state == IAPState.Processing) Popup.ShowBlank(Localization.Get("PROCESSING")); else if(state == IAPState.Failed) Popup.ShowBlank(Localization.Get("PURCHASE_FAILED"), 2f); else if(state == IAPState.Cancelled) Popup.ShowBlank(Localization.Get("PURCHASE_FAILED"), 2f); else if(state == IAPState.Success) PurchaseComplete(); }
public static void RegisterAndroidInAppPurchase(IAPState purchaseState, string purchaseToken, string productId, string orderId, long purchaseTime, string developerPayload, double price, string currency) { FuseLog("RegisterInAppPurchase(" + purchaseState.ToString() + "," + purchaseToken + "," + productId + "," + orderId + "," + purchaseTime + "," + developerPayload + "," + price + "," + currency + ")"); _fuseUnityPlugin.CallStatic("registerInAppPurchase", purchaseState.ToString(), purchaseToken, productId, orderId, purchaseTime, developerPayload, price, currency); }
public static void RegisterAndroidInAppPurchase(IAPState purchaseState, string purchaseToken, string productId, string orderId, DateTime purchaseTime, string developerPayload, double price, string currency) { }
/// <summary>Records an Android in-app purchase in the Fuse system when the price and currency are known.</summary> /// <remarks> /// If your app is using the Prime31 or Unibill plugin you do not need to call these functions manually. /// Simply make sure the correct options are checked on the FuseSDK object. /// </remarks> /// <param name="purchaseState">The type of transaction being recorded.</param> /// <param name="purchaseToken">The purchase token provided by Google Play.</param> /// <param name="productId">The product id of the item being purchased.</param> /// <param name="orderId">The order id of this transaction.</param> /// <param name="purchaseTime">Unix timestamp when purchase was made.</param> /// <param name="developerPayload">Developer payload provided by Google Play.</param> /// <param name="price">The price of the purchased item.</param> /// <param name="currency">The currency string identifier.</param> public static void RegisterAndroidInAppPurchase(IAPState purchaseState, string purchaseToken, string productId, string orderId, long purchaseTime, string developerPayload, double price, string currency) { //OnPurchaseVerification(verified, transactionId, originalTransactionId); }