Skip to content

Commit

Permalink
Codegen for openapi v226
Browse files Browse the repository at this point in the history
  • Loading branch information
anniel-stripe committed Feb 16, 2023
1 parent c14c703 commit 0156d24
Show file tree
Hide file tree
Showing 46 changed files with 862 additions and 67 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v223
v226
12 changes: 8 additions & 4 deletions src/Stripe.net/Entities/Accounts/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ namespace Stripe

/// <summary>
/// This is an object representing a Stripe account. You can retrieve it to see properties
/// on the account like its current e-mail address or if the account is enabled yet to make
/// live charges.
/// on the account like its current requirements or if the account is enabled to make live
/// charges or receive payouts.
///
/// Some properties, marked below, are available only to platforms that want to <a
/// href="https://stripe.com/docs/connect/accounts">create and manage Express or Custom
/// For Custom accounts, the properties below are always returned. For other accounts, some
/// properties are returned until that account has started to go through Connect Onboarding.
/// Once you create an <a href="https://stripe.com/docs/api/account_links">Account Link</a>
/// for a Standard or Express account, some parameters are no longer returned. These are
/// marked as <strong>Custom Only</strong> or <strong>Custom and Express</strong> below.
/// Learn about the differences <a href="https://stripe.com/docs/connect/accounts">between
/// accounts</a>.
/// </summary>
public class Account : StripeEntity<Account>, IHasId, IHasMetadata, IHasObject, IPaymentSource
Expand Down
4 changes: 3 additions & 1 deletion src/Stripe.net/Entities/BillingPortal/Sessions/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public Configuration Configuration
public string Customer { get; set; }

