@stripe/stripe-js 1.24.0 → 1.27.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.24.0",
57
+ version: "1.27.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
@@ -117,7 +117,8 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
117
117
  var stripe = maybeStripe.apply(undefined, args);
118
118
  registerWrapper(stripe, startTime);
119
119
  return stripe;
120
- };
120
+ }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
121
+
121
122
  var validateLoadParams = function validateLoadParams(params) {
122
123
  var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
123
124
 
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.24.0",
61
+ version: "1.27.0",
62
62
  startTime: startTime
63
63
  });
64
64
  };
@@ -121,7 +121,8 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
121
121
  var stripe = maybeStripe.apply(undefined, args);
122
122
  registerWrapper(stripe, startTime);
123
123
  return stripe;
124
- };
124
+ }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
125
+
125
126
  var validateLoadParams = function validateLoadParams(params) {
126
127
  var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n");
127
128
 
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "1.24.0",
41
+ version: "1.27.0",
42
42
  startTime: startTime
43
43
  });
44
44
  };
@@ -101,7 +101,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
101
101
  var stripe = maybeStripe.apply(undefined, args);
102
102
  registerWrapper(stripe, startTime);
103
103
  return stripe;
104
- };
104
+ }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
105
105
 
106
106
  // own script injection.
107
107
 
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.24.0",
45
+ version: "1.27.0",
46
46
  startTime: startTime
47
47
  });
48
48
  };
@@ -105,7 +105,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
105
105
  var stripe = maybeStripe.apply(undefined, args);
106
106
  registerWrapper(stripe, startTime);
107
107
  return stripe;
108
- };
108
+ }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
109
109
 
110
110
  // own script injection.
111
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "1.24.0",
3
+ "version": "1.27.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "main": "dist/stripe.js",
6
6
  "module": "dist/stripe.esm.js",
package/src/shared.ts CHANGED
@@ -132,6 +132,7 @@ export const initStripe = (
132
132
  return stripe;
133
133
  };
134
134
 
