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 for beta #2126

Merged
merged 10 commits into from
Jul 5, 2024
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1104
v1116
2 changes: 2 additions & 0 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {FinancingTransactions as CapitalFinancingTransactions} from './resources
import {Forms as TaxForms} from './resources/Tax/Forms.js';
import {InboundTransfers as TestHelpersTreasuryInboundTransfers} from './resources/TestHelpers/Treasury/InboundTransfers.js';
import {InboundTransfers as TreasuryInboundTransfers} from './resources/Treasury/InboundTransfers.js';
import {Institutions as FinancialConnectionsInstitutions} from './resources/FinancialConnections/Institutions.js';
import {Locations as TerminalLocations} from './resources/Terminal/Locations.js';
import {MeterEventAdjustments as BillingMeterEventAdjustments} from './resources/Billing/MeterEventAdjustments.js';
import {MeterEvents as BillingMeterEvents} from './resources/Billing/MeterEvents.js';
Expand Down Expand Up @@ -157,6 +158,7 @@ export const Entitlements = resourceNamespace('entitlements', {
});
export const FinancialConnections = resourceNamespace('financialConnections', {
Accounts: FinancialConnectionsAccounts,
Institutions: FinancialConnectionsInstitutions,
Sessions: FinancialConnectionsSessions,
Transactions: FinancialConnectionsTransactions,
});
Expand Down
15 changes: 15 additions & 0 deletions src/resources/FinancialConnections/Institutions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec

