IStoreController.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. namespace UnityEngine.Purchasing
  4. {
  5. /// <summary>
  6. /// Used by Applications to control Unity Purchasing.
  7. /// </summary>
  8. public interface IStoreController
  9. {
  10. /// <summary>
  11. /// Gets the collection of products in the store.
  12. /// </summary>
  13. /// <value> The product collection. </value>
  14. ProductCollection products { get; }
  15. /// <summary>
  16. /// Initiate a purchase from the controlled store.
  17. /// </summary>
  18. /// <param name="product"> The product to be purchased. </param>
  19. /// <param name="payload"> The developer payload provided for certain stores that define such a concept (ex: Google Play). </param>
  20. void InitiatePurchase(Product product, string payload);
  21. /// <summary>
  22. /// Initiate a purchase from the controlled store.
  23. /// </summary>
  24. /// <param name="productId"> The id of the product to be purchased. </param>
  25. /// <param name="payload"> The developer payload provided for certain stores that define such a concept (ex: Google Play). </param>
  26. void InitiatePurchase(string productId, string payload);
  27. /// <summary>
  28. /// Initiate a purchase from the controlled store.
  29. /// </summary>
  30. /// <param name="product"> The product to be purchased. </param>
  31. void InitiatePurchase(Product product);
  32. /// <summary>
  33. /// Initiate a purchase from the controlled store
  34. /// </summary>
  35. /// <param name="productId"> The id of the product to be purchased. </param>
  36. void InitiatePurchase(string productId);
  37. /// <summary>
  38. /// Fetch additional products from the controlled store.
  39. /// </summary>
  40. /// <param name="additionalProducts"> The set of product definitions to be fetched. </param>
  41. /// <param name="successCallback"> The event triggered on a successful fetch. </param>
  42. /// <param name="failCallback"> The event triggered on a failed fetch. </param>
  43. void FetchAdditionalProducts(HashSet<ProductDefinition> additionalProducts, Action successCallback,
  44. Action<InitializationFailureReason> failCallback);
  45. /// <summary>
  46. /// Where an Application returned ProcessingResult.Pending
  47. /// from IStoreListener.ProcessPurchase(), Applications should call
  48. /// this method when processing completes.
  49. /// </summary>
  50. /// <param name="product"> The product for which its pending purchase it to be confirmed. </param>
  51. void ConfirmPendingPurchase(Product product);
  52. }
  53. }