@stripe/stripe-js 7.4.0 → 7.5.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/index.js CHANGED
@@ -55,7 +55,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
55
55
 
56
56
  stripe._registerWrapper({
57
57
  name: 'stripe-js',
58
- version: "7.4.0",
58
+ version: "7.5.0",
59
59
  startTime: startTime
60
60
  });
61
61
  };
@@ -151,7 +151,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
151
151
  var expectedVersion = RELEASE_TRAIN;
152
152
 
153
153
  if (isTestKey && version !== expectedVersion) {
154
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
154
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.5.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
155
155
  }
156
156
 
157
157
  var stripe = maybeStripe.apply(undefined, args);
package/dist/index.mjs CHANGED
@@ -51,7 +51,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
51
51
 
52
52
  stripe._registerWrapper({
53
53
  name: 'stripe-js',
54
- version: "7.4.0",
54
+ version: "7.5.0",
55
55
  startTime: startTime
56
56
  });
57
57
  };
@@ -147,7 +147,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
147
147
  var expectedVersion = RELEASE_TRAIN;
148
148
 
149
149
  if (isTestKey && version !== expectedVersion) {
150
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
150
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.5.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
151
151
  }
152
152
 
153
153
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.js CHANGED
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
71
71
 
72
72
  stripe._registerWrapper({
73
73
  name: 'stripe-js',
74
- version: "7.4.0",
74
+ version: "7.5.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -167,7 +167,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
167
167
  var expectedVersion = RELEASE_TRAIN;
168
168
 
169
169
  if (isTestKey && version !== expectedVersion) {
170
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
170
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.5.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
171
171
  }
172
172
 
173
173
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.mjs CHANGED
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
67
67
 
68
68
  stripe._registerWrapper({
69
69
  name: 'stripe-js',
70
- version: "7.4.0",
70
+ version: "7.5.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -163,7 +163,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
163
163
  var expectedVersion = RELEASE_TRAIN;
164
164
 
165
165
  if (isTestKey && version !== expectedVersion) {
166
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
166
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.5.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
167
167
  }
168
168
 
169
169
  var stripe = maybeStripe.apply(undefined, args);
@@ -470,6 +470,22 @@ export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
470
470
  handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
471
471
  ): StripeCheckoutExpressCheckoutElement;
472
472
 
473
+ /**
474
+ * Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
475
+ */
476
+ on(
477
+ eventType: 'cancel',
478
+ handler: (event: {elementType: 'expressCheckout'}) => any
479
+ ): StripeCheckoutExpressCheckoutElement;
480
+ once(
481
+ eventType: 'cancel',
482
+ handler: (event: {elementType: 'expressCheckout'}) => any
483
+ ): StripeCheckoutExpressCheckoutElement;
484
+ off(
485
+ eventType: 'cancel',
486
+ handler?: (event: {elementType: 'expressCheckout'}) => any
487
+ ): StripeCheckoutExpressCheckoutElement;
488
+
473
489
  /**
474
490
  * Updates the options the `ExpressCheckoutElement` was initialized with.
475
491
  * Updates are merged into the existing configuration.
@@ -470,6 +470,22 @@ export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
470
470
  handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
471
471
  ): StripeCheckoutExpressCheckoutElement;
472
472
 
473
+ /**
474
+ * Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
475
+ */
476
+ on(
477
+ eventType: 'cancel',
478
+ handler: (event: {elementType: 'expressCheckout'}) => any
479
+ ): StripeCheckoutExpressCheckoutElement;
480
+ once(
481
+ eventType: 'cancel',
482
+ handler: (event: {elementType: 'expressCheckout'}) => any
483
+ ): StripeCheckoutExpressCheckoutElement;
484
+ off(
485
+ eventType: 'cancel',
486
+ handler?: (event: {elementType: 'expressCheckout'}) => any
487
+ ): StripeCheckoutExpressCheckoutElement;
488
+
473
489
  /**
474
490
  * Updates the options the `ExpressCheckoutElement` was initialized with.
475
491
  * Updates are merged into the existing configuration.
@@ -306,6 +306,12 @@ export interface StripePaymentElementChangeEvent {
306
306
  */
307
307
  value: {
308
308
  type: string;
309
+ billingDetails?: {
310
+ address: {
311
+ country?: null | string;
312
+ postalCode?: null | string;
313
+ };
314
+ };
309
315
  payment_method?: {
310
316
  id: string;
311
317
  type: string;
@@ -306,6 +306,12 @@ export interface StripePaymentElementChangeEvent {
306
306
  */
307
307
  value: {
308
308
  type: string;
309
+ billingDetails?: {
310
+ address: {
311
+ country?: null | string;
312
+ postalCode?: null | string;
313
+ };
314
+ };
309
315
  payment_method?: {
310
316
  id: string;
311
317
  type: string;
@@ -20,6 +20,7 @@ export type CreatePaymentMethodData =
20
20
  | CreatePaymentMethodAuBecsDebitData
21
21
  | CreatePaymentMethodBacsDebitData
22
22
  | CreatePaymentMethodBancontactData
23
+ | CreatePaymentMethodBillieData
23
24
  | CreatePaymentMethodBlikData
24
25
  | CreatePaymentMethodBoletoData
25
26
  | CreatePaymentMethodCardData
@@ -96,6 +97,20 @@ export interface CreatePaymentMethodBancontactData
96
97
  };
97
98
  }
98
99
 
100
+ export interface CreatePaymentMethodBillieData
101
+ extends PaymentMethodCreateParams {
102
+ /**
103
+ * Requires beta access:
104
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
105
+ */
106
+ type: 'billie';
107
+
108
+ /**
109
+ * Details about the Billie pament method. Currently there are no supported child attributes for this field, but sending an empty object is mandatory.
110
+ */
111
+ billie: {}; // eslint-disable-line @typescript-eslint/ban-types
112
+ }
113
+
99
114
  export interface CreatePaymentMethodBlikData extends PaymentMethodCreateParams {
100
115
  type: 'blik';
101
116
 
@@ -673,6 +688,38 @@ export interface ConfirmBancontactPaymentOptions {
673
688
  handleActions?: boolean;
674
689
  }
675
690
 
691
+ /**
692
+ * Data to be sent with a `stripe.confirmBilliePayment` request.
693
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
694
+ */
695
+ export interface ConfirmBilliePaymentData extends PaymentIntentConfirmParams {
696
+ /**
697
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
698
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
699
+ *
700
+ * @recommended
701
+ */
702
+ payment_method?: string | Omit<CreatePaymentMethodBillieData, 'type'>;
703
+
704
+ /**
705
+ * The url your customer will be directed to after they complete authentication.
706
+ *
707
+ * @recommended
708
+ */
709
+ return_url?: string;
710
+ }
711
+
712
+ /**
713
+ * An options object to control the behavior of `stripe.confirmBilliePayment`.
714
+ */
715
+ export interface ConfirmBilliePaymentOptions {
716
+ /**
717
+ * Set this to `false` if you want to [manually handle the authorization redirect](https://docs.stripe.com/payments/billie/accept-a-payment#handle-redirect).
718
+ * Default is `true`.
719
+ */
720
+ handleActions?: boolean;
721
+ }
722
+
676
723
  /**
677
724
  * An options object to control the behavior of `stripe.confirmBlikPayment`.
678
725
  */
@@ -20,6 +20,7 @@ export type CreatePaymentMethodData =
20
20
  | CreatePaymentMethodAuBecsDebitData
21
21
  | CreatePaymentMethodBacsDebitData
22
22
  | CreatePaymentMethodBancontactData
23
+ | CreatePaymentMethodBillieData
23
24
  | CreatePaymentMethodBlikData
24
25
  | CreatePaymentMethodBoletoData
25
26
  | CreatePaymentMethodCardData
@@ -96,6 +97,20 @@ export interface CreatePaymentMethodBancontactData
96
97
  };
97
98
  }
98
99
 
100
+ export interface CreatePaymentMethodBillieData
101
+ extends PaymentMethodCreateParams {
102
+ /**
103
+ * Requires beta access:
104
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
105
+ */
106
+ type: 'billie';
107
+
108
+ /**
109
+ * Details about the Billie pament method. Currently there are no supported child attributes for this field, but sending an empty object is mandatory.
110
+ */
111
+ billie: {}; // eslint-disable-line @typescript-eslint/ban-types
112
+ }
113
+
99
114
  export interface CreatePaymentMethodBlikData extends PaymentMethodCreateParams {
100
115
  type: 'blik';
101
116
 
@@ -673,6 +688,38 @@ export interface ConfirmBancontactPaymentOptions {
673
688
  handleActions?: boolean;
674
689
  }
675
690
 
691
+ /**
692
+ * Data to be sent with a `stripe.confirmBilliePayment` request.
693
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
694
+ */
695
+ export interface ConfirmBilliePaymentData extends PaymentIntentConfirmParams {
696
+ /**
697
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
698
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
699
+ *
700
+ * @recommended
701
+ */
702
+ payment_method?: string | Omit<CreatePaymentMethodBillieData, 'type'>;
703
+
704
+ /**
705
+ * The url your customer will be directed to after they complete authentication.
706
+ *
707
+ * @recommended
708
+ */
709
+ return_url?: string;
710
+ }
711
+
712
+ /**
713
+ * An options object to control the behavior of `stripe.confirmBilliePayment`.
714
+ */
715
+ export interface ConfirmBilliePaymentOptions {
716
+ /**
717
+ * Set this to `false` if you want to [manually handle the authorization redirect](https://docs.stripe.com/payments/billie/accept-a-payment#handle-redirect).
718
+ * Default is `true`.
719
+ */
720
+ handleActions?: boolean;
721
+ }
722
+
676
723
  /**
677
724
  * An options object to control the behavior of `stripe.confirmBlikPayment`.
678
725
  */
@@ -209,6 +209,24 @@ export interface Stripe {
209
209
  options?: paymentIntents.ConfirmBancontactPaymentOptions
210
210
  ): Promise<PaymentIntentResult>;
211
211
 
212
+ /**
213
+ * Requires beta access:
214
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
215
+ *
216
+ * Use `stripe.confirmBilliePayment` in the [Billie Payments](https://stripe.com/docs/payments/billie) with Payment Methods flow when the customer submits your payment form.
217
+ * 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.
218
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
219
+ *
220
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
221
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
222
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
223
+ */
224
+ confirmBilliePayment(
225
+ clientSecret: string,
226
+ data?: paymentIntents.ConfirmBilliePaymentData,
227
+ options?: paymentIntents.ConfirmBilliePaymentOptions
228
+ ): Promise<PaymentIntentResult>;
229
+
212
230
  /**
213
231
  * Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form.
214
232
  * When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction.
@@ -209,6 +209,24 @@ export interface Stripe {
209
209
  options?: paymentIntents.ConfirmBancontactPaymentOptions
210
210
  ): Promise<PaymentIntentResult>;
211
211
 
212
+ /**
213
+ * Requires beta access:
214
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
215
+ *
216
+ * Use `stripe.confirmBilliePayment` in the [Billie Payments](https://stripe.com/docs/payments/billie) with Payment Methods flow when the customer submits your payment form.
217
+ * 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.
218
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
219
+ *
220
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
221
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
222
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
223
+ */
224
+ confirmBilliePayment(
225
+ clientSecret: string,
226
+ data?: paymentIntents.ConfirmBilliePaymentData,
227
+ options?: paymentIntents.ConfirmBilliePaymentOptions
228
+ ): Promise<PaymentIntentResult>;
229
+
212
230
  /**
213
231
  * Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form.
214
232
  * When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "7.4.0",
3
+ "version": "7.5.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",