@stripe/stripe-js 5.1.0 → 5.3.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.
@@ -178,17 +178,30 @@ export namespace PaymentIntent {
178
178
  }
179
179
 
180
180
  export interface NextAction {
181
+ /**
182
+ * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `wechat_pay_display_qr_code`, or `verify_with_microdeposits`.
183
+ */
184
+ type: string;
185
+
186
+ /**
187
+ * Contains instructions for authenticating a payment by redirecting your customer to another page or application.
188
+ */
181
189
  redirect_to_url?: NextAction.RedirectToUrl;
182
190
 
183
191
  /**
184
- * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk` or `wechat_pay_display_qr_code`.
192
+ * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
185
193
  */
186
- type: string;
194
+ use_stripe_sdk?: NextAction.UseStripeSdk;
187
195
 
188
196
  /**
189
197
  * Wechat Pay display qrcode
190
198
  */
191
199
  wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode;
200
+
201
+ /**
202
+ * Contains details describing microdeposits verification flow.
203
+ */
204
+ verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
192
205
  }
193
206
 
194
207
  export namespace NextAction {
@@ -214,6 +227,23 @@ export namespace PaymentIntent {
214
227
  */
215
228
  image_data_url: string;
216
229
  }
230
+ export interface UseStripeSdk {}
231
+ export interface VerifyWithMicrodeposits {
232
+ /**
233
+ * The timestamp when the microdeposits are expected to land.
234
+ */
235
+ arrival_date: number;
236
+
237
+ /**
238
+ * The URL for the hosted verification page, which allows customers to verify their bank account.
239
+ */
240
+ hosted_verification_url: string;
241
+
242
+ /**
243
+ * The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
244
+ */
245
+ microdeposit_type: string | null;
246
+ }
217
247
  }
218
248
 
219
249
  export type SetupFutureUsage = 'off_session' | 'on_session';
@@ -178,17 +178,30 @@ export namespace PaymentIntent {
178
178
  }
179
179
 
180
180
  export interface NextAction {
181
+ /**
182
+ * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `wechat_pay_display_qr_code`, or `verify_with_microdeposits`.
183
+ */
184
+ type: string;
185
+
186
+ /**
187
+ * Contains instructions for authenticating a payment by redirecting your customer to another page or application.
188
+ */
181
189
  redirect_to_url?: NextAction.RedirectToUrl;
182
190
 
183
191
  /**
184
- * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk` or `wechat_pay_display_qr_code`.
192
+ * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.
185
193
  */
186
- type: string;
194
+ use_stripe_sdk?: NextAction.UseStripeSdk;
187
195
 
188
196
  /**
189
197
  * Wechat Pay display qrcode
190
198
  */
191
199
  wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode;
200
+
201
+ /**
202
+ * Contains details describing microdeposits verification flow.
203
+ */
204
+ verify_with_microdeposits?: NextAction.VerifyWithMicrodeposits;
192
205
  }
193
206
 
194
207
  export namespace NextAction {
@@ -214,6 +227,23 @@ export namespace PaymentIntent {
214
227
  */
215
228
  image_data_url: string;
216
229
  }
230
+ export interface UseStripeSdk {}
231
+ export interface VerifyWithMicrodeposits {
232
+ /**
233
+ * The timestamp when the microdeposits are expected to land.
234
+ */
235
+ arrival_date: number;
236
+
237
+ /**
238
+ * The URL for the hosted verification page, which allows customers to verify their bank account.
239
+ */
240
+ hosted_verification_url: string;
241
+
242
+ /**
243
+ * The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
244
+ */
245
+ microdeposit_type: string | null;
246
+ }
217
247
  }
218
248
 
219
249
  export type SetupFutureUsage = 'off_session' | 'on_session';
package/dist/index.js CHANGED
@@ -42,12 +42,12 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
42
42
 
43
43
  stripe._registerWrapper({
44
44
  name: 'stripe-js',
45
- version: "5.0.0",
45
+ version: "5.2.0",
46
46
  startTime: startTime
47
47
  });
48
48
  };
49
49
 
50
- var stripePromise = null;
50
+ var stripePromise$1 = null;
51
51
  var onErrorListener = null;
52
52
  var onLoadListener = null;
53
53
 
