No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IWinRT.cs 3.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. using System.Collections.Generic;
  2. using System.Collections.ObjectModel;
  3. namespace UnityEngine.Purchasing.Default
  4. {
  5. /// <summary>
  6. /// Interface for Universal Windows Platform purchasing callbacks.
  7. /// </summary>
  8. public interface IWindowsIAPCallback
  9. {
  10. /// <summary>
  11. /// Callback received when receiving the list of products.
  12. /// </summary>
  13. /// <param name="winProducts"> The products retrieved. </param>
  14. void OnProductListReceived(WinProductDescription[] winProducts);
  15. /// <summary>
  16. /// Callback received when receiving an error when attempting to get the list of products.
  17. /// </summary>
  18. /// <param name="message"> The error message explaining the failure. </param>
  19. void OnProductListError(string message);
  20. /// <summary>
  21. /// Callback received after making a successful purchase.
  22. /// </summary>
  23. /// <param name="productId"> The ID of the product purchased. </param>
  24. /// <param name="receipt"> The receipt of the purchase. </param>
  25. /// <param name="transactionId"> The ID of the transaction event. </param>
  26. void OnPurchaseSucceeded(string productId, string receipt, string transactionId);
  27. /// <summary>
  28. /// Callback received after making a failed purchase.
  29. /// </summary>
  30. /// <param name="productId"> The ID of the product purchased. </param>
  31. /// <param name="error"> The error explaining the failure. </param>
  32. void OnPurchaseFailed(string productId, string error);
  33. /// <summary>
  34. /// Call used to log messsages during the callbacks in this interface.
  35. /// </summary>
  36. /// <param name="message"> The message to be logged. </param>
  37. void log(string message);
  38. /// <summary>
  39. /// Call used to log various errors during the callbacks in this interface.
  40. /// </summary>
  41. /// <param name="error"> The error message to be logged. </param>
  42. void logError(string error);
  43. }
  44. /// <summary>
  45. /// Interface for Universal Windows Platform purchasing calls.
  46. /// </summary>
  47. public interface IWindowsIAP
  48. {
  49. /// <summary>
  50. /// Builds a set of local products to be used as a proxy for what's on the Windows Store.
  51. /// </summary>
  52. /// <param name="products"> The products used. </param>
  53. void BuildDummyProducts(List<WinProductDescription> products);
  54. /// <summary>
  55. /// Initializes the Windows Store.
  56. /// </summary>
  57. /// <param name="callback"> The implementation of <c>IWindowsIAPCallback</c> used to handle events. </param>
  58. void Initialize(IWindowsIAPCallback callback);
  59. /// <summary>
  60. /// Retrieve products from the Windows Store.
  61. /// </summary>
  62. /// <param name="retryIfOffline"> Whether or not to retry the retrieval if it fails due to lack of an Internet connection. </param>
  63. void RetrieveProducts(bool retryIfOffline);
  64. /// <summary>
  65. /// Purchases a product.
  66. /// </summary>
  67. /// <param name="productId"> The ID product to be purchased. </param>
  68. void Purchase(string productId);
  69. /// <summary>
  70. /// Finalizes a transaction.
  71. /// </summary>
  72. /// <param name="transactionId"> The ID of transaction to be finalzed. </param>
  73. void FinaliseTransaction(string transactionId);
  74. }
  75. }