Skip to content

Commit

Permalink
Codegen for openapi v152 (#1441)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe committed Jun 8, 2022
1 parent d0f14ef commit 553986d
Show file tree
Hide file tree
Showing 12 changed files with 703 additions and 65 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v150
v152
14 changes: 14 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,20 @@ describe('Apps.Secret', function() {
});
});

describe('CashBalance', function() {
it('retrieveCashBalance method', async function() {
const cashBalance = await stripe.customers.retrieveCashBalance('cus_123');
expect(cashBalance).not.to.be.null;
});

it('updateCashBalance method', async function() {
const cashBalance = await stripe.customers.updateCashBalance('cus_123', {
settings: {reconciliation_mode: 'manual'},
});
expect(cashBalance).not.to.be.null;
});
});

describe('Charge', function() {
it('create method', async function() {
const charge = await stripe.charges.create({
Expand Down
621 changes: 608 additions & 13 deletions types/2020-08-27/Checkout/Sessions.d.ts

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions types/2020-08-27/InvoiceLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,7 @@ declare module 'stripe' {
>;

/**
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`.
*
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
*
* Prorations can be disabled by passing `none`.
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
*/
subscription_proration_behavior?: InvoiceLineItemListUpcomingParams.SubscriptionProrationBehavior;

Expand Down
12 changes: 4 additions & 8 deletions types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ declare module 'stripe' {
amount_paid: number;

/**
* The amount remaining, in %s, that is due.
* The difference between amount_due and amount_paid, in %s.
*/
amount_remaining: number;

Expand Down Expand Up @@ -1162,7 +1162,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;
}
Expand Down Expand Up @@ -1503,7 +1503,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;
}
Expand Down Expand Up @@ -1732,11 +1732,7 @@ declare module 'stripe' {
>;

/**
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`.
*
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
*
* Prorations can be disabled by passing `none`.
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
*/
subscription_proration_behavior?: InvoiceRetrieveUpcomingParams.SubscriptionProrationBehavior;

Expand Down
6 changes: 3 additions & 3 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3196,7 +3196,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;

Expand Down Expand Up @@ -4831,7 +4831,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;

Expand Down Expand Up @@ -6601,7 +6601,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;

Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/PaymentMethods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ declare module 'stripe' {
/**
* Contains information about US bank account networks that can be used.
*/
networks?: UsBankAccount.Networks | null;
networks: UsBankAccount.Networks | null;

/**
* Routing number of the bank account.
Expand Down
16 changes: 16 additions & 0 deletions types/2020-08-27/SetupAttempts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ declare module 'stripe' {
*/
application: string | Stripe.Application | null;

/**
* If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
*
* It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
*/
attach_to_self?: boolean;

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
Expand All @@ -31,6 +38,13 @@ declare module 'stripe' {
*/
customer: string | Stripe.Customer | Stripe.DeletedCustomer | null;

/**
* Indicates the directions of money movement for which this payment method is intended to be used.
*
* Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
*/
flow_directions: Array<SetupAttempt.FlowDirection> | null;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
Expand Down Expand Up @@ -70,6 +84,8 @@ declare module 'stripe' {
}

namespace SetupAttempt {
type FlowDirection = 'inbound' | 'outbound';

interface PaymentMethodDetails {
acss_debit?: PaymentMethodDetails.AcssDebit;

Expand Down
47 changes: 43 additions & 4 deletions types/2020-08-27/SetupIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ declare module 'stripe' {
*
* Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
*/
flow_directions?: Array<SetupIntent.FlowDirection> | null;
flow_directions: Array<SetupIntent.FlowDirection> | null;

/**
* The error encountered in the previous SetupIntent confirmation.
Expand Down Expand Up @@ -513,6 +513,13 @@ declare module 'stripe' {
}

interface SetupIntentCreateParams {
/**
* If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
*
* It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
*/
attach_to_self?: boolean;

/**
* Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If the payment method attached is a card, a return_url may be provided in case additional authentication is required.
*/
Expand All @@ -535,6 +542,13 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* Indicates the directions of money movement for which this payment method is intended to be used.
*
* Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
*/
flow_directions?: Array<SetupIntentCreateParams.FlowDirection>;

/**
* This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm).
*/
Expand Down Expand Up @@ -588,6 +602,8 @@ declare module 'stripe' {
}

namespace SetupIntentCreateParams {
type FlowDirection = 'inbound' | 'outbound';

interface MandateData {
/**
* This hash contains details about the customer acceptance of the Mandate.
Expand Down Expand Up @@ -1342,7 +1358,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;

Expand Down Expand Up @@ -1403,6 +1419,13 @@ declare module 'stripe' {
}

interface SetupIntentUpdateParams {
/**
* If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
*
* It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
*/
attach_to_self?: boolean;

/**
* ID of the Customer this SetupIntent belongs to, if one exists.
*
Expand All @@ -1420,6 +1443,13 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* Indicates the directions of money movement for which this payment method is intended to be used.
*
* Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
*/
flow_directions?: Array<SetupIntentUpdateParams.FlowDirection>;

/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
Expand Down Expand Up @@ -1448,6 +1478,8 @@ declare module 'stripe' {
}

namespace SetupIntentUpdateParams {
type FlowDirection = 'inbound' | 'outbound';

interface PaymentMethodData {
/**
* If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
Expand Down Expand Up @@ -2153,7 +2185,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;

Expand Down Expand Up @@ -2188,6 +2220,13 @@ declare module 'stripe' {
}

interface SetupIntentListParams extends PaginationParams {
/**
* If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.
*
* It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
*/
attach_to_self?: boolean;

/**
* A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
*/
Expand Down Expand Up @@ -3055,7 +3094,7 @@ declare module 'stripe' {
namespace UsBankAccount {
interface FinancialConnections {
/**
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `payment_method`, and `transactions`.
* The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
*/
permissions?: Array<FinancialConnections.Permission>;

Expand Down
18 changes: 3 additions & 15 deletions types/2020-08-27/SubscriptionItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,7 @@ declare module 'stripe' {
price_data?: SubscriptionItemCreateParams.PriceData;

/**
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`.
*
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
*
* Prorations can be disabled by passing `none`.
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
*/
proration_behavior?: SubscriptionItemCreateParams.ProrationBehavior;

Expand Down Expand Up @@ -300,11 +296,7 @@ declare module 'stripe' {
price_data?: SubscriptionItemUpdateParams.PriceData;

/**
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`.
*
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
*
* Prorations can be disabled by passing `none`.
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
*/
proration_behavior?: SubscriptionItemUpdateParams.ProrationBehavior;

Expand Down Expand Up @@ -412,11 +404,7 @@ declare module 'stripe' {
clear_usage?: boolean;

/**
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. Valid values are `create_prorations`, `none`, or `always_invoice`.
*
* Passing `create_prorations` will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under [certain conditions](https://stripe.com/docs/subscriptions/upgrading-downgrading#immediate-payment). In order to always invoice immediately for prorations, pass `always_invoice`.
*
* Prorations can be disabled by passing `none`.
* Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.
*/
proration_behavior?: SubscriptionItemDeleteParams.ProrationBehavior;

Expand Down
Loading

0 comments on commit 553986d

Please sign in to comment.