@stripe/stripe-js 1.32.0 → 1.35.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/api/financial-connections.d.ts +86 -0
- package/types/api/index.d.ts +1 -0
- package/types/stripe-js/elements/link-authentication.d.ts +16 -0
- package/types/stripe-js/elements/payment.d.ts +37 -0
- package/types/stripe-js/elements/shipping-address.d.ts +42 -0
- package/types/stripe-js/financial-connections.d.ts +19 -0
- package/types/stripe-js/stripe.d.ts +43 -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
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Financial Connections Session object
|
|
3
|
+
*/
|
|
4
|
+
export interface FinancialConnectionsSession {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for the object.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List of accounts collected by the Session
|
|
12
|
+
*/
|
|
13
|
+
accounts: FinancialConnectionsSession.Account[];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Filters applied to the Session
|
|
17
|
+
*/
|
|
18
|
+
filters?: FinancialConnectionsSession.Filters;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* List of data permissions requested in the Session
|
|
22
|
+
*/
|
|
23
|
+
permissions?: FinancialConnectionsSession.Permission[];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* For webview integrations only. The user will be redirected to this URL to return to your app.
|
|
27
|
+
*/
|
|
28
|
+
return_url?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export namespace FinancialConnectionsSession {
|
|
32
|
+
/**
|
|
33
|
+
* The Financial Connections Account object
|
|
34
|
+
*/
|
|
35
|
+
export interface Account {
|
|
36
|
+
/**
|
|
37
|
+
* Unique identifier for the object.
|
|
38
|
+
*/
|
|
39
|
+
id: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* String representing the object's type. `'linked_account'` is present for backwards-compatibility.
|
|
43
|
+
*/
|
|
44
|
+
object: 'linked_account' | 'financial_connections.account';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The type of the account.
|
|
48
|
+
*/
|
|
49
|
+
category: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A human-readable name that has been assigned to this account, either by the account holder or by the institution.
|
|
53
|
+
*/
|
|
54
|
+
display_name: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The name of the institution that holds this account.
|
|
58
|
+
*/
|
|
59
|
+
institution_name: string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The last 4 digits of the account number. If present, this will be 4 numeric characters.
|
|
63
|
+
*/
|
|
64
|
+
last4: string | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Filters to restrict the kinds of accounts to collect.
|
|
69
|
+
*/
|
|
70
|
+
export interface Filters {
|
|
71
|
+
/**
|
|
72
|
+
* List of countries from which to collect accounts.
|
|
73
|
+
*/
|
|
74
|
+
countries?: string[];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Data features to which access can be requested
|
|
79
|
+
*/
|
|
80
|
+
export type Permission =
|
|
81
|
+
| 'payment_method'
|
|
82
|
+
| 'balances'
|
|
83
|
+
| 'transactions'
|
|
84
|
+
| 'ownership'
|
|
85
|
+
| 'account_numbers';
|
|
86
|
+
}
|
package/types/api/index.d.ts
CHANGED
|
@@ -106,6 +106,22 @@ export type StripeLinkAuthenticationElement = StripeElementBase & {
|
|
|
106
106
|
error: StripeError;
|
|
107
107
|
}) => any
|
|
108
108
|
): StripeLinkAuthenticationElement;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
|
|
112
|
+
*/
|
|
113
|
+
on(
|
|
114
|
+
eventType: 'loaderstart',
|
|
115
|
+
handler: (event: {elementType: 'linkAuthentication'}) => any
|
|
116
|
+
): StripeLinkAuthenticationElement;
|
|
117
|
+
once(
|
|
118
|
+
eventType: 'loaderstart',
|
|
119
|
+
handler: (event: {elementType: 'linkAuthentication'}) => any
|
|
120
|
+
): StripeLinkAuthenticationElement;
|
|
121
|
+
off(
|
|
122
|
+
eventType: 'loaderstart',
|
|
123
|
+
handler?: (event: {elementType: 'linkAuthentication'}) => any
|
|
124
|
+
): StripeLinkAuthenticationElement;
|
|
109
125
|
};
|
|
110
126
|
|
|
111
127
|
export interface StripeLinkAuthenticationElementOptions {
|
|
@@ -98,6 +98,22 @@ export type StripePaymentElement = StripeElementBase & {
|
|
|
98
98
|
handler?: (event: {elementType: 'payment'; error: StripeError}) => any
|
|
99
99
|
): StripePaymentElement;
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
|
|
103
|
+
*/
|
|
104
|
+
on(
|
|
105
|
+
eventType: 'loaderstart',
|
|
106
|
+
handler: (event: {elementType: 'payment'}) => any
|
|
107
|
+
): StripePaymentElement;
|
|
108
|
+
once(
|
|
109
|
+
eventType: 'loaderstart',
|
|
110
|
+
handler: (event: {elementType: 'payment'}) => any
|
|
111
|
+
): StripePaymentElement;
|
|
112
|
+
off(
|
|
113
|
+
eventType: 'loaderstart',
|
|
114
|
+
handler?: (event: {elementType: 'payment'}) => any
|
|
115
|
+
): StripePaymentElement;
|
|
116
|
+
|
|
101
117
|
/**
|
|
102
118
|
* Updates the options the `PaymentElement` was initialized with.
|
|
103
119
|
* Updates are merged into the existing configuration.
|
|
@@ -110,6 +126,22 @@ export type StripePaymentElement = StripeElementBase & {
|
|
|
110
126
|
collapse(): StripePaymentElement;
|
|
111
127
|
};
|
|
112
128
|
|
|
129
|
+
export interface DefaultValuesOption {
|
|
130
|
+
billingDetails?: {
|
|
131
|
+
name?: string;
|
|
132
|
+
email?: string;
|
|
133
|
+
phone?: string;
|
|
134
|
+
address?: {
|
|
135
|
+
country?: string;
|
|
136
|
+
postal_code?: string;
|
|
137
|
+
state?: string;
|
|
138
|
+
city?: string;
|
|
139
|
+
line1?: string;
|
|
140
|
+
line2?: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
113
145
|
export type FieldOption = 'auto' | 'never';
|
|
114
146
|
|
|
115
147
|
export interface FieldsOption {
|
|
@@ -152,6 +184,11 @@ export interface WalletsOption {
|
|
|
152
184
|
}
|
|
153
185
|
|
|
154
186
|
export interface StripePaymentElementOptions {
|
|
187
|
+
/**
|
|
188
|
+
* Provide initial customer information that will be displayed in the Payment Element.
|
|
189
|
+
*/
|
|
190
|
+
defaultValues?: DefaultValuesOption;
|
|
191
|
+
|
|
155
192
|
/**
|
|
156
193
|
* Override the business name displayed in the Payment Element.
|
|
157
194
|
* By default the PaymentElement will use your Stripe account or business name.
|
|
@@ -106,6 +106,30 @@ export type StripeShippingAddressElement = StripeElementBase & {
|
|
|
106
106
|
error: StripeError;
|
|
107
107
|
}) => any
|
|
108
108
|
): StripeShippingAddressElement;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Triggered when the loader UI is mounted to the DOM and ready to be displayed.
|
|
112
|
+
*/
|
|
113
|
+
on(
|
|
114
|
+
eventType: 'loaderstart',
|
|
115
|
+
handler: (event: {elementType: 'shippingAddress'}) => any
|
|
116
|
+
): StripeShippingAddressElement;
|
|
117
|
+
once(
|
|
118
|
+
eventType: 'loaderstart',
|
|
119
|
+
handler: (event: {elementType: 'shippingAddress'}) => any
|
|
120
|
+
): StripeShippingAddressElement;
|
|
121
|
+
off(
|
|
122
|
+
eventType: 'loaderstart',
|
|
123
|
+
handler?: (event: {elementType: 'shippingAddress'}) => any
|
|
124
|
+
): StripeShippingAddressElement;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Updates the options the `ShippingAddressElement` was initialized with.
|
|
128
|
+
* Updates are merged into the existing configuration.
|
|
129
|
+
*/
|
|
130
|
+
update(
|
|
131
|
+
options: Partial<StripeShippingAddressElementOptions>
|
|
132
|
+
): StripeShippingAddressElement;
|
|
109
133
|
};
|
|
110
134
|
|
|
111
135
|
export interface StripeShippingAddressElementOptions {
|
|
@@ -132,12 +156,29 @@ export interface StripeShippingAddressElementOptions {
|
|
|
132
156
|
postal_code?: string | null;
|
|
133
157
|
country: string;
|
|
134
158
|
};
|
|
159
|
+
phone?: string | null;
|
|
135
160
|
};
|
|
136
161
|
|
|
137
162
|
/**
|
|
138
163
|
* Whether or not ShippingAddressElement provides autocomplete suggestions
|
|
139
164
|
*/
|
|
140
165
|
disableAutocomplete?: boolean;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Control which additional fields to display in the shippingAddress Element.
|
|
169
|
+
*/
|
|
170
|
+
fields?: {
|
|
171
|
+
phone?: 'always' | 'never' | 'auto';
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Specify validation rules for the above additional fields.
|
|
176
|
+
*/
|
|
177
|
+
validation?: {
|
|
178
|
+
phone?: {
|
|
179
|
+
required: 'always' | 'never' | 'auto';
|
|
180
|
+
};
|
|
181
|
+
};
|
|
141
182
|
}
|
|
142
183
|
|
|
143
184
|
export interface StripeShippingAddressElementChangeEvent
|
|
@@ -175,5 +216,6 @@ export interface StripeShippingAddressElementChangeEvent
|
|
|
175
216
|
postal_code: string;
|
|
176
217
|
country: string;
|
|
177
218
|
};
|
|
219
|
+
phone?: string;
|
|
178
220
|
};
|
|
179
221
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data to be sent with a `stripe.collectFinancialConnectionsAccounts` request.
|
|
3
|
+
*/
|
|
4
|
+
export interface CollectFinancialConnectionsAccountsOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The client secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).
|
|
7
|
+
*/
|
|
8
|
+
clientSecret: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Data to be sent with a `stripe.collectBankAccountToken` request.
|
|
13
|
+
*/
|
|
14
|
+
export interface CollectBankAccountTokenOptions {
|
|
15
|
+
/**
|
|
16
|
+
* The client secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).
|
|
17
|
+
*/
|
|
18
|
+
clientSecret: string;
|
|
19
|
+
}
|
|
@@ -4,6 +4,7 @@ import * as setupIntents from './setup-intents';
|
|
|
4
4
|
import * as orders from './orders';
|
|
5
5
|
import * as tokens from './token-and-sources';
|
|
6
6
|
import * as elements from './elements';
|
|
7
|
+
import * as financialConnections from './financial-connections';
|
|
7
8
|
|
|
8
9
|
import {StripeElements, StripeElementsOptions} from './elements-group';
|
|
9
10
|
import {RedirectToCheckoutOptions} from './checkout';
|
|
@@ -975,6 +976,29 @@ export interface Stripe {
|
|
|
975
976
|
* * @docs https://stripe.com/docs/js/identity/modal
|
|
976
977
|
*/
|
|
977
978
|
verifyIdentity(clientSecret: string): Promise<VerificationSessionResult>;
|
|
979
|
+
|
|
980
|
+
/////////////////////////////
|
|
981
|
+
/// Financial Connections
|
|
982
|
+
///
|
|
983
|
+
/////////////////////////////
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Use `stripe.collectFinancialConnectionsAccounts` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect financial accounts.
|
|
987
|
+
*
|
|
988
|
+
* * @docs https://stripe.com/docs/js/financial_connections/collect_financial_connections_accounts
|
|
989
|
+
*/
|
|
990
|
+
collectFinancialConnectionsAccounts(
|
|
991
|
+
options: financialConnections.CollectFinancialConnectionsAccountsOptions
|
|
992
|
+
): Promise<FinancialConnectionsSessionResult>;
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* Use `stripe.collectBankAccountToken` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect a [Bank Account Token](https://stripe.com/docs/api/tokens/object).
|
|
996
|
+
*
|
|
997
|
+
* * @docs https://stripe.com/docs/js/financial_connections/collect_bank_account_token
|
|
998
|
+
*/
|
|
999
|
+
collectBankAccountToken(
|
|
1000
|
+
options: financialConnections.CollectBankAccountTokenOptions
|
|
1001
|
+
): Promise<CollectBankAccountTokenResult>;
|
|
978
1002
|
}
|
|
979
1003
|
|
|
980
1004
|
export type PaymentIntentResult =
|
|
@@ -1010,6 +1034,25 @@ export type VerificationSessionResult =
|
|
|
1010
1034
|
| {verificationSession: api.VerificationSession; error?: undefined}
|
|
1011
1035
|
| {verificationSession?: undefined; error: StripeError};
|
|
1012
1036
|
|
|
1037
|
+
export type FinancialConnectionsSessionResult =
|
|
1038
|
+
| {
|
|
1039
|
+
financialConnectionsSession: api.FinancialConnectionsSession;
|
|
1040
|
+
error?: undefined;
|
|
1041
|
+
}
|
|
1042
|
+
| {financialConnectionsSession: undefined; error: StripeError};
|
|
1043
|
+
|
|
1044
|
+
export type CollectBankAccountTokenResult =
|
|
1045
|
+
| {
|
|
1046
|
+
financialConnectionsSession: api.FinancialConnectionsSession;
|
|
1047
|
+
token: string;
|
|
1048
|
+
error?: undefined;
|
|
1049
|
+
}
|
|
1050
|
+
| {
|
|
1051
|
+
financialConnectionsSession: undefined;
|
|
1052
|
+
token: undefined;
|
|
1053
|
+
error: StripeError;
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1013
1056
|
export interface WrapperLibrary {
|
|
1014
1057
|
/**
|
|
1015
1058
|
* Your library’s name, maximum length is 30
|