IStoreCallback.cs 2.3 KB

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