Skip to content
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
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1868
v1868
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec
namespace Stripe
{
public class InvoicePaymentGetOptions : BaseOptions
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class InvoicePaymentListOptions : ListOptions
{
/// <summary>
/// The identifier of the invoice whose payments to return.
/// </summary>
[JsonProperty("invoice")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("invoice")]
#endif
public string Invoice { get; set; }

/// <summary>
/// The payment details of the invoice payments to return.
/// </summary>
[JsonProperty("payment")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("payment")]
#endif
public InvoicePaymentPaymentOptions Payment { get; set; }

/// <summary>
/// The status of the invoice payments to return.
/// One of: <c>canceled</c>, <c>open</c>, or <c>paid</c>.
/// </summary>
[JsonProperty("status")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("status")]
#endif
public string Status { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class InvoicePaymentPaymentOptions : INestedOptions
{
/// <summary>
/// Only return invoice payments associated by this payment intent ID.
/// </summary>
[JsonProperty("payment_intent")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("payment_intent")]
#endif
public string PaymentIntent { get; set; }

[JsonProperty("payment_record")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("payment_record")]
#endif
public string PaymentRecord { get; set; }

/// <summary>
/// Only return invoice payments associated by this payment type.
/// One of: <c>payment_intent</c>, or <c>payment_record</c>.
/// </summary>
[JsonProperty("type")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("type")]
#endif
public string Type { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;

public class InvoicePaymentService : Service,
IListable<InvoicePayment, InvoicePaymentListOptions>,
IRetrievable<InvoicePayment, InvoicePaymentGetOptions>
{
public InvoicePaymentService()
{
}

internal InvoicePaymentService(ApiRequestor requestor)
: base(requestor)
{
}

public InvoicePaymentService(IStripeClient client)
: base(client)
{
}

/// <summary>
/// <p>Retrieves the invoice payment with the given ID.</p>.
/// </summary>
public virtual InvoicePayment Get(string id, InvoicePaymentGetOptions options = null, RequestOptions requestOptions = null)
{
return this.Request<InvoicePayment>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoice_payments/{WebUtility.UrlEncode(id)}", options, requestOptions);
}

/// <summary>
/// <p>Retrieves the invoice payment with the given ID.</p>.
/// </summary>
public virtual Task<InvoicePayment> GetAsync(string id, InvoicePaymentGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
return this.RequestAsync<InvoicePayment>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoice_payments/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken);
}

/// <summary>
/// <p>When retrieving an invoice, there is an includable payments property containing the
/// first handful of those items. There is also a URL where you can retrieve the full
/// (paginated) list of payments.</p>.
/// </summary>
public virtual StripeList<InvoicePayment> List(InvoicePaymentListOptions options = null, RequestOptions requestOptions = null)
{
return this.Request<StripeList<InvoicePayment>>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoice_payments", options, requestOptions);
}

/// <summary>
/// <p>When retrieving an invoice, there is an includable payments property containing the
/// first handful of those items. There is also a URL where you can retrieve the full
/// (paginated) list of payments.</p>.
/// </summary>
public virtual Task<StripeList<InvoicePayment>> ListAsync(InvoicePaymentListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
return this.RequestAsync<StripeList<InvoicePayment>>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoice_payments", options, requestOptions, cancellationToken);
}

/// <summary>
/// <p>When retrieving an invoice, there is an includable payments property containing the
/// first handful of those items. There is also a URL where you can retrieve the full
/// (paginated) list of payments.</p>.
/// </summary>
public virtual IEnumerable<InvoicePayment> ListAutoPaging(InvoicePaymentListOptions options = null, RequestOptions requestOptions = null)
{
return this.ListRequestAutoPaging<InvoicePayment>($"/v1/invoice_payments", options, requestOptions);
}

/// <summary>
/// <p>When retrieving an invoice, there is an includable payments property containing the
/// first handful of those items. There is also a URL where you can retrieve the full
/// (paginated) list of payments.</p>.
/// </summary>
public virtual IAsyncEnumerable<InvoicePayment> ListAutoPagingAsync(InvoicePaymentListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
return this.ListRequestAutoPagingAsync<InvoicePayment>($"/v1/invoice_payments", options, requestOptions, cancellationToken);
}
}
}
4 changes: 4 additions & 0 deletions src/Stripe.net/Services/V1Services.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class V1Services : Service
private FxQuoteService fxQuotes;
private IdentityService identity;
private InvoiceService invoices;
private InvoicePaymentService invoicePayments;
private InvoiceRenderingTemplateService invoiceRenderingTemplates;
private InvoiceItemService invoiceItems;
private IssuingService issuing;
Expand Down Expand Up @@ -205,6 +206,9 @@ internal V1Services(IStripeClient client)
public virtual InvoiceService Invoices => this.invoices ??= new InvoiceService(
this.Requestor);

public virtual InvoicePaymentService InvoicePayments => this.invoicePayments ??= new InvoicePaymentService(
this.Requestor);

public virtual InvoiceRenderingTemplateService InvoiceRenderingTemplates => this.invoiceRenderingTemplates ??= new InvoiceRenderingTemplateService(
this.Requestor);

Expand Down
Loading