IStoreCallback.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. namespace UnityEngine.Purchasing.Extension
  4. {
  5. /// <summary>
  6. /// Callback interface for <see cref="IStore"/>s.
  7. /// </summary>
  8. public interface IStoreCallback
  9. {
  10. /// <summary>
  11. /// For querying product information.
  12. /// </summary>
  13. ProductCollection products { get; }
  14. /// <summary>
  15. /// Purhasing unavailable.
  16. /// </summary>
  17. /// <param name="reason"> The reason the initialization failed. </param>
  18. void OnSetupFailed(InitializationFailureReason reason);
  19. /// <summary>
  20. /// Complete setup by providing a list of available products,
  21. /// complete with metadata and any associated purchase receipts
  22. /// and transaction IDs.
  23. ///
  24. /// Any previously unseen purchases will be completed by the PurchasingManager.
  25. /// </summary>
  26. /// <param name="products"> The list of product descriptions retrieved. </param>
  27. void OnProductsRetrieved(List<ProductDescription> products);
  28. /// <summary>
  29. /// Inform Unity Purchasing of a purchase.
  30. /// </summary>
  31. /// <param name="storeSpecificId"> The product id specific to the store it was purchased from. </param>
  32. /// <param name="receipt"> The receipt provided by the store detailing the purchase </param>
  33. /// <param name="transactionIdentifier"> The id of the transaction </param>
  34. void OnPurchaseSucceeded(string storeSpecificId, string receipt, string transactionIdentifier);
  35. /// <summary>
  36. /// Inform Unity Purchasing of all active purchases.
  37. /// </summary>
  38. /// <param name="purchasedProducts">all active purchased products</param>
  39. void OnAllPurchasesRetrieved(List<Product> purchasedProducts);
  40. /// <summary>
  41. /// Notify a failed purchase with associated details.
  42. /// </summary>
  43. /// <param name="desc"> The object detailing the purchase failure </param>
  44. void OnPurchaseFailed(PurchaseFailureDescription desc);
  45. /// <summary>
  46. /// Stores may opt to disable Unity IAP's transaction log if they offer a robust transaction
  47. /// system of their own (e.g. Apple).
  48. ///
  49. /// The default value is 'true'.
  50. /// </summary>
  51. bool useTransactionLog { get; set; }
  52. }
  53. }