@stripe/stripe-js 1.33.0 → 1.36.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.33.0",
57
+ version: "1.36.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.33.0",
61
+ version: "1.36.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.33.0",
41
+ version: "1.36.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.33.0",
45
+ version: "1.36.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.33.0",
3
+ "version": "1.36.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "main": "dist/stripe.js",
6
6
  "module": "dist/stripe.esm.js",
@@ -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
+ }
@@ -8,3 +8,4 @@ export * from './tokens';
8
8
  export * from './bank-accounts';
9
9
  export * from './cards';
10
10
  export * from './verification-sessions';
11
+ export * from './financial-connections';
@@ -1,3 +1,4 @@
1
+ import {Omit} from '../utils';
1
2
  import {Card} from './cards';
2
3
  import {BankAccount} from './bank-accounts';
3
4
  import {JapanAddressParam, MetadataParam} from './shared';
@@ -46,6 +47,10 @@ export interface Token {
46
47
  used: boolean;
47
48
  }
48
49
 
50
+ export type BankAccountToken = Omit<Token, 'card'> & {
51
+ bank_account: BankAccount;
52
+ };
53
+
49
54
  export namespace TokenCreateParams {
50
55
  export interface Account {
51
56
  /**
@@ -86,6 +86,22 @@ export type StripeCardNumberElement = StripeElementBase & {
86
86
  handler?: (event: {elementType: 'cardNumber'}) => any
87
87
  ): StripeCardNumberElement;
88
88
 
89
+ /**
90
+ * Triggered when there is a change to the available networks the provided card can run on.
91
+ */
92
+ on(
93
+ eventType: 'networkschange',
94
+ handler: (event: {elementType: 'cardNumber'}) => any
95
+ ): StripeCardNumberElement;
96
+ once(
97
+ eventType: 'networkschange',
98
+ handler: (event: {elementType: 'cardNumber'}) => any
99
+ ): StripeCardNumberElement;
100
+ off(
101
+ eventType: 'networkschange',
102
+ handler?: (event: {elementType: 'cardNumber'}) => any
103
+ ): StripeCardNumberElement;
104
+
89
105
  /**
90
106
  * Updates the options the `CardNumberElement` was initialized with.
91
107
  * Updates are merged into the existing configuration.
@@ -86,6 +86,22 @@ export type StripeCardElement = StripeElementBase & {
86
86
  handler?: (event: {elementType: 'card'}) => any
87
87
  ): StripeCardElement;
88
88
 
89
+ /**
90
+ * Triggered when there is a change to the available networks the provided card can run on.
91
+ */
92
+ on(
93
+ eventType: 'networkschange',
94
+ handler: (event: {elementType: 'card'}) => any
95
+ ): StripeCardElement;
96
+ once(
97
+ eventType: 'networkschange',
98
+ handler: (event: {elementType: 'card'}) => any
99
+ ): StripeCardElement;
100
+ off(
101
+ eventType: 'networkschange',
102
+ handler?: (event: {elementType: 'card'}) => any
103
+ ): StripeCardElement;
104
+
89
105
  /**
90
106
  * Updates the options the `CardElement` was initialized with.
91
107
  * Updates are merged into the existing configuration.
@@ -122,6 +122,14 @@ export type StripeShippingAddressElement = StripeElementBase & {
122
122
  eventType: 'loaderstart',
123
123
  handler?: (event: {elementType: 'shippingAddress'}) => any
124
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;
125
133
  };
126
134
 
127
135
  export interface StripeShippingAddressElementOptions {
@@ -148,12 +156,24 @@ export interface StripeShippingAddressElementOptions {
148
156
  postal_code?: string | null;
149
157
  country: string;
150
158
  };
159
+ phone?: string | null;
160
+ };
161
+
162
+ /**
163
+ * Control which additional fields to display in the shippingAddress Element.
164
+ */
165
+ fields?: {
166
+ phone?: 'always' | 'never' | 'auto';
151
167
  };
152
168
 
153
169
  /**
154
- * Whether or not ShippingAddressElement provides autocomplete suggestions
170
+ * Specify validation rules for the above additional fields.
155
171
  */
156
- disableAutocomplete?: boolean;
172
+ validation?: {
173
+ phone?: {
174
+ required: 'always' | 'never' | 'auto';
175
+ };
176
+ };
157
177
  }
158
178
 
159
179
  export interface StripeShippingAddressElementChangeEvent
@@ -191,5 +211,6 @@ export interface StripeShippingAddressElementChangeEvent
191
211
  postal_code: string;
192
212
  country: string;
193
213
  };
