@stripe/stripe-js 8.6.3 → 8.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
71
71
 
72
72
  stripe._registerWrapper({
73
73
  name: 'stripe-js',
74
- version: "8.6.3",
74
+ version: "8.7.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -172,7 +172,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
172
172
  var expectedVersion = RELEASE_TRAIN;
173
173
 
174
174
  if (isTestKey && version !== expectedVersion) {
175
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.6.3", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
175
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.7.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
176
176
  }
177
177
 
178
178
  var stripe = maybeStripe.apply(undefined, args);
package/dist/index.mjs CHANGED
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
67
67
 
68
68
  stripe._registerWrapper({
69
69
  name: 'stripe-js',
70
- version: "8.6.3",
70
+ version: "8.7.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -168,7 +168,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
168
168
  var expectedVersion = RELEASE_TRAIN;
169
169
 
170
170
  if (isTestKey && version !== expectedVersion) {
171
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.6.3", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
171
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.7.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
172
172
  }
173
173
 
174
174
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.js CHANGED
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
71
71
 
72
72
  stripe._registerWrapper({
73
73
  name: 'stripe-js',
74
- version: "8.6.3",
74
+ version: "8.7.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -172,7 +172,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
172
172
  var expectedVersion = RELEASE_TRAIN;
173
173
 
174
174
  if (isTestKey && version !== expectedVersion) {
175
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.6.3", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
175
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.7.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
176
176
  }
177
177
 
178
178
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.mjs CHANGED
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
67
67
 
68
68
  stripe._registerWrapper({
69
69
  name: 'stripe-js',
70
- version: "8.6.3",
70
+ version: "8.7.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -168,7 +168,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
168
168
  var expectedVersion = RELEASE_TRAIN;
169
169
 
170
170
  if (isTestKey && version !== expectedVersion) {
171
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.6.3", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
171
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("8.7.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
172
172
  }
173
173
 
174
174
  var stripe = maybeStripe.apply(undefined, args);
@@ -31,14 +31,18 @@ export interface StripeCheckoutElementsOptions {
31
31
  loader?: 'auto' | 'always' | 'never';
32
32
  fonts?: Array<CssFontSource | CustomFontSource>;
33
33
  savedPaymentMethod?: SavedPaymentMethodOption;
34
+ syncAddressCheckbox?: 'billing' | 'shipping' | 'none';
34
35
  }
35
36
 
36
37
  export interface StripeCheckoutOptions {
37
38
  clientSecret: Promise<string> | string;
38
39
  elementsOptions?: StripeCheckoutElementsOptions;
40
+ adaptivePricing?: {allowed?: boolean};
39
41
  defaultValues?: {
40
42
  billingAddress?: StripeCheckoutContact;
41
43
  shippingAddress?: StripeCheckoutContact;
44
+ email?: string;
45
+ phoneNumber?: string;
42
46
  };
43
47
  }
44
48
 
@@ -361,6 +365,38 @@ export type StripeCheckoutAddressElementOptions = {
361
365
  };
362
366
  };
363
367
 
368
+ /**
369
+ * Wallet button theme options for PaymentFormElement.
370
+ */
371
+ export type PaymentFormWalletButtonTheme = {
372
+ applePay?: 'black' | 'white' | 'white-outline';
373
+ googlePay?: 'black' | 'white';
374
+ paypal?: 'gold' | 'blue' | 'silver' | 'white' | 'black';
375
+ klarna?: 'dark' | 'light' | 'outlined';
376
+ };
377
+
378
+ export type StripeCheckoutPaymentFormElementOptions = {
379
+ /**
380
+ * The layout of the PaymentFormElement.
381
+ */
382
+ layout?: 'expanded' | 'compact';
383
+
384
+ /**
385
+ * An array of saved addresses to display in the PaymentFormElement.
386
+ */
387
+ contacts?: ContactOption[];
388
+
389
+ /**
390
+ * Wallet configuration options.
391
+ */
392
+ wallets?: {
393
+ /**
394
+ * Button theme options for wallet payment methods.
395
+ */
396
+ buttonTheme?: PaymentFormWalletButtonTheme;
397
+ };
398
+ };
399
+
364
400
  export type StripeCheckoutExpressCheckoutElementOptions = {
365
401
  buttonHeight: StripeExpressCheckoutElementOptions['buttonHeight'];
366
402
  buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme'];
@@ -634,7 +670,9 @@ export interface StripeCheckout {
634
670
  options?: StripeCheckoutPaymentElementOptions
635
671
  ): StripePaymentElement;
636
672
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
637
- createPaymentFormElement(): StripePaymentFormElement;
673
+ createPaymentFormElement(
674
+ options?: StripeCheckoutPaymentFormElementOptions
675
+ ): StripePaymentFormElement;
638
676
  createBillingAddressElement(
639
677
  options?: StripeCheckoutAddressElementOptions
640
678
  ): StripeAddressElement;
@@ -31,14 +31,18 @@ export interface StripeCheckoutElementsOptions {
31
31
  loader?: 'auto' | 'always' | 'never';
32
32
  fonts?: Array<CssFontSource | CustomFontSource>;
33
33
  savedPaymentMethod?: SavedPaymentMethodOption;
34
+ syncAddressCheckbox?: 'billing' | 'shipping' | 'none';
34
35
  }
35
36
 
36
37
  export interface StripeCheckoutOptions {
37
38
  clientSecret: Promise<string> | string;
38
39
  elementsOptions?: StripeCheckoutElementsOptions;
40
+ adaptivePricing?: {allowed?: boolean};
39
41
  defaultValues?: {
40
42
  billingAddress?: StripeCheckoutContact;
41
43
  shippingAddress?: StripeCheckoutContact;
44
+ email?: string;
45
+ phoneNumber?: string;
42
46
  };
43
47
  }
44
48
 
@@ -361,6 +365,38 @@ export type StripeCheckoutAddressElementOptions = {
361
365
  };
362
366
  };
363
367
 
368
+ /**
369
+ * Wallet button theme options for PaymentFormElement.
370
+ */
371
+ export type PaymentFormWalletButtonTheme = {
372
+ applePay?: 'black' | 'white' | 'white-outline';
373
+ googlePay?: 'black' | 'white';
374
+ paypal?: 'gold' | 'blue' | 'silver' | 'white' | 'black';
375
+ klarna?: 'dark' | 'light' | 'outlined';
376
+ };
377
+
378
+ export type StripeCheckoutPaymentFormElementOptions = {
379
+ /**
380
+ * The layout of the PaymentFormElement.
381
+ */
382
+ layout?: 'expanded' | 'compact';
383
+
384
+ /**
385
+ * An array of saved addresses to display in the PaymentFormElement.
386
+ */
387
+ contacts?: ContactOption[];
388
+
389
+ /**
390
+ * Wallet configuration options.
391
+ */
392
+ wallets?: {
393
+ /**
394
+ * Button theme options for wallet payment methods.
395
+ */
396
+ buttonTheme?: PaymentFormWalletButtonTheme;
397
+ };
398
+ };
399
+
364
400
  export type StripeCheckoutExpressCheckoutElementOptions = {
365
401
  buttonHeight: StripeExpressCheckoutElementOptions['buttonHeight'];
366
402
  buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme'];
@@ -634,7 +670,9 @@ export interface StripeCheckout {
634
670
  options?: StripeCheckoutPaymentElementOptions
635
671
  ): StripePaymentElement;
636
672
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
637
- createPaymentFormElement(): StripePaymentFormElement;
673
+ createPaymentFormElement(
674
+ options?: StripeCheckoutPaymentFormElementOptions
675
+ ): StripePaymentFormElement;
638
676
  createBillingAddressElement(
639
677
  options?: StripeCheckoutAddressElementOptions
640
678
  ): StripeAddressElement;
@@ -16,4 +16,3 @@ export * from './payment';
16
16
  export * from './shipping-address';
17
17
  export * from './issuing';
18
18
  export * from './tax-id';
19
- export * from './payment-form';
@@ -16,4 +16,3 @@ export * from './payment';
16
16
  export * from './shipping-address';
17
17
  export * from './issuing';
18
18
  export * from './tax-id';
19
- export * from './payment-form';
@@ -1,5 +1,114 @@
1
1
  import {StripeError} from '../stripe';
2
2
  import {StripeElementBase} from './base';
3
+ import {StripeExpressCheckoutElementConfirmEvent} from './express-checkout';
4
+
5
+ /**
6
+ * Address type used in PaymentFormElement change events.
7
+ */
8
+ export type PaymentFormAddress = {
9
+ line1?: string | null;
10
+ line2?: string | null;
11
+ city?: string | null;
12
+ state?: string | null;
13
+ postal_code?: string | null;
14
+ country?: string | null;
15
+ };
16
+
17
+ /**
18
+ * The change event payload for the PaymentFormElement.
19
+ */
20
+ export interface StripePaymentFormElementChangeEvent {
21
+ /**
22
+ * The type of element that emitted this event.
23
+ */
24
+ elementType: 'paymentForm';
25
+
26
+ /**
27
+ * Whether all required fields in the PaymentFormElement are complete.
28
+ */
29
+ complete: boolean;
30
+
31
+ /**
32
+ * Whether the PaymentFormElement is currently empty.
33
+ */
34
+ empty: boolean;
35
+
36
+ /**
37
+ * An object containing the current form values.
38
+ */
39
+ value: {
40
+ customerDetails: {
41
+ email: string;
42
+ };
43
+ shippingOption?: {
44
+ id: string;
45
+ displayName: string;
46
+ amount: string;
47
+ };
48
+ shippingAddress?: {
49
+ name: string;
50
+ address: PaymentFormAddress;
51
+ };
52
+ billingAddress?: {
53
+ name: string;
54
+ address: PaymentFormAddress;
55
+ };
56
+ tax?: {
57
+ businessName: string;
58
+ taxId: string;
59
+ taxIdType: string;
60
+ externalTaxIdType: string;
61
+ };
62
+ customFields?: Record<string, string | number>;
63
+ payment?: {
64
+ collapsed: boolean;
65
+ type: string;
66
+ country?: string | null;
67
+ billingDetails?: {
68
+ address?: {
69
+ country?: string;
70
+ postal_code?: string;
71
+ };
72
+ } | null;
73
+ payment_method?: {
74
+ id: string;
75
+ type: string;
76
+ billing_details: {
77
+ address: PaymentFormAddress;
78
+ name: string | null;
79
+ email: string | null;
80
+ phone: string | null;
81
+ };
82
+ } | null;
83
+ savePaymentMethod?: boolean;
84
+ };
85
+ };
86
+ }
87
+
88
+ /**
89
+ * Confirm event when user completes via Express Checkout (Apple Pay, Google Pay, etc.)
90
+ */
91
+ interface StripePaymentFormExpressCheckoutConfirmEvent
92
+ extends StripeExpressCheckoutElementConfirmEvent {
93
+ source: 'payment-form-ece';
94
+ }
95
+
96
+ /**
97
+ * Confirm event when user clicks the Pay button.
98
+ * paymentMethodType is the selected payment method (e.g., 'card', 'sepa_debit')
99
+ * or null if payment collection is not needed.
100
+ */
101
+ interface StripePaymentFormPayButtonConfirmEvent {
102
+ source: 'payment-form-pay-button';
103
+ paymentMethodType: string | null;
104
+ }
105
+
106
+ /**
107
+ * The confirm event payload for the PaymentFormElement.
108
+ */
109
+ export type StripePaymentFormElementConfirmEvent =
110
+ | StripePaymentFormExpressCheckoutConfirmEvent
111
+ | StripePaymentFormPayButtonConfirmEvent;
3
112
 
4
113
  export type StripePaymentFormElement = StripeElementBase & {
5
114
  /**
@@ -18,6 +127,54 @@ export type StripePaymentFormElement = StripeElementBase & {
18
127
  handler?: (event: {elementType: 'paymentForm'}) => any
19
128
  ): StripePaymentFormElement;
20
129
 
130
+ /**
131
+ * Triggered when the element gains focus.
132
+ */
133
+ on(
134
+ eventType: 'focus',
135
+ handler: (event: {elementType: 'paymentForm'}) => any
136
+ ): StripePaymentFormElement;
137
+ once(
138
+ eventType: 'focus',
139
+ handler: (event: {elementType: 'paymentForm'}) => any
140
+ ): StripePaymentFormElement;
141
+ off(
142
+ eventType: 'focus',
143
+ handler?: (event: {elementType: 'paymentForm'}) => any
144
+ ): StripePaymentFormElement;
145
+
146
+ /**
147
+ * Triggered when the element loses focus.
148
+ */
149
+ on(
150
+ eventType: 'blur',
151
+ handler: (event: {elementType: 'paymentForm'}) => any
152
+ ): StripePaymentFormElement;
153
+ once(
154
+ eventType: 'blur',
155
+ handler: (event: {elementType: 'paymentForm'}) => any
156
+ ): StripePaymentFormElement;
157
+ off(
158
+ eventType: 'blur',
159
+ handler?: (event: {elementType: 'paymentForm'}) => any
160
+ ): StripePaymentFormElement;
161
+
162
+ /**
163
+ * Triggered when the escape key is pressed within the element.
164
+ */
165
+ on(
166
+ eventType: 'escape',
167
+ handler: (event: {elementType: 'paymentForm'}) => any
168
+ ): StripePaymentFormElement;
169
+ once(
170
+ eventType: 'escape',
171
+ handler: (event: {elementType: 'paymentForm'}) => any
172
+ ): StripePaymentFormElement;
173
+ off(
174
+ eventType: 'escape',
175
+ handler?: (event: {elementType: 'paymentForm'}) => any
176
+ ): StripePaymentFormElement;
177
+
21
178
  /**
22
179
  * Triggered when the element fails to load.
23
180
  */
@@ -33,4 +190,57 @@ export type StripePaymentFormElement = StripeElementBase & {
33
190
  eventType: 'loaderror',
34
191
  handler?: (event: {elementType: 'paymentForm'; error: StripeError}) => any
35
192
  ): StripePaymentFormElement;
193
+
194
+ /**
195
+ * Triggered when the element's value changes.
196
+ */
197
+ on(
198
+ eventType: 'change',
199
+ handler: (event: StripePaymentFormElementChangeEvent) => any
200
+ ): StripePaymentFormElement;
201
+ once(
202
+ eventType: 'change',
203
+ handler: (event: StripePaymentFormElementChangeEvent) => any
204
+ ): StripePaymentFormElement;
205
+ off(
206
+ eventType: 'change',
207
+ handler?: (event: StripePaymentFormElementChangeEvent) => any
208
+ ): StripePaymentFormElement;
209
+
210
+ /**
211
+ * Triggered when a buyer authorizes a payment within a supported payment method.
212
+ */
213
+ on(
214
+ eventType: 'confirm',
215
+ handler: (event: StripePaymentFormElementConfirmEvent) => any
216
+ ): StripePaymentFormElement;
217
+ once(
218
+ eventType: 'confirm',
219
+ handler: (event: StripePaymentFormElementConfirmEvent) => any
220
+ ): StripePaymentFormElement;
221
+ off(
222
+ eventType: 'confirm',
223
+ handler?: (event: StripePaymentFormElementConfirmEvent) => any
224
+ ): StripePaymentFormElement;
225
+
226
+ /**
227
+ * Triggered when the payment interface is dismissed (e.g., a buyer closes the payment interface).
228
+ */
229
+ on(
230
+ eventType: 'cancel',
231
+ handler: (event: {elementType: 'paymentForm'}) => any
232
+ ): StripePaymentFormElement;
233
+ once(
234
+ eventType: 'cancel',
235
+ handler: (event: {elementType: 'paymentForm'}) => any
236
+ ): StripePaymentFormElement;
237
+ off(
238
+ eventType: 'cancel',
239
+ handler?: (event: {elementType: 'paymentForm'}) => any
240
+ ): StripePaymentFormElement;
241
+
242
+ /**
243
+ * Retrieves the current form values from the PaymentFormElement.
244
+ */
245
+ getValue(): Promise<StripePaymentFormElementChangeEvent>;
36
246
  };
@@ -1,5 +1,114 @@
1
1
  import {StripeError} from '../stripe';
2
2
  import {StripeElementBase} from './base';
3
+ import {StripeExpressCheckoutElementConfirmEvent} from './express-checkout';
4
+
5
+ /**
6
+ * Address type used in PaymentFormElement change events.
7
+ */
8
+ export type PaymentFormAddress = {
9
+ line1?: string | null;
10
+ line2?: string | null;
11
+ city?: string | null;
12
+ state?: string | null;
13
+ postal_code?: string | null;
14
+ country?: string | null;
15
+ };
16
+
17
+ /**
18
+ * The change event payload for the PaymentFormElement.
19
+ */
20
+ export interface StripePaymentFormElementChangeEvent {
21
+ /**
22
+ * The type of element that emitted this event.
23
+ */
24
+ elementType: 'paymentForm';
25
+
26
+ /**
27
+ * Whether all required fields in the PaymentFormElement are complete.
28
+ */
29
+ complete: boolean;
30
+
31
+ /**
32
+ * Whether the PaymentFormElement is currently empty.
33
+ */
34
+ empty: boolean;
35
+
36
+ /**
37
+ * An object containing the current form values.
38
+ */
39
+ value: {
40
+ customerDetails: {
41
+ email: string;
42
+ };
43
+ shippingOption?: {
44
+ id: string;
45
+ displayName: string;
46
+ amount: string;
47
+ };
48
+ shippingAddress?: {
49
+ name: string;
50
+ address: PaymentFormAddress;
51
+ };
52
+ billingAddress?: {
53
+ name: string;
54
+ address: PaymentFormAddress;
55
+ };
56
+ tax?: {
57
+ businessName: string;
58
+ taxId: string;
59
+ taxIdType: string;
60
+ externalTaxIdType: string;
61
+ };
62
+ customFields?: Record<string, string | number>;
63
+ payment?: {
64
+ collapsed: boolean;
65
+ type: string;
66
+ country?: string | null;
67
+ billingDetails?: {
68
+ address?: {
69
+ country?: string;
70
+ postal_code?: string;
71
+ };
72
+ } | null;
73
+ payment_method?: {
74
+ id: string;
75
+ type: string;
76
+ billing_details: {
77
+ address: PaymentFormAddress;
78
+ name: string | null;
79
+ email: string | null;
80
+ phone: string | null;
81
+ };
82
+ } | null;
83
+ savePaymentMethod?: boolean;
84
+ };
85
+ };
86
+ }
87
+
88
+ /**
89
+ * Confirm event when user completes via Express Checkout (Apple Pay, Google Pay, etc.)
90
+ */
91
+ interface StripePaymentFormExpressCheckoutConfirmEvent
92
+ extends StripeExpressCheckoutElementConfirmEvent {
93
+ source: 'payment-form-ece';
94
+ }
95
+
96
+ /**
97
+ * Confirm event when user clicks the Pay button.
98
+ * paymentMethodType is the selected payment method (e.g., 'card', 'sepa_debit')
99
+ * or null if payment collection is not needed.
100
+ */
101
+ interface StripePaymentFormPayButtonConfirmEvent {
102
+ source: 'payment-form-pay-button';
103
+ paymentMethodType: string | null;
104
+ }
105
+
106
+ /**
107
+ * The confirm event payload for the PaymentFormElement.
108
+ */
109
+ export type StripePaymentFormElementConfirmEvent =
110
+ | StripePaymentFormExpressCheckoutConfirmEvent
111
+ | StripePaymentFormPayButtonConfirmEvent;
3
112
 
4
113
  export type StripePaymentFormElement = StripeElementBase & {
5
114
  /**
@@ -18,6 +127,54 @@ export type StripePaymentFormElement = StripeElementBase & {
18
127
  handler?: (event: {elementType: 'paymentForm'}) => any
19
128
  ): StripePaymentFormElement;
20
129
 
130
+ /**
131
+ * Triggered when the element gains focus.
132
+ */
133
+ on(
134
+ eventType: 'focus',
135
+ handler: (event: {elementType: 'paymentForm'}) => any
136
+ ): StripePaymentFormElement;
137
+ once(
138
+ eventType: 'focus',
139
+ handler: (event: {elementType: 'paymentForm'}) => any
140
+ ): StripePaymentFormElement;
141
+ off(
142
+ eventType: 'focus',
143
+ handler?: (event: {elementType: 'paymentForm'}) => any
144
+ ): StripePaymentFormElement;
145
+
146
+ /**
147
+ * Triggered when the element loses focus.
148
+ */
149
+ on(
150
+ eventType: 'blur',
151
+ handler: (event: {elementType: 'paymentForm'}) => any
152
+ ): StripePaymentFormElement;
153
+ once(
154
+ eventType: 'blur',
155
+ handler: (event: {elementType: 'paymentForm'}) => any
156
+ ): StripePaymentFormElement;
157
+ off(
158
+ eventType: 'blur',
159
+ handler?: (event: {elementType: 'paymentForm'}) => any
160
+ ): StripePaymentFormElement;
161
+
162
+ /**
163
+ * Triggered when the escape key is pressed within the element.
164
+ */
165
+ on(
166
+ eventType: 'escape',
167
+ handler: (event: {elementType: 'paymentForm'}) => any
168
+ ): StripePaymentFormElement;
169
+ once(
170
+ eventType: 'escape',
171
+ handler: (event: {elementType: 'paymentForm'}) => any
172
+ ): StripePaymentFormElement;
173
+ off(
174
+ eventType: 'escape',
175
+ handler?: (event: {elementType: 'paymentForm'}) => any
176
+ ): StripePaymentFormElement;
177
+
21
178
  /**
22
179
  * Triggered when the element fails to load.
23
180
  */
@@ -33,4 +190,57 @@ export type StripePaymentFormElement = StripeElementBase & {
33
190
  eventType: 'loaderror',
34
191
  handler?: (event: {elementType: 'paymentForm'; error: StripeError}) => any
35
192
  ): StripePaymentFormElement;
193
+
194
+ /**
195
+ * Triggered when the element's value changes.
196
+ */
197
+ on(
198
+ eventType: 'change',
199
+ handler: (event: StripePaymentFormElementChangeEvent) => any
200
+ ): StripePaymentFormElement;
201
+ once(
202
+ eventType: 'change',
203
+ handler: (event: StripePaymentFormElementChangeEvent) => any
204
+ ): StripePaymentFormElement;
205
+ off(
206
+ eventType: 'change',
207
+ handler?: (event: StripePaymentFormElementChangeEvent) => any
208
+ ): StripePaymentFormElement;
209
+
210
+ /**
211
+ * Triggered when a buyer authorizes a payment within a supported payment method.
212
+ */
213
+ on(
214
+ eventType: 'confirm',
215
+ handler: (event: StripePaymentFormElementConfirmEvent) => any
216
+ ): StripePaymentFormElement;
217
+ once(
218
+ eventType: 'confirm',
219
+ handler: (event: StripePaymentFormElementConfirmEvent) => any
220
+ ): StripePaymentFormElement;
221
+ off(
222
+ eventType: 'confirm',
223
+ handler?: (event: StripePaymentFormElementConfirmEvent) => any
224
+ ): StripePaymentFormElement;
225
+
226
+ /**
227
+ * Triggered when the payment interface is dismissed (e.g., a buyer closes the payment interface).
228
+ */
229
+ on(
230
+ eventType: 'cancel',
231
+ handler: (event: {elementType: 'paymentForm'}) => any
232
+ ): StripePaymentFormElement;
233
+ once(
234
+ eventType: 'cancel',
235
+ handler: (event: {elementType: 'paymentForm'}) => any
236
+ ): StripePaymentFormElement;
237
+ off(
238
+ eventType: 'cancel',
239
+ handler?: (event: {elementType: 'paymentForm'}) => any
240
+ ): StripePaymentFormElement;
241
+
242
+ /**
243
+ * Retrieves the current form values from the PaymentFormElement.
244
+ */
245
+ getValue(): Promise<StripePaymentFormElementChangeEvent>;
36
246
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "8.6.3",
3
+ "version": "8.7.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",