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

Update generated code (new) #2661

Merged
merged 8 commits into from
Mar 23, 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 @@
v263
v277
6 changes: 6 additions & 0 deletions src/Stripe.net/Entities/Checkout/Sessions/Session.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ public class Session : StripeEntity<Session>, IHasId, IHasMetadata, IHasObject
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// Currency conversion details for automatic currency conversion sessions.
/// </summary>
[JsonProperty("currency_conversion")]
public SessionCurrencyConversion CurrencyConversion { get; set; }

/// <summary>
/// Collect additional information from your customer using custom fields. Up to 2 fields
/// are supported.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// File generated from our OpenAPI spec
namespace Stripe.Checkout
{
using Newtonsoft.Json;

public class SessionCurrencyConversion : StripeEntity<SessionCurrencyConversion>
{
/// <summary>
/// Total of all items in source currency before discounts or taxes are applied.
/// </summary>
[JsonProperty("amount_subtotal")]
public long AmountSubtotal { get; set; }

/// <summary>
/// Total of all items in source currency after discounts and taxes are applied.
/// </summary>
[JsonProperty("amount_total")]
public long AmountTotal { get; set; }

/// <summary>
/// Exchange rate used to convert source currency amounts to customer currency amounts.
/// </summary>
[JsonProperty("fx_rate")]
public decimal FxRate { get; set; }

/// <summary>
/// Creation currency of the CheckoutSession before localization.
/// </summary>
[JsonProperty("source_currency")]
public string SourceCurrency { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class DisputeEvidenceDetails : StripeEntity<DisputeEvidenceDetails>
{
/// <summary>
/// Date by which evidence must be submitted in order to successfully challenge dispute.
/// Will be null if the customer's bank or credit card company doesn't allow a response for
/// Will be 0 if the customer's bank or credit card company doesn't allow a response for
/// this particular dispute.
/// </summary>
[JsonProperty("due_by")]
Expand Down
6 changes: 6 additions & 0 deletions src/Stripe.net/Entities/SetupIntents/SetupIntent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public Application Application
[JsonProperty("attach_to_self")]
public bool AttachToSelf { get; set; }

/// <summary>
/// Settings for automatic payment methods compatible with this Setup Intent.
/// </summary>
[JsonProperty("automatic_payment_methods")]
public SetupIntentAutomaticPaymentMethods AutomaticPaymentMethods { get; set; }

/// <summary>
/// Reason for cancellation of this SetupIntent, one of <c>abandoned</c>,
/// <c>requested_by_customer</c>, or <c>duplicate</c>.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// File generated from our OpenAPI spec
namespace Stripe
{
using Newtonsoft.Json;

public class SetupIntentAutomaticPaymentMethods : StripeEntity<SetupIntentAutomaticPaymentMethods>
{
/// <summary>
/// Automatically calculates compatible payment methods.
/// </summary>
[JsonProperty("enabled")]
public bool? Enabled { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// File generated from our OpenAPI spec
namespace Stripe.Tax
{
using System.Collections.Generic;
using Newtonsoft.Json;

public class CalculationLineItem : StripeEntity<CalculationLineItem>, IHasId, IHasObject
{
/// <summary>
/// Unique identifier for the object.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// String representing the object's type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }

/// <summary>
/// The line item amount in integer cents. If <c>tax_behavior=inclusive</c>, then this
/// amount includes taxes. Otherwise, taxes were calculated on top of this amount.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }

/// <summary>
/// The amount of tax calculated for this line item, in integer cents.
/// </summary>
[JsonProperty("amount_tax")]
public long AmountTax { get; set; }

/// <summary>
/// Has the value <c>true</c> if the object exists in live mode or the value <c>false</c> if
/// the object exists in test mode.
/// </summary>
[JsonProperty("livemode")]
public bool Livemode { get; set; }

/// <summary>
/// A Product ID.
/// </summary>
[JsonProperty("product")]
public string Product { get; set; }

/// <summary>
/// The number of units of the item being purchased. For reversals, this is the quantity
/// reversed.
/// </summary>
[JsonProperty("quantity")]
public long Quantity { get; set; }

/// <summary>
/// A custom identifier for this line item.
/// </summary>
[JsonProperty("reference")]
public string Reference { get; set; }

/// <summary>
/// Specifies whether the <c>amount</c> includes taxes. If <c>tax_behavior=inclusive</c>,
/// then the amount includes taxes.
/// One of: <c>exclusive</c>, or <c>inclusive</c>.
/// </summary>
[JsonProperty("tax_behavior")]
public string TaxBehavior { get; set; }

/// <summary>
/// Detailed account of taxes relevant to this line item.
/// </summary>
[JsonProperty("tax_breakdown")]
public List<CalculationLineItemTaxBreakdown> TaxBreakdown { get; set; }

/// <summary>
/// The <a href="https://stripe.com/docs/tax/tax-categories">tax code</a> ID used for this
/// resource.
/// </summary>
[JsonProperty("tax_code")]
public string TaxCode { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// File generated from our OpenAPI spec
namespace Stripe.Tax
{
using Newtonsoft.Json;

public class CalculationLineItemTaxBreakdown : StripeEntity<CalculationLineItemTaxBreakdown>
{
/// <summary>
/// The amount of tax, in integer cents.
/// </summary>
[JsonProperty("amount")]
public long Amount { get; set; }

[JsonProperty("jurisdiction")]
public CalculationLineItemTaxBreakdownJurisdiction Jurisdiction { get; set; }

/// <summary>
/// Indicates whether the jurisdiction was determined by the origin (merchant's address) or
/// destination (customer's address).
/// One of: <c>destination</c>, or <c>origin</c>.
/// </summary>
[JsonProperty("sourcing")]
public string Sourcing { get; set; }

/// <summary>
/// Details regarding the rate for this tax. This field will be <c>null</c> when the tax is
/// not imposed, for example if the product is exempt from tax.
/// </summary>
[JsonProperty("tax_rate_details")]
public CalculationLineItemTaxBreakdownTaxRateDetails TaxRateDetails { get; set; }

/// <summary>
/// The reasoning behind this tax, for example, if the product is tax exempt. The possible
/// values for this field may be extended as new tax rules are supported.
/// One of: <c>customer_exempt</c>, <c>not_collecting</c>, <c>not_subject_to_tax</c>,
/// <c>not_supported</c>, <c>portion_product_exempt</c>, <c>portion_reduced_rated</c>,
/// <c>portion_standard_rated</c>, <c>product_exempt</c>, <c>product_exempt_holiday</c>,
/// <c>proportionally_rated</c>, <c>reduced_rated</c>, <c>reverse_charge</c>,
/// <c>standard_rated</c>, <c>taxable_basis_reduced</c>, or <c>zero_rated</c>.
/// </summary>
[JsonProperty("taxability_reason")]
public string TaxabilityReason { get; set; }

/// <summary>
/// The amount on which tax is calculated, in integer cents.
/// </summary>
[JsonProperty("taxable_amount")]
public long TaxableAmount { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// File generated from our OpenAPI spec
namespace Stripe.Tax
{
using Newtonsoft.Json;

public class CalculationLineItemTaxBreakdownJurisdiction : StripeEntity<CalculationLineItemTaxBreakdownJurisdiction>
{
/// <summary>
/// Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO
/// 3166-1 alpha-2</a>).
/// </summary>
[JsonProperty("country")]
public string Country { get; set; }

/// <summary>
/// A human-readable name for the jurisdiction imposing the tax.
/// </summary>
[JsonProperty("display_name")]
public string DisplayName { get; set; }

/// <summary>
/// Indicates the level of the jurisdiction imposing the tax.
/// One of: <c>city</c>, <c>country</c>, <c>county</c>, <c>district</c>, or <c>state</c>.
/// </summary>
[JsonProperty("level")]
public string Level { get; set; }

/// <summary>
/// <a href="https://en.wikipedia.org/wiki/ISO_3166-2:US">ISO 3166-2 subdivision code</a>,
/// without country prefix. For example, "NY" for New York, United States.
/// </summary>
[JsonProperty("state")]
public string State { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// File generated from our OpenAPI spec
namespace Stripe.Tax
{
using Newtonsoft.Json;

public class CalculationLineItemTaxBreakdownTaxRateDetails : StripeEntity<CalculationLineItemTaxBreakdownTaxRateDetails>
{
/// <summary>
/// A localized display name for tax type, intended to be human-readable. For example,
/// "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)".
/// </summary>
[JsonProperty("display_name")]
public string DisplayName { get; set; }

/// <summary>
/// The tax rate percentage as a string. For example, 8.5% is represented as "8.5".
/// </summary>
[JsonProperty("percentage_decimal")]
public string PercentageDecimal { get; set; }

/// <summary>
/// The tax type, such as <c>vat</c> or <c>sales_tax</c>.
/// One of: <c>gst</c>, <c>hst</c>, <c>igst</c>, <c>jct</c>, <c>lease_tax</c>, <c>pst</c>,
/// <c>qst</c>, <c>rst</c>, <c>sales_tax</c>, or <c>vat</c>.
/// </summary>
[JsonProperty("tax_type")]
public string TaxType { get; set; }
}
}
102 changes: 102 additions & 0 deletions src/Stripe.net/Entities/Tax/Calculations/Calculation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// File generated from our OpenAPI spec
namespace Stripe.Tax
{
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Stripe.Infrastructure;

/// <summary>
/// A Tax <c>Calculation</c> allows you to calculate the tax to collect from your customer.
/// </summary>
public class Calculation : StripeEntity<Calculation>, IHasId, IHasObject
{
/// <summary>
/// Unique identifier for the calculation.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// String representing the object's type. Objects of the same type share the same value.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }

/// <summary>
/// Total after taxes.
/// </summary>
[JsonProperty("amount_total")]
public long AmountTotal { get; set; }

/// <summary>
/// Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
/// code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
/// currency</a>.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// The ID of an existing <a
/// href="https://stripe.com/docs/api/customers/object">Customer</a> used for the resource.
/// </summary>
[JsonProperty("customer")]
public string Customer { get; set; }

[JsonProperty("customer_details")]
public CalculationCustomerDetails CustomerDetails { get; set; }

/// <summary>
/// Timestamp of date at which the tax calculation will expire.
/// </summary>
[JsonProperty("expires_at")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime? ExpiresAt { get; set; }

/// <summary>
/// The list of items the customer is purchasing.
/// </summary>
[JsonProperty("line_items")]
public StripeList<CalculationLineItem> LineItems { get; set; }

/// <summary>
/// Has the value <c>true</c> if the object exists in live mode or the value <c>false</c> if
/// the object exists in test mode.
/// </summary>
[JsonProperty("livemode")]
public bool Livemode { get; set; }

/// <summary>
/// The shipping cost details for the calculation.
/// </summary>
[JsonProperty("shipping_cost")]
public CalculationShippingCost ShippingCost { get; set; }

/// <summary>
/// The amount of tax to be collected on top of the line item prices.
/// </summary>
[JsonProperty("tax_amount_exclusive")]
public long TaxAmountExclusive { get; set; }

/// <summary>
/// The amount of tax already included in the line item prices.
/// </summary>
[JsonProperty("tax_amount_inclusive")]
public long TaxAmountInclusive { get; set; }

/// <summary>
/// Breakdown of individual tax amounts that add up to the total.
/// </summary>
[JsonProperty("tax_breakdown")]
public List<CalculationTaxBreakdown> TaxBreakdown { get; set; }

/// <summary>
/// Timestamp of date at which the tax rules and rates in effect applies for the
/// calculation.
/// </summary>
[JsonProperty("tax_date")]
[JsonConverter(typeof(UnixDateTimeConverter))]
public DateTime TaxDate { get; set; } = Stripe.Infrastructure.DateTimeUtils.UnixEpoch;
}
}
Loading