1
0

GooglePlayReceipt.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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,
  15. /// <summary>
  16. /// The purchase was cancelled.
  17. /// </summary>
  18. Cancelled,
  19. /// <summary>
  20. /// The purchase was refunded.
  21. /// </summary>
  22. Refunded
  23. }
  24. /// <summary>
  25. /// A GooglePlay purchase receipt
  26. /// </summary>
  27. public class GooglePlayReceipt : IPurchaseReceipt
  28. {
  29. /// <summary>
  30. /// The item's product identifier.
  31. /// </summary>
  32. public string productID { get; private set; }
  33. /// <summary>
  34. /// The ID of the transaction.
  35. /// </summary>
  36. public string transactionID => orderID;
  37. /// <summary>
  38. /// A unique order identifier for the transaction.
  39. /// </summary>
  40. public string orderID { get; private set; }
  41. /// <summary>
  42. /// The package name of the app.
  43. /// </summary>
  44. public string packageName { get; private set; }
  45. /// <summary>
  46. /// A token that uniquely identifies a purchase for a given item and user pair.
  47. /// </summary>
  48. public string purchaseToken { get; private set; }
  49. /// <summary>
  50. /// The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).
  51. /// </summary>
  52. public DateTime purchaseDate { get; private set; }
  53. /// <summary>
  54. /// The purchase state of the order.
  55. /// </summary>
  56. public GooglePurchaseState purchaseState { get; private set; }
  57. /// <summary>
  58. /// Constructor that initializes the members from the input parameters.
  59. /// </summary>
  60. /// <param name="productID"> The item's product identifier. </param>
  61. /// <param name="orderID"> The unique order identifier for the transaction. </param>
  62. /// <param name="packageName"> The package name of the app. </param>
  63. /// <param name="purchaseToken"> The token that uniquely identifies a purchase for a given item and user pair. </param>
  64. /// <param name="purchaseTime"> The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970). </param>
  65. /// <param name="purchaseState"> The purchase state of the order. </param>
  66. public GooglePlayReceipt(string productID, string orderID, string packageName,
  67. string purchaseToken, DateTime purchaseTime, GooglePurchaseState purchaseState)
  68. {
  69. throw new NotImplementedException();
  70. }
  71. }
  72. }