Skip to content

Commit

Permalink
Merge pull request #674 from clement911/2021-10-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Oct 14, 2021
2 parents a20a043 + f7d4dea commit 5ca6bc0
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ShopifySharp/Entities/DraftOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,11 @@ public class DraftOrder : ShopifyObject
/// </summary>
[JsonProperty("use_customer_default_address")]
public bool? UseCustomerDefaultAddress { get; set; }

/// <summary>
/// The terms and conditions under which a payment should be processed.
/// </summary>
[JsonProperty("payment_terms")]
public PaymentTerms PaymentTerms { get; set; }
}
}
6 changes: 6 additions & 0 deletions ShopifySharp/Entities/Fulfillment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,11 @@ public class Fulfillment : ShopifyObject

[JsonProperty("name")]
public string Name { get; set; }

/// <summary>
/// The address of the fulfillment location
/// </summary>
[JsonProperty("origin_address")]
public Address OriginAddress { get; set; }
}
}
6 changes: 6 additions & 0 deletions ShopifySharp/Entities/LineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,11 @@ public class LineItem : ShopifyObject
/// </summary>
[JsonProperty("origin_location")]
public LineItemOriginLocation OriginLocation { get; set; }

/// <summary>
/// A unique identifier for a quantity of items within a single fulfillment. An order can have multiple fulfillment line items.
/// </summary>
[JsonProperty("fulfillment_line_item_id")]
public long? FulfillmentLineItemId { get; set; }
}
}
6 changes: 6 additions & 0 deletions ShopifySharp/Entities/Order.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,11 @@ public class Order : ShopifyObject
/// </summary>
[JsonProperty("estimated_taxes")]
public bool? EstimatedTaxes { get; set; }

/// <summary>
/// The terms and conditions under which a payment should be processed.
/// </summary>
[JsonProperty("payment_terms")]
public PaymentTerms PaymentTerms { get; set; }
}
}
44 changes: 44 additions & 0 deletions ShopifySharp/Entities/PaymentSchedule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Newtonsoft.Json;
using System;

namespace ShopifySharp
{
public class PaymentSchedule
{
/// <summary>
/// The amount that is owed according to the payment terms.
/// </summary>
[JsonProperty("amount")]
public decimal? amount { get; set; }

/// <summary>
/// The presentment currency for the payment
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// The date and time when the payment terms were initiated
/// </summary>
[JsonProperty("issued_at")]
public DateTimeOffset? IssuedAt { get; set; }

/// <summary>
/// The date and time when the payment is due. Calculated based on issued_at and due_in_days or a customized fixed date if the type is fixed.
/// </summary>
[JsonProperty("due_at")]
public DateTimeOffset? DueAt { get; set; }

/// <summary>
/// The date and time when the purchase is completed. Returns null initially and updates when the payment is captured
/// </summary>
[JsonProperty("completed_at")]
public DateTimeOffset? CompletedAt { get; set; }

/// <summary>
/// The name of the payment method gateway.
/// </summary>
[JsonProperty("expected_payment_method")]
public string ExpectedPaymentMethod { get; set; }
}
}
43 changes: 43 additions & 0 deletions ShopifySharp/Entities/PaymentTerms.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using Newtonsoft.Json;

namespace ShopifySharp
{
public class PaymentTerms
{
/// <summary>
/// The amount that is owed according to the payment terms.
/// </summary>
[JsonProperty("amount")]
public decimal? amount { get; set; }

/// <summary>
/// The presentment currency for the payment
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// The number of days between the invoice date and due date that is defined in the selected payment terms template.
/// </summary>
[JsonProperty("due_in_days")]
public int? DueInDays { get; set; }

/// <summary>
/// The name of the selected payment terms template for the order.
/// </summary>
[JsonProperty("payment_terms_name")]
public string PaymentTermsName { get; set; }

/// <summary>
/// The type of selected payment terms template for the order.
/// </summary>
[JsonProperty("payment_terms_type")]
public string PaymentTermsType { get; set; }

/// <summary>
/// An array of schedules associated to the payment terms.
/// </summary>
[JsonProperty("payment_schedules")]
public PaymentSchedule[] PaymentSchedules { get; set; }
}
}
6 changes: 6 additions & 0 deletions ShopifySharp/Entities/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public class Transaction : ShopifyObject
[JsonProperty("authorization")]
public string Authorization { get; set; }

/// <summary>
/// The date and time when the Shopify Payments authorization expires.
/// </summary>
[JsonProperty("authorization_expires_at")]
public DateTimeOffset? AuthorizationExpiresAt { get; set; }

/// <summary>
/// The date and time when the transaction was created.
/// </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 => "2021-07";
public virtual string APIVersion => "2021-10";

private static IRequestExecutionPolicy _GlobalExecutionPolicy = new DefaultRequestExecutionPolicy();

Expand Down

0 comments on commit 5ca6bc0

Please sign in to comment.