135
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
135
136
  export const validateLoadParams = (params: any): LoadParams => {
136
137
  const errorMessage = `invalid load parameters; expected object of shape
137
138
 
@@ -62,6 +62,8 @@ export interface PaymentMethod {
62
62
  afterpay_clearpay?: PaymentMethod.AfterpayClearpay;
63
63
 
64
64
  acss_debit?: PaymentMethod.AcssDebit;
65
+
66
+ us_bank_account?: PaymentMethod.UsBankAccount;
65
67
  }
66
68
 
67
69
  export namespace PaymentMethod {
@@ -266,6 +268,28 @@ export namespace PaymentMethod {
266
268
  */
267
269
  transit_number: string;
268
270
  }
271
+
272
+ export interface UsBankAccount {
273
+ /**
274
+ * Customer’s bank account number.
275
+ */
276
+ account_number: string;
277
+
278
+ /**
279
+ * The routing transit number for the bank account.
280
+ */
281
+ routing_number: string;
282
+
283
+ /**
284
+ * The type of entity that holds the account. This can be either `individual` or `company`.
285
+ */
286
+ account_holder_type: string;
287
+
288
+ /**
289
+ * Account type: checkings or savings. Defaults to checking if omitted.
290
+ */
291
+ account_type: string;
292
+ }
269
293
  }
270
294
 
271
295
  export interface PaymentMethodCreateParams {
@@ -95,6 +95,31 @@ export interface StripeShippingAddressElementOptions {
95
95
  * Control which countries are displayed in the shippingAddress Element.
96
96
  */
97
97
  allowedCountries?: string[] | null;
98
+
99
+ /**
100
+ * Whether or not ShippingAddressElement accepts PO boxes
101
+ */
102
+ blockPoBox?: boolean;
103
+
104
+ /**
105
+ * Default value for ShippingAddressElement fields
106
+ */
107
+ defaultValues?: {
108
+ name?: string | null;
109
+ address?: {
110
+ line1?: string | null;
111
+ line2?: string | null;
112
+ city?: string | null;
113
+ state?: string | null;
114
+ postal_code?: string | null;
115
+ country: string;
116
+ };
117
+ };
118
+
119
+ /**
120
+ * Whether or not ShippingAddressElement provides autocomplete suggestions
121
+ */
122
+ disableAutocomplete?: boolean;
98
123
  }
99
124
 
100
125
  export interface StripeShippingAddressElementChangeEvent
@@ -124,13 +149,13 @@ export interface StripeShippingAddressElementChangeEvent
124
149
  */
125
150
  value: {
126
151
  name: string;
127
- addressLine1: string;
128
- addressLine2: string;
129
- locality: string;
130
- administrativeArea: string;
131
- postalCode: string;
132
- country: string;
133
- dependentLocality: string;
134
- sortingCode: string;
152
+ address: {
153
+ line1: string;
154
+ line2: string;
155
+ city: string;
156
+ state: string;
157
+ postal_code: string;
158
+ country: string;
159
+ };
135
160
  };
136
161
  }
@@ -458,6 +458,13 @@ export interface StripeElementsOptions {
458
458
  * @docs https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret
459
459
  */
460
460
  clientSecret?: string;
461
+
462
+ /**
463
+ * Display skeleton loader UI while waiting for Elements to be fully loaded, after they are mounted.
464
+ * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
465
+ * Default is `'auto'` (Stripe determines if a loader UI should be shown).
466
+ */
467
+ loader?: 'auto' | 'always' | 'never';
461
468
  }
462
469
 
463
470
  /*
@@ -34,6 +34,7 @@ export type CreatePaymentMethodData =
34
34
  | CreatePaymentMethodPayNowData
35
35
  | CreatePaymentMethodPromptPayData
36
36
  | CreatePaymentMethodFpxData
37
+ | CreatePaymentMethodUsBankAccountData
37
38
  | CreatePaymentMethodSepaDebitData
38
39
  | CreatePaymentMethodSofortData
39
40
  | CreatePaymentMethodWechatPayData;
@@ -443,6 +444,66 @@ export interface CreatePaymentMethodAcssDebitData
443
444
  billing_details: PaymentMethodCreateParams.BillingDetails;
444
445
  }
445
446
 
447
+ export interface CreatePaymentMethodUsBankAccountData
448
+ extends PaymentMethodCreateParams {
449
+ type: 'us_bank_account';
450
+
451
+ /**
452
+ * Can be omitted as Stripe will help to collect bank account details and verification.
453
+ * Refer to our [integration guide](https://stripe.com/docs/payments/acss-debit/accept-a-payment) for more details.
454
+ */
455
+ us_bank_account: {
456
+ /**
457
+ * Customer’s bank account number.
458
+ */
459
+ account_number: string;
460
+
461
+ /**
462
+ * The routing transit number for the bank account.
463
+ */
464
+ routing_number: string;
465
+
466
+ /**
467
+ * The type of entity that holds the account. This can be either `individual` or `company`.
468
+ */
469
+ account_holder_type: string;
470
+
471
+ /**
472
+ * Account type: checkings or savings. Defaults to checking if omitted.
473
+ */
474
+ account_type?: string;
475
+ };
476
+
477
+ /**
478
+ * The customer's billing details.
479
+ * `name`, `email`, and `address` are required.
480
+ *
481
+ * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details
482
+ */
483
+ billing_details: PaymentMethodCreateParams.BillingDetails;
484
+ }
485
+
486
+ export interface CollectBankAccountParams {
487
+ /**
488
+ * The payment method type for the bank account details (e.g. `us_bank_account`)
489
+ */
490
+ payment_method_type: string;
491
+ /**
492
+ * Payment method specific data to be sent with the request (billing details)
493
+ */
494
+ payment_method_data: CollectBankAccountPaymentMethodData;
495
+ }
496
+
497
+ export interface CollectBankAccountPaymentMethodData {
498
+ /**
499
+ * The customer's billing details.
500
+ * `name`, `email`, and `address` are required.
501
+ *
502
+ * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details
503
+ */
504
+ billing_details: PaymentMethodCreateParams.BillingDetails;
505
+ }
506
+
446
507
  /**
447
508
  * Data to be sent with a `stripe.confirmBancontactPayment` request.
448
509
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -1207,6 +1268,17 @@ export interface ConfirmAcssDebitPaymentOptions {
1207
1268
  skipMandate?: boolean;
1208
1269
  }
1209
1270
 
1271
+ export interface ConfirmUsBankAccountPaymentData
1272
+ extends PaymentIntentConfirmParams {
1273
+ /**
1274
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
1275
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
1276
+ *
1277
+ * @recommended
1278
+ */
1279
+ payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>;
1280
+ }
1281
+
1210
1282
  /**
1211
1283
  * Data to be sent with a `stripe.confirmPayment` request.
1212
1284
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -1242,3 +1314,15 @@ export interface VerifyMicrodepositsForPaymentData {
1242
1314
  */
1243
1315
  amounts?: Array<number>;
1244
1316
  }
1317
+
1318
+ /**
1319
+ * Data to be sent with a `stripe.collectBankAccountForPayment` request.
1320
+ */
1321
+ export interface CollectBankAccountForPaymentOptions {
1322
+ /**
1323
+ * The client secret of the PaymentIntent.
1324
+ */
1325
+ clientSecret: string;
1326
+
1327
+ params: CollectBankAccountParams;
1328
+ }
@@ -10,6 +10,8 @@ import {
10
10
  CreatePaymentMethodSofortData,
11
11
  CreatePaymentMethodPayPalData,
12
12
  CreatePaymentMethodBacsDebitData,
13
+ CreatePaymentMethodUsBankAccountData,
14
+ CollectBankAccountParams,
13
15
  } from './payment-intents';
14
16
 
15
17
  import {Omit} from '../utils';
@@ -186,3 +188,26 @@ export interface VerifyMicrodepositsForSetupData {
186
188
  */
187
189
  amounts?: Array<number>;
188
190
  }
191
+
192
+ export interface ConfirmUsBankAccountSetupData
193
+ extends SetupIntentConfirmParams {
194
+ /**
195
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
196
+ * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`.
197
+ *
198
+ * @recommended
199
+ */
200
+ payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>;
201
+ }
202
+
203
+ /**
204
+ * Data to be sent with a `stripe.collectBankAccountForSetup` request.
205
+ */
206
+ export interface CollectBankAccountForSetupOptions {
207
+ /**
208
+ * The client secret of the SetupIntent.
209
+ */
210
+ clientSecret: string;
211
+
212
+ params: CollectBankAccountParams;
213
+ }
@@ -89,6 +89,19 @@ export interface Stripe {
89
89
  options?: paymentIntents.ConfirmAcssDebitPaymentOptions
90
90
  ): Promise<PaymentIntentResult>;
