@stripe/stripe-js 1.35.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.35.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.35.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.35.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.35.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.35.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",
@@ -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.
@@ -159,11 +159,6 @@ export interface StripeShippingAddressElementOptions {
159
159
  phone?: string | null;
160
160
  };
161
161
 
162
- /**
163
- * Whether or not ShippingAddressElement provides autocomplete suggestions
164
- */
165
- disableAutocomplete?: boolean;
166
-
167
162
  /**
168
163
  * Control which additional fields to display in the shippingAddress Element.
169
164
  */
@@ -7,10 +7,9 @@ import * as elements from './elements';
7
7
  import * as financialConnections from './financial-connections';
8
8
 
9
9
  import {StripeElements, StripeElementsOptions} from './elements-group';
10
- import {RedirectToCheckoutOptions} from './checkout';
10
+ import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout';
11
11
  import {PaymentRequestOptions, PaymentRequest} from './payment-request';
12
12
  import {StripeElement, StripeElementLocale} from './elements-group';
13
- import {CheckoutLocale} from './checkout';
14
13
 
15
14
  export interface Stripe {
16
15
  /////////////////////////////
@@ -508,6 +507,14 @@ export interface Stripe {
508
507
  data?: paymentIntents.VerifyMicrodepositsForPaymentData
509
508
  ): Promise<PaymentIntentResult>;
510
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
+
511
518
  /**
512
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)
513
520
  * payment method to collect the customer’s bank account in your payment form.
@@ -1044,7 +1051,7 @@ export type FinancialConnectionsSessionResult =
1044
1051
  export type CollectBankAccountTokenResult =
1045
1052
  | {
1046
1053
  financialConnectionsSession: api.FinancialConnectionsSession;
1047
- token: string;
1054
+ token: api.BankAccountToken;
1048
1055
  error?: undefined;
1049
1056
  }
1050
1057
  | {
@@ -1053,6 +1060,14 @@ export type CollectBankAccountTokenResult =
1053
1060
  error: StripeError;
1054
1061
  };
1055
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
+
1056
1071
  export interface WrapperLibrary {
1057
1072
  /**
1058
1073
  * Your library’s name, maximum length is 30