From dc9e14521dca8a7794c0a6df6a1dc0793a7760ed Mon Sep 17 00:00:00 2001 From: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com> Date: Mon, 11 Oct 2021 14:05:53 -0400 Subject: [PATCH] Codegen for openapi ef061d9 (#1269) --- .../resources/generated_examples_test.spec.js | 5 +- types/2020-08-27/Accounts.d.ts | 4 +- types/2020-08-27/Charges.d.ts | 14 +- types/2020-08-27/Customers.d.ts | 1 + types/2020-08-27/PaymentIntents.d.ts | 216 ++++++++++++++++++ types/2020-08-27/PaymentMethods.d.ts | 62 +++++ 6 files changed, 298 insertions(+), 4 deletions(-) diff --git a/test/resources/generated_examples_test.spec.js b/test/resources/generated_examples_test.spec.js index cfcd5cbfa7..5d95064cd9 100644 --- a/test/resources/generated_examples_test.spec.js +++ b/test/resources/generated_examples_test.spec.js @@ -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; }); }); diff --git a/types/2020-08-27/Accounts.d.ts b/types/2020-08-27/Accounts.d.ts index b57a25d24c..397f455372 100644 --- a/types/2020-08-27/Accounts.d.ts +++ b/types/2020-08-27/Accounts.d.ts @@ -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; @@ -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; diff --git a/types/2020-08-27/Charges.d.ts b/types/2020-08-27/Charges.d.ts index e67ce669ac..ac8e94ca01 100644 --- a/types/2020-08-27/Charges.d.ts +++ b/types/2020-08-27/Charges.d.ts @@ -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 { /** diff --git a/types/2020-08-27/Customers.d.ts b/types/2020-08-27/Customers.d.ts index 1d39be886f..2754bec002 100644 --- a/types/2020-08-27/Customers.d.ts +++ b/types/2020-08-27/Customers.d.ts @@ -692,6 +692,7 @@ declare module 'stripe' { | 'giropay' | 'grabpay' | 'ideal' + | 'klarna' | 'oxxo' | 'p24' | 'sepa_debit' diff --git a/types/2020-08-27/PaymentIntents.d.ts b/types/2020-08-27/PaymentIntents.d.ts index 189bef84c6..78848a5355 100644 --- a/types/2020-08-27/PaymentIntents.d.ts +++ b/types/2020-08-27/PaymentIntents.d.ts @@ -509,6 +509,8 @@ declare module 'stripe' { ideal?: PaymentMethodOptions.Ideal; + klarna?: PaymentMethodOptions.Klarna; + oxxo?: PaymentMethodOptions.Oxxo; p24?: PaymentMethodOptions.P24; @@ -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. @@ -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`. */ @@ -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 { @@ -1359,6 +1399,7 @@ declare module 'stripe' { | 'giropay' | 'grabpay' | 'ideal' + | 'klarna' | 'oxxo' | 'p24' | 'sepa_debit' @@ -1411,6 +1452,11 @@ declare module 'stripe' { */ ideal?: Stripe.Emptyable; + /** + * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + */ + klarna?: Stripe.Emptyable; + /** * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. */ @@ -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. @@ -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`. */ @@ -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 { @@ -2199,6 +2308,7 @@ declare module 'stripe' { | 'giropay' | 'grabpay' | 'ideal' + | 'klarna' | 'oxxo' | 'p24' | 'sepa_debit' @@ -2251,6 +2361,11 @@ declare module 'stripe' { */ ideal?: Stripe.Emptyable; + /** + * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + */ + klarna?: Stripe.Emptyable; + /** * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. */ @@ -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. @@ -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`. */ @@ -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 { @@ -3153,6 +3331,7 @@ declare module 'stripe' { | 'giropay' | 'grabpay' | 'ideal' + | 'klarna' | 'oxxo' | 'p24' | 'sepa_debit' @@ -3205,6 +3384,11 @@ declare module 'stripe' { */ ideal?: Stripe.Emptyable; + /** + * If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + */ + klarna?: Stripe.Emptyable; + /** * If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. */ @@ -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. diff --git a/types/2020-08-27/PaymentMethods.d.ts b/types/2020-08-27/PaymentMethods.d.ts index 555dda4973..ce0d51043e 100644 --- a/types/2020-08-27/PaymentMethods.d.ts +++ b/types/2020-08-27/PaymentMethods.d.ts @@ -58,6 +58,8 @@ declare module 'stripe' { interac_present?: PaymentMethod.InteracPresent; + klarna?: PaymentMethod.Klarna; + /** * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. */ @@ -507,6 +509,32 @@ declare module 'stripe' { interface InteracPresent {} + interface Klarna { + /** + * The customer's date of birth, if provided. + */ + dob?: Klarna.Dob | null; + } + + namespace Klarna { + interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number | null; + + /** + * The month of birth, between 1 and 12. + */ + month: number | null; + + /** + * The four-digit year of birth. + */ + year: number | null; + } + } + interface Oxxo {} interface P24 { @@ -614,6 +642,7 @@ declare module 'stripe' { | 'grabpay' | 'ideal' | 'interac_present' + | 'klarna' | 'oxxo' | 'p24' | 'sepa_debit' @@ -709,6 +738,11 @@ declare module 'stripe' { */ interac_present?: PaymentMethodCreateParams.InteracPresent; + /** + * If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + */ + klarna?: PaymentMethodCreateParams.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`. */ @@ -965,6 +999,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 { @@ -1035,6 +1095,7 @@ declare module 'stripe' { | 'giropay' | 'grabpay' | 'ideal' + | 'klarna' | 'oxxo' | 'p24' | 'sepa_debit' @@ -1176,6 +1237,7 @@ declare module 'stripe' { | 'giropay' | 'grabpay' | 'ideal' + | 'klarna' | 'oxxo' | 'p24' | 'sepa_debit'