@@ -69,11 +69,11 @@ var onLoad = function onLoad(resolve, reject) {
69
69
 
70
70
  var loadScript = function loadScript(params) {
71
71
  // Ensure that we only attempt to load Stripe.js at most once
72
- if (stripePromise !== null) {
73
- return stripePromise;
72
+ if (stripePromise$1 !== null) {
73
+ return stripePromise$1;
74
74
  }
75
75
 
76
- stripePromise = new Promise(function (resolve, reject) {
76
+ stripePromise$1 = new Promise(function (resolve, reject) {
77
77
  if (typeof window === 'undefined' || typeof document === 'undefined') {
78
78
  // Resolve to null when imported server side. This makes the module
79
79
  // safe to import in an isomorphic code base.
@@ -119,8 +119,8 @@ var loadScript = function loadScript(params) {
119
119
  }
120
120
  }); // Resets stripePromise on error
121
121
 
122
- return stripePromise["catch"](function (error) {
123
- stripePromise = null;
122
+ return stripePromise$1["catch"](function (error) {
123
+ stripePromise$1 = null;
124
124
  return Promise.reject(error);
125
125
  });
126
126
  };
@@ -134,20 +134,20 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
134
134
  return stripe;
135
135
  }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
136
136
 
137
- var stripePromise$1;
137
+ var stripePromise;
138
138
  var loadCalled = false;
139
139
 
140
140
  var getStripePromise = function getStripePromise() {
141
- if (stripePromise$1) {
142
- return stripePromise$1;
141
+ if (stripePromise) {
142
+ return stripePromise;
143
143
  }
144
144
 
145
- stripePromise$1 = loadScript(null)["catch"](function (error) {
145
+ stripePromise = loadScript(null)["catch"](function (error) {
146
146
  // clear cache on error
147
- stripePromise$1 = null;
147
+ stripePromise = null;
148
148
  return Promise.reject(error);
149
149
  });
150
- return stripePromise$1;
150
+ return stripePromise;
151
151
  }; // Execute our own script injection after a tick to give users time to do their
152
152
  // own script injection.
153
153
 
package/dist/index.mjs CHANGED
@@ -38,12 +38,12 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "5.0.0",
41
+ version: "5.2.0",
42
42
  startTime: startTime
43
43
  });
44
44
  };
45
45
 
46
- var stripePromise = null;
46
+ var stripePromise$1 = null;
47
47
  var onErrorListener = null;
48
48
  var onLoadListener = null;
49
49
 
@@ -65,11 +65,11 @@ var onLoad = function onLoad(resolve, reject) {
65
65
 
66
66
  var loadScript = function loadScript(params) {
67
67
  // Ensure that we only attempt to load Stripe.js at most once
68
- if (stripePromise !== null) {
69
- return stripePromise;
68
+ if (stripePromise$1 !== null) {
69
+ return stripePromise$1;
70
70
  }
71
71
 
72
- stripePromise = new Promise(function (resolve, reject) {
72
+ stripePromise$1 = new Promise(function (resolve, reject) {
73
73
  if (typeof window === 'undefined' || typeof document === 'undefined') {
74
74
  // Resolve to null when imported server side. This makes the module
75
75
  // safe to import in an isomorphic code base.
@@ -115,8 +115,8 @@ var loadScript = function loadScript(params) {
115
115
  }
116
116
  }); // Resets stripePromise on error
117
117
 
118
- return stripePromise["catch"](function (error) {
119
- stripePromise = null;
118
+ return stripePromise$1["catch"](function (error) {
119
+ stripePromise$1 = null;
120
120
  return Promise.reject(error);
121
121
  });
122
122
  };
@@ -130,20 +130,20 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
130
130
  return stripe;
131
131
  }; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
132
132
 
133
- var stripePromise$1;
133
+ var stripePromise;
134
134
  var loadCalled = false;
135
135
 
136
136
  var getStripePromise = function getStripePromise() {
137
- if (stripePromise$1) {
138
- return stripePromise$1;
137
+ if (stripePromise) {
138
+ return stripePromise;
139
139
  }
140
140
 
141
- stripePromise$1 = loadScript(null)["catch"](function (error) {
141
+ stripePromise = loadScript(null)["catch"](function (error) {
142
142
  // clear cache on error
143
- stripePromise$1 = null;
143
+ stripePromise = null;
144
144
  return Promise.reject(error);
145
145
  });
146
- return stripePromise$1;
146
+ return stripePromise;
147
147
  }; // Execute our own script injection after a tick to give users time to do their
148
148
  // own script injection.
149
149
 
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: "5.0.0",
61
+ version: "5.2.0",
62
62
  startTime: startTime
63
63
  });
64
64
  };
package/dist/pure.mjs CHANGED
@@ -54,7 +54,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
54
54
 
55
55
  stripe._registerWrapper({
56
56
  name: 'stripe-js',
57
- version: "5.0.0",
57
+ version: "5.2.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
@@ -233,10 +233,6 @@ export interface StripeCheckoutSession {
233
233
  total: StripeCheckoutTotalSummary;
234
234
  }
235
235
 
236
- export type StripeCheckoutResult =
237
- | {session: StripeCheckoutSession; error?: undefined}
238
- | {session?: undefined; error: StripeError};
239
-
240
236
  export type StripeCheckoutPaymentElementOptions = {
241
237
  layout?: Layout | LayoutObject;
242
238
  paymentMethodOrder?: Array<string>;
@@ -448,7 +444,7 @@ export interface StripeCheckout {
448
444
  }) => Promise<StripeCheckoutUpdateLineItemQuantityResult>;
449
445
  updateShippingOption: (
450
446
  shippingOption: string
451
- ) => Promise<StripeCheckoutResult>;
447
+ ) => Promise<StripeCheckoutUpdateShippingOptionResult>;
452
448
  confirm: (args?: {
453
449
  returnUrl?: string;
454
450
  redirect?: StripeCheckoutRedirectBehavior;
@@ -233,10 +233,6 @@ export interface StripeCheckoutSession {
233
233
  total: StripeCheckoutTotalSummary;
234
234
  }
235
235
 
236
- export type StripeCheckoutResult =
237
- | {session: StripeCheckoutSession; error?: undefined}
238
- | {session?: undefined; error: StripeError};
239
-
240
236
  export type StripeCheckoutPaymentElementOptions = {
241
237
  layout?: Layout | LayoutObject;
242
238
  paymentMethodOrder?: Array<string>;
@@ -448,7 +444,7 @@ export interface StripeCheckout {
448
444
  }) => Promise<StripeCheckoutUpdateLineItemQuantityResult>;
449
445
  updateShippingOption: (
450
446
  shippingOption: string
451
- ) => Promise<StripeCheckoutResult>;
447
+ ) => Promise<StripeCheckoutUpdateShippingOptionResult>;
452
448
  confirm: (args?: {
453
449
  returnUrl?: string;
454
450
  redirect?: StripeCheckoutRedirectBehavior;
@@ -730,14 +730,14 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
730
730
  *
731
731
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
732
732
  */
733
- captureMethod?: 'manual' | 'automatic';
733
+ captureMethod?: 'manual' | 'automatic' | 'automatic_async';
734
734
 
735
735
  /**
736
736
  * Controls when the funds will be captured from the customer’s account.
737
737
  *
738
738
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
739
739
  */
740
- capture_method?: 'manual' | 'automatic';
740
+ capture_method?: 'manual' | 'automatic' | 'automatic_async';
741
741
 
742
742
  /**
743
743
  * The Stripe account ID which is the business of record.
@@ -872,14 +872,14 @@ export interface StripeElementsUpdateOptions {
872
872
  *
873
873
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
874
874
  */
875
- captureMethod?: 'manual' | 'automatic';
875
+ captureMethod?: 'manual' | 'automatic' | 'automatic_async';
876
876
 
877
877
  /**
878
878
  * Controls when the funds will be captured from the customer’s account.
879
879
  *
880
880
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
881
881
  */
882
- capture_method?: 'manual' | 'automatic';
882
+ capture_method?: 'manual' | 'automatic' | 'automatic_async';
883
883
 
884
884
  /**
885
885
  * Instead of using automatic payment methods, declare specific payment methods to enable.
@@ -730,14 +730,14 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
730
730
  *
731
731
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
732
732
  */
733
- captureMethod?: 'manual' | 'automatic';
733
+ captureMethod?: 'manual' | 'automatic' | 'automatic_async';
734
734
 
735
735
  /**
736
736
  * Controls when the funds will be captured from the customer’s account.
737
737
  *
738
738
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
739
739
  */
740
- capture_method?: 'manual' | 'automatic';
740
+ capture_method?: 'manual' | 'automatic' | 'automatic_async';
741
741
 
742
742
  /**
743
743
  * The Stripe account ID which is the business of record.
@@ -872,14 +872,14 @@ export interface StripeElementsUpdateOptions {
872
872
  *
873
873
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
874
874
  */
875
- captureMethod?: 'manual' | 'automatic';
875
+ captureMethod?: 'manual' | 'automatic' | 'automatic_async';
876
876
 
877
877
  /**
878
878
  * Controls when the funds will be captured from the customer’s account.
879
879
  *
880
880
  * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
881
881
  */
882
- capture_method?: 'manual' | 'automatic';
882
+ capture_method?: 'manual' | 'automatic' | 'automatic_async';
883
883
 
884
884
  /**
885
885
  * Instead of using automatic payment methods, declare specific payment methods to enable.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "5.1.0",
3
+ "version": "5.3.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",
@@ -58,7 +58,7 @@
58
58
  "jest": "^24.9.0",
59
59
  "prettier": "^1.19.1",
60
60
  "rimraf": "^2.6.2",
61
- "rollup": "^1.29.0",
61
+ "rollup": "^2.79.2",
62
62
  "rollup-plugin-babel": "^4.3.3",
63
63
  "rollup-plugin-typescript2": "^0.25.3",
64
64
  "ts-jest": "^24.3.0",