From 91370e211424541da82d023316df641ac76fca86 Mon Sep 17 00:00:00 2001 From: Mark Fleckser Date: Tue, 11 Aug 2026 12:27:44 -0700 Subject: [PATCH 1/4] Add CPM in ECE types --- types/stripe-js/elements-group.d.ts | 43 +++++++++++++++++++ .../stripe-js/elements/express-checkout.d.ts | 3 ++ 2 files changed, 46 insertions(+) diff --git a/types/stripe-js/elements-group.d.ts b/types/stripe-js/elements-group.d.ts index 645331c9..c4eff9f5 100644 --- a/types/stripe-js/elements-group.d.ts +++ b/types/stripe-js/elements-group.d.ts @@ -1415,4 +1415,47 @@ export interface CustomPaymentMethod { */ subtitle?: string; }; + + /** + * Additional options to configure the Custom Payment Method in the Payment Element. Alias for `options`. + */ + payment?: { + /** + * The payment form type. + */ + type: 'static'; + + /** + * Display additional information about the payment method, max 100 characters. + */ + subtitle?: string; + }; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Additional options to configure the Custom Payment Method in the Express Checkout Element. + */ + expressCheckout?: { + /** + * The payment button type. + */ + type: 'embedded'; + + /** + * Options for the embedded Custom Payment Method. + */ + embedded: { + /** + * Function for rendering custom content in the Custom Payment Method button, called on mount. + */ + handleRender: (container: HTMLDivElement) => void; + + /** + * Function for cleaning up the Custom Payment Method button, called when the Custom Payment Method is removed and on unmount. + */ + handleDestroy?: () => void; + }; + }; } diff --git a/types/stripe-js/elements/express-checkout.d.ts b/types/stripe-js/elements/express-checkout.d.ts index 50101c61..8afa8573 100644 --- a/types/stripe-js/elements/express-checkout.d.ts +++ b/types/stripe-js/elements/express-checkout.d.ts @@ -607,6 +607,9 @@ export interface StripeExpressCheckoutElementAvailablePaymentMethodsChangeEvent paypal?: {available: boolean}; amazonPay?: {available: boolean}; klarna?: {available: boolean}; + [customPaymentMethodId: `cpmt_${string}`]: + | {available: boolean} + | undefined; } | undefined; } From bd75a2160225579edef99e5e5b6eff1724cf5122 Mon Sep 17 00:00:00 2001 From: Mark Fleckser Date: Tue, 11 Aug 2026 13:42:36 -0700 Subject: [PATCH 2/4] Added embedded to payment --- types/stripe-js/elements-group.d.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/types/stripe-js/elements-group.d.ts b/types/stripe-js/elements-group.d.ts index c4eff9f5..e092cf50 100644 --- a/types/stripe-js/elements-group.d.ts +++ b/types/stripe-js/elements-group.d.ts @@ -1423,12 +1423,27 @@ export interface CustomPaymentMethod { /** * The payment form type. */ - type: 'static'; + type: 'static' | 'embedded'; /** * Display additional information about the payment method, max 100 characters. */ subtitle?: string; + + /** + * Options for the embedded Custom Payment Method. + */ + embedded: { + /** + * Function for rendering custom content in the Custom Payment Method form, called on mount. + */ + handleRender: (container: HTMLDivElement) => void; + + /** + * Function for cleaning up the Custom Payment Method form, called when the Custom Payment Method is removed and on unmount. + */ + handleDestroy?: () => void; + }; }; /** From f30fddfa31638e3275e00bc3a89ba642754782fc Mon Sep 17 00:00:00 2001 From: Mark Fleckser Date: Tue, 11 Aug 2026 13:59:04 -0700 Subject: [PATCH 3/4] Add embedded to options --- types/stripe-js/elements-group.d.ts | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/types/stripe-js/elements-group.d.ts b/types/stripe-js/elements-group.d.ts index e092cf50..5dc47410 100644 --- a/types/stripe-js/elements-group.d.ts +++ b/types/stripe-js/elements-group.d.ts @@ -1404,16 +1404,34 @@ export interface CustomPaymentMethod { /** * Additional options to configure the Custom Payment Method. */ - options: { + options?: { /** * The payment form type. */ - type: 'static'; + type: 'static' | 'embedded'; /** * Display additional information about the payment method, max 100 characters. */ subtitle?: string; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Options for the embedded Custom Payment Method. Required for type: 'embedded'. + */ + embedded?: { + /** + * Function for rendering custom content in the Custom Payment Method form, called on mount. + */ + handleRender: (container: HTMLDivElement) => void; + + /** + * Function for cleaning up the Custom Payment Method form, called when the Custom Payment Method is removed and on unmount. + */ + handleDestroy?: () => void; + }; }; /** @@ -1431,9 +1449,12 @@ export interface CustomPaymentMethod { subtitle?: string; /** - * Options for the embedded Custom Payment Method. + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Options for the embedded Custom Payment Method. Required for type: 'embedded'. */ - embedded: { + embedded?: { /** * Function for rendering custom content in the Custom Payment Method form, called on mount. */ From 555bc7f0b648130cb66c72d9d465aa820f69fd91 Mon Sep 17 00:00:00 2001 From: Mark Fleckser Date: Tue, 11 Aug 2026 14:21:53 -0700 Subject: [PATCH 4/4] Change apmce cpmid to broad string type --- types/stripe-js/elements/express-checkout.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/types/stripe-js/elements/express-checkout.d.ts b/types/stripe-js/elements/express-checkout.d.ts index 8afa8573..a6ae66be 100644 --- a/types/stripe-js/elements/express-checkout.d.ts +++ b/types/stripe-js/elements/express-checkout.d.ts @@ -607,9 +607,7 @@ export interface StripeExpressCheckoutElementAvailablePaymentMethodsChangeEvent paypal?: {available: boolean}; amazonPay?: {available: boolean}; klarna?: {available: boolean}; - [customPaymentMethodId: `cpmt_${string}`]: - | {available: boolean} - | undefined; + [customPaymentMethodId: string]: {available: boolean} | undefined; } | undefined; }