@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 +1 -1
- package/dist/pure.js +1 -1
- package/dist/stripe.esm.js +1 -1
- package/dist/stripe.js +1 -1
- package/package.json +1 -1
- package/types/stripe-js/elements/address.d.ts +11 -0
- package/types/stripe-js/elements/index.d.ts +1 -0
- package/types/stripe-js/elements/payment-method-messaging.d.ts +93 -0
- package/types/stripe-js/elements-group.d.ts +21 -0
package/dist/pure.esm.js
CHANGED
package/dist/pure.js
CHANGED
package/dist/stripe.esm.js
CHANGED
package/dist/stripe.js
CHANGED
package/package.json
CHANGED
|
@@ -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;
|
|
@@ -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
|
/////////////////////////////
|