/// Draft invoices are fully editable. Once an invoice is finalized,
diff --git a/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs b/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs
index dd46c7903a..c6237576e2 100644
--- a/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs
+++ b/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs
@@ -53,50 +53,6 @@ public virtual IAsyncEnumerable ListLineItemsAutoPagingAsync(st
return this.ListRequestAutoPagingAsync($"/v1/invoices/{WebUtility.UrlEncode(id)}/lines", options, requestOptions, cancellationToken);
}
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.List instead.")]
- public virtual StripeList ListUpcomingLineItems(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null)
- {
- return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoices/upcoming/lines", options, requestOptions);
- }
-
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.ListAsync instead.")]
- public virtual Task> ListUpcomingLineItemsAsync(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
- {
- return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoices/upcoming/lines", options, requestOptions, cancellationToken);
- }
-
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.ListAutoPaging instead.")]
- public virtual IEnumerable ListUpcomingLineItemsAutoPaging(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null)
- {
- return this.ListRequestAutoPaging($"/v1/invoices/upcoming/lines", options, requestOptions);
- }
-
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.ListAutoPagingAsync instead.")]
- public virtual IAsyncEnumerable ListUpcomingLineItemsAutoPagingAsync(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
- {
- return this.ListRequestAutoPagingAsync($"/v1/invoices/upcoming/lines", options, requestOptions, cancellationToken);
- }
-
///
/// Updates an invoice’s line item. Some fields, such as tax_amounts, only live on
/// the invoice line item, so they can only be updated through this endpoint. Other fields,
diff --git a/src/Stripe.net/Services/InvoiceUpcomingLines/InvoiceUpcomingLinesListOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceUpcomingLinesOptions.cs
similarity index 94%
rename from src/Stripe.net/Services/InvoiceUpcomingLines/InvoiceUpcomingLinesListOptions.cs
rename to src/Stripe.net/Services/Invoices/InvoiceUpcomingLinesOptions.cs
index 7b7a489e2d..76240379ce 100644
--- a/src/Stripe.net/Services/InvoiceUpcomingLines/InvoiceUpcomingLinesListOptions.cs
+++ b/src/Stripe.net/Services/Invoices/InvoiceUpcomingLinesOptions.cs
@@ -9,7 +9,7 @@ namespace Stripe
using STJS = System.Text.Json.Serialization;
#endif
- public class InvoiceUpcomingLinesListOptions : ListOptions
+ public class InvoiceUpcomingLinesOptions : ListOptions
{
///
/// Settings for automatic tax lookup for this invoice preview.
@@ -18,7 +18,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("automatic_tax")]
#endif
- public InvoiceUpcomingLinesAutomaticTaxOptions AutomaticTax { get; set; }
+ public InvoiceAutomaticTaxOptions AutomaticTax { get; set; }
///
/// The ID of the coupon to apply to this phase of the subscription schedule. This field has
@@ -61,7 +61,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("customer_details")]
#endif
- public InvoiceUpcomingLinesCustomerDetailsOptions CustomerDetails { get; set; }
+ public InvoiceCustomerDetailsOptions CustomerDetails { get; set; }
///
/// The coupons to redeem into discounts for the invoice preview. If not specified, inherits
@@ -73,7 +73,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("discounts")]
#endif
- public List Discounts { get; set; }
+ public List Discounts { get; set; }
///
/// List of invoice items to add or update in the upcoming invoice preview (up to 250).
@@ -82,7 +82,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("invoice_items")]
#endif
- public List InvoiceItems { get; set; }
+ public List InvoiceItems { get; set; }
///
/// The connected account that issues the invoice. The invoice is presented with the
@@ -92,7 +92,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("issuer")]
#endif
- public InvoiceUpcomingLinesIssuerOptions Issuer { get; set; }
+ public InvoiceIssuerOptions Issuer { get; set; }
///
/// The account (if any) for which the funds of the invoice payment are intended. If set,
@@ -135,7 +135,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("schedule_details")]
#endif
- public InvoiceUpcomingLinesScheduleDetailsOptions ScheduleDetails { get; set; }
+ public InvoiceScheduleDetailsOptions ScheduleDetails { get; set; }
///
/// The identifier of the subscription for which you'd like to retrieve the upcoming
@@ -225,7 +225,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("subscription_details")]
#endif
- public InvoiceUpcomingLinesSubscriptionDetailsOptions SubscriptionDetails { get; set; }
+ public InvoiceSubscriptionDetailsOptions SubscriptionDetails { get; set; }
///
/// A list of up to 20 subscription items, each with an attached price. This field has been
@@ -236,7 +236,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("subscription_items")]
#endif
- public List SubscriptionItems { get; set; }
+ public List SubscriptionItems { get; set; }
///
/// The pre-billing to apply to the subscription as a preview. This field has been
@@ -247,7 +247,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("subscription_prebilling")]
#endif
- public InvoiceUpcomingLinesSubscriptionPrebillingOptions SubscriptionPrebilling { get; set; }
+ public InvoiceSubscriptionPrebillingOptions SubscriptionPrebilling { get; set; }
///
/// Determines how to handle existing, or none.
///
[JsonProperty("political_exposure")]
#if NET6_0_OR_GREATER
diff --git a/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs b/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs
index 98519481f1..560d7f1793 100644
--- a/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs
+++ b/src/Stripe.net/Services/V2/Core/EventDestinations/EventDestinationService.cs
@@ -103,17 +103,17 @@ public virtual V2.EventDestination Get(string id, EventDestinationGetOptions opt
///
/// Lists all event destinations.
///
- public virtual StripeList List(EventDestinationListOptions options = null, RequestOptions requestOptions = null)
+ public virtual V2.StripeList List(EventDestinationListOptions options = null, RequestOptions requestOptions = null)
{
- return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions);
+ return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions);
}
///
/// Lists all event destinations.
///
- public virtual Task> ListAsync(EventDestinationListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
+ public virtual Task> ListAsync(EventDestinationListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
- return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions, cancellationToken);
+ return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions, cancellationToken);
}
///
diff --git a/src/Stripe.net/Services/V2/Core/Events/EventService.cs b/src/Stripe.net/Services/V2/Core/Events/EventService.cs
index ac5d439f25..e39553225f 100644
--- a/src/Stripe.net/Services/V2/Core/Events/EventService.cs
+++ b/src/Stripe.net/Services/V2/Core/Events/EventService.cs
@@ -39,17 +39,17 @@ public virtual V2.Event Get(string id, EventGetOptions options = null, RequestOp
///
/// List events, going back up to 30 days.
///
- public virtual StripeList List(EventListOptions options = null, RequestOptions requestOptions = null)
+ public virtual V2.StripeList List(EventListOptions options = null, RequestOptions requestOptions = null)
{
- return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions);
+ return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions);
}
///
/// List events, going back up to 30 days.
///
- public virtual Task> ListAsync(EventListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
+ public virtual Task> ListAsync(EventListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
- return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions, cancellationToken);
+ return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions, cancellationToken);
}
///
diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs
index 3410f25ec2..a3861d4886 100644
--- a/src/StripeTests/Services/GeneratedExamplesTest.cs
+++ b/src/StripeTests/Services/GeneratedExamplesTest.cs
@@ -756,8 +756,7 @@ public void TestCouponsPost()
var options = new CouponCreateOptions
{
PercentOff = 25.5M,
- Duration = "repeating",
- DurationInMonths = 3,
+ Duration = "once",
};
var service = new CouponService(this.StripeClient);
service.Create(options);
@@ -1852,21 +1851,6 @@ public void TestInvoicesSendPost()
"/v1/invoices/in_xxxxxxxxxxxxx/send");
}
- [Fact]
- public void TestInvoicesUpcomingGet()
- {
- var options = new UpcomingInvoiceOptions
- {
- Customer = "cus_9utnxg47pWjV1e",
- };
- var service = new InvoiceService(this.StripeClient);
- service.Upcoming(options);
- this.AssertRequest(
- HttpMethod.Get,
- "/v1/invoices/upcoming",
- "customer=cus_9utnxg47pWjV1e");
- }
-
[Fact]
public void TestInvoicesVoidPost()
{
diff --git a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs
index cc939ae16d..2943bc5fc7 100644
--- a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs
+++ b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs
@@ -19,7 +19,6 @@ public class InvoiceServiceTest : BaseStripeTest
private readonly InvoiceListOptions listOptions;
private readonly InvoiceLineItemListOptions lineItemListOptions;
private readonly UpcomingInvoiceOptions upcomingOptions;
- private readonly InvoiceUpcomingLinesListOptions upcomingListLineItemsOptions;
private readonly InvoiceFinalizeOptions finalizeOptions;
private readonly InvoiceMarkUncollectibleOptions markUncollectibleOptions;
private readonly InvoiceSendOptions sendOptions;
@@ -67,13 +66,6 @@ public InvoiceServiceTest(
Subscription = "sub_123",
};
- this.upcomingListLineItemsOptions = new InvoiceUpcomingLinesListOptions()
- {
- Limit = 1,
- Customer = "cus_123",
- Subscription = "sub_123",
- };
-
this.finalizeOptions = new InvoiceFinalizeOptions
{
};
@@ -239,44 +231,6 @@ public async Task ListLineItemsAutoPagingAsync()
Assert.Equal("line_item", lineItem.Object);
}
- [Fact]
- public void ListUpcomingLineItems()
- {
- var lineItems = this.service.UpcomingLines.List(this.upcomingListLineItemsOptions);
- this.AssertRequest(HttpMethod.Get, "/v1/invoices/upcoming/lines");
- Assert.NotNull(lineItems);
- Assert.Equal("list", lineItems.Object);
- Assert.Single(lineItems.Data);
- Assert.Equal("line_item", lineItems.Data[0].Object);
- }
-
- [Fact]
- public async Task ListUpcomingLineItemsAsync()
- {
- var lineItems = await this.service.UpcomingLines.ListAsync(this.upcomingListLineItemsOptions);
- this.AssertRequest(HttpMethod.Get, "/v1/invoices/upcoming/lines");
- Assert.NotNull(lineItems);
- Assert.Equal("list", lineItems.Object);
- Assert.Single(lineItems.Data);
- Assert.Equal("line_item", lineItems.Data[0].Object);
- }
-
- [Fact]
- public void ListUpcomingLineItemsAutoPaging()
- {
- var lineItem = this.service.UpcomingLines.ListAutoPaging(this.upcomingListLineItemsOptions).First();
- Assert.NotNull(lineItem);
- Assert.Equal("line_item", lineItem.Object);
- }
-
- [Fact]
- public async Task ListUpcomingLineItemsAutoPagingAsync()
- {
- var lineItem = await this.service.UpcomingLines.ListAutoPagingAsync(this.upcomingListLineItemsOptions).FirstAsync();
- Assert.NotNull(lineItem);
- Assert.Equal("line_item", lineItem.Object);
- }
-
[Fact]
public void MarkUncollectible()
{
diff --git a/src/StripeTests/Services/Invoices/UpcomingInvoiceListLineItemsOptionsTest.cs b/src/StripeTests/Services/Invoices/UpcomingInvoiceListLineItemsOptionsTest.cs
deleted file mode 100644
index c56111360c..0000000000
--- a/src/StripeTests/Services/Invoices/UpcomingInvoiceListLineItemsOptionsTest.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-namespace StripeTests
-{
- using System;
- using Stripe;
- using Stripe.Infrastructure.FormEncoding;
- using Xunit;
-
- public class UpcomingInvoiceListLineItemsOptionsTest : BaseStripeTest
- {
- [Fact]
- public void SerializeSubscriptionBillingCycleAnchor()
- {
- var testCases = new[]
- {
- new
- {
- options = new InvoiceUpcomingLinesListOptions()
- {
- SubscriptionBillingCycleAnchor = DateTime.Parse("Fri, 13 Feb 2009 23:31:30Z"),
- },
- want = "subscription_billing_cycle_anchor=1234567890",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionBillingCycleAnchor = SubscriptionBillingCycleAnchor.Now,
- },
- want = "subscription_billing_cycle_anchor=now",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionBillingCycleAnchor = SubscriptionBillingCycleAnchor.Unchanged,
- },
- want = "subscription_billing_cycle_anchor=unchanged",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionTrialEnd = DateTime.Parse("Fri, 13 Feb 2009 23:31:30Z"),
- },
- want = "subscription_trial_end=1234567890",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionTrialEnd = SubscriptionTrialEnd.Now,
- },
- want = "subscription_trial_end=now",
- },
- };
-
- foreach (var testCase in testCases)
- {
- Assert.Equal(testCase.want, ContentEncoder.CreateQueryString(testCase.options));
- }
- }
- }
-}