diff --git a/ShopifySharp.Tests/Order_Tests.cs b/ShopifySharp.Tests/Order_Tests.cs index 5451cb2a..f0d56a21 100644 --- a/ShopifySharp.Tests/Order_Tests.cs +++ b/ShopifySharp.Tests/Order_Tests.cs @@ -205,6 +205,24 @@ public async Task Can_Be_Partially_Updated() // In previous versions of ShopifySharp, the updated JSON would have sent 'email=null', clearing out the email address. Assert.Equal(created.Email, updated.Email); } + + [Fact] + public void TipPaymentGatewaySpecified_GetDeserialized() + { + string orderJson = @"{ + ""id"": 123, + ""line_items"": [ + { + ""id"": 123, + ""tip_payment_gateway"": null + } + ] +} +"; + var order = Infrastructure.Serializer.Deserialize(orderJson); + Assert.Null(order.LineItems.First().TipPaymentGateway); + Assert.True(order.LineItems.First().TipPaymentGatewaySpecified); + } } public class Order_Tests_Fixture : IAsyncLifetime diff --git a/ShopifySharp/Entities/LineItem.cs b/ShopifySharp/Entities/LineItem.cs index 0f876053..7fcc6aaa 100644 --- a/ShopifySharp/Entities/LineItem.cs +++ b/ShopifySharp/Entities/LineItem.cs @@ -118,7 +118,7 @@ public class LineItem : ShopifyObject /// /// The payment gateway used to tender the tip, such as shopify_payments. Present only on tips. /// - [JsonProperty("tip_payment_gateway")] + [JsonProperty("tip_payment_gateway", NullValueHandling = NullValueHandling.Include)] public string TipPaymentGateway { get; set; } ///