@stripe/stripe-js 1.37.0 → 1.38.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/pure.esm.js CHANGED
@@ -54,7 +54,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
54
54
 
55
55
  stripe._registerWrapper({
56
56
  name: 'stripe-js',
57
- version: "1.37.0",
57
+ version: "1.38.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
package/dist/pure.js CHANGED
@@ -58,7 +58,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
58
58
 
59
59
  stripe._registerWrapper({
60
60
  name: 'stripe-js',
61
- version: "1.37.0",
61
+ version: "1.38.0",
62
62
  startTime: startTime
63
63
  });
64
64
  };
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "1.37.0",
41
+ version: "1.38.0",
42
42
  startTime: startTime
43
43
  });
44
44
  };
package/dist/stripe.js CHANGED
@@ -42,7 +42,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
42
42
 
43
43
  stripe._registerWrapper({
44
44
  name: 'stripe-js',
45
- version: "1.37.0",
45
+ version: "1.38.0",
46
46
  startTime: startTime
47
47
  });
48
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "1.37.0",
3
+ "version": "1.38.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "main": "dist/stripe.js",
6
6
  "module": "dist/stripe.esm.js",
@@ -171,6 +171,8 @@ export interface StripeAddressElementOptions {
171
171
  */
172
172
  defaultValues?: {
173
173
  name?: string | null;
174
+ firstName?: string | null;
175
+ lastName?: string | null;
174
176
  address?: {
175
177
  line1?: string | null;
176
178
  line2?: string | null;
@@ -197,6 +199,13 @@ export interface StripeAddressElementOptions {
197
199
  required: 'always' | 'never' | 'auto';
198
200
  };
199
201
  };
202
+
203
+ /**
204
+ * Specify display options in the AddressElement
205
+ */
206
+ display?: {
207
+ name?: 'full' | 'split' | 'organization';
208
+ };
200
209
  }
201
210
 
202
211
  export interface StripeAddressElementChangeEvent
@@ -231,6 +240,8 @@ export interface StripeAddressElementChangeEvent
231
240
  */
232
241
  value: {
233
242
  name: string;
243
+ firstName?: string;
244
+ lastName?: string;
234
245
  address: {
235
246
  line1: string;
236
247
  line2: string | null;
@@ -1,4 +1,5 @@
1
1
  export * from './address';
2
+ export * from './payment-method-messaging';
2
3
  export * from './affirm-message';
3
4
  export * from './afterpay-clearpay-message';
4
5
  export * from './au-bank-account';
@@ -0,0 +1,93 @@
1
+ export type StripePaymentMethodMessagingElement = {
2
+ /**
3
+ * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM.
4
+ * `element.mount` accepts either a CSS Selector (e.g., `'#payment-method-messaging'`) or a DOM element.
5
+ */
6
+ mount(domElement: string | HTMLElement): void;
7
+
8
+ /**
9
+ * Removes the element from the DOM and destroys it.
10
+ * A destroyed element can not be re-activated or re-mounted to the DOM.
11
+ */
12
+ destroy(): void;
13
+
14
+ /**
15
+ * Unmounts the element from the DOM.
16
+ * Call `element.mount` to re-attach it to the DOM.
17
+ */
18
+ unmount(): void;
19
+
20
+ /**
21
+ * Updates the options the `PaymentMethodMessagingElement` was initialized with.
22
+ * Updates are merged into the existing configuration.
23
+ */
24
+ update(options: Partial<StripePaymentMethodMessagingElementOptions>): void;
25
+
26
+ /**
27
+ * Triggered when the element is fully loaded and ready to perform method calls.
28
+ */
29
+ on(
30
+ eventType: 'ready',
31
+ handler: (event: {elementType: 'paymentMethodMessaging'}) => any
32
+ ): StripePaymentMethodMessagingElement;
33
+ };
34
+
35
+ export interface StripePaymentMethodMessagingElementOptions {
36
+ /**
37
+ * The total amount in the smallest currency unit.
38
+ */
39
+ amount: number;
40
+
41
+ /**
42
+ * The currency to display.
43
+ */
44
+ currency:
45
+ | 'USD'
46
+ | 'GBP'
47
+ | 'EUR'
48
+ | 'DKK'
49
+ | 'NOK'
50
+ | 'SEK'
51
+ | 'AUD'
52
+ | 'CAD'
53
+ | 'NZD';
54
+
55
+ /**
56
+ * Payment methods to show messaging for.
57
+ */
58
+ paymentMethods: Array<'afterpay_clearpay' | 'klarna'>;
59
+
60
+ /**
61
+ * The country the end-buyer is in.
62
+ */
63
+ countryCode:
64
+ | 'US'
65
+ | 'CA'
66
+ | 'AU'
67
+ | 'NZ'
68
+ | 'GB'
69
+ | 'IE'
70
+ | 'FR'
71
+ | 'ES'
72
+ | 'DE'
73
+ | 'AT'
74
+ | 'BE'
75
+ | 'DK'
76
+ | 'FI'
77
+ | 'IT'
78
+ | 'NL'
79
+ | 'NO'
80
+ | 'SE';
81
+
82
+ /**
83
+ * The font color of the promotional message.
84
+ */
85
+ darkMode?: boolean;
86
+
87
+ /**
88
+ * The font size of the promotional message.
89
+ */
90
+ metaData?: {
91
+ messagingClientReferenceId: string | null;
92
+ };
93
+ }
@@ -31,6 +31,8 @@ import {
31
31
  StripeAfterpayClearpayMessageElementOptions,
32
32
  StripeAffirmMessageElement,
33
33
  StripeAffirmMessageElementOptions,
34
+ StripePaymentMethodMessagingElementOptions,
35
+ StripePaymentMethodMessagingElement,
34
36
  StripeAfterpayClearpayMessageElement,
35
37
  StripeAuBankAccountElementOptions,
36
38
  } from './elements';
@@ -71,6 +73,25 @@ export interface StripeElements {
71
73
  */
72
74
  getElement(elementType: 'address'): StripeAddressElement | null;
73
75
 
76
+ /////////////////////////////
77
+ /// paymentMethodMessaging
78
+ /////////////////////////////
79
+
80
+ /**
81
+ * Creates an `paymentMethodMessagingElement`.
82
+ */
83
+ create(
84
+ elementType: 'paymentMethodMessaging',
85
+ options: StripePaymentMethodMessagingElementOptions
86
+ ): StripePaymentMethodMessagingElement;
87
+
88
+ /**
89
+ * Looks up a previously created `Element` by its type.
90
+ */
91
+ getElement(
92
+ elementType: 'paymentMethodMessaging'
93
+ ): StripePaymentMethodMessagingElement | null;
94
+
74
95
  /////////////////////////////
75
96
  /// affirmMessage
76
97
  /////////////////////////////