@stripe/stripe-js 4.2.0 → 4.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.
@@ -150,6 +150,21 @@ export namespace PaymentMethod {
150
150
  */
151
151
  last4: string;
152
152
 
153
+ /**
154
+ * Contains information about card networks that can be used to process the payment.
155
+ */
156
+ networks: {
157
+ /**
158
+ * The preferred network for co-branded cards.
159
+ */
160
+ preferred: string | null;
161
+
162
+ /**
163
+ * All available networks for the card.
164
+ */
165
+ available: string[];
166
+ } | null;
167
+
153
168
  /**
154
169
  * Contains details on how this Card maybe be used for 3D Secure authentication.
155
170
  */
@@ -150,6 +150,21 @@ export namespace PaymentMethod {
150
150
  */
151
151
  last4: string;
152
152
 
153
+ /**
154
+ * Contains information about card networks that can be used to process the payment.
155
+ */
156
+ networks: {
157
+ /**
158
+ * The preferred network for co-branded cards.
159
+ */
160
+ preferred: string | null;
161
+
162
+ /**
163
+ * All available networks for the card.
164
+ */
165
+ available: string[];
166
+ } | null;
167
+
153
168
  /**
154
169
  * Contains details on how this Card maybe be used for 3D Secure authentication.
155
170
  */
package/dist/index.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: "4.1.0",
45
+ version: "4.2.0",
46
46
  startTime: startTime
47
47
  });
48
48
  };
package/dist/index.mjs CHANGED
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "4.1.0",
41
+ version: "4.2.0",
42
42
  startTime: startTime
43
43
  });
44
44
  };
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: "4.1.0",
61
+ version: "4.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: "4.1.0",
57
+ version: "4.2.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
@@ -259,3 +259,7 @@ export interface StripeAddressElementChangeEvent {
259
259
  phone?: string;
260
260
  };
261
261
  }
262
+
263
+ export interface StripeAddressElementGetElementOptions {
264
+ mode: AddressMode;
265
+ }
@@ -259,3 +259,7 @@ export interface StripeAddressElementChangeEvent {
259
259
  phone?: string;
260
260
  };
261
261
  }
262
+
263
+ export interface StripeAddressElementGetElementOptions {
264
+ mode: AddressMode;
265
+ }
@@ -47,6 +47,7 @@ import {
47
47
  StripeIssuingCardCopyButtonElementOptions,
48
48
  StripeExpressCheckoutElement,
49
49
  StripeExpressCheckoutElementOptions,
50
+ StripeAddressElementGetElementOptions,
50
51
  } from './elements';
51
52
  import {StripeError} from './stripe';
52
53
 
@@ -84,7 +85,10 @@ export interface StripeElements {
84
85
  /**
85
86
  * Looks up a previously created `Element` by its type.
86
87
  */
87
- getElement(elementType: 'address'): StripeAddressElement | null;
88
+ getElement(
89
+ elementType: 'address',
90
+ options?: StripeAddressElementGetElementOptions
91
+ ): StripeAddressElement | null;
88
92
 
89
93
  /////////////////////////////
90
94
  /// paymentMethodMessaging
@@ -47,6 +47,7 @@ import {
47
47
  StripeIssuingCardCopyButtonElementOptions,
48
48
  StripeExpressCheckoutElement,
49
49
  StripeExpressCheckoutElementOptions,
50
+ StripeAddressElementGetElementOptions,
50
51
  } from './elements';
51
52
  import {StripeError} from './stripe';
52
53
 
@@ -84,7 +85,10 @@ export interface StripeElements {
84
85
  /**
85
86
  * Looks up a previously created `Element` by its type.
86
87
  */
87
- getElement(elementType: 'address'): StripeAddressElement | null;
88
+ getElement(
89
+ elementType: 'address',
90
+ options?: StripeAddressElementGetElementOptions
91
+ ): StripeAddressElement | null;
88
92
 
89
93
  /////////////////////////////
90
94
  /// paymentMethodMessaging
@@ -1,3 +1,26 @@
1
+ export type StripeEmbeddedCheckoutAddress = {
2
+ country: string;
3
+ line1?: string | null;
4
+ line2?: string | null;
5
+ city?: string | null;
6
+ postal_code?: string | null;
7
+ state?: string | null;
8
+ };
9
+
10
+ export type StripeEmbeddedCheckoutShippingDetails = {
11
+ name: string;
12
+ address: StripeEmbeddedCheckoutAddress;
13
+ };
14
+
15
+ export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
16
+ checkoutSessionId: string;
17
+ shippingDetails: StripeEmbeddedCheckoutShippingDetails;
18
+ };
19
+
20
+ export type ResultAction =
21
+ | {type: 'accept'}
22
+ | {type: 'reject'; errorMessage?: string};
23
+
1
24
  export interface StripeEmbeddedCheckoutOptions {
2
25
  /**
3
26
  * The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
@@ -13,6 +36,15 @@ export interface StripeEmbeddedCheckoutOptions {
13
36
  * You can use it to unmount Embedded Checkout and render a custom success UI.
14
37
  */
15
38
  onComplete?: () => void;
39
+ /**
40
+ * onShippingDetailsChange is called when the customer completes the shipping details form.
41
+ *
42
+ * The callback is required when [permissions.update.shipping_details](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-shipping_details) is set to `server_only`.
43
+ * For a step-by-step guide on using this callback to customize shipping options during checkout, see [Customize Shipping Options](https://docs.stripe.com/payments/checkout/custom-shipping-options).
44
+ */
45
+ onShippingDetailsChange?: (
46
+ event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
47
+ ) => Promise<ResultAction>;
16
48
  }
17
49
 
18
50
  export interface StripeEmbeddedCheckout {
@@ -1,3 +1,26 @@
1
+ export type StripeEmbeddedCheckoutAddress = {
2
+ country: string;
3
+ line1?: string | null;
4
+ line2?: string | null;
5
+ city?: string | null;
6
+ postal_code?: string | null;
7
+ state?: string | null;
8
+ };
9
+
10
+ export type StripeEmbeddedCheckoutShippingDetails = {
11
+ name: string;
12
+ address: StripeEmbeddedCheckoutAddress;
13
+ };
14
+
15
+ export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
16
+ checkoutSessionId: string;
17
+ shippingDetails: StripeEmbeddedCheckoutShippingDetails;
18
+ };
19
+
20
+ export type ResultAction =
21
+ | {type: 'accept'}
22
+ | {type: 'reject'; errorMessage?: string};
23
+
1
24
  export interface StripeEmbeddedCheckoutOptions {
2
25
  /**
3
26
  * The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
@@ -13,6 +36,15 @@ export interface StripeEmbeddedCheckoutOptions {
13
36
  * You can use it to unmount Embedded Checkout and render a custom success UI.
14
37
  */
15
38
  onComplete?: () => void;
39
+ /**
40
+ * onShippingDetailsChange is called when the customer completes the shipping details form.
41
+ *
42
+ * The callback is required when [permissions.update.shipping_details](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-shipping_details) is set to `server_only`.
43
+ * For a step-by-step guide on using this callback to customize shipping options during checkout, see [Customize Shipping Options](https://docs.stripe.com/payments/checkout/custom-shipping-options).
44
+ */
45
+ onShippingDetailsChange?: (
46
+ event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
47
+ ) => Promise<ResultAction>;
16
48
  }
17
49
 
18
50
  export interface StripeEmbeddedCheckout {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",