/// <summary>
/// Information about a specific flow for the customer to go through.
/// Information about a specific flow for the customer to go through. See the <a
/// href="https://stripe.com/docs/customer-management/portal-deep-links">docs</a> to learn
/// more about using customer portal deep links and flows.
/// </summary>
[JsonProperty("flow")]
public SessionFlow Flow { get; set; }
Expand Down
12 changes: 9 additions & 3 deletions src/Stripe.net/Entities/Checkout/Sessions/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Stripe.Checkout
/// href="https://stripe.com/docs/api/payment_intents">PaymentIntent</a> or an active <a
/// href="https://stripe.com/docs/api/subscriptions">Subscription</a>.
///
/// You can create a Checkout Session on your server and pass its ID to the client to begin
/// You can create a Checkout Session on your server and redirect to its URL to begin
/// Checkout.
///
/// Related guide: <a href="https://stripe.com/docs/checkout/quickstart">Checkout
Expand All @@ -27,8 +27,7 @@ namespace Stripe.Checkout
public class Session : StripeEntity<Session>, IHasId, IHasMetadata, IHasObject
{
/// <summary>
/// Unique identifier for the object. Used to pass to <c>redirectToCheckout</c> in
/// Stripe.js.
/// Unique identifier for the object.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
Expand Down Expand Up @@ -115,6 +114,13 @@ public class Session : StripeEntity<Session>, IHasId, IHasMetadata, IHasObject
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// Collect additional information from your customer using custom fields. Up to 2 fields
/// are supported.
/// </summary>
[JsonProperty("custom_fields")]
public List<SessionCustomField> CustomFields { get; set; }

[JsonProperty("custom_text")]
public SessionCustomText CustomText { get; set; }

Expand Down
50 changes: 50 additions & 0 deletions src/Stripe.net/Entities/Checkout/Sessions/SessionCustomField.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// File generated from our OpenAPI spec
namespace Stripe.Checkout
{
using Newtonsoft.Json;

public class SessionCustomField : StripeEntity<SessionCustomField>
{
/// <summary>
/// Configuration for <c>type=dropdown</c> fields.
/// </summary>
[JsonProperty("dropdown")]
public SessionCustomFieldDropdown Dropdown { get; set; }

/// <summary>
/// String of your choice that your integration can use to reconcile this field. Must be
/// unique to this field, alphanumeric, and up to 200 characters.
/// </summary>
[JsonProperty("key")]
public string Key { get; set; }

[JsonProperty("label")]
public SessionCustomFieldLabel Label { get; set; }

/// <summary>
/// Configuration for <c>type=numeric</c> fields.
/// </summary>
[JsonProperty("numeric")]
public SessionCustomFieldNumeric Numeric { get; set; }

/// <summary>
/// Whether the customer is required to complete the field before completing the Checkout
/// Session. Defaults to <c>false</c>.
/// </summary>
[JsonProperty("optional")]
public bool Optional { get; set; }

/// <summary>
/// Configuration for <c>type=text</c> fields.
/// </summary>
[JsonProperty("text")]
public SessionCustomFieldText Text { get; set; }

/// <summary>
/// The type of the field.
/// One of: <c>dropdown</c>, <c>numeric</c>, or <c>text</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// File generated from our OpenAPI spec
namespace Stripe.Checkout
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class SessionCustomFieldDropdown : StripeEntity<SessionCustomFieldDropdown>
{
/// <summary>
/// The options available for the customer to select. Up to 200 options allowed.
/// </summary>
[JsonProperty("options")]
public List<SessionCustomFieldDropdownOption> Options { get; set; }

/// <summary>
/// The option selected by the customer. This will be the <c>value</c> for the option.
/// </summary>
[JsonProperty("value")]
public string Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// File generated from our OpenAPI spec
namespace Stripe.Checkout
{
using Newtonsoft.Json;

public class SessionCustomFieldDropdownOption : StripeEntity<SessionCustomFieldDropdownOption>
{
/// <summary>
/// The label for the option, displayed to the customer. Up to 100 characters.
/// </summary>
[JsonProperty("label")]
public string Label { get; set; }

/// <summary>
/// The value for this option, not displayed to the customer, used by your integration to
/// reconcile the option selected by the customer. Must be unique to this option,
/// alphanumeric, and up to 100 characters.
/// </summary>
[JsonProperty("value")]
public string Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// File generated from our OpenAPI spec
namespace Stripe.Checkout
{
using Newtonsoft.Json;

public class SessionCustomFieldLabel : StripeEntity<SessionCustomFieldLabel>
{
/// <summary>
/// Custom text for the label, displayed to the customer. Up to 50 characters.
/// </summary>
[JsonProperty("custom")]
public string Custom { get; set; }

/// <summary>
/// The type of the label.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
namespace Stripe.Checkout
{
using Newtonsoft.Json;

public class SessionCustomFieldNumeric : StripeEntity<SessionCustomFieldNumeric>
{
/// <summary>
/// The value entered by the customer, containing only digits.
/// </summary>
[JsonProperty("value")]
public string Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
namespace Stripe.Checkout
{
using Newtonsoft.Json;

public class SessionCustomFieldText : StripeEntity<SessionCustomFieldText>
{
/// <summary>
/// The value entered by the customer.
/// </summary>
[JsonProperty("value")]
public string Value { get; set; }
}
}
21 changes: 16 additions & 5 deletions src/Stripe.net/Entities/InvoiceItems/InvoiceItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ namespace Stripe
using Stripe.Infrastructure;

/// <summary>
/// Sometimes you want to add a charge or credit to a customer, but actually charge or
/// credit the customer's card only at the end of a regular billing cycle. This is useful
/// for combining several charges (to minimize per-transaction fees), or for having Stripe
/// tabulate your usage-based billing totals.
/// Invoice Items represent the component lines of an <a
/// href="https://stripe.com/docs/api/invoices">invoice</a>. An invoice item is added to an
/// invoice by creating or updating it with an <c>invoice</c> field, at which point it will
/// be included as <a href="https://stripe.com/docs/api/invoices/line_item">an invoice line
/// item</a> within <a
/// href="https://stripe.com/docs/api/invoices/object#invoice_object-lines">invoice.lines</a>.
///
/// Related guide: <a
/// Invoice Items can be created before you are ready to actually send the invoice. This can
/// be particularly useful when combined with a <a
/// href="https://stripe.com/docs/api/subscriptions">subscription</a>. Sometimes you want to
/// add a charge or credit to a customer, but actually charge or credit the customer’s card
/// only at the end of a regular billing cycle. This is useful for combining several charges
/// (to minimize per-transaction fees), or for having Stripe tabulate your usage-based
/// billing totals.
///
/// Related guides: <a href="https://stripe.com/docs/invoicing/integration">Integrate with
/// the Invoicing API</a>, <a
/// href="https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items">Subscription
/// Invoices</a>.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Stripe.net/Entities/InvoiceLineItems/InvoiceLineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ public List<Discount> Discounts
public string Subscription { get; set; }

/// <summary>
/// The subscription item that generated this invoice item. Left empty if the line item is
/// not an explicit result of a subscription.
/// The subscription item that generated this line item. Left empty if the line item is not
/// an explicit result of a subscription.
/// </summary>
[JsonProperty("subscription_item")]
public string SubscriptionItem { get; set; }
Expand Down
4 changes: 3 additions & 1 deletion src/Stripe.net/Entities/Invoices/Invoice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@ public Invoice LatestRevision

/// <summary>
/// The individual line items that make up the invoice. <c>lines</c> is sorted as follows:
/// invoice items in reverse chronological order, followed by the subscription, if any.
/// (1) pending invoice items (including prorations) in reverse chronological order, (2)
/// subscription items in reverse chronological order, and (3) invoice items added after
/// invoice creation in chronological order.
/// </summary>
[JsonProperty("lines")]
public StripeList<InvoiceLineItem> Lines { get; set; }
Expand Down
7 changes: 7 additions & 0 deletions src/Stripe.net/Entities/PaymentLinks/PaymentLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ public class PaymentLink : StripeEntity<PaymentLink>, IHasId, IHasMetadata, IHas
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// Collect additional information from your customer using custom fields. Up to 2 fields
/// are supported.
/// </summary>
[JsonProperty("custom_fields")]
public List<PaymentLinkCustomField> CustomFields { get; set; }

[JsonProperty("custom_text")]
public PaymentLinkCustomText CustomText { get; set; }

Expand Down
38 changes: 38 additions & 0 deletions src/Stripe.net/Entities/PaymentLinks/PaymentLinkCustomField.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class PaymentLinkCustomField : StripeEntity<PaymentLinkCustomField>
{
/// <summary>
/// Configuration for <c>type=dropdown</c> fields.
/// </summary>
[JsonProperty("dropdown")]
public PaymentLinkCustomFieldDropdown Dropdown { get; set; }

/// <summary>
/// String of your choice that your integration can use to reconcile this field. Must be
/// unique to this field, alphanumeric, and up to 200 characters.
/// </summary>
[JsonProperty("key")]
public string Key { get; set; }

[JsonProperty("label")]
public PaymentLinkCustomFieldLabel Label { get; set; }

/// <summary>
/// Whether the customer is required to complete the field before completing the Checkout
/// Session. Defaults to <c>false</c>.
/// </summary>
[JsonProperty("optional")]
public bool Optional { get; set; }

/// <summary>
/// The type of the field.
/// One of: <c>dropdown</c>, <c>numeric</c>, or <c>text</c>.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class PaymentLinkCustomFieldDropdown : StripeEntity<PaymentLinkCustomFieldDropdown>
{
/// <summary>
/// The options available for the customer to select. Up to 200 options allowed.
/// </summary>
[JsonProperty("options")]
public List<PaymentLinkCustomFieldDropdownOption> Options { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class PaymentLinkCustomFieldDropdownOption : StripeEntity<PaymentLinkCustomFieldDropdownOption>
{
/// <summary>
/// The label for the option, displayed to the customer. Up to 100 characters.
/// </summary>
[JsonProperty("label")]
public string Label { get; set; }

/// <summary>
/// The value for this option, not displayed to the customer, used by your integration to
/// reconcile the option selected by the customer. Must be unique to this option,
/// alphanumeric, and up to 100 characters.
/// </summary>
[JsonProperty("value")]
public string Value { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class PaymentLinkCustomFieldLabel : StripeEntity<PaymentLinkCustomFieldLabel>
{
/// <summary>
/// Custom text for the label, displayed to the customer. Up to 50 characters.
/// </summary>
[JsonProperty("custom")]
public string Custom { get; set; }

/// <summary>
/// The type of the label.
/// </summary>
[JsonProperty("type")]
public string Type { get; set; }
}
}
4 changes: 3 additions & 1 deletion src/Stripe.net/Entities/Refunds/Refund.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ public BalanceTransaction FailureBalanceTransaction

/// <summary>
/// If the refund failed, the reason for refund failure if known. Possible values are
/// <c>lost_or_stolen_card</c>, <c>expired_or_canceled_card</c>, or <c>unknown</c>.
/// <c>lost_or_stolen_card</c>, <c>expired_or_canceled_card</c>,
/// <c>charge_for_pending_refund_disputed</c>, <c>insufficient_funds</c>, <c>declined</c>,
/// <c>merchant_request</c> or <c>unknown</c>.
/// </summary>
[JsonProperty("failure_reason")]
public string FailureReason { get; set; }
Expand Down
Loading

0 comments on commit 0156d24

Please sign in to comment.