Skip to content

Commit

Permalink
Merge pull request #1819 from stripe/remi-add-sub-changes
Browse files Browse the repository at this point in the history
Add support for `PendingInvoiceItemInterval` on `Subscription`
  • Loading branch information
remi-stripe authored Oct 24, 2019
2 parents 9ed2557 + 0228819 commit 889f00d
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Stripe.net/Entities/Subscriptions/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ public Invoice LatestInvoice
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }

/// <summary>
/// Specifies the approximate timestamp on which any pending invoice items will be billed
/// according to the schedule provided at <c>PendingInvoiceItemInterval</c>.
/// </summary>
[JsonProperty("next_pending_invoice_item_invoice")]
public long? NextPendingInvoiceItemInvoice { get; set; }

/// <summary>
/// Specifies an interval for how often to bill for any pending invoice items. It is
/// analogous to creating an invoice for the given subscription at the specified interval.
/// </summary>
[JsonProperty("pending_invoice_item_interval")]
public SubscriptionPendingInvoiceItemInterval PendingInvoiceItemInterval { get; set; }

#region Expandable PendingSetupIntent

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Stripe
{
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class SubscriptionPendingInvoiceItemInterval : StripeEntity<SubscriptionPendingInvoiceItemInterval>
{
/// <summary>
/// Specifies invoicing frequency. Either <c>day</c>, <c>week</c>, <c>month</c> or
/// <c>year</c>.
/// </summary>
[JsonProperty("interval")]
public string Interval { get; set; }

/// <summary>
/// The number of intervals between invoices.
/// </summary>
[JsonProperty("interval_count")]
public long IntervalCount { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Stripe
{
using Newtonsoft.Json;

public class SubscriptionPendingInvoiceItemIntervalOptions : INestedOptions
{
/// <summary>
/// Specifies invoicing frequency. Either <c>day</c>, <c>week</c>, <c>month</c> or
/// <c>year</c>.
/// </summary>
[JsonProperty("interval")]
public string Interval { get; set; }

/// <summary>
/// The number of intervals between invoices.
/// </summary>
[JsonProperty("interval_count")]
public long? IntervalCount { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public abstract class SubscriptionSharedOptions : BaseOptions, IHasMetadata
[JsonProperty("metadata")]
public Dictionary<string, string> Metadata { get; set; }

/// <summary>
/// Specifies an interval for how often to bill for any pending invoice items. It is
/// analogous to creating an invoice for the given subscription at the specified interval.
/// </summary>
[JsonProperty("pending_invoice_item_interval")]
public SubscriptionPendingInvoiceItemIntervalOptions PendingInvoiceItemInterval { get; set; }

/// <summary>
/// Indicates if a customer is on session while an invoice payment is attempted.
/// </summary>
Expand Down

0 comments on commit 889f00d

Please sign in to comment.