Skip to content

Commit

Permalink
Merge pull request #88 from mattgenious/dev
Browse files Browse the repository at this point in the history
12.2.1
  • Loading branch information
mattgenious authored Sep 13, 2022
2 parents dc4aa20 + 852ce9e commit 122f343
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>12.2.0</Version>
<AssemblyVersion>12.2.0.0</AssemblyVersion>
<Version>12.2.1</Version>
<AssemblyVersion>12.2.1.0</AssemblyVersion>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageProjectUrl>https://github.com/mattgenious/RechargeSharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/mattgenious/RechargeSharp</RepositoryUrl>
<RepositoryType>GIT</RepositoryType>
<PackageTags>C#, .NET, ecommerce, recharge, rechargepayments</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<FileVersion>12.2.0.0</FileVersion>
<FileVersion>12.2.1.0</FileVersion>
<Authors>Matt Luccas Phaure Minet</Authors>
<Description>A C# library for RechargePayments</Description>
<PackageReleaseNotes>Simplify target frameworks</PackageReleaseNotes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
<None Update="TestData\Product.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TestData\Product2.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions RechargeSharp.Entities.Tests/RechargeSharpSerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,16 @@ public void CanDeserializeActualProductJsonTest()
Assert.NotNull(deserialized);
Assert.NotEqual(0, deserialized.Id);
}

[Theory]
[InlineAutoData]
public void CanDeserializeActualProduct2JsonTest()
{
var jsonString = TestDataHandler.GetProduct2String;
var deserialized = JsonConvert.DeserializeObject<Product>(jsonString);
Assert.NotNull(deserialized);
Assert.NotEqual(0, deserialized.Id);
}

[Theory]
[InlineAutoData]
Expand Down
33 changes: 33 additions & 0 deletions RechargeSharp.Entities.Tests/TestData/Product2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"collection_id": null,
"created_at": "2022-09-12T06:39:18",
"discount_amount": 0E-10,
"discount_type": "percentage",
"handle": "test-test",
"id": 12312313,
"images": {
"large": "https://cdn.shopify.com/s/files/1/123/123/123/products/Test_large.png",
"medium": "https://cdn.shopify.com/s/files/1/123/123/123/products/Test_medium.png",
"original": "https://cdn.shopify.com/s/files/1/123/123/123/products/Testpng",
"small": "https://cdn.shopify.com/s/files/1/123/123/123/products/Test_small.png"
},
"product_id": 123,
"shopify_product_id": 123123,
"subscription_defaults": {
"charge_interval_frequency": null,
"cutoff_day_of_month": null,
"cutoff_day_of_week": null,
"expire_after_specific_number_of_charges": null,
"modifiable_properties": [],
"number_charges_until_expiration": null,
"order_day_of_month": null,
"order_day_of_week": null,
"order_interval_frequency_options": [
"30"
],
"order_interval_unit": "day",
"storefront_purchase_options": "inactive"
},
"title": "Test",
"updated_at": "2022-09-12T06:43:38"
}
1 change: 1 addition & 0 deletions RechargeSharp.Entities.Tests/Utilities/TestDataHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ internal class TestDataHandler
public static string GetTestAddressUTCString => File.ReadAllText(TestDataPaths.AddressUTC);

public static string GetProductString => File.ReadAllText(TestDataPaths.Product);
public static string GetProduct2String => File.ReadAllText(TestDataPaths.Product2);
}
}
1 change: 1 addition & 0 deletions RechargeSharp.Entities.Tests/Utilities/TestDataPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ internal class TestDataPaths
public static string AddressUTC => Path.Join(BasePath, "AddressUTC.json");
public static string AddressOffset => Path.Join(BasePath, "AddressOffset.json");
public static string Product => Path.Join(BasePath, "Product.json");
public static string Product2 => Path.Join(BasePath, "Product2.json");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override int GetHashCode()
}

[JsonProperty("charge_interval_frequency")]
public long ChargeIntervalFrequency { get; set; }
public long? ChargeIntervalFrequency { get; set; }

[JsonProperty("cutoff_day_of_month")]
public long? CutoffDayOfMonth { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public enum StorefrontPurchaseOptions
[EnumMember(Value = "subscription_only")]
SubscriptionOnly,
[EnumMember(Value = "subscription_and_onetime")]
SubscriptionAndOnetime
SubscriptionAndOnetime,
[EnumMember(Value = "inactive")]
Inactive
}
}
6 changes: 3 additions & 3 deletions RechargeSharp.Entities/RechargeSharp.Entities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>12.2.0</Version>
<AssemblyVersion>12.2.0.0</AssemblyVersion>
<Version>12.2.1</Version>
<AssemblyVersion>12.2.1.0</AssemblyVersion>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageProjectUrl>https://github.com/mattgenious/RechargeSharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/mattgenious/RechargeSharp</RepositoryUrl>
<RepositoryType>GIT</RepositoryType>
<PackageTags>C#, .NET, ecommerce, recharge, rechargepayments</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<FileVersion>12.2.0.0</FileVersion>
<FileVersion>12.2.1.0</FileVersion>
<Authors>Matt Luccas Phaure Minet</Authors>
<Description>A C# library for RechargePayments</Description>
<PackageReleaseNotes>Shared address phone no longer required</PackageReleaseNotes>
Expand Down
6 changes: 3 additions & 3 deletions RechargeSharp/RechargeSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>12.2.0</Version>
<AssemblyVersion>12.2.0.0</AssemblyVersion>
<Version>12.2.1</Version>
<AssemblyVersion>12.2.1.0</AssemblyVersion>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageProjectUrl>https://github.com/mattgenious/RechargeSharp</PackageProjectUrl>
<RepositoryUrl>https://github.com/mattgenious/RechargeSharp</RepositoryUrl>
<RepositoryType>GIT</RepositoryType>
<PackageTags>C#, .NET, ecommerce, recharge, rechargepayments</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<FileVersion>12.2.0.0</FileVersion>
<FileVersion>12.2.1.0</FileVersion>
<Authors>Matt Luccas Phaure Minet</Authors>
<Description>A C# library for RechargePayments</Description>
<PackageReleaseNotes>Simplify target frameworks</PackageReleaseNotes>
Expand Down

0 comments on commit 122f343

Please sign in to comment.