From 16cbfd1fbd48b03d04c29be3111edfd6a70e61ae Mon Sep 17 00:00:00 2001 From: Peter Jang Date: Mon, 20 Jul 2026 16:41:51 -0500 Subject: [PATCH 1/3] Add walletOptions.emailRequired and walletOptions.phoneNumberRequired parameters for PE create/update --- types/stripe-js/elements/payment.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/types/stripe-js/elements/payment.d.ts b/types/stripe-js/elements/payment.d.ts index 252ebeaa..0669cc73 100644 --- a/types/stripe-js/elements/payment.d.ts +++ b/types/stripe-js/elements/payment.d.ts @@ -334,6 +334,11 @@ export interface PaymentWalletsOption { link?: PaymentWalletOption; } +export interface PaymentWalletOptionsOption { + emailRequired?: boolean; + phoneNumberRequired?: boolean; +} + export type Layout = 'tabs' | 'accordion' | 'auto'; type RadiosOption = 'auto' | 'never' | 'always' | 'if_multiple'; @@ -390,6 +395,11 @@ export interface StripePaymentElementOptions { */ wallets?: PaymentWalletsOption; + /** + * Control wallet behavior options in the Payment Element. + */ + walletOptions?: PaymentWalletOptionsOption; + /** * Specify a layout to use when rendering a Payment Element. */ From a07866e4812784fc4913b7d9dbb0b1dddcbdba83 Mon Sep 17 00:00:00 2001 From: Peter Jang Date: Mon, 10 Aug 2026 14:11:58 -0500 Subject: [PATCH 2/3] Add walletOptions.emailRequired and walletOptions.phoneNumberRequired parameters for EwCS PE create --- types/stripe-js/checkout.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/stripe-js/checkout.d.ts b/types/stripe-js/checkout.d.ts index c5e05152..d13722cc 100644 --- a/types/stripe-js/checkout.d.ts +++ b/types/stripe-js/checkout.d.ts @@ -3,6 +3,7 @@ import { Layout, TermsOption, StripePaymentElement, + PaymentWalletOptionsOption, } from './elements/payment'; import {ContactOption, StripeAddressElement} from './elements/address'; import {Appearance, CssFontSource, CustomFontSource} from './elements-group'; @@ -405,6 +406,7 @@ export type StripeCheckoutPaymentElementOptions = { terms?: TermsOption; fields?: FieldsOption; wallets?: PaymentWalletsOption; + walletOptions?: PaymentWalletOptionsOption; }; export type StripeCheckoutAddressElementOptions = { From 83ff79757c3f20360cb3a2dbe63921d346637103 Mon Sep 17 00:00:00 2001 From: Peter Jang Date: Mon, 10 Aug 2026 15:19:16 -0500 Subject: [PATCH 3/3] Add valid/invalid test cases for walletOptions --- tests/types/src/invalid.ts | 32 ++++++++++++++++++++++++++++++++ tests/types/src/valid.ts | 17 +++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/tests/types/src/invalid.ts b/tests/types/src/invalid.ts index 851b545c..1f12a16b 100644 --- a/tests/types/src/invalid.ts +++ b/tests/types/src/invalid.ts @@ -166,6 +166,22 @@ elements.create('payment', { }, }); +// invalid type for walletOptions.emailRequired +// @ts-expect-error: No overload matches this call +elements.create('payment', { + walletOptions: { + emailRequired: 'yes', + }, +}); + +// invalid type for walletOptions.phoneNumberRequired +// @ts-expect-error: No overload matches this call +elements.create('payment', { + walletOptions: { + phoneNumberRequired: 'yes', + }, +}); + paymentElement.on('change', (e) => { // @ts-expect-error: `error` is not present on PaymentElement "change" event. if (e.error) { @@ -649,6 +665,22 @@ checkoutElementsSdk.createShippingAddressElement({ }, }); +// invalid type for walletOptions.emailRequired in EwCS +checkoutElementsSdk.createPaymentElement({ + walletOptions: { + // @ts-expect-error: Type 'string' is not assignable to type 'boolean | undefined' + emailRequired: 'yes', + }, +}); + +// invalid type for walletOptions.phoneNumberRequired in EwCS +checkoutElementsSdk.createPaymentElement({ + walletOptions: { + // @ts-expect-error: Type 'string' is not assignable to type 'boolean | undefined' + phoneNumberRequired: 'yes', + }, +}); + const checkoutFormSdk = stripe.initCheckoutFormSdk({ clientSecret: 'cs_test_foo', }); diff --git a/tests/types/src/valid.ts b/tests/types/src/valid.ts index b5ed70eb..65d7b3f2 100644 --- a/tests/types/src/valid.ts +++ b/tests/types/src/valid.ts @@ -541,6 +541,10 @@ const paymentElement: StripePaymentElement = elements.create('payment', { googlePay: 'auto', link: 'auto', }, + walletOptions: { + emailRequired: true, + phoneNumberRequired: true, + }, layout: { type: 'accordion', visibleAccordionItemsCount: 2, @@ -581,6 +585,13 @@ paymentElement.update({ }, }); +paymentElement.update({ + walletOptions: { + emailRequired: true, + phoneNumberRequired: false, + }, +}); + let paymentElementDefaults: StripePaymentElement = elements.create('payment'); paymentElementDefaults = elements.create('payment', {}); @@ -3693,6 +3704,12 @@ const checkoutElementsSdk = stripe.initCheckoutElementsSdk({ clientSecret: 'cs_test_foo', }); const checkoutPaymentElement: StripePaymentElement = checkoutElementsSdk.createPaymentElement(); +checkoutElementsSdk.createPaymentElement({ + walletOptions: { + emailRequired: true, + phoneNumberRequired: true, + }, +}); checkoutElementsSdk.getPaymentElement(); const checkoutAddressElement: StripeAddressElement = checkoutElementsSdk.createBillingAddressElement(); checkoutElementsSdk.getBillingAddressElement();