diff --git a/Apple.Receipt.Example.ConsoleApp/Apple.Receipt.Example.ConsoleApp.csproj b/Apple.Receipt.Example.ConsoleApp/Apple.Receipt.Example.ConsoleApp.csproj index 29276f9..ef39ece 100644 --- a/Apple.Receipt.Example.ConsoleApp/Apple.Receipt.Example.ConsoleApp.csproj +++ b/Apple.Receipt.Example.ConsoleApp/Apple.Receipt.Example.ConsoleApp.csproj @@ -2,12 +2,12 @@ Exe - net7.0 + net8.0 false - + diff --git a/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests.csproj b/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests.csproj index 34164f6..aed2e32 100644 --- a/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests.csproj +++ b/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests/Apple.Receipt.Example.Tests.csproj @@ -1,15 +1,15 @@  - net7.0 + net8.0 false - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Apple.Receipt.Example/Apple.Receipt.Example.csproj b/Apple.Receipt.Example/Apple.Receipt.Example.csproj index f168685..4323808 100644 --- a/Apple.Receipt.Example/Apple.Receipt.Example.csproj +++ b/Apple.Receipt.Example/Apple.Receipt.Example.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 false diff --git a/Apple.Receipt.Models/Apple.Receipt.Models.csproj b/Apple.Receipt.Models/Apple.Receipt.Models.csproj index 7694e12..05c357f 100644 --- a/Apple.Receipt.Models/Apple.Receipt.Models.csproj +++ b/Apple.Receipt.Models/Apple.Receipt.Models.csproj @@ -12,8 +12,8 @@ MIT images/icon.png Apple Receipt Models - Migrated to .NET 7.0 and NuGet package updates - net7.0 + Migrated to .NET 8.0 and NuGet package updates + net8.0 https://github.com/shoshins/apple-receipt Git @@ -43,7 +43,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Apple.Receipt.Models/AppleInAppPurchaseReceipt.cs b/Apple.Receipt.Models/AppleInAppPurchaseReceipt.cs index 2ae5939..b95697b 100644 --- a/Apple.Receipt.Models/AppleInAppPurchaseReceipt.cs +++ b/Apple.Receipt.Models/AppleInAppPurchaseReceipt.cs @@ -7,6 +7,81 @@ namespace Apple.Receipt.Models { public class AppleInAppPurchaseReceipt { + /// + /// The appAccountToken associated with this transaction. + /// + /// + /// This field is only present if your app supplied an appAccountToken(_:) + /// or provided a UUID for the applicationUsername property when the user made the purchase. + /// + [JsonProperty("app_account_token")] + public string AppAccountToken { get; set; } + + /// + /// Purchaser of the product or a family member + /// + /// + /// A value that indicates whether the user is the purchaser of the product or is a family member with access to the product through Family Sharing. + /// + [JsonProperty("in_app_ownership_type")] + public string InAppOwnershipTypeString { get; set; } + /// + /// Purchaser of the product - strongly typed enumerator + /// + public InAppOwnershipType? OwnershipType { + get { + if (string.IsNullOrEmpty(InAppOwnershipTypeString)) { + return null; + } + switch (InAppOwnershipTypeString) { + case "FAMILY_SHARED": { + return InAppOwnershipType.FamilyShared; + } + case "PURCHASED": { + return InAppOwnershipType.Purchased; + } + default: { + return null; + } + } + } + } + + /// + /// True if auto-renewable subscription has been canceled due to an upgrade. + /// + /// + /// An indicator that an auto-renewable subscription has been canceled due to an upgrade. + /// This field is only present for upgrade transactions. + /// + [JsonProperty("is_upgraded")] + public bool IsUpgraded { get; set; } + + /// + /// True if auto-renewable subscription has been canceled due to an upgrade. + /// + /// + /// The reference name of a subscription offer that you configured in App Store Connect. + /// This field is present when a customer redeems a subscription offer code. + /// + [JsonProperty("offer_code_ref_name")] + public string OfferCodeRefName { get; set; } + + /// + /// The identifier of the promotional offer for an auto-renewable subscription that the user redeems. + /// + [JsonProperty("promotional_offer_id")] + public string PromoOfferId { get; set; } + + /// + /// The identifier of the subscription group to which the subscription belongs. + /// + /// + /// The value for this field is identical to the subscriptionGroupIdentifier property in SKProduct. + /// + [JsonProperty("subscription_group_identifier")] + public string SubscriptionGroupId { get; set; } + /// /// The number of items purchased. /// diff --git a/Apple.Receipt.Models/Enums/InAppOwnershipType.cs b/Apple.Receipt.Models/Enums/InAppOwnershipType.cs new file mode 100644 index 0000000..6fa1084 --- /dev/null +++ b/Apple.Receipt.Models/Enums/InAppOwnershipType.cs @@ -0,0 +1,23 @@ +namespace Apple.Receipt.Models.Enums +{ + /// + /// The relationship of the user with the family-shared purchase to which they have access. + /// + /// + /// When family members benefit from a shared subscription, App Store updates their receipt to include the family-shared purchase. + /// Use the value of in_app_ownership_type to understand whether a transaction belongs to the purchaser or a family member who benefits. + /// This field appears in the App Store server notifications unified receipt (unified_receipt.Latest_receipt_info) and + /// in transaction receipts (responseBody.Latest_receipt_info). + /// + public enum InAppOwnershipType + { + /// + /// “FAMILY_SHARED” - The transaction belongs to a family member who benefits from service. + /// + FamilyShared, + /// + /// “PURCHASED” - The transaction belongs to the purchaser. + /// + Purchased + } +} \ No newline at end of file diff --git a/Apple.Receipt.Parser.Tests/Apple.Receipt.Parser.Tests.csproj b/Apple.Receipt.Parser.Tests/Apple.Receipt.Parser.Tests.csproj index de3e3b8..ff9e2ec 100644 --- a/Apple.Receipt.Parser.Tests/Apple.Receipt.Parser.Tests.csproj +++ b/Apple.Receipt.Parser.Tests/Apple.Receipt.Parser.Tests.csproj @@ -1,18 +1,18 @@  - net7.0 + net8.0 annotations false - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Apple.Receipt.Parser/Apple.Receipt.Parser.csproj b/Apple.Receipt.Parser/Apple.Receipt.Parser.csproj index 1b86b4d..b8d21f2 100644 --- a/Apple.Receipt.Parser/Apple.Receipt.Parser.csproj +++ b/Apple.Receipt.Parser/Apple.Receipt.Parser.csproj @@ -12,8 +12,8 @@ MIT images/icon.png Apple Receipt Parser Base64 Asn1 Asn.1 - Migrated to .NET 7.0 - net7.0 + Migrated to .NET 8.0 + net8.0 true @@ -41,8 +41,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Apple.Receipt.Verificator.Tests/Apple.Receipt.Verificator.Tests.csproj b/Apple.Receipt.Verificator.Tests/Apple.Receipt.Verificator.Tests.csproj index 9105c1d..f03a8b8 100644 --- a/Apple.Receipt.Verificator.Tests/Apple.Receipt.Verificator.Tests.csproj +++ b/Apple.Receipt.Verificator.Tests/Apple.Receipt.Verificator.Tests.csproj @@ -1,15 +1,15 @@  - net7.0 + net8.0 annotations false - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Apple.Receipt.Verificator/Apple.Receipt.Verificator.csproj b/Apple.Receipt.Verificator/Apple.Receipt.Verificator.csproj index 67b004b..35fb02b 100644 --- a/Apple.Receipt.Verificator/Apple.Receipt.Verificator.csproj +++ b/Apple.Receipt.Verificator/Apple.Receipt.Verificator.csproj @@ -12,8 +12,8 @@ MIT images/icon.png Apple Receipt Validation AppStore - Migrated to .NET 7.0 and NuGet package updates. - net7.0 + Migrated to .NET 8.0 and NuGet package updates. + net8.0 true @@ -41,16 +41,16 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/global.json b/global.json index bfe28a0..bcbec44 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "8.0.100", "rollForward": "latestFeature" } } \ No newline at end of file