Skip to content

Commit

Permalink
Update generated code (#1976)
Browse files Browse the repository at this point in the history
* Update generated code for v717

* Update generated code for v720

* Update generated code for v721

* Update generated code for v721

* Update generated code for v722

* Update generated code for v725

* Update generated code for v726

* Update generated code for v729

* Update generated code for v730

* Update generated code for v731

* Update generated code for v733

* Update generated code for v733

* Update generated code for v734

* Update generated code for v734

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] committed Dec 21, 2023
1 parent 876e484 commit dba16fc
Show file tree
Hide file tree
Showing 35 changed files with 794 additions and 46 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v715
v734
2 changes: 2 additions & 0 deletions src/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {TestClocks as TestHelpersTestClocks} from './resources/TestHelpers/TestC
import {Tokens as IssuingTokens} from './resources/Issuing/Tokens.js';
import {TransactionEntries as TreasuryTransactionEntries} from './resources/Treasury/TransactionEntries.js';
import {Transactions as TestHelpersIssuingTransactions} from './resources/TestHelpers/Issuing/Transactions.js';
import {Transactions as FinancialConnectionsTransactions} from './resources/FinancialConnections/Transactions.js';
import {Transactions as IssuingTransactions} from './resources/Issuing/Transactions.js';
import {Transactions as TaxTransactions} from './resources/Tax/Transactions.js';
import {Transactions as TreasuryTransactions} from './resources/Treasury/Transactions.js';
Expand Down Expand Up @@ -119,6 +120,7 @@ export const Climate = resourceNamespace('climate', {
export const FinancialConnections = resourceNamespace('financialConnections', {
Accounts: FinancialConnectionsAccounts,
Sessions: FinancialConnectionsSessions,
Transactions: FinancialConnectionsTransactions,
});
export const Identity = resourceNamespace('identity', {
VerificationReports: IdentityVerificationReports,
Expand Down
8 changes: 8 additions & 0 deletions src/resources/FinancialConnections/Accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ export const Accounts = StripeResource.extend({
method: 'POST',
fullPath: '/v1/financial_connections/accounts/{account}/refresh',
}),
subscribe: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/accounts/{account}/subscribe',
}),
unsubscribe: stripeMethod({
method: 'POST',
fullPath: '/v1/financial_connections/accounts/{account}/unsubscribe',
}),
});
15 changes: 15 additions & 0 deletions src/resources/FinancialConnections/Transactions.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 Transactions = StripeResource.extend({
retrieve: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/transactions/{transaction}',
}),
list: stripeMethod({
method: 'GET',
fullPath: '/v1/financial_connections/transactions',
methodType: 'list',
}),
});
78 changes: 78 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,26 @@ describe('Generated tests', function() {
expect(account).not.to.be.null;
});

it('test_financial_connections_accounts_subscribe_post', async function() {
const account = await stripe.financialConnections.accounts.subscribe(
'fa_123',
{
features: ['transactions'],
}
);
expect(account).not.to.be.null;
});

it('test_financial_connections_accounts_unsubscribe_post', async function() {
const account = await stripe.financialConnections.accounts.unsubscribe(
'fa_123',
{
features: ['transactions'],
}
);
expect(account).not.to.be.null;
});

