@stripe/stripe-js 1.41.0 → 1.42.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/cart.d.ts +53 -2
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
|
@@ -86,7 +86,39 @@ export type StripeCartElement = StripeElementBase & {
|
|
|
86
86
|
* Updates the options the `CartElement` was initialized with.
|
|
87
87
|
* Updates are merged into the existing configuration.
|
|
88
88
|
*/
|
|
89
|
-
update(options:
|
|
89
|
+
update(options: StripeCartElementUpdateOptions): StripeCartElement;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Makes the Cart Element visible
|
|
93
|
+
*/
|
|
94
|
+
show(): StripeCartElement;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Makes the Cart Element not visible
|
|
98
|
+
*/
|
|
99
|
+
hide(): StripeCartElement;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Cancels the "Check Out" button loader and displays an error message regarding why going to checkout failed
|
|
103
|
+
*/
|
|
104
|
+
cancelCheckout(errorMessage?: string | null): StripeCartElement;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Adds a line item to the CartSession
|
|
108
|
+
*/
|
|
109
|
+
addLineItem(
|
|
110
|
+
lineItemData:
|
|
111
|
+
| {
|
|
112
|
+
product: string;
|
|
113
|
+
price?: null;
|
|
114
|
+
quantity?: number | null;
|
|
115
|
+
}
|
|
116
|
+
| {
|
|
117
|
+
price: string;
|
|
118
|
+
product?: null;
|
|
119
|
+
quantity?: number | null;
|
|
120
|
+
}
|
|
121
|
+
): Promise<{error?: StripeError}>;
|
|
90
122
|
};
|
|
91
123
|
|
|
92
124
|
export type CartDescriptor = 'cart' | 'bag' | 'basket';
|
|
@@ -110,7 +142,26 @@ export interface StripeCartElementOptions {
|
|
|
110
142
|
* By default the Cart Element will use the title 'Your [descriptor]'.
|
|
111
143
|
*/
|
|
112
144
|
header?: {
|
|
113
|
-
text?: string;
|
|
145
|
+
text?: string | null;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Control whether the Element automatically appears when items are added to the cart.
|
|
150
|
+
* By default, the Cart Element will use 'auto'.
|
|
151
|
+
*/
|
|
152
|
+
showOnAdd?: CartShowOnAdd | null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/*
|
|
156
|
+
* Updatable options for an `Elements` instance
|
|
157
|
+
*/
|
|
158
|
+
export interface StripeCartElementUpdateOptions {
|
|
159
|
+
/**
|
|
160
|
+
* Override the text used in the title of the Element.
|
|
161
|
+
* By default the Cart Element will use the title 'Your [descriptor]'.
|
|
162
|
+
*/
|
|
163
|
+
header?: {
|
|
164
|
+
text?: string | null;
|
|
114
165
|
};
|
|
115
166
|
|
|
116
167
|
/**
|