Skip to content

Commit

Permalink
Codegen for openapi v157 (#1453)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stripe committed Jun 17, 2022
1 parent 17fba45 commit 6137808
Show file tree
Hide file tree
Showing 19 changed files with 207 additions and 15 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v154
v157
1 change: 1 addition & 0 deletions lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ module.exports = {
Readers: require('./resources/Terminal/Readers'),
}),
TestHelpers: resourceNamespace('testHelpers', {
Customers: require('./resources/TestHelpers/Customers'),
Refunds: require('./resources/TestHelpers/Refunds'),
TestClocks: require('./resources/TestHelpers/TestClocks'),
Terminal: resourceNamespace('terminal', {
Expand Down
15 changes: 15 additions & 0 deletions lib/resources/TestHelpers/Customers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// File generated from our OpenAPI spec

'use strict';

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

module.exports = StripeResource.extend({
path: 'test_helpers/customers',

fundCashBalance: stripeMethod({
method: 'POST',
path: '/{customer}/fund_cash_balance',
}),
});
8 changes: 8 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ describe('Customer', function() {
expect(fundingInstructions).not.to.be.null;
});

it('fundCashBalance method', async function() {
const customerBalanceTransaction = await stripe.testHelpers.customers.fundCashBalance(
'cus_123',
{amount: 30, currency: 'eur'}
);
expect(customerBalanceTransaction).not.to.be.null;
});

it('list method', async function() {
const customers = await stripe.customers.list({limit: 3});
expect(customers).not.to.be.null;
Expand Down
40 changes: 40 additions & 0 deletions types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,16 @@ declare module 'stripe' {
* The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix: string | null;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kana: string | null;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kanji: string | null;
}

namespace CardPayments {
Expand Down Expand Up @@ -981,6 +991,16 @@ declare module 'stripe' {
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only)
*/
statement_descriptor_kanji: string | null;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kana: string | null;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kanji: string | null;
}

interface Payouts {
Expand Down Expand Up @@ -2160,6 +2180,16 @@ declare module 'stripe' {
* The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix?: string;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kana?: Stripe.Emptyable<string>;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kanji?: Stripe.Emptyable<string>;
}

namespace CardPayments {
Expand Down Expand Up @@ -3322,6 +3352,16 @@ declare module 'stripe' {
* The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix?: string;

/**
* The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kana?: Stripe.Emptyable<string>;

/**
* The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion.
*/
statement_descriptor_prefix_kanji?: Stripe.Emptyable<string>;
}

namespace CardPayments {
Expand Down
20 changes: 20 additions & 0 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,16 @@ declare module 'stripe' {
* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
*/
setup_future_usage?: Card.SetupFutureUsage;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
*/
statement_descriptor_suffix_kana?: string;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
*/
statement_descriptor_suffix_kanji?: string;
}

namespace Card {
Expand Down Expand Up @@ -2133,6 +2143,16 @@ declare module 'stripe' {
* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
*/
setup_future_usage?: Card.SetupFutureUsage;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
*/
statement_descriptor_suffix_kana?: string;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
*/
statement_descriptor_suffix_kanji?: string;
}

namespace Card {
Expand Down
7 changes: 6 additions & 1 deletion types/2020-08-27/CreditNotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ declare module 'stripe' {
status: CreditNote.Status;

/**
* The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.
* The integer amount in %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
*/
subtotal: number;

Expand All @@ -124,6 +124,11 @@ declare module 'stripe' {
*/
total: number;

/**
* The integer amount in %s representing the total amount of the credit note, excluding tax, but including discounts.
*/
total_excluding_tax: number | null;

/**
* Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid.
*/
Expand Down
20 changes: 16 additions & 4 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ declare module 'stripe' {
* Default footer to be displayed on invoices for this customer.
*/
footer: string | null;

/**
* Default options for invoice PDF rendering for this customer.
*/
rendering_options: InvoiceSettings.RenderingOptions | null;
}

namespace InvoiceSettings {
Expand All @@ -172,6 +177,13 @@ declare module 'stripe' {
*/
value: string;
}

interface RenderingOptions {
/**
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
*/
amount_tax_display: string | null;
}
}

interface Shipping {
Expand Down Expand Up @@ -422,7 +434,7 @@ declare module 'stripe' {
/**
* Default options for invoice PDF rendering for this customer.
*/
rendering_options?: InvoiceSettings.RenderingOptions;
rendering_options?: Stripe.Emptyable<InvoiceSettings.RenderingOptions>;
}

namespace InvoiceSettings {
Expand All @@ -440,7 +452,7 @@ declare module 'stripe' {

interface RenderingOptions {
/**
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
*/
amount_tax_display?: Stripe.Emptyable<
RenderingOptions.AmountTaxDisplay
Expand Down Expand Up @@ -707,7 +719,7 @@ declare module 'stripe' {
/**
* Default options for invoice PDF rendering for this customer.
*/
rendering_options?: InvoiceSettings.RenderingOptions;
rendering_options?: Stripe.Emptyable<InvoiceSettings.RenderingOptions>;
}

namespace InvoiceSettings {
Expand All @@ -725,7 +737,7 @@ declare module 'stripe' {

interface RenderingOptions {
/**
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
*/
amount_tax_display?: Stripe.Emptyable<
RenderingOptions.AmountTaxDisplay
Expand Down
14 changes: 13 additions & 1 deletion types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ declare module 'stripe' {
*/
receipt_number: string | null;

/**
* Options for invoice PDF rendering.
*/
rendering_options: Invoice.RenderingOptions | null;

/**
* Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance.
*/
Expand Down Expand Up @@ -318,7 +323,7 @@ declare module 'stripe' {
subscription_proration_date?: number;

/**
* Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
* Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
*/
subtotal: number;

Expand Down Expand Up @@ -769,6 +774,13 @@ declare module 'stripe' {
| 'wechat_pay';
}

interface RenderingOptions {
/**
* How line-item prices and amounts will be displayed with respect to tax on invoice PDFs.
*/
amount_tax_display: string | null;
}

type Status =
| 'deleted'
| 'draft'
Expand Down
40 changes: 40 additions & 0 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,16 @@ declare module 'stripe' {
* When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
*/
setup_future_usage?: Card.SetupFutureUsage;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
*/
statement_descriptor_suffix_kana?: string;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
*/
statement_descriptor_suffix_kanji?: string;
}

namespace Card {
Expand Down Expand Up @@ -2811,6 +2821,16 @@ declare module 'stripe' {
* If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.
*/
setup_future_usage?: Stripe.Emptyable<Card.SetupFutureUsage>;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
*/
statement_descriptor_suffix_kana?: Stripe.Emptyable<string>;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
*/
statement_descriptor_suffix_kanji?: Stripe.Emptyable<string>;
}

namespace Card {
Expand Down Expand Up @@ -4470,6 +4490,16 @@ declare module 'stripe' {
* If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.
*/
setup_future_usage?: Stripe.Emptyable<Card.SetupFutureUsage>;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
*/
statement_descriptor_suffix_kana?: Stripe.Emptyable<string>;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
*/
statement_descriptor_suffix_kanji?: Stripe.Emptyable<string>;
}

namespace Card {
Expand Down Expand Up @@ -6264,6 +6294,16 @@ declare module 'stripe' {
* If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.
*/
setup_future_usage?: Stripe.Emptyable<Card.SetupFutureUsage>;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.
*/
statement_descriptor_suffix_kana?: Stripe.Emptyable<string>;

/**
* Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.
*/
statement_descriptor_suffix_kanji?: Stripe.Emptyable<string>;
}

namespace Card {
Expand Down
Loading

0 comments on commit 6137808

Please sign in to comment.