Skip to content

Commit

Permalink
Codegen for openapi v156
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stripe committed Jun 17, 2022
1 parent 17fba45 commit 3feb68c
Show file tree
Hide file tree
Showing 17 changed files with 214 additions and 50 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v154
v156
78 changes: 43 additions & 35 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,49 @@ describe('CashBalance', function() {
});
});

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

it('createBalanceTransaction method', async function() {
const balanceTransaction = await stripe.customers.createBalanceTransaction(
'cus_xxxxxxxxxxxxx',
{amount: -500, currency: 'usd'}
);
expect(balanceTransaction).not.to.be.null;
});

it('retrieveBalanceTransaction method', async function() {
const balanceTransaction = await stripe.customers.retrieveBalanceTransaction(
'cus_xxxxxxxxxxxxx',
'cbtxn_xxxxxxxxxxxxx'
);
expect(balanceTransaction).not.to.be.null;
});

it('updateBalanceTransaction method', async function() {
const balanceTransaction = await stripe.customers.updateBalanceTransaction(
'cus_xxxxxxxxxxxxx',
'cbtxn_xxxxxxxxxxxxx',
{metadata: {order_id: '6735'}}
);
expect(balanceTransaction).not.to.be.null;
});

it('listBalanceTransactions method', async function() {
const balanceTransactions = await stripe.customers.listBalanceTransactions(
'cus_xxxxxxxxxxxxx',
{limit: 3}
);
expect(balanceTransactions).not.to.be.null;
});
});

describe('Charge', function() {
it('create method', async function() {
const charge = await stripe.charges.create({
Expand Down Expand Up @@ -1435,41 +1478,6 @@ describe('CreditNoteLineItem', function() {
});
});

describe('CustomerBalanceTransaction', function() {
it('createBalanceTransaction method', async function() {
const balanceTransaction = await stripe.customers.createBalanceTransaction(
'cus_xxxxxxxxxxxxx',
{amount: -500, currency: 'usd'}
);
expect(balanceTransaction).not.to.be.null;
});

it('retrieveBalanceTransaction method', async function() {
const balanceTransaction = await stripe.customers.retrieveBalanceTransaction(
'cus_xxxxxxxxxxxxx',
'cbtxn_xxxxxxxxxxxxx'
);
expect(balanceTransaction).not.to.be.null;
});

it('updateBalanceTransaction method', async function() {
const balanceTransaction = await stripe.customers.updateBalanceTransaction(
'cus_xxxxxxxxxxxxx',
'cbtxn_xxxxxxxxxxxxx',
{metadata: {order_id: '6735'}}
);
expect(balanceTransaction).not.to.be.null;
});

it('listBalanceTransactions method', async function() {
const balanceTransactions = await stripe.customers.listBalanceTransactions(
'cus_xxxxxxxxxxxxx',
{limit: 3}
);
expect(balanceTransactions).not.to.be.null;
});
});

describe('BillingPortal.Session', function() {
it('create method', async function() {
const session = await stripe.billingPortal.sessions.create({
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
Loading

0 comments on commit 3feb68c

Please sign in to comment.