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 for beta branch #1483

Merged
merged 3 commits into from
Jul 21, 2022
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 @@
v166
v170
1 change: 1 addition & 0 deletions lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
Products: require('./resources/Products'),
PromotionCodes: require('./resources/PromotionCodes'),
Quotes: require('./resources/Quotes'),
QuotePhases: require('./resources/QuotePhases'),
Refunds: require('./resources/Refunds'),
Reviews: require('./resources/Reviews'),
SetupAttempts: require('./resources/SetupAttempts'),
Expand Down
27 changes: 27 additions & 0 deletions lib/resources/QuotePhases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// File generated from our OpenAPI spec

'use strict';

const StripeResource = require('../StripeResource');
const stripeMethod = StripeResource.method;

module.exports = StripeResource.extend({
path: 'quote_phases',

retrieve: stripeMethod({
method: 'GET',
path: '/{quotePhase}',
}),

list: stripeMethod({
method: 'GET',
path: '',
methodType: 'list',
}),

listLineItems: stripeMethod({
method: 'GET',
path: '/{quotePhase}/line_items',
methodType: 'list',
}),
});
12 changes: 12 additions & 0 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ declare module 'stripe' {
*/
currency: string | null;

/**
* The default three-letter [ISO code for the currency](https://stripe.com/docs/currencies) that the customer will be charged in for billing purposes.
*/
default_currency?: string | null;

/**
* ID of the default payment source for the customer.
*
Expand Down Expand Up @@ -72,6 +77,13 @@ declare module 'stripe' {
*/
email: string | null;

/**
* The current multi-currency balances, if any, being stored on the customer.If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency.If negative, the customer has an amount owed that will be added to their next invoice denominated in that currency. These balances do not refer to any unpaid invoices.They solely track amounts that have yet to be successfully applied to any invoice. A balance in a particular currency is only applied to any invoice as an invoice in that currency is finalized.
*/
invoice_credit_balance?: {
[key: string]: number;
};

/**
* The prefix for the customer used to generate unique invoice numbers.
*/
Expand Down
25 changes: 25 additions & 0 deletions types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,11 @@ declare module 'stripe' {
}

interface PaymentSettings {
/**
* ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
*/
default_mandate: string | null;

/**
* Payment-method-specific configuration to provide to the invoice's PaymentIntent.
*/
Expand Down Expand Up @@ -936,6 +941,11 @@ declare module 'stripe' {
*/
collection_method?: InvoiceCreateParams.CollectionMethod;

/**
* The currency to create this invoice in. Defaults to that of `customer` if not specified.
*/
currency?: string;

/**
* A list of up to 4 custom fields to be displayed on the invoice.
*/
Expand Down Expand Up @@ -1069,6 +1079,11 @@ declare module 'stripe' {
}

interface PaymentSettings {
/**
* ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
*/
default_mandate?: string;

/**
* Payment-method-specific configuration to provide to the invoice's PaymentIntent.
*/
Expand Down Expand Up @@ -1445,6 +1460,11 @@ declare module 'stripe' {
}

interface PaymentSettings {
/**
* ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
*/
default_mandate?: string;

/**
* Payment-method-specific configuration to provide to the invoice's PaymentIntent.
*/
Expand Down Expand Up @@ -1736,6 +1756,11 @@ declare module 'stripe' {
*/
forgive?: boolean;

/**
* ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set.
*/
mandate?: string;

/**
* Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session).
*/
Expand Down
226 changes: 226 additions & 0 deletions types/2020-08-27/QuotePhases.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
/**
* The QuotePhase object.
*/
interface QuotePhase {
/**
* Unique identifier for the object.
*/
id: string;

/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'quote_phase';

/**
* Total before any discounts or taxes are applied.
*/
amount_subtotal: number;

/**
* Total after discounts and taxes are applied.
*/
amount_total: number;

/**
* If set to `new`, the billing_cycle_anchor of the subscription is set to the start of the phase when entering the phase. If unset, then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).
*/
billing_cycle_anchor: 'reset' | null;

/**
* Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.
*/
collection_method: QuotePhase.CollectionMethod | null;

/**
* The default tax rates to apply to the subscription during this phase of the quote.
*/
default_tax_rates?: Array<string | Stripe.TaxRate>;

/**
* The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts.
*/
discounts: Array<string | Stripe.Discount>;

/**
* The end of this phase of the quote
*/
end_date: number | null;

/**
* The invoice settings applicable during this phase.
*/
invoice_settings: QuotePhase.InvoiceSettings | null;

/**
* Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`.
*/
iterations: number | null;

/**
* A list of items the customer is being quoted for.
*/
line_items?: ApiList<Stripe.LineItem>;

/**
* If the quote will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`.
*/
proration_behavior: QuotePhase.ProrationBehavior;

total_details: QuotePhase.TotalDetails;

/**
* If set to true the entire phase is counted as a trial and the customer will not be charged for any recurring fees.
*/
trial: boolean | null;

/**
* When the trial ends within the phase.
*/
trial_end: number | null;
}

namespace QuotePhase {
type CollectionMethod = 'charge_automatically' | 'send_invoice';

interface InvoiceSettings {
/**
* Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.
*/
days_until_due: number | null;
}

type ProrationBehavior = 'always_invoice' | 'create_prorations' | 'none';

interface TotalDetails {
/**
* This is the sum of all the discounts.
*/
amount_discount: number;

/**
* This is the sum of all the shipping amounts.
*/
amount_shipping: number | null;

/**
* This is the sum of all the tax amounts.
*/
amount_tax: number;

breakdown?: TotalDetails.Breakdown;
}

namespace TotalDetails {
interface Breakdown {
/**
* The aggregated discounts.
*/
discounts: Array<Breakdown.Discount>;

/**
* The aggregated tax amounts by rate.
*/
taxes: Array<Breakdown.Tax>;
}

namespace Breakdown {
interface Discount {
/**
* The amount discounted.
*/
amount: number;

/**
* A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes).
* It contains information about when the discount began, when it will end, and what it is applied to.
*
* Related guide: [Applying Discounts to Subscriptions](https://stripe.com/docs/billing/subscriptions/discounts).
*/
discount: Stripe.Discount;
}

interface Tax {
/**
* Amount of tax applied for this rate.
*/
amount: number;

/**
* Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.
*
* Related guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates).
*/
rate: Stripe.TaxRate;
}
}
}
}

interface QuotePhaseRetrieveParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface QuotePhaseListParams extends PaginationParams {
/**
* The ID of the quote whose phases will be retrieved.
*/
quote: string;

/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

interface QuotePhaseListLineItemsParams extends PaginationParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}

class QuotePhasesResource {
/**
* Retrieves the quote phase with the given ID.
*/
retrieve(
id: string,
params?: QuotePhaseRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.QuotePhase>>;
retrieve(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.QuotePhase>>;

/**
* Returns a list of quote phases.
*/
list(
params: QuotePhaseListParams,
options?: RequestOptions
): ApiListPromise<Stripe.QuotePhase>;

/**
* When retrieving a quote phase, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
*/
listLineItems(
id: string,
params?: QuotePhaseListLineItemsParams,
options?: RequestOptions
): ApiListPromise<Stripe.LineItem>;
listLineItems(
id: string,
options?: RequestOptions
): ApiListPromise<Stripe.LineItem>;
}
}
}
Loading