@stripe/stripe-js 2.1.2 → 2.1.4
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/custom-checkout.d.ts +17 -7
- package/types/stripe-js/elements-group.d.ts +16 -0
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
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
StripeAddressElement,
|
|
11
11
|
} from './elements/address';
|
|
12
12
|
import {Appearance, CssFontSource, CustomFontSource} from './elements-group';
|
|
13
|
+
import {StripeError} from './stripe';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Requires beta access:
|
|
@@ -49,24 +50,33 @@ export type StripeCustomCheckoutShippingAddress = {
|
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
export type StripeCustomCheckoutBillingAddress = StripeCustomCheckoutShippingAddress;
|
|
53
|
+
export type StripeCustomCheckoutResult =
|
|
54
|
+
| {session: StripeCustomCheckoutSession; error?: undefined}
|
|
55
|
+
| {session?: undefined; error: StripeError};
|
|
52
56
|
|
|
53
57
|
export interface StripeCustomCheckoutActions {
|
|
54
|
-
applyPromotionCode: (
|
|
55
|
-
|
|
58
|
+
applyPromotionCode: (
|
|
59
|
+
promotionCode: string
|
|
60
|
+
) => Promise<StripeCustomCheckoutResult>;
|
|
61
|
+
removePromotionCode: () => Promise<StripeCustomCheckoutResult>;
|
|
56
62
|
updateShippingAddress: (
|
|
57
63
|
shippingAddress: StripeCustomCheckoutShippingAddress
|
|
58
|
-
) => Promise<
|
|
64
|
+
) => Promise<StripeCustomCheckoutResult>;
|
|
59
65
|
updateBillingAddress: (
|
|
60
66
|
billingAddress: StripeCustomCheckoutBillingAddress
|
|
61
|
-
) => Promise<
|
|
67
|
+
) => Promise<StripeCustomCheckoutResult>;
|
|
62
68
|
updatePhoneNumber: (phoneNumber: string) => void;
|
|
63
69
|
updateEmail: (email: string) => void;
|
|
64
70
|
updateLineItemQuantity: (args: {
|
|
65
71
|
lineItem: string;
|
|
66
72
|
quantity: number;
|
|
67
|
-
}) => Promise<
|
|
68
|
-
updateShippingOption: (
|
|
69
|
-
|
|
73
|
+
}) => Promise<StripeCustomCheckoutResult>;
|
|
74
|
+
updateShippingOption: (
|
|
75
|
+
shippingOption: string
|
|
76
|
+
) => Promise<StripeCustomCheckoutResult>;
|
|
77
|
+
confirm: (args?: {
|
|
78
|
+
return_url?: string;
|
|
79
|
+
}) => Promise<StripeCustomCheckoutResult>;
|
|
70
80
|
}
|
|
71
81
|
|
|
72
82
|
/**
|
|
@@ -745,6 +745,22 @@ export interface StripeElementsOptionsMode extends BaseStripeElementsOptions {
|
|
|
745
745
|
*/
|
|
746
746
|
payment_method_types?: string[];
|
|
747
747
|
|
|
748
|
+
/**
|
|
749
|
+
* When using automatic payment methods (omitting paymentMethodTypes), provide a
|
|
750
|
+
* payment method configuration ID for deriving payment methods.
|
|
751
|
+
*
|
|
752
|
+
* @docs https://stripe.com/docs/connect/payment-method-configurations
|
|
753
|
+
*/
|
|
754
|
+
paymentMethodConfiguration?: string;
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* When using automatic payment methods (omitting payment_method_types), provide a
|
|
758
|
+
* payment method configuration ID for deriving payment methods.
|
|
759
|
+
*
|
|
760
|
+
* @docs https://stripe.com/docs/connect/payment-method-configurations
|
|
761
|
+
*/
|
|
762
|
+
payment_method_configuration?: string;
|
|
763
|
+
|
|
748
764
|
/**
|
|
749
765
|
* Allows PaymentMethods to be created from the Elements instance.
|
|
750
766
|
*/
|