@stripe/stripe-js 1.25.0 → 1.26.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.25.0",
57
+ version: "1.26.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.25.0",
61
+ version: "1.26.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.25.0",
41
+ version: "1.26.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.25.0",
45
+ version: "1.26.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.25.0",
3
+ "version": "1.26.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 {
@@ -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,55 @@ 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 CollectBankAccountPaymentMethodData {
487
+ /**
488
+ * The customer's billing details.
489
+ * `name`, `email`, and `address` are required.
490
+ *
491
+ * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details
492
+ */
493
+ billing_details: PaymentMethodCreateParams.BillingDetails;
494
+ }
495
+
446
496
  /**
447
497
  * Data to be sent with a `stripe.confirmBancontactPayment` request.
448
498
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -1207,6 +1257,17 @@ export interface ConfirmAcssDebitPaymentOptions {
1207
1257
  skipMandate?: boolean;
1208
1258
  }
1209
1259
 
1260
+ export interface ConfirmUsBankAccountPaymentData
1261
+ extends PaymentIntentConfirmParams {
1262
+ /**
1263
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
1264
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
1265
+ *
1266
+ * @recommended
1267
+ */
1268
+ payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>;
1269
+ }
1270
+
1210
1271
  /**
1211
1272
  * Data to be sent with a `stripe.confirmPayment` request.
1212
1273
  * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
@@ -1242,3 +1303,17 @@ export interface VerifyMicrodepositsForPaymentData {
1242
1303
  */
1243
1304
  amounts?: Array<number>;
1244
1305
  }
1306
+
1307
+ /**
1308
+ * Data to be sent with a `stripe.collectBankAccountForPayment` request.
1309
+ */
1310
+ export interface CollectBankAccountForPaymentOptions {
1311
+ /**
1312
+ * The payment method type for the bank account details (e.g. `us_bank_account`)
1313
+ */
1314
+ payment_method_type: string;
1315
+ /**
1316
+ * Payment method specific data to be sent with the request (billing details)
1317
+ */
1318
+ payment_method_data: CollectBankAccountPaymentMethodData;
1319
+ }
@@ -10,6 +10,8 @@ import {
10
10
  CreatePaymentMethodSofortData,
11
11
  CreatePaymentMethodPayPalData,
12
12
  CreatePaymentMethodBacsDebitData,
13
+ CreatePaymentMethodUsBankAccountData,
14
+ CollectBankAccountPaymentMethodData,
13
15
  } from './payment-intents';
14
16
 
15
17
  import {Omit} from '../utils';
@@ -186,3 +188,28 @@ 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 payment method type for the bank account details (e.g. `us_bank_account`)
209
+ */
210
+ payment_method_type: string;
211
+ /**
212
+ * Payment method specific data to be sent with the request (billing details)
213
+ */
214
+ payment_method_data: CollectBankAccountPaymentMethodData;
215
+ }
@@ -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,17 @@ 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
+ clientSecret: string,
517
+ options: paymentIntents.CollectBankAccountForPaymentOptions
518
+ ): Promise<PaymentIntentResult>;
519
+
496
520
  /**
497
521
  * 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
522
  *
@@ -562,6 +586,19 @@ export interface Stripe {
562
586
  options?: setupIntents.ConfirmAcssDebitSetupOptions
563
587
  ): Promise<SetupIntentResult>;
564
588
 
589
+ /**
590
+ * 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.
591
+ *
592
+ * When you confirm a [SetupIntent](https://stripe.com/docs/api/setup_intents), it needs to have an attached PaymentMethod.
593
+ * 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.
594
+ *
595
+ * @docs https://stripe.com/docs/js/setup_intents/confirm_us_bank_account_setup
596
+ */
597
+ confirmUsBankAccountSetup(
598
+ clientSecret: string,
599
+ data?: setupIntents.ConfirmUsBankAccountSetupData
600
+ ): Promise<SetupIntentResult>;
601
+
565
602
  /**
566
603
  * Requires beta access:
567
604
  * Contact [Stripe support](https://support.stripe.com/) for more information.
@@ -742,6 +779,17 @@ export interface Stripe {
742
779
  data?: setupIntents.VerifyMicrodepositsForSetupData
743
780
  ): Promise<PaymentIntentResult>;
744
781
 
782
+ /**
783
+ * 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)
784
+ * payment method to collect the customer’s bank account in your payment form.
785
+ *
786
+ * @docs https://stripe.com/docs/js/setup_intents/collect_bank_account_for_setup
787
+ */
788
+ collectBankAccountForSetup(
789
+ clientSecret: string,
790
+ options: setupIntents.CollectBankAccountForSetupOptions
791
+ ): Promise<SetupIntentResult>;
792
+
745
793
  /**
746
794
  * Retrieve a [SetupIntent](https://stripe.com/docs/api/setup_intents) using its client secret.
747
795
  *