using System; namespace UnityEngine.Purchasing.Security { /// /// An Apple receipt as defined here: /// https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1 /// public class AppleReceipt { /// /// The app bundle ID /// public string bundleID { get; internal set; } /// /// The app version number /// public string appVersion { get; internal set; } /// /// The expiration date of the receipt /// public DateTime expirationDate { get; internal set; } /// /// An opaque value used, with other data, to compute the SHA-1 hash during validation. /// public byte[] opaque { get; internal set; } /// /// A SHA-1 hash, used to validate the receipt. /// public byte[] hash { get; internal set; } /// /// The version of the app that was originally purchased. /// public string originalApplicationVersion { get; internal set; } /// /// The date the receipt was created /// public DateTime receiptCreationDate { get; internal set; } /// /// The receipts of the In-App purchases. /// public AppleInAppPurchaseReceipt[] inAppPurchaseReceipts; } /// /// The details of an individual purchase. /// public class AppleInAppPurchaseReceipt : IPurchaseReceipt { /// /// The number of items purchased. /// public int quantity { get; internal set; } /// /// The product ID /// public string productID { get; internal set; } /// /// The ID of the transaction. /// public string transactionID { get; internal set; } /// /// For a transaction that restores a previous transaction, the transaction ID of the original transaction. Otherwise, identical to the transactionID. /// public string originalTransactionIdentifier { get; internal set; } /// /// The date of purchase. /// public DateTime purchaseDate { get; internal set; } /// /// For a transaction that restores a previous transaction, the date of the original transaction. /// public DateTime originalPurchaseDate { get; internal set; } /// /// The expiration date for the subscription, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT. /// public DateTime subscriptionExpirationDate { get; internal set; } /// /// For a transaction that was canceled by Apple customer support, the time and date of the cancellation. /// For an auto-renewable subscription plan that was upgraded, the time and date of the upgrade transaction. /// public DateTime cancellationDate { get; internal set; } /// /// For a subscription, whether or not it is in the free trial period. /// public int isFreeTrial { get; internal set; } /// /// The type of product. /// public int productType { get; internal set; } /// /// For an auto-renewable subscription, whether or not it is in the introductory price period. /// public int isIntroductoryPricePeriod { get; internal set; } } }