Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

AppleReceipt.cs 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System;
  2. namespace UnityEngine.Purchasing.Security
  3. {
  4. /// <summary>
  5. /// An Apple receipt as defined here:
  6. /// https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1
  7. /// </summary>
  8. public class AppleReceipt
  9. {
  10. /// <summary>
  11. /// The app bundle ID
  12. /// </summary>
  13. public string bundleID { get; internal set; }
  14. /// <summary>
  15. /// The app version number
  16. /// </summary>
  17. public string appVersion { get; internal set; }
  18. /// <summary>
  19. /// The expiration date of the receipt
  20. /// </summary>
  21. public DateTime expirationDate { get; internal set; }
  22. /// <summary>
  23. /// An opaque value used, with other data, to compute the SHA-1 hash during validation.
  24. /// </summary>
  25. public byte[] opaque { get; internal set; }
  26. /// <summary>
  27. /// A SHA-1 hash, used to validate the receipt.
  28. /// </summary>
  29. public byte[] hash { get; internal set; }
  30. /// <summary>
  31. /// The version of the app that was originally purchased.
  32. /// </summary>
  33. public string originalApplicationVersion { get; internal set; }
  34. /// <summary>
  35. /// The date the receipt was created
  36. /// </summary>
  37. public DateTime receiptCreationDate { get; internal set; }
  38. /// <summary>
  39. /// The receipts of the In-App purchases.
  40. /// </summary>
  41. public AppleInAppPurchaseReceipt[] inAppPurchaseReceipts;
  42. }
  43. /// <summary>
  44. /// The details of an individual purchase.
  45. /// </summary>
  46. public class AppleInAppPurchaseReceipt : IPurchaseReceipt
  47. {
  48. /// <summary>
  49. /// The number of items purchased.
  50. /// </summary>
  51. public int quantity { get; internal set; }
  52. /// <summary>
  53. /// The product ID
  54. /// </summary>
  55. public string productID { get; internal set; }
  56. /// <summary>
  57. /// The ID of the transaction.
  58. /// </summary>
  59. public string transactionID { get; internal set; }
  60. /// <summary>
  61. /// For a transaction that restores a previous transaction, the transaction ID of the original transaction. Otherwise, identical to the transactionID.
  62. /// </summary>
  63. public string originalTransactionIdentifier { get; internal set; }
  64. /// <summary>
  65. /// The date of purchase.
  66. /// </summary>
  67. public DateTime purchaseDate { get; internal set; }
  68. /// <summary>
  69. /// For a transaction that restores a previous transaction, the date of the original transaction.
  70. /// </summary>
  71. public DateTime originalPurchaseDate { get; internal set; }
  72. /// <summary>
  73. /// The expiration date for the subscription, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.
  74. /// </summary>
  75. public DateTime subscriptionExpirationDate { get; internal set; }
  76. /// <summary>
  77. /// For a transaction that was canceled by Apple customer support, the time and date of the cancellation.
  78. /// For an auto-renewable subscription plan that was upgraded, the time and date of the upgrade transaction.
  79. /// </summary>
  80. public DateTime cancellationDate { get; internal set; }
  81. /// <summary>
  82. /// For a subscription, whether or not it is in the free trial period.
  83. /// </summary>
  84. public int isFreeTrial { get; internal set; }
  85. /// <summary>
  86. /// The type of product.
  87. /// </summary>
  88. public int productType { get; internal set; }
  89. /// <summary>
  90. /// For an auto-renewable subscription, whether or not it is in the introductory price period.
  91. /// </summary>
  92. public int isIntroductoryPricePeriod { get; internal set; }
  93. }
  94. }