Skip to content

Commit

Permalink
Feature/lib update (#30)
Browse files Browse the repository at this point in the history
* .net 8 & nuget update

* release note corrected for.net 8

* #29 missing fields added
  • Loading branch information
shoshins authored Dec 25, 2023
1 parent ed584de commit 42d205d
Show file tree
Hide file tree
Showing 11 changed files with 132 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion Apple.Receipt.Example/Apple.Receipt.Example.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions Apple.Receipt.Models/Apple.Receipt.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PackageLicense>MIT</PackageLicense>
<PackageIcon>images/icon.png</PackageIcon>
<PackageTags>Apple Receipt Models</PackageTags>
<PackageReleaseNotes>Migrated to .NET 7.0 and NuGet package updates</PackageReleaseNotes>
<TargetFramework>net7.0</TargetFramework>
<PackageReleaseNotes>Migrated to .NET 8.0 and NuGet package updates</PackageReleaseNotes>
<TargetFramework>net8.0</TargetFramework>
<RepositoryUrl>https://github.com/shoshins/apple-receipt</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
</PropertyGroup>
Expand Down Expand Up @@ -43,7 +43,7 @@
<None Include="../icon.png" Pack="true" PackagePath="images/" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
75 changes: 75 additions & 0 deletions Apple.Receipt.Models/AppleInAppPurchaseReceipt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,81 @@ namespace Apple.Receipt.Models
{
public class AppleInAppPurchaseReceipt
{
/// <summary>
/// The appAccountToken associated with this transaction.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
[JsonProperty("app_account_token")]
public string AppAccountToken { get; set; }

/// <summary>
/// Purchaser of the product or a family member
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
[JsonProperty("in_app_ownership_type")]
public string InAppOwnershipTypeString { get; set; }
/// <summary>
/// Purchaser of the product - strongly typed enumerator
/// </summary>
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;
}
}
}
}

/// <summary>
/// True if auto-renewable subscription has been canceled due to an upgrade.
/// </summary>
/// <remarks>
/// An indicator that an auto-renewable subscription has been canceled due to an upgrade.
/// This field is only present for upgrade transactions.
/// </remarks>
[JsonProperty("is_upgraded")]
public bool IsUpgraded { get; set; }

/// <summary>
/// True if auto-renewable subscription has been canceled due to an upgrade.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
[JsonProperty("offer_code_ref_name")]
public string OfferCodeRefName { get; set; }

/// <summary>
/// The identifier of the promotional offer for an auto-renewable subscription that the user redeems.
/// </summary>
[JsonProperty("promotional_offer_id")]
public string PromoOfferId { get; set; }

/// <summary>
/// The identifier of the subscription group to which the subscription belongs.
/// </summary>
/// <remarks>
/// The value for this field is identical to the subscriptionGroupIdentifier property in SKProduct.
/// </remarks>
[JsonProperty("subscription_group_identifier")]
public string SubscriptionGroupId { get; set; }

/// <summary>
/// The number of items purchased.
/// </summary>
Expand Down
23 changes: 23 additions & 0 deletions Apple.Receipt.Models/Enums/InAppOwnershipType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace Apple.Receipt.Models.Enums
{
/// <summary>
/// The relationship of the user with the family-shared purchase to which they have access.
/// </summary>
/// <remarks>
/// 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).
/// </remarks>
public enum InAppOwnershipType
{
/// <summary>
/// “FAMILY_SHARED” - The transaction belongs to a family member who benefits from service.
/// </summary>
FamilyShared,
/// <summary>
/// “PURCHASED” - The transaction belongs to the purchaser.
/// </summary>
Purchased
}
}
12 changes: 6 additions & 6 deletions Apple.Receipt.Parser.Tests/Apple.Receipt.Parser.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>annotations</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.79.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="CompareNETObjects" Version="4.83.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 4 additions & 4 deletions Apple.Receipt.Parser/Apple.Receipt.Parser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PackageLicense>MIT</PackageLicense>
<PackageIcon>images/icon.png</PackageIcon>
<PackageTags>Apple Receipt Parser Base64 Asn1 Asn.1</PackageTags>
<PackageReleaseNotes>Migrated to .NET 7.0</PackageReleaseNotes>
<TargetFramework>net7.0</TargetFramework>
<PackageReleaseNotes>Migrated to .NET 8.0</PackageReleaseNotes>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
Expand Down Expand Up @@ -41,8 +41,8 @@
<None Include="../icon.png" Pack="true" PackagePath="images/" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>annotations</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
16 changes: 8 additions & 8 deletions Apple.Receipt.Verificator/Apple.Receipt.Verificator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PackageLicense>MIT</PackageLicense>
<PackageIcon>images/icon.png</PackageIcon>
<PackageTags>Apple Receipt Validation AppStore</PackageTags>
<PackageReleaseNotes>Migrated to .NET 7.0 and NuGet package updates.</PackageReleaseNotes>
<TargetFramework>net7.0</TargetFramework>
<PackageReleaseNotes>Migrated to .NET 8.0 and NuGet package updates.</PackageReleaseNotes>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
Expand Down Expand Up @@ -41,16 +41,16 @@
<None Include="../icon.png" Pack="true" PackagePath="images/" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Refit.HttpClientFactory" Version="6.5.1" />
<PackageReference Include="Refit.Newtonsoft.Json" Version="6.5.1" />
<PackageReference Include="Refit.HttpClientFactory" Version="7.0.0" />
<PackageReference Include="Refit.Newtonsoft.Json" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Apple.Receipt.Parser\Apple.Receipt.Parser.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "latestFeature"
}
}

0 comments on commit 42d205d

Please sign in to comment.