Skip to content

Commit

Permalink
Codegen for openapi v182
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stripe committed Aug 18, 2022
1 parent 66d2709 commit bb89aeb
Show file tree
Hide file tree
Showing 12 changed files with 310 additions and 15 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v178
v182
11 changes: 11 additions & 0 deletions lib/resources/Customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

retrieveCashBalanceTransaction: stripeMethod({
method: 'GET',
path: '/{customer}/cash_balance_transactions/{transaction}',
}),

listCashBalanceTransactions: stripeMethod({
method: 'GET',
path: '/{customer}/cash_balance_transactions',
methodType: 'list',
}),

createSource: stripeMethod({
method: 'POST',
path: '/{customer}/sources',
Expand Down
4 changes: 2 additions & 2 deletions types/2022-08-01/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ declare module 'stripe' {
/**
* A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
*
* By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the bank account or card creation API.
* By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs.
*/
external_account?: string | AccountCreateParams.ExternalAccount;

Expand Down Expand Up @@ -2407,7 +2407,7 @@ declare module 'stripe' {
/**
* A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation.
*
* By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the bank account or card creation API.
* By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs.
*/
external_account?: string;

Expand Down
154 changes: 154 additions & 0 deletions types/2022-08-01/CustomerCashBalanceTransactions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
// File generated from our OpenAPI spec

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

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

applied_to_payment?: CustomerCashBalanceTransaction.AppliedToPayment;

/**
* Time at which the object was created. Measured in seconds since the Unix epoch.
*/
created: number;

/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;

/**
* The customer whose available cash balance changed as a result of this transaction.
*/
customer: string | Stripe.Customer;

/**
* The total available cash balance for the specified currency after this transaction was applied. Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
*/
ending_balance: number;

funded?: CustomerCashBalanceTransaction.Funded;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;

/**
* The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance.
*/
net_amount: number;

refunded_from_payment?: CustomerCashBalanceTransaction.RefundedFromPayment;

/**
* The type of the cash balance transaction. One of `applied_to_payment`, `unapplied_from_payment`, `refunded_from_payment`, `funded`, `return_initiated`, or `return_canceled`. New types may be added in future. See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types.
*/
type: CustomerCashBalanceTransaction.Type;

unapplied_from_payment?: CustomerCashBalanceTransaction.UnappliedFromPayment;
}

namespace CustomerCashBalanceTransaction {
interface AppliedToPayment {
/**
* The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to.
*/
payment_intent: string | Stripe.PaymentIntent;
}

interface Funded {
bank_transfer: Funded.BankTransfer;
}

namespace Funded {
interface BankTransfer {
eu_bank_transfer?: BankTransfer.EuBankTransfer;

/**
* The user-supplied reference field on the bank transfer.
*/
reference: string | null;

/**
* The funding method type used to fund the customer balance. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.
*/
type: BankTransfer.Type;
}

namespace BankTransfer {
interface EuBankTransfer {
/**
* The BIC of the bank of the sender of the funding.
*/
bic: string | null;

/**
* The last 4 digits of the IBAN of the sender of the funding.
*/
iban_last4: string | null;

/**
* The full name of the sender, as supplied by the sending bank.
*/
sender_name: string | null;
}

type Type =
| 'eu_bank_transfer'
| 'gb_bank_transfer'
| 'jp_bank_transfer'
| 'mx_bank_transfer';
}
}

interface RefundedFromPayment {
/**
* The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance.
*/
refund: string | Stripe.Refund;
}

type Type =
| 'applied_to_payment'
| 'funded'
| 'refunded_from_payment'
| 'return_canceled'
| 'return_initiated'
| 'unapplied_from_payment';

interface UnappliedFromPayment {
/**
* The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from.
*/
payment_intent: string | Stripe.PaymentIntent;
}
}

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

interface CustomerCashBalanceTransactionListParams
extends PaginationParams {
/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;
}
}
}
28 changes: 28 additions & 0 deletions types/2022-08-01/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,34 @@ declare module 'stripe' {
options?: RequestOptions
): ApiListPromise<Stripe.CustomerBalanceTransaction>;

/**
* Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance).
*/
retrieveCashBalanceTransaction(
customerId: string,
id: string,
params?: CustomerCashBalanceTransactionRetrieveParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.CustomerCashBalanceTransaction>>;
retrieveCashBalanceTransaction(
customerId: string,
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.CustomerCashBalanceTransaction>>;

/**
* Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance).
*/
listCashBalanceTransactions(
id: string,
params?: CustomerCashBalanceTransactionListParams,
options?: RequestOptions
): ApiListPromise<Stripe.CustomerCashBalanceTransaction>;
listCashBalanceTransactions(
id: string,
options?: RequestOptions
): ApiListPromise<Stripe.CustomerCashBalanceTransaction>;

/**
* When you create a new credit card, you must specify a customer or recipient on which to create it.
*
Expand Down
3 changes: 0 additions & 3 deletions types/2022-08-01/Orders.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ declare module 'stripe' {
| 'link'
| 'oxxo'
| 'p24'
| 'paypal'
| 'sepa_debit'
| 'sofort'
| 'wechat_pay';
Expand Down Expand Up @@ -1779,7 +1778,6 @@ declare module 'stripe' {
| 'link'
| 'oxxo'
| 'p24'
| 'paypal'
| 'sepa_debit'
| 'sofort'
| 'wechat_pay';
Expand Down Expand Up @@ -2934,7 +2932,6 @@ declare module 'stripe' {
| 'link'
| 'oxxo'
| 'p24'
| 'paypal'
| 'sepa_debit'
| 'sofort'
| 'wechat_pay';
Expand Down
5 changes: 5 additions & 0 deletions types/2022-08-01/PaymentLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ declare module 'stripe' {
*/
consent_collection: PaymentLink.ConsentCollection | null;

/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;

/**
* Configuration for Customer creation during checkout.
*/
Expand Down
51 changes: 51 additions & 0 deletions types/2022-08-01/SetupIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,6 +1326,11 @@ declare module 'stripe' {
*/
moto?: boolean;

/**
* Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time.
*/
network?: Card.Network;

/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
*/
Expand Down Expand Up @@ -1391,6 +1396,18 @@ declare module 'stripe' {
type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year';
}

type Network =
| 'amex'
| 'cartes_bancaires'
| 'diners'
| 'discover'
| 'interac'
| 'jcb'
| 'mastercard'
| 'unionpay'
| 'unknown'
| 'visa';

type RequestThreeDSecure = 'any' | 'automatic';
}

Expand Down Expand Up @@ -2175,6 +2192,11 @@ declare module 'stripe' {
*/
moto?: boolean;

/**
* Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time.
*/
network?: Card.Network;

/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
*/
Expand Down Expand Up @@ -2240,6 +2262,18 @@ declare module 'stripe' {
type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year';
}

type Network =
| 'amex'
| 'cartes_bancaires'
| 'diners'
| 'discover'
| 'interac'
| 'jcb'
| 'mastercard'
| 'unionpay'
| 'unknown'
| 'visa';

type RequestThreeDSecure = 'any' | 'automatic';
}

Expand Down Expand Up @@ -3106,6 +3140,11 @@ declare module 'stripe' {
*/
moto?: boolean;

/**
* Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time.
*/
network?: Card.Network;

/**
* We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
*/
Expand Down Expand Up @@ -3171,6 +3210,18 @@ declare module 'stripe' {
type Interval = 'day' | 'month' | 'sporadic' | 'week' | 'year';
}

type Network =
| 'amex'
| 'cartes_bancaires'
| 'diners'
| 'discover'
| 'interac'
| 'jcb'
| 'mastercard'
| 'unionpay'
| 'unknown'
| 'visa';

type RequestThreeDSecure = 'any' | 'automatic';
}

Expand Down
Loading

0 comments on commit bb89aeb

Please sign in to comment.