91
91
 
92
+ /**
93
+ * Use `stripe.confirmUsBankAccountPayment` in the [Accept a payment](https://stripe.com/docs/payments/ach-debit/accept-a-payment) flow for the [ACH Direct Debit]((https://stripe.com/docs/payments/ach-debit) payment method to record the customer’s authorization for payment.
94
+ *
95
+ * When you confirm a [PaymentIntent](https://stripe.com/docs/api/payment_intents), it needs to have an attached PaymentMethod.
96
+ * Use `stripe.collectBankAccountForPayment` to collect and attach a [PaymentMethod](https://stripe.com/docs/api/payment_methods), or provide bank account details using the `data` parameter if a `PaymentMethod` was not already provided.
97
+ *
98
+ * @docs https://stripe.com/docs/js/payment_intents/confirm_us_bank_account_payment
99
+ */
100
+ confirmUsBankAccountPayment(
101
+ clientSecret: string,
102
+ data?: paymentIntents.ConfirmUsBankAccountPaymentData
103
+ ): Promise<PaymentIntentResult>;
104
+
92
105
  /**
93
106
  * Use `stripe.confirmAlipayPayment` in the [Alipay Payments](https://stripe.com/docs/payments/alipay) with Payment Methods flow when the customer submits your payment form.
94
107
  * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
@@ -493,6 +506,16 @@ export interface Stripe {
493
506
  data?: paymentIntents.VerifyMicrodepositsForPaymentData
494
507
  ): Promise<PaymentIntentResult>;
495
508
 
509
+ /**
510
+ * 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)
511
+ * payment method to collect the customer’s bank account in your payment form.
512
+ *
513
+ * @docs https://stripe.com/docs/js/payment_intents/collect_bank_account_for_payment
514
+ */
515
+ collectBankAccountForPayment(
516
+ options: paymentIntents.CollectBankAccountForPaymentOptions
517
+ ): Promise<PaymentIntentResult>;
518
+
496
519
  /**
497
520
  * Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call.
498
521
  *
@@ -562,6 +585,19 @@ export interface Stripe {
562
585
  options?: setupIntents.ConfirmAcssDebitSetupOptions
563
586
  ): Promise<SetupIntentResult>;
564
587
 
588
+ /**
589
+ * Use `stripe.confirmUsBankAccountSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit payment](https://stripe.com/docs/payments/ach-debit) method to record the customer’s authorization for future payments.
590
+ *
591
+ * When you confirm a [SetupIntent](https://stripe.com/docs/api/setup_intents), it needs to have an attached PaymentMethod.
592
+ * Use `stripe.collectBankAccountForSetup` to collect and attach a [PaymentMethod](https://stripe.com/docs/api/payment_methods), or provide bank account details using the `data` parameter if a `PaymentMethod` was not already provided.
593
+ *
594
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_us_bank_account_setup
595
+ */
596
+ confirmUsBankAccountSetup(
597
+ clientSecret: string,
598
+ data?: setupIntents.ConfirmUsBankAccountSetupData
599
+ ): Promise<SetupIntentResult>;
600
+
565
601
  /**
566
602
  * Requires beta access:
567
603
  * Contact [Stripe support](https://support.stripe.com/) for more information.
@@ -742,6 +778,16 @@ export interface Stripe {
742
778
  data?: setupIntents.VerifyMicrodepositsForSetupData
743
779
  ): Promise<PaymentIntentResult>;
744
780
 
781
+ /**
782
+ * Use `stripe.collectBankAccountForSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit)
783
+ * payment method to collect the customer’s bank account in your payment form.
784
+ *
785
+ * @docs https://stripe.com/docs/js/setup_intents/collect_bank_account_for_setup
786
+ */
787
+ collectBankAccountForSetup(
788
+ options: setupIntents.CollectBankAccountForSetupOptions
789
+ ): Promise<SetupIntentResult>;
790
+
745
791
  /**
746
792
  * Retrieve a [SetupIntent](https://stripe.com/docs/api/setup_intents) using its client secret.
747
793
  *