Geen omschrijving
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.

GooglePlayReceipt.cs 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. namespace UnityEngine.Purchasing.Security
  3. {
  4. // See Google's reference docs.
  5. // http://developer.android.com/google/play/billing/billing_reference.html
  6. /// <summary>
  7. /// The state of the GooglePlay purchase.
  8. /// </summary>
  9. public enum GooglePurchaseState
  10. {
  11. /// <summary>
  12. /// The purchase was completed.
  13. /// </summary>
  14. Purchased = 0,
  15. /// <summary>
  16. /// The purchase was cancelled.
  17. /// </summary>
  18. Cancelled = 1,
  19. /// <summary>
  20. /// The purchase was refunded.
  21. /// </summary>
  22. Refunded = 2,
  23. /// <summary>
  24. /// The purchase was deferred.
  25. /// </summary>
  26. Deferred = 4
  27. }
  28. /// <summary>
  29. /// A GooglePlay purchase receipt
  30. /// </summary>
  31. public class GooglePlayReceipt : IPurchaseReceipt
  32. {
  33. /// <summary>
  34. /// The item's product identifier.
  35. /// </summary>
  36. public string productID { get; private set; }
  37. /// <summary>
  38. /// The ID of the transaction.
  39. /// </summary>
  40. public string transactionID => orderID;
  41. /// <summary>
  42. /// A unique order identifier for the transaction.
  43. /// </summary>
  44. public string orderID { get; private set; }
  45. /// <summary>
  46. /// The package name of the app.
  47. /// </summary>
  48. public string packageName { get; private set; }
  49. /// <summary>
  50. /// A token that uniquely identifies a purchase for a given item and user pair.
  51. /// </summary>
  52. public string purchaseToken { get; private set; }
  53. /// <summary>
  54. /// The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).
  55. /// </summary>
  56. public DateTime purchaseDate { get; private set; }
  57. /// <summary>
  58. /// The purchase state of the order.
  59. /// </summary>
  60. public GooglePurchaseState purchaseState { get; private set; }
  61. /// <summary>
  62. /// Constructor that initializes the members from the input parameters.
  63. /// </summary>
  64. /// <param name="productID"> The item's product identifier. </param>
  65. /// <param name="orderID"> The unique order identifier for the transaction. </param>
  66. /// <param name="packageName"> The package name of the app. </param>
  67. /// <param name="purchaseToken"> The token that uniquely identifies a purchase for a given item and user pair. </param>
  68. /// <param name="purchaseTime"> The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). </param>
  69. /// <param name="purchaseState"> The purchase state of the order. </param>
  70. public GooglePlayReceipt(string productID, string orderID, string packageName,
  71. string purchaseToken, DateTime purchaseTime, GooglePurchaseState purchaseState)
  72. {
  73. throw new NotImplementedException();
  74. }
  75. }
  76. }