Skip to content

Commit

Permalink
Codegen for openapi ef061d9 (#1269)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Oct 11, 2021
1 parent 32d6f99 commit dc9e145
Show file tree
Hide file tree
Showing 6 changed files with 298 additions and 4 deletions.
5 changes: 4 additions & 1 deletion test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ describe('Customer', function() {
});

it('listPaymentMethods method', async function() {
const paymentMethods = await stripe.customers.listPaymentMethods('cus_xyz');
const paymentMethods = await stripe.customers.listPaymentMethods(
'cus_xyz',
{type: 'card'}
);
expect(paymentMethods).not.to.be.null;
});
});
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ declare module 'stripe' {
documents?: AccountCreateParams.Documents;

/**
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe will never directly email Custom accounts.
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent.
*/
email?: string;

Expand Down Expand Up @@ -2084,7 +2084,7 @@ declare module 'stripe' {
documents?: AccountUpdateParams.Documents;

/**
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe will never directly email Custom accounts.
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe only emails Custom accounts with your consent.
*/
email?: string;

Expand Down
14 changes: 13 additions & 1 deletion types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,19 @@ declare module 'stripe' {
}
}

interface Klarna {}
interface Klarna {
/**
* The Klarna payment method used for this transaction.
* Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments`
*/
payment_method_category?: string | null;

/**
* Preferred language of the Klarna authorization page that the customer is redirected to.
* Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `it-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `fr-FR`, or `en-FR`
*/
preferred_locale?: string | null;
}

interface Multibanco {
/**
Expand Down
1 change: 1 addition & 0 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ declare module 'stripe' {
| 'giropay'
| 'grabpay'
| 'ideal'
| 'klarna'
| 'oxxo'
| 'p24'
| 'sepa_debit'
Expand Down
216 changes: 216 additions & 0 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ declare module 'stripe' {

ideal?: PaymentMethodOptions.Ideal;

klarna?: PaymentMethodOptions.Klarna;

oxxo?: PaymentMethodOptions.Oxxo;

p24?: PaymentMethodOptions.P24;
Expand Down Expand Up @@ -684,6 +686,13 @@ declare module 'stripe' {

interface Ideal {}

interface Klarna {
/**
* Preferred locale of the Klarna checkout page that the customer is redirected to.
*/
preferred_locale: string | null;
}

interface Oxxo {
/**
* The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
Expand Down Expand Up @@ -1065,6 +1074,11 @@ declare module 'stripe' {
*/
interac_present?: PaymentMethodData.InteracPresent;

/**
* If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
*/
klarna?: PaymentMethodData.Klarna;

/**
* 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 @@ -1290,6 +1304,32 @@ declare module 'stripe' {

interface InteracPresent {}

interface Klarna {
/**
* Customer's date of birth
*/
dob?: Klarna.Dob;
}

namespace Klarna {
interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number;

/**
* The month of birth, between 1 and 12.
*/
month: number;

/**
* The four-digit year of birth.
*/
year: number;
}
}

interface Oxxo {}

