Skip to content

Commit

Permalink
Merge pull request #572 from nozzlegear/2020-07
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Sep 11, 2020
2 parents 30c6898 + e9d785e commit 9ceed45
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 7 deletions.
8 changes: 7 additions & 1 deletion ShopifySharp/Entities/Checkout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ public class Checkout : ShopifyObject
/// </summary>
[JsonProperty("total_discounts")]
public decimal? TotalDiscounts { get; set; }


/// <summary>
/// The total duties of the checkout in presentment currency.
/// </summary>
[JsonProperty("total_duties")]
public decimal? TotalDuties { get; set; }

/// <summary>
/// The sum of all the prices of all the items in the order.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions ShopifySharp/Entities/LineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,11 @@ public class LineItem : ShopifyObject
/// </summary>
[JsonProperty("price_set")]
public PriceSet PriceSet { get; set; }

/// <summary>
/// A list of duty objects, each containing information about a duty on the line item
/// </summary>
[JsonProperty("duties")]
public IEnumerable<LineItemDuty> Duties { get; set; }
}
}
25 changes: 25 additions & 0 deletions ShopifySharp/Entities/LineItemDuty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShopifySharp
{
public class LineItemDuty : ShopifyObject
{
[JsonProperty("harmonized_system_code")]
public string HarmonizedSystemCode { get; set; }

[JsonProperty("country_code_of_origin")]
public string CountryCodeOfOrigin { get; set; }

[JsonProperty("shop_money")]
public Price ShopMoney { get; set; }

[JsonProperty("presentment_money")]
public Price PresentmentMoney { get; set; }

[JsonProperty("tax_lines")]
public IEnumerable<TaxLine> TaxLines { get; set; }
}
}
12 changes: 12 additions & 0 deletions ShopifySharp/Entities/Location.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,17 @@ public class Location : ShopifyObject
/// </summary>
[JsonProperty("legacy")]
public bool? Legacy { get; set; }

/// <summary>
/// The localized name of the location's country.
/// </summary>
[JsonProperty("localized_country_name")]
public string LocalizedCountryName { get; set; }

/// <summary>
/// The localized name of the location's region. Typically a province, state, or prefecture.
/// </summary>
[JsonProperty("localized_province_name")]
public string LocalizedProvinceName { get; set; }
}
}
12 changes: 12 additions & 0 deletions ShopifySharp/Entities/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,5 +342,17 @@ public class Order : ShopifyObject
/// </summary>
[JsonProperty("metafields")]
public IEnumerable<MetaField> Metafields { get; set; }

/// <summary>
/// The current total duties charged on the order in shop and presentment currencies.
/// </summary>
[JsonProperty("current_total_duties_set")]
public PriceSet CurrentTotalDutiesSet { get; set; }

/// <summary>
/// The original total duties charged on the order in shop and presentment currencies.
/// </summary>
[JsonProperty("original_total_duties_set")]
public PriceSet OriginalTotalDutiesSet { get; set; }
}
}
6 changes: 6 additions & 0 deletions ShopifySharp/Entities/Refund.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public class Refund : ShopifyObject
/// </summary>
[JsonProperty("user_id")]
public long? UserId { get; set; }

/// <summary>
/// A list of duties that have been returned as part of the refund.
/// </summary>
[JsonProperty("duties")]
public IEnumerable<RefundDuty> Duties { get; set; }
}

public class Shipping
Expand Down
16 changes: 16 additions & 0 deletions ShopifySharp/Entities/RefundDuty.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace ShopifySharp
{
public class RefundDuty
{
[JsonProperty("duty_id")]
public long? DutyId { get; set; }

[JsonProperty("amount_set")]
public PriceSet AmountSet { get; set; }
}
}
5 changes: 0 additions & 5 deletions ShopifySharp/Services/Collection/CollectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ namespace ShopifySharp
/// </summary>
public class CollectionService : ShopifyService
{
/// <remarks>
/// This endpoint is not supported in 2019-10.
/// </remarks>
public override string APIVersion => "2020-07";

/// <summary>
/// Creates a new instance of the service.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion ShopifySharp/Services/ShopifyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace ShopifySharp
{
public abstract class ShopifyService
{
public virtual string APIVersion => "2019-10";
public virtual string APIVersion => "2020-07";

private static IRequestExecutionPolicy _GlobalExecutionPolicy = new DefaultRequestExecutionPolicy();

Expand Down

0 comments on commit 9ceed45

Please sign in to comment.