import {StripeResource} from '../../StripeResource.js';
const stripeMethod = StripeResource.method;
export const Institutions = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/institutions/{institution}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/institutions',
methodType: 'list',
}),
});
4 changes: 2 additions & 2 deletions types/Billing/MeterEventSummaries.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare module 'stripe' {
aggregated_value: number;

/**
* End timestamp for this event summary (inclusive).
* End timestamp for this event summary (exclusive). Must be aligned with minute boundaries.
*/
end_time: number;

Expand All @@ -39,7 +39,7 @@ declare module 'stripe' {
meter: string;

/**
* Start timestamp for this event summary (inclusive).
* Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries.
*/
start_time: number;
}
Expand Down
4 changes: 2 additions & 2 deletions types/Billing/MetersResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ declare module 'stripe' {
customer: string;

/**
* The timestamp from when to stop aggregating meter events (exclusive).
* The timestamp from when to stop aggregating meter events (exclusive). Must be aligned with minute boundaries.
*/
end_time: number;

/**
* The timestamp from when to start aggregating meter events (inclusive).
* The timestamp from when to start aggregating meter events (inclusive). Must be aligned with minute boundaries.
*/
start_time: number;

Expand Down
5 changes: 5 additions & 0 deletions types/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,11 @@ declare module 'stripe' {
* The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`.
*/
account_subcategories?: Array<Filters.AccountSubcategory>;

/**
* The institution to use to filter for possible accounts to link.
*/
institution?: string;
}

namespace Filters {
Expand Down
56 changes: 42 additions & 14 deletions types/CustomerSessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
declare module 'stripe' {
namespace Stripe {
/**
* A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)
* control over a customer.
* A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
* control over a Customer.
*/
interface CustomerSession {
/**
Expand All @@ -13,14 +13,14 @@ declare module 'stripe' {
object: 'customer_session';

/**
* The client secret of this customer session. Used on the client to set up secure access to the given `customer`.
* The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`.
*
* The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.
*/
client_secret: string;

/**
* Configuration for the components supported by this customer session.
* Configuration for the components supported by this Customer Session.
*/
components?: CustomerSession.Components;

Expand All @@ -30,12 +30,12 @@ declare module 'stripe' {
created: number;

/**
* The customer the customer session was created for.
* The Customer the Customer Session was created for.
*/
customer: string | Stripe.Customer;

/**
* The timestamp at which this customer session will expire.
* The timestamp at which this Customer Session will expire.
*/
expires_at: number;

Expand All @@ -53,7 +53,7 @@ declare module 'stripe' {
buy_button: Components.BuyButton;

/**
* This hash contains whether the payment element is enabled and the features it supports.
* This hash contains whether the Payment Element is enabled and the features it supports.
*/
payment_element?: Components.PaymentElement;

Expand All @@ -73,44 +73,72 @@ declare module 'stripe' {

interface PaymentElement {
/**
* Whether the payment element is enabled.
* Whether the Payment Element is enabled.
*/
enabled: boolean;

/**
* This hash defines whether the payment element supports certain features.
* This hash defines whether the Payment Element supports certain features.
*/
features: PaymentElement.Features | null;
}

namespace PaymentElement {
interface Features {
/**
* Controls whether the Payment Element displays the option to remove a saved payment method."
* A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.
*
* If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
*/
payment_method_allow_redisplay_filters: Array<
Features.PaymentMethodAllowRedisplayFilter
>;

/**
* Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`.
*/
payment_method_redisplay: Features.PaymentMethodRedisplay;

/**
* Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`.
*/
payment_method_redisplay_limit: number | null;

/**
* Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`.
*
* Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
*/
payment_method_remove: Features.PaymentMethodRemove;

/**
* Controls whether the Payment Element displays a checkbox offering to save a new payment method.
* Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`.
*
* If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`.
*/
payment_method_save: Features.PaymentMethodSave;

/**
* Controls whether the Payment Element displays the option to update a saved payment method.
* When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent.
*
* When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation.
*/
payment_method_update: Features.PaymentMethodUpdate;
payment_method_save_usage: Features.PaymentMethodSaveUsage | null;
}

namespace Features {
type PaymentMethodAllowRedisplayFilter =
| 'always'
| 'limited'
| 'unspecified';

type PaymentMethodRedisplay = 'disabled' | 'enabled';

type PaymentMethodRemove = 'disabled' | 'enabled';

type PaymentMethodSave = 'disabled' | 'enabled';

type PaymentMethodUpdate = 'disabled' | 'enabled';
type PaymentMethodSaveUsage = 'off_session' | 'on_session';
}
}

Expand Down
48 changes: 38 additions & 10 deletions types/CustomerSessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare module 'stripe' {
components: CustomerSessionCreateParams.Components;

/**
* The ID of an existing customer for which to create the customer session.
* The ID of an existing customer for which to create the Customer Session.
*/
customer: string;

Expand All @@ -27,7 +27,7 @@ declare module 'stripe' {
buy_button?: Components.BuyButton;

/**
* Configuration for the payment element.
* Configuration for the Payment Element.
*/
payment_element?: Components.PaymentElement;

Expand All @@ -47,44 +47,72 @@ declare module 'stripe' {

interface PaymentElement {
/**
* Whether the payment element is enabled.
* Whether the Payment Element is enabled.
*/
enabled: boolean;

/**
* This hash defines whether the payment element supports certain features.
* This hash defines whether the Payment Element supports certain features.
*/
features?: PaymentElement.Features;
}

namespace PaymentElement {
interface Features {
/**
* Controls whether the Payment Element displays the option to remove a saved payment method."
* A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list.
*
* If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
*/
payment_method_allow_redisplay_filters?: Array<
Features.PaymentMethodAllowRedisplayFilter
>;

/**
* Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`.
*/
payment_method_redisplay?: Features.PaymentMethodRedisplay;

/**
* Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `10`.
*/
payment_method_redisplay_limit?: number;

/**
* Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`.
*
* Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods).
*/
payment_method_remove?: Features.PaymentMethodRemove;

/**
* Controls whether the Payment Element displays a checkbox offering to save a new payment method.
* Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`.
*
* If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`.
*/
payment_method_save?: Features.PaymentMethodSave;

/**
* Controls whether the Payment Element displays the option to update a saved payment method.
* When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent.
*
* When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation.
*/
payment_method_update?: Features.PaymentMethodUpdate;
payment_method_save_usage?: Features.PaymentMethodSaveUsage;
}

namespace Features {
type PaymentMethodAllowRedisplayFilter =
| 'always'
| 'limited'
| 'unspecified';

type PaymentMethodRedisplay = 'disabled' | 'enabled';

type PaymentMethodRemove = 'disabled' | 'enabled';

type PaymentMethodSave = 'disabled' | 'enabled';

type PaymentMethodUpdate = 'disabled' | 'enabled';
type PaymentMethodSaveUsage = 'off_session' | 'on_session';
}
}

Expand All @@ -99,7 +127,7 @@ declare module 'stripe' {

class CustomerSessionsResource {
/**
* Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
* Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.
*/
create(
params: CustomerSessionCreateParams,
Expand Down
2 changes: 1 addition & 1 deletion types/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ declare module 'stripe' {
name?: string | null;

/**
* The suffix of the customer's next invoice number (for example, 0001).
* The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
*/
next_invoice_sequence?: number;

Expand Down
2 changes: 1 addition & 1 deletion types/EventTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ declare module 'stripe' {
}

/**
* Occurs whenever a card or source will expire at the end of the month.
* Occurs whenever a card or source will expire at the end of the month. This event only works with legacy integrations using Card or Source objects. If you use the PaymentMethod API, this event won't occur.
*/
interface CustomerSourceExpiringEvent extends EventBase {
type: 'customer.source.expiring';
Expand Down
2 changes: 1 addition & 1 deletion types/FinancialConnections/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ declare module 'stripe' {
| 'other'
| 'savings';

type Subscription = 'inferred_balances' | 'transactions';
type Subscription = 'balance' | 'inferred_balances' | 'transactions';

type SupportedPaymentMethodType = 'link' | 'us_bank_account';

Expand Down
4 changes: 2 additions & 2 deletions types/FinancialConnections/AccountsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ declare module 'stripe' {
}

namespace AccountSubscribeParams {
type Feature = 'inferred_balances' | 'transactions';
type Feature = 'balance' | 'inferred_balances' | 'transactions';
}

interface AccountUnsubscribeParams {
Expand All @@ -116,7 +116,7 @@ declare module 'stripe' {
}

namespace AccountUnsubscribeParams {
type Feature = 'inferred_balances' | 'transactions';
type Feature = 'balance' | 'inferred_balances' | 'transactions';
}

class AccountsResource {
Expand Down
Loading
Loading