Skip to content

Commit

Permalink
Merge pull request #811 from clement911/tip-gateway-fix
Browse files Browse the repository at this point in the history
Tip gateway fix
  • Loading branch information
clement911 authored Nov 27, 2022
2 parents c8243b6 + b1ffd28 commit 00820e8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions ShopifySharp.Tests/Order_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Order>(orderJson);
Assert.Null(order.LineItems.First().TipPaymentGateway);
Assert.True(order.LineItems.First().TipPaymentGatewaySpecified);
}
}

public class Order_Tests_Fixture : IAsyncLifetime
Expand Down
2 changes: 1 addition & 1 deletion ShopifySharp/Entities/LineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public class LineItem : ShopifyObject
/// <summary>
/// The payment gateway used to tender the tip, such as shopify_payments. Present only on tips.
/// </summary>
[JsonProperty("tip_payment_gateway")]
[JsonProperty("tip_payment_gateway", NullValueHandling = NullValueHandling.Include)]
public string TipPaymentGateway { get; set; }

/// <summary>
Expand Down

0 comments on commit 00820e8

Please sign in to comment.