it('test_financial_connections_sessions_get', async function() {
const session = await stripe.financialConnections.sessions.retrieve(
'fcsess_xyz'
Expand Down Expand Up @@ -1149,6 +1169,20 @@ describe('Generated tests', function() {
expect(session).not.to.be.null;
});

it('test_financial_connections_transactions_get', async function() {
const transaction = await stripe.financialConnections.transactions.retrieve(
'tr_123'
);
expect(transaction).not.to.be.null;
});

it('test_financial_connections_transactions_get_2', async function() {
const transactions = await stripe.financialConnections.transactions.list({
account: 'fca_xyz',
});
expect(transactions).not.to.be.null;
});

it('test_identity_verification_reports_get', async function() {
const verificationReports = await stripe.identity.verificationReports.list({
limit: 3,
Expand Down Expand Up @@ -2641,6 +2675,50 @@ describe('Generated tests', function() {
expect(taxRate).not.to.be.null;
});

it('test_tax_registrations_get', async function() {
const registrations = await stripe.tax.registrations.list({
status: 'all',
});
expect(registrations).not.to.be.null;
});

it('test_tax_registrations_post', async function() {
const registration = await stripe.tax.registrations.create({
country: 'IE',
country_options: {
ie: {
type: 'oss_union',
},
},
active_from: 'now',
});
expect(registration).not.to.be.null;
});

it('test_tax_registrations_post_2', async function() {
const registration = await stripe.tax.registrations.update(
'taxreg_xxxxxxxxxxxxx',
{
expires_at: 'now',
}
);
expect(registration).not.to.be.null;
});

it('test_tax_settings_get', async function() {
const settings = await stripe.tax.settings.retrieve();
expect(settings).not.to.be.null;
});

it('test_tax_settings_post', async function() {
const settings = await stripe.tax.settings.update({
defaults: {
tax_code: 'txcd_10000000',
},
});
expect(settings).not.to.be.null;
});

it('test_tax_transactions_create_from_calculation_post', async function() {
const transaction = await stripe.tax.transactions.createFromCalculation({
calculation: 'xxx',
Expand Down
17 changes: 16 additions & 1 deletion types/AccountSessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,22 @@ declare module 'stripe' {
}

namespace Payouts {
interface Features {}
interface Features {
/**
* Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
*/
edit_payout_schedule: boolean;

/**
* Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
*/
instant_payouts: boolean;

/**
* Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
*/
standard_payouts: boolean;
}
}
}
}
Expand Down
20 changes: 19 additions & 1 deletion types/AccountSessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,29 @@ declare module 'stripe' {
*/
enabled: boolean;

/**
* The list of features enabled in the embedded component.
*/
features?: Payouts.Features;
}

namespace Payouts {
interface Features {}
interface Features {
/**
* Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
*/
edit_payout_schedule?: boolean;

/**
* Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
*/
instant_payouts?: boolean;

/**
* Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise.
*/
standard_payouts?: boolean;
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions types/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ declare module 'stripe' {
* Describes the type of transaction being performed by Checkout in order to customize
* relevant text on the page, such as the submit button. `submit_type` can only be
* specified on Checkout Sessions in `payment` mode, but not Checkout Sessions
* in `subscription` or `setup` mode.
* in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used.
*/
submit_type: Session.SubmitType | null;

Expand Down Expand Up @@ -1384,7 +1384,7 @@ declare module 'stripe' {
/**
* Data features requested to be retrieved upon account creation.
*/
prefetch: Array<'balances'> | null;
prefetch: Array<FinancialConnections.Prefetch> | null;

/**
* For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
Expand All @@ -1398,6 +1398,8 @@ declare module 'stripe' {
| 'ownership'
| 'payment_method'
| 'transactions';

type Prefetch = 'balances' | 'transactions';
}

type SetupFutureUsage = 'none' | 'off_session' | 'on_session';
Expand Down
6 changes: 4 additions & 2 deletions types/Checkout/SessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ declare module 'stripe' {
* Describes the type of transaction being performed by Checkout in order to customize
* relevant text on the page, such as the submit button. `submit_type` can only be
* specified on Checkout Sessions in `payment` mode, but not Checkout Sessions
* in `subscription` or `setup` mode.
* in `subscription` or `setup` mode. Possible values are `auto`, `pay`, `book`, `donate`. If blank or `auto`, `pay` is used.
*/
submit_type?: SessionCreateParams.SubmitType;

Expand Down Expand Up @@ -1614,7 +1614,7 @@ declare module 'stripe' {
/**
* List of data features that you would like to retrieve upon account creation.
*/
prefetch?: Array<'balances'>;
prefetch?: Array<FinancialConnections.Prefetch>;
}

namespace FinancialConnections {
Expand All @@ -1623,6 +1623,8 @@ declare module 'stripe' {
| 'ownership'
| 'payment_method'
| 'transactions';

type Prefetch = 'balances' | 'transactions';
}

type SetupFutureUsage = 'none' | 'off_session' | 'on_session';
Expand Down
30 changes: 23 additions & 7 deletions types/EventTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ declare module 'stripe' {
| FinancialConnectionsAccountDisconnectedEvent
| FinancialConnectionsAccountReactivatedEvent
| FinancialConnectionsAccountRefreshedBalanceEvent
| FinancialConnectionsAccountRefreshedTransactionsEvent
| IdentityVerificationSessionCanceledEvent
| IdentityVerificationSessionCreatedEvent
| IdentityVerificationSessionProcessingEvent
Expand Down Expand Up @@ -274,7 +275,7 @@ declare module 'stripe' {

namespace AccountExternalAccountCreatedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.BankAccount | Stripe.Card | Stripe.Source;
object: Stripe.ExternalAccount;
}
}

Expand All @@ -288,7 +289,7 @@ declare module 'stripe' {

namespace AccountExternalAccountDeletedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.BankAccount | Stripe.Card | Stripe.Source;
object: Stripe.ExternalAccount;
}
}

Expand All @@ -302,7 +303,7 @@ declare module 'stripe' {

namespace AccountExternalAccountUpdatedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.BankAccount | Stripe.Card | Stripe.Source;
object: Stripe.ExternalAccount;
}
}

Expand Down Expand Up @@ -946,7 +947,7 @@ declare module 'stripe' {

namespace CustomerSourceCreatedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.BankAccount | Stripe.Card | Stripe.Source;
object: Stripe.CustomerSource;
}
}

Expand All @@ -960,7 +961,7 @@ declare module 'stripe' {

namespace CustomerSourceDeletedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.BankAccount | Stripe.Card | Stripe.Source;
object: Stripe.CustomerSource;
}
}

Expand All @@ -974,7 +975,7 @@ declare module 'stripe' {

namespace CustomerSourceExpiringEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.Card | Stripe.Source;
object: Stripe.CustomerSource;
}
}

Expand All @@ -988,7 +989,7 @@ declare module 'stripe' {

namespace CustomerSourceUpdatedEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.BankAccount | Stripe.Card | Stripe.Source;
object: Stripe.CustomerSource;
}
}

Expand Down Expand Up @@ -1259,6 +1260,21 @@ declare module 'stripe' {
}
}

/**
* Occurs when an Account’s `transaction_refresh` status transitions from `pending` to either `succeeded` or `failed`.
*/
interface FinancialConnectionsAccountRefreshedTransactionsEvent
extends EventBase {
type: 'financial_connections.account.refreshed_transactions';
data: FinancialConnectionsAccountRefreshedTransactionsEvent.Data;
}

namespace FinancialConnectionsAccountRefreshedTransactionsEvent {
interface Data extends Stripe.Event.Data {
object: Stripe.FinancialConnections.Account;
}
}

/**
* Occurs whenever a VerificationSession is canceled
*/
Expand Down
1 change: 1 addition & 0 deletions types/Events.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ declare module 'stripe' {
| 'financial_connections.account.disconnected'
| 'financial_connections.account.reactivated'
| 'financial_connections.account.refreshed_balance'
| 'financial_connections.account.refreshed_transactions'
| 'identity.verification_session.canceled'
| 'identity.verification_session.created'
| 'identity.verification_session.processing'
Expand Down
2 changes: 1 addition & 1 deletion types/Files.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare module 'stripe' {
* This object represents files hosted on Stripe's servers. You can upload
* files with the [create file](https://stripe.com/docs/api#create_file) request
* (for example, when uploading dispute evidence). Stripe also
* creates files independetly (for example, the results of a [Sigma scheduled
* creates files independently (for example, the results of a [Sigma scheduled
* query](https://stripe.com/docs/api#scheduled_queries)).
*
* Related guide: [File upload guide](https://stripe.com/docs/file-upload)
Expand Down
Loading

0 comments on commit dba16fc

Please sign in to comment.