Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for PendingInvoiceItemInterval on Subscription #1819

Merged
merged 1 commit into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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