@stripe/stripe-js 1.50.0 → 1.52.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 +1 -1
- package/dist/pure.js +1 -1
- package/dist/stripe.esm.js +1 -1
- package/dist/stripe.js +1 -1
- package/package.json +1 -1
- package/types/stripe-js/elements/payment-method-messaging.d.ts +1 -1
- package/types/stripe-js/elements-group.d.ts +66 -0
- package/types/stripe-js/payment-intents.d.ts +49 -0
- package/types/stripe-js/stripe.d.ts +24 -3
package/dist/pure.esm.js
CHANGED
package/dist/pure.js
CHANGED
package/dist/stripe.esm.js
CHANGED
package/dist/stripe.js
CHANGED
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ export interface StripePaymentMethodMessagingElementOptions {
|
|
|
55
55
|
/**
|
|
56
56
|
* Payment methods to show messaging for.
|
|
57
57
|
*/
|
|
58
|
-
paymentMethods: Array<'afterpay_clearpay' | 'klarna'>;
|
|
58
|
+
paymentMethods: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The country the end-buyer is in.
|
|
@@ -672,6 +672,11 @@ export interface StripeElementsOptionsClientSecret
|
|
|
672
672
|
* @docs https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret
|
|
673
673
|
*/
|
|
674
674
|
clientSecret?: string;
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Either use mode or clientSecret when creating an Elements group
|
|
678
|
+
*/
|
|
679
|
+
mode?: never;
|
|
675
680
|
}
|
|
676
681
|
|
|
677
682
|
export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
|
|
@@ -690,6 +695,13 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
|
|
|
690
695
|
*/
|
|
691
696
|
amount?: number;
|
|
692
697
|
|
|
698
|
+
/**
|
|
699
|
+
* Indicates that you intend to make future payments with this PaymentIntent’s payment method.
|
|
700
|
+
*
|
|
701
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
|
|
702
|
+
*/
|
|
703
|
+
setupFutureUsage?: 'off_session' | 'on_session';
|
|
704
|
+
|
|
693
705
|
/**
|
|
694
706
|
* Indicates that you intend to make future payments with this PaymentIntent’s payment method.
|
|
695
707
|
*
|
|
@@ -697,6 +709,13 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
|
|
|
697
709
|
*/
|
|
698
710
|
setup_future_usage?: 'off_session' | 'on_session';
|
|
699
711
|
|
|
712
|
+
/**
|
|
713
|
+
* Controls when the funds will be captured from the customer’s account.
|
|
714
|
+
*
|
|
715
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
|
|
716
|
+
*/
|
|
717
|
+
captureMethod?: 'manual' | 'automatic';
|
|
718
|
+
|
|
700
719
|
/**
|
|
701
720
|
* Controls when the funds will be captured from the customer’s account.
|
|
702
721
|
*
|
|
@@ -704,14 +723,40 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
|
|
|
704
723
|
*/
|
|
705
724
|
capture_method?: 'manual' | 'automatic';
|
|
706
725
|
|
|
726
|
+
/**
|
|
727
|
+
* Instead of using automatic payment methods, declare specific payment methods to enable.
|
|
728
|
+
*
|
|
729
|
+
* @docs https://stripe.com/docs/payments/payment-methods/overview
|
|
730
|
+
*/
|
|
731
|
+
paymentMethodTypes?: string[];
|
|
732
|
+
|
|
707
733
|
/**
|
|
708
734
|
* Instead of using automatic payment methods, declare specific payment methods to enable.
|
|
709
735
|
*
|
|
710
736
|
* @docs https://stripe.com/docs/payments/payment-methods/overview
|
|
711
737
|
*/
|
|
712
738
|
payment_method_types?: string[];
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Allows PaymentMethods to be created from the Elements instance.
|
|
742
|
+
*/
|
|
743
|
+
paymentMethodCreation?: 'manual';
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Allows PaymentMethods to be created from the Elements instance.
|
|
747
|
+
*/
|
|
748
|
+
payment_method_creation?: 'manual';
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Either use mode or clientSecret when creating an Elements group
|
|
752
|
+
*/
|
|
753
|
+
clientSecret?: never;
|
|
713
754
|
}
|
|
714
755
|
|
|
756
|
+
export type StripeElementsOptions =
|
|
757
|
+
| StripeElementsOptionsClientSecret
|
|
758
|
+
| StripeElementsOptionsMode;
|
|
759
|
+
|
|
715
760
|
/*
|
|
716
761
|
* Updatable options for an `Elements` instance
|
|
717
762
|
*/
|
|
@@ -746,6 +791,13 @@ export interface StripeElementsUpdateOptions {
|
|
|
746
791
|
*/
|
|
747
792
|
amount?: number;
|
|
748
793
|
|
|
794
|
+
/**
|
|
795
|
+
* Indicates that you intend to make future payments with this PaymentIntent’s payment method.
|
|
796
|
+
*
|
|
797
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
|
|
798
|
+
*/
|
|
799
|
+
setupFutureUsage?: 'off_session' | 'on_session';
|
|
800
|
+
|
|
749
801
|
/**
|
|
750
802
|
* Indicates that you intend to make future payments with this PaymentIntent’s payment method.
|
|
751
803
|
*
|
|
@@ -753,6 +805,13 @@ export interface StripeElementsUpdateOptions {
|
|
|
753
805
|
*/
|
|
754
806
|
setup_future_usage?: 'off_session' | 'on_session';
|
|
755
807
|
|
|
808
|
+
/**
|
|
809
|
+
* Controls when the funds will be captured from the customer’s account.
|
|
810
|
+
*
|
|
811
|
+
* @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method
|
|
812
|
+
*/
|
|
813
|
+
captureMethod?: 'manual' | 'automatic';
|
|
814
|
+
|
|
756
815
|
/**
|
|
757
816
|
* Controls when the funds will be captured from the customer’s account.
|
|
758
817
|
*
|
|
@@ -766,6 +825,13 @@ export interface StripeElementsUpdateOptions {
|
|
|
766
825
|
* @docs https://stripe.com/docs/payments/payment-methods/overview
|
|
767
826
|
*/
|
|
768
827
|
payment_method_types?: string[];
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Instead of using automatic payment methods, declare specific payment methods to enable.
|
|
831
|
+
*
|
|
832
|
+
* @docs https://stripe.com/docs/payments/payment-methods/overview
|
|
833
|
+
*/
|
|
834
|
+
paymentMethodTypes?: string[];
|
|
769
835
|
}
|
|
770
836
|
|
|
771
837
|
/*
|
|
@@ -20,6 +20,7 @@ export type CreatePaymentMethodData =
|
|
|
20
20
|
| CreatePaymentMethodAuBecsDebitData
|
|
21
21
|
| CreatePaymentMethodBacsDebitData
|
|
22
22
|
| CreatePaymentMethodBancontactData
|
|
23
|
+
| CreatePaymentMethodBlikData
|
|
23
24
|
| CreatePaymentMethodBoletoData
|
|
24
25
|
| CreatePaymentMethodCardData
|
|
25
26
|
| CreatePaymentMethodCashappData
|
|
@@ -95,6 +96,15 @@ export interface CreatePaymentMethodBancontactData
|
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
export interface CreatePaymentMethodBlikData extends PaymentMethodCreateParams {
|
|
100
|
+
type: 'blik';
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Details about the BLIK pament method. Currently there are no supported child attributes for this field.
|
|
104
|
+
*/
|
|
105
|
+
blik?: {}; // eslint-disable-line @typescript-eslint/ban-types
|
|
106
|
+
}
|
|
107
|
+
|
|
98
108
|
export interface CreatePaymentMethodBoletoData
|
|
99
109
|
extends PaymentMethodCreateParams {
|
|
100
110
|
type: 'boleto';
|
|
@@ -542,6 +552,35 @@ export interface ConfirmBancontactPaymentData
|
|
|
542
552
|
return_url?: string;
|
|
543
553
|
}
|
|
544
554
|
|
|
555
|
+
/**
|
|
556
|
+
* Data to be sent with a `stripe.ConfirmBlikPayment` request.
|
|
557
|
+
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
|
|
558
|
+
*/
|
|
559
|
+
export interface ConfirmBlikPaymentData extends PaymentIntentConfirmParams {
|
|
560
|
+
/**
|
|
561
|
+
* Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
|
|
562
|
+
* This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
|
|
563
|
+
*
|
|
564
|
+
* @recommended
|
|
565
|
+
*/
|
|
566
|
+
payment_method?: string | Omit<CreatePaymentMethodBlikData, 'type'>;
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with.
|
|
570
|
+
*/
|
|
571
|
+
payment_method_options: {
|
|
572
|
+
/**
|
|
573
|
+
* A configuration for this BLIK payment.
|
|
574
|
+
*/
|
|
575
|
+
blik: {
|
|
576
|
+
/**
|
|
577
|
+
* Your customer's 6-digit BLIK code.
|
|
578
|
+
*/
|
|
579
|
+
code: string;
|
|
580
|
+
};
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
|
|
545
584
|
/**
|
|
546
585
|
* Data to be sent with a `stripe.confirmBoletoPayment` request.
|
|
547
586
|
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
|
|
@@ -609,6 +648,16 @@ export interface ConfirmBancontactPaymentOptions {
|
|
|
609
648
|
handleActions?: boolean;
|
|
610
649
|
}
|
|
611
650
|
|
|
651
|
+
/**
|
|
652
|
+
* An options object to control the behavior of `stripe.confirmBlikPayment`.
|
|
653
|
+
*/
|
|
654
|
+
export interface ConfirmBlikPaymentOptions {
|
|
655
|
+
/**
|
|
656
|
+
* Set this to false if you want to manually determine if the confirmation has succeeded or failed.
|
|
657
|
+
*/
|
|
658
|
+
handleActions?: boolean;
|
|
659
|
+
}
|
|
660
|
+
|
|
612
661
|
/**
|
|
613
662
|
* Data to be sent with a `stripe.confirmCardPayment` request.
|
|
614
663
|
* Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
|
|
@@ -203,6 +203,18 @@ export interface Stripe {
|
|
|
203
203
|
options?: paymentIntents.ConfirmBancontactPaymentOptions
|
|
204
204
|
): Promise<PaymentIntentResult>;
|
|
205
205
|
|
|
206
|
+
/**
|
|
207
|
+
* Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form.
|
|
208
|
+
* When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction.
|
|
209
|
+
*
|
|
210
|
+
* @docs https://stripe.com/docs/js/payment_intents/confirm_blik_payment
|
|
211
|
+
*/
|
|
212
|
+
confirmBlikPayment(
|
|
213
|
+
clientSecret: string,
|
|
214
|
+
data: paymentIntents.ConfirmBlikPaymentData,
|
|
215
|
+
options?: paymentIntents.ConfirmBlikPaymentOptions
|
|
216
|
+
): Promise<PaymentIntentResult>;
|
|
217
|
+
|
|
206
218
|
/**
|
|
207
219
|
* Use `stripe.confirmBoletoPayment` in the [Boleto Payment](https://stripe.com/docs/payments/boleto) with Payment Methods flow when the customer submits your payment form.
|
|
208
220
|
* When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide.
|
|
@@ -578,8 +590,8 @@ export interface Stripe {
|
|
|
578
590
|
handleCardAction(clientSecret: string): Promise<PaymentIntentResult>;
|
|
579
591
|
|
|
580
592
|
/**
|
|
581
|
-
* Use `stripe.handleNextAction` in the
|
|
582
|
-
* It will throw an error if the `PaymentIntent` has a different status.
|
|
593
|
+
* Use `stripe.handleNextAction` in the [finalizing payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server) flow to finish confirmation of a [PaymentIntent](https://stripe.com/docs/api/payment_intents) or [SetupIntent](https://stripe.com/docs/api/setup_intents) with the `requires_action` status.
|
|
594
|
+
* It will throw an error if the `PaymentIntent` or `SetupIntent` has a different status.
|
|
583
595
|
*
|
|
584
596
|
* Note that `stripe.handleNextAction` may take several seconds to complete.
|
|
585
597
|
* During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner.
|
|
@@ -593,7 +605,7 @@ export interface Stripe {
|
|
|
593
605
|
*/
|
|
594
606
|
handleNextAction(options: {
|
|
595
607
|
clientSecret: string;
|
|
596
|
-
}): Promise<
|
|
608
|
+
}): Promise<PaymentIntentOrSetupIntentResult>;
|
|
597
609
|
|
|
598
610
|
/**
|
|
599
611
|
* Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow
|
|
@@ -1191,6 +1203,15 @@ export type SetupIntentResult =
|
|
|
1191
1203
|
| {setupIntent: api.SetupIntent; error?: undefined}
|
|
1192
1204
|
| {setupIntent?: undefined; error: StripeError};
|
|
1193
1205
|
|
|
1206
|
+
export type PaymentIntentOrSetupIntentResult =
|
|
1207
|
+
| {
|
|
1208
|
+
paymentIntent: api.PaymentIntent;
|
|
1209
|
+
setupIntent?: undefined;
|
|
1210
|
+
error?: undefined;
|
|
1211
|
+
}
|
|
1212
|
+
| {paymentIntent?: undefined; setupIntent: api.SetupIntent; error?: undefined}
|
|
1213
|
+
| {paymentIntent?: undefined; setupIntent?: undefined; error: StripeError};
|
|
1214
|
+
|
|
1194
1215
|
export type ProcessOrderResult =
|
|
1195
1216
|
| {paymentIntent: api.PaymentIntent; order: api.Order; error?: undefined}
|
|
1196
1217
|
| {paymentIntent?: undefined; order: api.Order; error?: undefined}
|