interface P24 {
Expand Down Expand Up @@ -1359,6 +1399,7 @@ declare module 'stripe' {
| 'giropay'
| 'grabpay'
| 'ideal'
| 'klarna'
| 'oxxo'
| 'p24'
| 'sepa_debit'
Expand Down Expand Up @@ -1411,6 +1452,11 @@ declare module 'stripe' {
*/
ideal?: Stripe.Emptyable<PaymentMethodOptions.Ideal>;

/**
* If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
*/
klarna?: Stripe.Emptyable<PaymentMethodOptions.Klarna>;

/**
* If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
*/
Expand Down Expand Up @@ -1598,6 +1644,38 @@ declare module 'stripe' {

interface Ideal {}

interface Klarna {
/**
* Preferred language of the Klarna authorization page that the customer is redirected to
*/
preferred_locale?: Klarna.PreferredLocale;
}

namespace Klarna {
type PreferredLocale =
| 'da-DK'
| 'de-AT'
| 'de-DE'
| 'en-AT'
| 'en-DE'
| 'en-DK'
| 'en-FI'
| 'en-GB'
| 'en-NL'
| 'en-NO'
| 'en-SE'
| 'en-US'
| 'es-ES'
| 'fi-FI'
| 'fr-BE'
| 'it-IT'
| 'nb-NO'
| 'nl-BE'
| 'nl-NL'
| 'sv-FI'
| 'sv-SE';
}

interface Oxxo {
/**
* The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
Expand Down Expand Up @@ -1905,6 +1983,11 @@ declare module 'stripe' {
*/
interac_present?: PaymentMethodData.InteracPresent;

/**
* If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
*/
klarna?: PaymentMethodData.Klarna;

/**
* 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 @@ -2130,6 +2213,32 @@ declare module 'stripe' {

interface InteracPresent {}

interface Klarna {
/**
* Customer's date of birth
*/
dob?: Klarna.Dob;
}

namespace Klarna {
interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number;

/**
* The month of birth, between 1 and 12.
*/
month: number;

/**
* The four-digit year of birth.
*/
year: number;
}
}

interface Oxxo {}

interface P24 {
Expand Down Expand Up @@ -2199,6 +2308,7 @@ declare module 'stripe' {
| 'giropay'
| 'grabpay'
| 'ideal'
| 'klarna'
| 'oxxo'
| 'p24'
| 'sepa_debit'
Expand Down Expand Up @@ -2251,6 +2361,11 @@ declare module 'stripe' {
*/
ideal?: Stripe.Emptyable<PaymentMethodOptions.Ideal>;

/**
* If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
*/
klarna?: Stripe.Emptyable<PaymentMethodOptions.Klarna>;

/**
* If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
*/
Expand Down Expand Up @@ -2438,6 +2553,38 @@ declare module 'stripe' {

interface Ideal {}

interface Klarna {
/**
* Preferred language of the Klarna authorization page that the customer is redirected to
*/
preferred_locale?: Klarna.PreferredLocale;
}

namespace Klarna {
type PreferredLocale =
| 'da-DK'
| 'de-AT'
| 'de-DE'
| 'en-AT'
| 'en-DE'
| 'en-DK'
| 'en-FI'
| 'en-GB'
| 'en-NL'
| 'en-NO'
| 'en-SE'
| 'en-US'
| 'es-ES'
| 'fi-FI'
| 'fr-BE'
| 'it-IT'
| 'nb-NO'
| 'nl-BE'
| 'nl-NL'
| 'sv-FI'
| 'sv-SE';
}

interface Oxxo {
/**
* The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
Expand Down Expand Up @@ -2859,6 +3006,11 @@ declare module 'stripe' {
*/
interac_present?: PaymentMethodData.InteracPresent;

/**
* If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.
*/
klarna?: PaymentMethodData.Klarna;

/**
* 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 @@ -3084,6 +3236,32 @@ declare module 'stripe' {

interface InteracPresent {}

interface Klarna {
/**
* Customer's date of birth
*/
dob?: Klarna.Dob;
}

namespace Klarna {
interface Dob {
/**
* The day of birth, between 1 and 31.
*/
day: number;

/**
* The month of birth, between 1 and 12.
*/
month: number;

/**
* The four-digit year of birth.
*/
year: number;
}
}

interface Oxxo {}

interface P24 {
Expand Down Expand Up @@ -3153,6 +3331,7 @@ declare module 'stripe' {
| 'giropay'
| 'grabpay'
| 'ideal'
| 'klarna'
| 'oxxo'
| 'p24'
| 'sepa_debit'
Expand Down Expand Up @@ -3205,6 +3384,11 @@ declare module 'stripe' {
*/
ideal?: Stripe.Emptyable<PaymentMethodOptions.Ideal>;

/**
* If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options.
*/
klarna?: Stripe.Emptyable<PaymentMethodOptions.Klarna>;

/**
* If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options.
*/
Expand Down Expand Up @@ -3392,6 +3576,38 @@ declare module 'stripe' {

interface Ideal {}

interface Klarna {
/**
* Preferred language of the Klarna authorization page that the customer is redirected to
*/
preferred_locale?: Klarna.PreferredLocale;
}

namespace Klarna {
type PreferredLocale =
| 'da-DK'
| 'de-AT'
| 'de-DE'
| 'en-AT'
| 'en-DE'
| 'en-DK'
| 'en-FI'
| 'en-GB'
| 'en-NL'
| 'en-NO'
| 'en-SE'
| 'en-US'
| 'es-ES'
| 'fi-FI'
| 'fr-BE'
| 'it-IT'
| 'nb-NO'
| 'nl-BE'
| 'nl-NL'
| 'sv-FI'
| 'sv-SE';
}

interface Oxxo {
/**
* The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.
Expand Down

0 comments on commit dc9e145

Please sign in to comment.