214
+ phone?: string;
194
215
  };
195
216
  }
@@ -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,12 +4,12 @@ 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
- import {RedirectToCheckoutOptions} from './checkout';
10
+ import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout';
10
11
  import {PaymentRequestOptions, PaymentRequest} from './payment-request';
11
12
  import {StripeElement, StripeElementLocale} from './elements-group';
12
- import {CheckoutLocale} from './checkout';
13
13
 
14
14
  export interface Stripe {
15
15
  /////////////////////////////
@@ -507,6 +507,14 @@ export interface Stripe {
507
507
  data?: paymentIntents.VerifyMicrodepositsForPaymentData
508
508
  ): Promise<PaymentIntentResult>;
509
509
 
510
+ /**
511
+ * Use stripe.createRadarSession to create a [Radar Session](https://stripe.com/docs/radar/radar-session) in your checkout flow or when saving card details.
512
+ * A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
513
+ * This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
514
+ * By using Radar Sessions, you can capture critical fraud information without tokenizing on Stripe.
515
+ */
516
+ createRadarSession(): Promise<RadarSessionPayload>;
517
+
510
518
  /**
511
519
  * Use `stripe.collectBankAccountForPayment` in the [Accept a payment flow](https://stripe.com/docs/payments/ach-debit/accept-a-payment) for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit)
512
520
  * payment method to collect the customer’s bank account in your payment form.
@@ -975,6 +983,29 @@ export interface Stripe {
975
983
  * * @docs https://stripe.com/docs/js/identity/modal
976
984
  */
977
985
  verifyIdentity(clientSecret: string): Promise<VerificationSessionResult>;
986
+
987
+ /////////////////////////////
988
+ /// Financial Connections
989
+ ///
990
+ /////////////////////////////
991
+
992
+ /**
993
+ * Use `stripe.collectFinancialConnectionsAccounts` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect financial accounts.
994
+ *
995
+ * * @docs https://stripe.com/docs/js/financial_connections/collect_financial_connections_accounts
996
+ */
997
+ collectFinancialConnectionsAccounts(
998
+ options: financialConnections.CollectFinancialConnectionsAccountsOptions
999
+ ): Promise<FinancialConnectionsSessionResult>;
1000
+
1001
+ /**
1002
+ * 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).
1003
+ *
1004
+ * * @docs https://stripe.com/docs/js/financial_connections/collect_bank_account_token
1005
+ */
1006
+ collectBankAccountToken(
1007
+ options: financialConnections.CollectBankAccountTokenOptions
1008
+ ): Promise<CollectBankAccountTokenResult>;
978
1009
  }
979
1010
 
980
1011
  export type PaymentIntentResult =
@@ -1010,6 +1041,33 @@ export type VerificationSessionResult =
1010
1041
  | {verificationSession: api.VerificationSession; error?: undefined}
1011
1042
  | {verificationSession?: undefined; error: StripeError};
1012
1043
 
1044
+ export type FinancialConnectionsSessionResult =
1045
+ | {
1046
+ financialConnectionsSession: api.FinancialConnectionsSession;
1047
+ error?: undefined;
1048
+ }
1049
+ | {financialConnectionsSession: undefined; error: StripeError};
1050
+
1051
+ export type CollectBankAccountTokenResult =
1052
+ | {
1053
+ financialConnectionsSession: api.FinancialConnectionsSession;
1054
+ token: api.BankAccountToken;
1055
+ error?: undefined;
1056
+ }
1057
+ | {
1058
+ financialConnectionsSession: undefined;
1059
+ token: undefined;
1060
+ error: StripeError;
1061
+ };
1062
+
1063
+ /* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments.
1064
+ This metadata includes information like IP address, browser, screen or device information, and other device characteristics.
1065
+ You can find more details about how Radar uses this data by reading about how Radar performs [advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection).
1066
+ */
1067
+ export type RadarSessionPayload =
1068
+ | {radarSession: Record<any, any>; error?: undefined}
1069
+ | {radarSession?: undefined; error: StripeError};
1070
+
1013
1071
  export interface WrapperLibrary {
1014
1072
  /**
1015
1073
  * Your library’s name, maximum length is 30