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

API Updates #2633

Merged
merged 1 commit into from
Jan 19, 2023
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 @@
v217
v219
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe.Checkout
public class SessionCustomTextShippingAddress : StripeEntity<SessionCustomTextShippingAddress>
{
/// <summary>
/// Text may be up to 500 characters in length.
/// Text may be up to 1000 characters in length.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe.Checkout
public class SessionCustomTextSubmit : StripeEntity<SessionCustomTextSubmit>
{
/// <summary>
/// Text may be up to 500 characters in length.
/// Text may be up to 1000 characters in length.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
Expand Down
41 changes: 33 additions & 8 deletions src/Stripe.net/Entities/Discounts/Discount.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;

/// <summary>
/// A discount represents the actual application of a <a
/// href="https://stripe.com/docs/api#coupons">coupon</a> or <a
/// href="https://stripe.com/docs/api#promotion_codes">promotion code</a>. It contains
/// information about when the discount began, when it will end, and what it is applied to.
///
/// Related guide: <a
/// href="https://stripe.com/docs/billing/subscriptions/discounts">Applying Discounts to
/// Subscriptions</a>.
/// </summary>
public class Discount : StripeEntity<Discount>, IHasId, IHasObject
{
/// <summary>
/// Unique identifier for the object.
/// The ID of the discount object. Discounts cannot be fetched by ID. Use
/// <c>expand[]=discounts</c> in API calls to expand discount IDs in an array.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
Expand All @@ -26,7 +38,14 @@ public class Discount : StripeEntity<Discount>, IHasId, IHasObject
public string CheckoutSession { get; set; }

/// <summary>
/// Hash describing the coupon applied to create this discount.
/// A coupon contains information about a percent-off or amount-off discount you might want
/// to apply to a customer. Coupons may be applied to <a
/// href="https://stripe.com/docs/api#subscriptions">subscriptions</a>, <a
/// href="https://stripe.com/docs/api#invoices">invoices</a>, <a
/// href="https://stripe.com/docs/api/checkout/sessions">checkout sessions</a>, <a
/// href="https://stripe.com/docs/api#quotes">quotes</a>, and more. Coupons do not work with
/// conventional one-off <a href="https://stripe.com/docs/api#create_charge">charges</a> or
/// <a href="https://stripe.com/docs/api/payment_intents">payment intents</a>.
/// </summary>
[JsonProperty("coupon")]
public Coupon Coupon { get; set; }
Expand All @@ -47,6 +66,8 @@ public string CustomerId
/// <summary>
/// (Expanded)
/// The ID of the customer associated with this discount.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Customer Customer
Expand All @@ -67,24 +88,24 @@ public Customer Customer
public bool? Deleted { get; set; }

/// <summary>
/// If the coupon has a <c>duration</c> of <c>repeating</c>, the date that this discount
/// will end. If the coupon has a <c>duration</c> of <c>once</c> or forever, this attribute
/// will be null.
/// If the coupon has a duration of <c>repeating</c>, the date that this discount will end.
/// If the coupon has a duration of <c>once</c> or <c>forever</c>, this attribute will be
/// null.
/// </summary>
[JsonProperty("end")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime? End { get; set; }

/// <summary>
/// The invoice that the discounts coupon was applied to, if it was applied directly to a
/// The invoice that the discount's coupon was applied to, if it was applied directly to a
/// particular invoice.
/// </summary>
[JsonProperty("invoice")]
public string Invoice { get; set; }

/// <summary>
/// The invoice item id (or invoice line item id for invoice line items of
/// type=subscription) that the discounts coupon was applied to, if it was applied
/// The invoice item <c>id</c> (or invoice line item <c>id</c> for invoice line items of
/// type='subscription') that the discount's coupon was applied to, if it was applied
/// directly to a particular invoice item or invoice line item.
/// </summary>
[JsonProperty("invoice_item")]
Expand All @@ -106,6 +127,8 @@ public string PromotionCodeId
/// <summary>
/// (Expanded)
/// The promotion code applied to create this discount.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public PromotionCode PromotionCode
Expand Down Expand Up @@ -144,6 +167,8 @@ public string SubscriptionId
/// (Expanded)
/// The subscription that this coupon is applied to, if it is applied to a particular
/// subscription.
///
/// For more information, see the <a href="https://stripe.com/docs/expand">expand documentation</a>.
/// </summary>
[JsonIgnore]
public Subscription Subscription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe
public class PaymentLinkCustomTextShippingAddress : StripeEntity<PaymentLinkCustomTextShippingAddress>
{
/// <summary>
/// Text may be up to 500 characters in length.
/// Text may be up to 1000 characters in length.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe
public class PaymentLinkCustomTextSubmit : StripeEntity<PaymentLinkCustomTextSubmit>
{
/// <summary>
/// Text may be up to 500 characters in length.
/// Text may be up to 1000 characters in length.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe.Checkout
public class SessionCustomTextSubmitOptions : INestedOptions
{
/// <summary>
/// Text may be up to 500 characters in length.
/// Text may be up to 1000 characters in length.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@ public class EphemeralKeyCreateOptions : BaseOptions

[JsonIgnore]
public string StripeVersion { get; set; }

/// <summary>
/// The ID of the Identity VerificationSession you'd like to access using the resulting
/// ephemeral key.
/// </summary>
[JsonProperty("verification_session")]
public string VerificationSession { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe
public class PaymentLinkCustomTextSubmitOptions : INestedOptions
{
/// <summary>
/// Text may be up to 500 characters in length.
/// Text may be up to 1000 characters in length.
/// </summary>
[JsonProperty("message")]
public string Message { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class SubscriptionItemCreateOptions : BaseOptions, IHasMetadata
/// href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a>
/// when the billing cycle changes (e.g., when switching plans, resetting
/// <c>billing_cycle_anchor=now</c>, or starting a trial), or if an item's <c>quantity</c>
/// changes.
/// changes. The default value is <c>create_prorations</c>.
/// One of: <c>always_invoice</c>, <c>create_prorations</c>, or <c>none</c>.
/// </summary>
[JsonProperty("proration_behavior")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class SubscriptionItemDeleteOptions : BaseOptions
/// href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a>
/// when the billing cycle changes (e.g., when switching plans, resetting
/// <c>billing_cycle_anchor=now</c>, or starting a trial), or if an item's <c>quantity</c>
/// changes.
/// changes. The default value is <c>create_prorations</c>.
/// One of: <c>always_invoice</c>, <c>create_prorations</c>, or <c>none</c>.
/// </summary>
[JsonProperty("proration_behavior")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class SubscriptionItemUpdateOptions : BaseOptions, IHasMetadata
/// href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a>
/// when the billing cycle changes (e.g., when switching plans, resetting
/// <c>billing_cycle_anchor=now</c>, or starting a trial), or if an item's <c>quantity</c>
/// changes.
/// changes. The default value is <c>create_prorations</c>.
/// One of: <c>always_invoice</c>, <c>create_prorations</c>, or <c>none</c>.
/// </summary>
[JsonProperty("proration_behavior")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ public class SubscriptionSchedulePhaseOptions : INestedOptions, IHasMetadata
/// <summary>
/// Whether the subscription schedule will create <a
/// href="https://stripe.com/docs/billing/subscriptions/prorations">prorations</a> when
/// transitioning to this phase. The default value is <c>create_prorations</c>.
/// transitioning to this phase. The default value is <c>create_prorations</c>. This setting
/// controls prorations when a phase is started asynchronously and it is persisted as a
/// field on the phase. It's different from the request-level <a
/// href="https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior">proration_behavior</a>
/// parameter which controls what happens if the update request affects the billing
/// configuration of the current phase.
/// One of: <c>always_invoice</c>, <c>create_prorations</c>, or <c>none</c>.
/// </summary>
[JsonProperty("proration_behavior")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public class SubscriptionUpdateOptions : BaseOptions, IHasMetadata
/// href="https://stripe.com/docs/subscriptions/billing-cycle#prorations">prorations</a>
/// when the billing cycle changes (e.g., when switching plans, resetting
/// <c>billing_cycle_anchor=now</c>, or starting a trial), or if an item's <c>quantity</c>
/// changes.
/// changes. The default value is <c>create_prorations</c>.
/// One of: <c>always_invoice</c>, <c>create_prorations</c>, or <c>none</c>.
/// </summary>
[JsonProperty("proration_behavior")]
Expand Down