@whop/checkout 0.0.44 → 0.0.46
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/static/checkout/chunk-KPUOTVOX.mjs +1 -0
- package/dist/static/checkout/index.cjs +1 -1
- package/dist/static/checkout/index.js +1 -1
- package/dist/static/checkout/index.mjs +1 -1
- package/dist/static/checkout/react/index.cjs +1 -1
- package/dist/static/checkout/react/index.d.mts +271 -18
- package/dist/static/checkout/react/index.d.ts +271 -18
- package/dist/static/checkout/react/index.js +1 -1
- package/dist/static/checkout/react/index.mjs +1 -1
- package/dist/static/checkout/{util-DnHRCaD4.d.mts → util-CWq7wxCs.d.mts} +30 -3
- package/dist/static/checkout/{util-DnHRCaD4.d.ts → util-CWq7wxCs.d.ts} +30 -3
- package/dist/static/checkout/util.cjs +1 -1
- package/dist/static/checkout/util.d.mts +1 -1
- package/dist/static/checkout/util.d.ts +1 -1
- package/dist/static/checkout/util.js +1 -1
- package/dist/static/checkout/util.mjs +1 -1
- package/package.json +2 -2
- package/dist/static/checkout/chunk-4NKKJ5O4.mjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { MutableRefObject, ReactNode } from 'react';
|
|
3
|
-
import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-
|
|
3
|
+
import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-CWq7wxCs.mjs';
|
|
4
4
|
|
|
5
5
|
declare const accentColorValues: readonly ["tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "cyan", "teal", "jade", "green", "grass", "brown", "blue", "orange", "indigo", "sky", "mint", "yellow", "amber", "lime", "lemon", "magenta", "gold", "bronze", "gray"];
|
|
6
6
|
type AccentColor = (typeof accentColorValues)[number];
|
|
@@ -32,11 +32,7 @@ interface WhopCheckoutEmbedThemeOptions {
|
|
|
32
32
|
highContrast?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* **Required** - The plan id you want to checkout.
|
|
38
|
-
*/
|
|
39
|
-
planId: string;
|
|
35
|
+
type WhopCheckoutEmbedProps = {
|
|
40
36
|
/**
|
|
41
37
|
* **Optional** - A ref to the embed controls.
|
|
42
38
|
*
|
|
@@ -51,12 +47,6 @@ interface WhopCheckoutEmbedProps {
|
|
|
51
47
|
* @default "system"
|
|
52
48
|
*/
|
|
53
49
|
theme?: "light" | "dark" | "system";
|
|
54
|
-
/**
|
|
55
|
-
* **Optional** - The session id to use for the checkout.
|
|
56
|
-
*
|
|
57
|
-
* This can be used to attach metadata to a checkout by first creating a session through the API and then passing the session id to the checkout element.
|
|
58
|
-
*/
|
|
59
|
-
sessionId?: string;
|
|
60
50
|
/**
|
|
61
51
|
* **Optional** - Turn on to hide the price in the embedded checkout form.
|
|
62
52
|
*
|
|
@@ -72,11 +62,15 @@ interface WhopCheckoutEmbedProps {
|
|
|
72
62
|
/**
|
|
73
63
|
* **Optional** - A callback function that will be called when the checkout is complete.
|
|
74
64
|
*/
|
|
75
|
-
onComplete?: (
|
|
65
|
+
onComplete?: ((
|
|
76
66
|
/** The plan id of the plan that was purchased. */
|
|
77
67
|
plan_id: string,
|
|
78
68
|
/** The receipt id of the purchase. */
|
|
79
|
-
receipt_id?: string) => void
|
|
69
|
+
receipt_id?: string) => void) | ((
|
|
70
|
+
/** The session id that was used to create the checkout. */
|
|
71
|
+
session_id: string,
|
|
72
|
+
/** The setup intent that was created */
|
|
73
|
+
setup_intent_id?: string) => void);
|
|
80
74
|
/**
|
|
81
75
|
* **Optional** - A callback function that will be called when the checkout state changes.
|
|
82
76
|
*/
|
|
@@ -153,7 +147,19 @@ interface WhopCheckoutEmbedProps {
|
|
|
153
147
|
* @default undefined
|
|
154
148
|
*/
|
|
155
149
|
setupFutureUsage?: "off_session";
|
|
156
|
-
}
|
|
150
|
+
} & ({
|
|
151
|
+
/**
|
|
152
|
+
* **Required** - The plan id to use for the checkout.
|
|
153
|
+
*/
|
|
154
|
+
planId: string;
|
|
155
|
+
} | {
|
|
156
|
+
/**
|
|
157
|
+
* **Required** - The session id to use for the checkout.
|
|
158
|
+
*
|
|
159
|
+
* This can be used to attach metadata to a checkout by first creating a session through the API and then passing the session id to the checkout element.
|
|
160
|
+
*/
|
|
161
|
+
sessionId: string;
|
|
162
|
+
});
|
|
157
163
|
|
|
158
164
|
/**
|
|
159
165
|
* This component can be used to embed whop checkout in your react app:
|
|
@@ -166,13 +172,260 @@ interface WhopCheckoutEmbedProps {
|
|
|
166
172
|
* }
|
|
167
173
|
* ```
|
|
168
174
|
*/
|
|
169
|
-
declare const WhopCheckoutEmbed: React__default.ForwardRefExoticComponent<Omit<
|
|
175
|
+
declare const WhopCheckoutEmbed: React__default.ForwardRefExoticComponent<(Omit<{
|
|
176
|
+
/**
|
|
177
|
+
* **Optional** - A ref to the embed controls.
|
|
178
|
+
*
|
|
179
|
+
* This can be used to submit the checkout form.
|
|
180
|
+
*/
|
|
181
|
+
ref?: MutableRefObject<WhopCheckoutEmbedControls | null>;
|
|
182
|
+
/**
|
|
183
|
+
* **Optional** - The theme you want to use for the checkout.
|
|
184
|
+
*
|
|
185
|
+
* Possible values are `light`, `dark` or `system`.
|
|
186
|
+
*
|
|
187
|
+
* @default "system"
|
|
188
|
+
*/
|
|
189
|
+
theme?: "light" | "dark" | "system";
|
|
190
|
+
/**
|
|
191
|
+
* **Optional** - Turn on to hide the price in the embedded checkout form.
|
|
192
|
+
*
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
195
|
+
hidePrice?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* **Optional** - Set to `true` to skip the final redirect and keep the top frame loaded.
|
|
198
|
+
*
|
|
199
|
+
* @default false
|
|
200
|
+
*/
|
|
201
|
+
skipRedirect?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* **Optional** - A callback function that will be called when the checkout is complete.
|
|
204
|
+
*/
|
|
205
|
+
onComplete?: ((
|
|
206
|
+
/** The plan id of the plan that was purchased. */
|
|
207
|
+
plan_id: string,
|
|
208
|
+
/** The receipt id of the purchase. */
|
|
209
|
+
receipt_id?: string) => void) | ((
|
|
210
|
+
/** The session id that was used to create the checkout. */
|
|
211
|
+
session_id: string,
|
|
212
|
+
/** The setup intent that was created */
|
|
213
|
+
setup_intent_id?: string) => void);
|
|
214
|
+
/**
|
|
215
|
+
* **Optional** - A callback function that will be called when the checkout state changes.
|
|
216
|
+
*/
|
|
217
|
+
onStateChange?: (
|
|
218
|
+
/** The new state of the checkout. */
|
|
219
|
+
state: WhopCheckoutState) => void;
|
|
220
|
+
/**
|
|
221
|
+
* **Optional** - A callback function that will be called when the address validation error occurs.
|
|
222
|
+
*/
|
|
223
|
+
onAddressValidationError?: (error: {
|
|
224
|
+
/** The error message of the address validation error. */
|
|
225
|
+
error_message: string;
|
|
226
|
+
/** The error code of the address validation error. */
|
|
227
|
+
error_code: string;
|
|
228
|
+
}) => void;
|
|
229
|
+
/**
|
|
230
|
+
* **Optional** - The UTM parameters to add to the checkout URL.
|
|
231
|
+
*
|
|
232
|
+
* **Note** - The keys must start with `utm_`
|
|
233
|
+
*/
|
|
234
|
+
utm?: Record<string, string | string[]>;
|
|
235
|
+
/**
|
|
236
|
+
* **Optional** - The styles to apply to the checkout embed.
|
|
237
|
+
*/
|
|
238
|
+
styles?: WhopEmbeddedCheckoutStyleOptions;
|
|
239
|
+
/**
|
|
240
|
+
* **Optional** - The prefill options to apply to the checkout embed.
|
|
241
|
+
*
|
|
242
|
+
* Used to prefill the email in the embedded checkout form.
|
|
243
|
+
* This setting can be helpful when integrating the embed into a funnel that collects the email prior to payment already.
|
|
244
|
+
*/
|
|
245
|
+
prefill?: WhopEmbeddedCheckoutPrefillOptions;
|
|
246
|
+
/**
|
|
247
|
+
* **Optional** - The theme options to apply to the checkout embed.
|
|
248
|
+
*/
|
|
249
|
+
themeOptions?: WhopCheckoutEmbedThemeOptions;
|
|
250
|
+
/**
|
|
251
|
+
* **Optional** - Set to `true` to hide the submit button in the embedded checkout form.
|
|
252
|
+
*
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
|
+
hideSubmitButton?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* **Optional** - Set to `true` to hide the terms and conditions in the embedded checkout form.
|
|
258
|
+
*
|
|
259
|
+
* @default false
|
|
260
|
+
*/
|
|
261
|
+
hideTermsAndConditions?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* **Optional** - Set to `true` to hide the email input in the embedded checkout form.
|
|
264
|
+
*
|
|
265
|
+
* @default false
|
|
266
|
+
*/
|
|
267
|
+
hideEmail?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* **Optional** - Set to `true` to disable the email input in the embedded checkout form.
|
|
270
|
+
*
|
|
271
|
+
* @default false
|
|
272
|
+
*/
|
|
273
|
+
disableEmail?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* **Optional** - Set to `true` to hide the address form in the embedded checkout form.
|
|
276
|
+
*
|
|
277
|
+
* @default false
|
|
278
|
+
*/
|
|
279
|
+
hideAddressForm?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* **Optional** - The affiliate code to use for the checkout.
|
|
282
|
+
*/
|
|
283
|
+
affiliateCode?: string;
|
|
284
|
+
/**
|
|
285
|
+
* **Optional** - The setup future usage to use for the checkout. When using the `chargeUser` API you need to set this to `off_session`. This will filter out payment methods that are not supported with that API.
|
|
286
|
+
*
|
|
287
|
+
* @default undefined
|
|
288
|
+
*/
|
|
289
|
+
setupFutureUsage?: "off_session";
|
|
290
|
+
} & {
|
|
291
|
+
/**
|
|
292
|
+
* **Required** - The plan id to use for the checkout.
|
|
293
|
+
*/
|
|
294
|
+
planId: string;
|
|
295
|
+
} & {
|
|
296
|
+
/**
|
|
297
|
+
* **Optional** - The fallback content to show while the checkout is loading.
|
|
298
|
+
*/
|
|
299
|
+
fallback?: ReactNode;
|
|
300
|
+
}, "ref"> | Omit<{
|
|
301
|
+
/**
|
|
302
|
+
* **Optional** - A ref to the embed controls.
|
|
303
|
+
*
|
|
304
|
+
* This can be used to submit the checkout form.
|
|
305
|
+
*/
|
|
306
|
+
ref?: MutableRefObject<WhopCheckoutEmbedControls | null>;
|
|
307
|
+
/**
|
|
308
|
+
* **Optional** - The theme you want to use for the checkout.
|
|
309
|
+
*
|
|
310
|
+
* Possible values are `light`, `dark` or `system`.
|
|
311
|
+
*
|
|
312
|
+
* @default "system"
|
|
313
|
+
*/
|
|
314
|
+
theme?: "light" | "dark" | "system";
|
|
315
|
+
/**
|
|
316
|
+
* **Optional** - Turn on to hide the price in the embedded checkout form.
|
|
317
|
+
*
|
|
318
|
+
* @default false
|
|
319
|
+
*/
|
|
320
|
+
hidePrice?: boolean;
|
|
321
|
+
/**
|
|
322
|
+
* **Optional** - Set to `true` to skip the final redirect and keep the top frame loaded.
|
|
323
|
+
*
|
|
324
|
+
* @default false
|
|
325
|
+
*/
|
|
326
|
+
skipRedirect?: boolean;
|
|
327
|
+
/**
|
|
328
|
+
* **Optional** - A callback function that will be called when the checkout is complete.
|
|
329
|
+
*/
|
|
330
|
+
onComplete?: ((
|
|
331
|
+
/** The plan id of the plan that was purchased. */
|
|
332
|
+
plan_id: string,
|
|
333
|
+
/** The receipt id of the purchase. */
|
|
334
|
+
receipt_id?: string) => void) | ((
|
|
335
|
+
/** The session id that was used to create the checkout. */
|
|
336
|
+
session_id: string,
|
|
337
|
+
/** The setup intent that was created */
|
|
338
|
+
setup_intent_id?: string) => void);
|
|
339
|
+
/**
|
|
340
|
+
* **Optional** - A callback function that will be called when the checkout state changes.
|
|
341
|
+
*/
|
|
342
|
+
onStateChange?: (
|
|
343
|
+
/** The new state of the checkout. */
|
|
344
|
+
state: WhopCheckoutState) => void;
|
|
345
|
+
/**
|
|
346
|
+
* **Optional** - A callback function that will be called when the address validation error occurs.
|
|
347
|
+
*/
|
|
348
|
+
onAddressValidationError?: (error: {
|
|
349
|
+
/** The error message of the address validation error. */
|
|
350
|
+
error_message: string;
|
|
351
|
+
/** The error code of the address validation error. */
|
|
352
|
+
error_code: string;
|
|
353
|
+
}) => void;
|
|
354
|
+
/**
|
|
355
|
+
* **Optional** - The UTM parameters to add to the checkout URL.
|
|
356
|
+
*
|
|
357
|
+
* **Note** - The keys must start with `utm_`
|
|
358
|
+
*/
|
|
359
|
+
utm?: Record<string, string | string[]>;
|
|
360
|
+
/**
|
|
361
|
+
* **Optional** - The styles to apply to the checkout embed.
|
|
362
|
+
*/
|
|
363
|
+
styles?: WhopEmbeddedCheckoutStyleOptions;
|
|
364
|
+
/**
|
|
365
|
+
* **Optional** - The prefill options to apply to the checkout embed.
|
|
366
|
+
*
|
|
367
|
+
* Used to prefill the email in the embedded checkout form.
|
|
368
|
+
* This setting can be helpful when integrating the embed into a funnel that collects the email prior to payment already.
|
|
369
|
+
*/
|
|
370
|
+
prefill?: WhopEmbeddedCheckoutPrefillOptions;
|
|
371
|
+
/**
|
|
372
|
+
* **Optional** - The theme options to apply to the checkout embed.
|
|
373
|
+
*/
|
|
374
|
+
themeOptions?: WhopCheckoutEmbedThemeOptions;
|
|
375
|
+
/**
|
|
376
|
+
* **Optional** - Set to `true` to hide the submit button in the embedded checkout form.
|
|
377
|
+
*
|
|
378
|
+
* @default false
|
|
379
|
+
*/
|
|
380
|
+
hideSubmitButton?: boolean;
|
|
381
|
+
/**
|
|
382
|
+
* **Optional** - Set to `true` to hide the terms and conditions in the embedded checkout form.
|
|
383
|
+
*
|
|
384
|
+
* @default false
|
|
385
|
+
*/
|
|
386
|
+
hideTermsAndConditions?: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* **Optional** - Set to `true` to hide the email input in the embedded checkout form.
|
|
389
|
+
*
|
|
390
|
+
* @default false
|
|
391
|
+
*/
|
|
392
|
+
hideEmail?: boolean;
|
|
393
|
+
/**
|
|
394
|
+
* **Optional** - Set to `true` to disable the email input in the embedded checkout form.
|
|
395
|
+
*
|
|
396
|
+
* @default false
|
|
397
|
+
*/
|
|
398
|
+
disableEmail?: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* **Optional** - Set to `true` to hide the address form in the embedded checkout form.
|
|
401
|
+
*
|
|
402
|
+
* @default false
|
|
403
|
+
*/
|
|
404
|
+
hideAddressForm?: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* **Optional** - The affiliate code to use for the checkout.
|
|
407
|
+
*/
|
|
408
|
+
affiliateCode?: string;
|
|
409
|
+
/**
|
|
410
|
+
* **Optional** - The setup future usage to use for the checkout. When using the `chargeUser` API you need to set this to `off_session`. This will filter out payment methods that are not supported with that API.
|
|
411
|
+
*
|
|
412
|
+
* @default undefined
|
|
413
|
+
*/
|
|
414
|
+
setupFutureUsage?: "off_session";
|
|
415
|
+
} & {
|
|
416
|
+
/**
|
|
417
|
+
* **Required** - The session id to use for the checkout.
|
|
418
|
+
*
|
|
419
|
+
* This can be used to attach metadata to a checkout by first creating a session through the API and then passing the session id to the checkout element.
|
|
420
|
+
*/
|
|
421
|
+
sessionId: string;
|
|
422
|
+
} & {
|
|
170
423
|
/**
|
|
171
424
|
* **Optional** - The fallback content to show while the checkout is loading.
|
|
172
425
|
*/
|
|
173
426
|
fallback?: ReactNode;
|
|
174
|
-
}, "ref"> & React__default.RefAttributes<WhopCheckoutEmbedControls>>;
|
|
427
|
+
}, "ref">) & React__default.RefAttributes<WhopCheckoutEmbedControls>>;
|
|
175
428
|
|
|
176
|
-
declare function useCheckoutEmbedControls(): React.RefObject<WhopCheckoutEmbedControls>;
|
|
429
|
+
declare function useCheckoutEmbedControls(): React.RefObject<WhopCheckoutEmbedControls | null>;
|
|
177
430
|
|
|
178
431
|
export { type AccentColor, WhopCheckoutEmbed, type WhopCheckoutEmbedProps, type WhopCheckoutEmbedThemeOptions, WhopEmbeddedCheckoutPrefillOptions, WhopEmbeddedCheckoutStyleOptions, accentColorValues, isAccentColor, useCheckoutEmbedControls };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { MutableRefObject, ReactNode } from 'react';
|
|
3
|
-
import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-
|
|
3
|
+
import { W as WhopCheckoutSubmitDetails, a as WhopCheckoutAddress, b as WhopCheckoutState, c as WhopEmbeddedCheckoutStyleOptions, d as WhopEmbeddedCheckoutPrefillOptions } from '../util-CWq7wxCs.js';
|
|
4
4
|
|
|
5
5
|
declare const accentColorValues: readonly ["tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "cyan", "teal", "jade", "green", "grass", "brown", "blue", "orange", "indigo", "sky", "mint", "yellow", "amber", "lime", "lemon", "magenta", "gold", "bronze", "gray"];
|
|
6
6
|
type AccentColor = (typeof accentColorValues)[number];
|
|
@@ -32,11 +32,7 @@ interface WhopCheckoutEmbedThemeOptions {
|
|
|
32
32
|
highContrast?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* **Required** - The plan id you want to checkout.
|
|
38
|
-
*/
|
|
39
|
-
planId: string;
|
|
35
|
+
type WhopCheckoutEmbedProps = {
|
|
40
36
|
/**
|
|
41
37
|
* **Optional** - A ref to the embed controls.
|
|
42
38
|
*
|
|
@@ -51,12 +47,6 @@ interface WhopCheckoutEmbedProps {
|
|
|
51
47
|
* @default "system"
|
|
52
48
|
*/
|
|
53
49
|
theme?: "light" | "dark" | "system";
|
|
54
|
-
/**
|
|
55
|
-
* **Optional** - The session id to use for the checkout.
|
|
56
|
-
*
|
|
57
|
-
* This can be used to attach metadata to a checkout by first creating a session through the API and then passing the session id to the checkout element.
|
|
58
|
-
*/
|
|
59
|
-
sessionId?: string;
|
|
60
50
|
/**
|
|
61
51
|
* **Optional** - Turn on to hide the price in the embedded checkout form.
|
|
62
52
|
*
|
|
@@ -72,11 +62,15 @@ interface WhopCheckoutEmbedProps {
|
|
|
72
62
|
/**
|
|
73
63
|
* **Optional** - A callback function that will be called when the checkout is complete.
|
|
74
64
|
*/
|
|
75
|
-
onComplete?: (
|
|
65
|
+
onComplete?: ((
|
|
76
66
|
/** The plan id of the plan that was purchased. */
|
|
77
67
|
plan_id: string,
|
|
78
68
|
/** The receipt id of the purchase. */
|
|
79
|
-
receipt_id?: string) => void
|
|
69
|
+
receipt_id?: string) => void) | ((
|
|
70
|
+
/** The session id that was used to create the checkout. */
|
|
71
|
+
session_id: string,
|
|
72
|
+
/** The setup intent that was created */
|
|
73
|
+
setup_intent_id?: string) => void);
|
|
80
74
|
/**
|
|
81
75
|
* **Optional** - A callback function that will be called when the checkout state changes.
|
|
82
76
|
*/
|
|
@@ -153,7 +147,19 @@ interface WhopCheckoutEmbedProps {
|
|
|
153
147
|
* @default undefined
|
|
154
148
|
*/
|
|
155
149
|
setupFutureUsage?: "off_session";
|
|
156
|
-
}
|
|
150
|
+
} & ({
|
|
151
|
+
/**
|
|
152
|
+
* **Required** - The plan id to use for the checkout.
|
|
153
|
+
*/
|
|
154
|
+
planId: string;
|
|
155
|
+
} | {
|
|
156
|
+
/**
|
|
157
|
+
* **Required** - The session id to use for the checkout.
|
|
158
|
+
*
|
|
159
|
+
* This can be used to attach metadata to a checkout by first creating a session through the API and then passing the session id to the checkout element.
|
|
160
|
+
*/
|
|
161
|
+
sessionId: string;
|
|
162
|
+
});
|
|
157
163
|
|
|
158
164
|
/**
|
|
159
165
|
* This component can be used to embed whop checkout in your react app:
|
|
@@ -166,13 +172,260 @@ interface WhopCheckoutEmbedProps {
|
|
|
166
172
|
* }
|
|
167
173
|
* ```
|
|
168
174
|
*/
|
|
169
|
-
declare const WhopCheckoutEmbed: React__default.ForwardRefExoticComponent<Omit<
|
|
175
|
+
declare const WhopCheckoutEmbed: React__default.ForwardRefExoticComponent<(Omit<{
|
|
176
|
+
/**
|
|
177
|
+
* **Optional** - A ref to the embed controls.
|
|
178
|
+
*
|
|
179
|
+
* This can be used to submit the checkout form.
|
|
180
|
+
*/
|
|
181
|
+
ref?: MutableRefObject<WhopCheckoutEmbedControls | null>;
|
|
182
|
+
/**
|
|
183
|
+
* **Optional** - The theme you want to use for the checkout.
|
|
184
|
+
*
|
|
185
|
+
* Possible values are `light`, `dark` or `system`.
|
|
186
|
+
*
|
|
187
|
+
* @default "system"
|
|
188
|
+
*/
|
|
189
|
+
theme?: "light" | "dark" | "system";
|
|
190
|
+
/**
|
|
191
|
+
* **Optional** - Turn on to hide the price in the embedded checkout form.
|
|
192
|
+
*
|
|
193
|
+
* @default false
|
|
194
|
+
*/
|
|
195
|
+
hidePrice?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* **Optional** - Set to `true` to skip the final redirect and keep the top frame loaded.
|
|
198
|
+
*
|
|
199
|
+
* @default false
|
|
200
|
+
*/
|
|
201
|
+
skipRedirect?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* **Optional** - A callback function that will be called when the checkout is complete.
|
|
204
|
+
*/
|
|
205
|
+
onComplete?: ((
|
|
206
|
+
/** The plan id of the plan that was purchased. */
|
|
207
|
+
plan_id: string,
|
|
208
|
+
/** The receipt id of the purchase. */
|
|
209
|
+
receipt_id?: string) => void) | ((
|
|
210
|
+
/** The session id that was used to create the checkout. */
|
|
211
|
+
session_id: string,
|
|
212
|
+
/** The setup intent that was created */
|
|
213
|
+
setup_intent_id?: string) => void);
|
|
214
|
+
/**
|
|
215
|
+
* **Optional** - A callback function that will be called when the checkout state changes.
|
|
216
|
+
*/
|
|
217
|
+
onStateChange?: (
|
|
218
|
+
/** The new state of the checkout. */
|
|
219
|
+
state: WhopCheckoutState) => void;
|
|
220
|
+
/**
|
|
221
|
+
* **Optional** - A callback function that will be called when the address validation error occurs.
|
|
222
|
+
*/
|
|
223
|
+
onAddressValidationError?: (error: {
|
|
224
|
+
/** The error message of the address validation error. */
|
|
225
|
+
error_message: string;
|
|
226
|
+
/** The error code of the address validation error. */
|
|
227
|
+
error_code: string;
|
|
228
|
+
}) => void;
|
|
229
|
+
/**
|
|
230
|
+
* **Optional** - The UTM parameters to add to the checkout URL.
|
|
231
|
+
*
|
|
232
|
+
* **Note** - The keys must start with `utm_`
|
|
233
|
+
*/
|
|
234
|
+
utm?: Record<string, string | string[]>;
|
|
235
|
+
/**
|
|
236
|
+
* **Optional** - The styles to apply to the checkout embed.
|
|
237
|
+
*/
|
|
238
|
+
styles?: WhopEmbeddedCheckoutStyleOptions;
|
|
239
|
+
/**
|
|
240
|
+
* **Optional** - The prefill options to apply to the checkout embed.
|
|
241
|
+
*
|
|
242
|
+
* Used to prefill the email in the embedded checkout form.
|
|
243
|
+
* This setting can be helpful when integrating the embed into a funnel that collects the email prior to payment already.
|
|
244
|
+
*/
|
|
245
|
+
prefill?: WhopEmbeddedCheckoutPrefillOptions;
|
|
246
|
+
/**
|
|
247
|
+
* **Optional** - The theme options to apply to the checkout embed.
|
|
248
|
+
*/
|
|
249
|
+
themeOptions?: WhopCheckoutEmbedThemeOptions;
|
|
250
|
+
/**
|
|
251
|
+
* **Optional** - Set to `true` to hide the submit button in the embedded checkout form.
|
|
252
|
+
*
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
|
+
hideSubmitButton?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* **Optional** - Set to `true` to hide the terms and conditions in the embedded checkout form.
|
|
258
|
+
*
|
|
259
|
+
* @default false
|
|
260
|
+
*/
|
|
261
|
+
hideTermsAndConditions?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* **Optional** - Set to `true` to hide the email input in the embedded checkout form.
|
|
264
|
+
*
|
|
265
|
+
* @default false
|
|
266
|
+
*/
|
|
267
|
+
hideEmail?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* **Optional** - Set to `true` to disable the email input in the embedded checkout form.
|
|
270
|
+
*
|
|
271
|
+
* @default false
|
|
272
|
+
*/
|
|
273
|
+
disableEmail?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* **Optional** - Set to `true` to hide the address form in the embedded checkout form.
|
|
276
|
+
*
|
|
277
|
+
* @default false
|
|
278
|
+
*/
|
|
279
|
+
hideAddressForm?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* **Optional** - The affiliate code to use for the checkout.
|
|
282
|
+
*/
|
|
283
|
+
affiliateCode?: string;
|
|
284
|
+
/**
|
|
285
|
+
* **Optional** - The setup future usage to use for the checkout. When using the `chargeUser` API you need to set this to `off_session`. This will filter out payment methods that are not supported with that API.
|
|
286
|
+
*
|
|
287
|
+
* @default undefined
|
|
288
|
+
*/
|
|
289
|
+
setupFutureUsage?: "off_session";
|
|
290
|
+
} & {
|
|
291
|
+
/**
|
|
292
|
+
* **Required** - The plan id to use for the checkout.
|
|
293
|
+
*/
|
|
294
|
+
planId: string;
|
|
295
|
+
} & {
|
|
296
|
+
/**
|
|
297
|
+
* **Optional** - The fallback content to show while the checkout is loading.
|
|
298
|
+
*/
|
|
299
|
+
fallback?: ReactNode;
|
|
300
|
+
}, "ref"> | Omit<{
|
|
301
|
+
/**
|
|
302
|
+
* **Optional** - A ref to the embed controls.
|
|
303
|
+
*
|
|
304
|
+
* This can be used to submit the checkout form.
|
|
305
|
+
*/
|
|
306
|
+
ref?: MutableRefObject<WhopCheckoutEmbedControls | null>;
|
|
307
|
+
/**
|
|
308
|
+
* **Optional** - The theme you want to use for the checkout.
|
|
309
|
+
*
|
|
310
|
+
* Possible values are `light`, `dark` or `system`.
|
|
311
|
+
*
|
|
312
|
+
* @default "system"
|
|
313
|
+
*/
|
|
314
|
+
theme?: "light" | "dark" | "system";
|
|
315
|
+
/**
|
|
316
|
+
* **Optional** - Turn on to hide the price in the embedded checkout form.
|
|
317
|
+
*
|
|
318
|
+
* @default false
|
|
319
|
+
*/
|
|
320
|
+
hidePrice?: boolean;
|
|
321
|
+
/**
|
|
322
|
+
* **Optional** - Set to `true` to skip the final redirect and keep the top frame loaded.
|
|
323
|
+
*
|
|
324
|
+
* @default false
|
|
325
|
+
*/
|
|
326
|
+
skipRedirect?: boolean;
|
|
327
|
+
/**
|
|
328
|
+
* **Optional** - A callback function that will be called when the checkout is complete.
|
|
329
|
+
*/
|
|
330
|
+
onComplete?: ((
|
|
331
|
+
/** The plan id of the plan that was purchased. */
|
|
332
|
+
plan_id: string,
|
|
333
|
+
/** The receipt id of the purchase. */
|
|
334
|
+
receipt_id?: string) => void) | ((
|
|
335
|
+
/** The session id that was used to create the checkout. */
|
|
336
|
+
session_id: string,
|
|
337
|
+
/** The setup intent that was created */
|
|
338
|
+
setup_intent_id?: string) => void);
|
|
339
|
+
/**
|
|
340
|
+
* **Optional** - A callback function that will be called when the checkout state changes.
|
|
341
|
+
*/
|
|
342
|
+
onStateChange?: (
|
|
343
|
+
/** The new state of the checkout. */
|
|
344
|
+
state: WhopCheckoutState) => void;
|
|
345
|
+
/**
|
|
346
|
+
* **Optional** - A callback function that will be called when the address validation error occurs.
|
|
347
|
+
*/
|
|
348
|
+
onAddressValidationError?: (error: {
|
|
349
|
+
/** The error message of the address validation error. */
|
|
350
|
+
error_message: string;
|
|
351
|
+
/** The error code of the address validation error. */
|
|
352
|
+
error_code: string;
|
|
353
|
+
}) => void;
|
|
354
|
+
/**
|
|
355
|
+
* **Optional** - The UTM parameters to add to the checkout URL.
|
|
356
|
+
*
|
|
357
|
+
* **Note** - The keys must start with `utm_`
|
|
358
|
+
*/
|
|
359
|
+
utm?: Record<string, string | string[]>;
|
|
360
|
+
/**
|
|
361
|
+
* **Optional** - The styles to apply to the checkout embed.
|
|
362
|
+
*/
|
|
363
|
+
styles?: WhopEmbeddedCheckoutStyleOptions;
|
|
364
|
+
/**
|
|
365
|
+
* **Optional** - The prefill options to apply to the checkout embed.
|
|
366
|
+
*
|
|
367
|
+
* Used to prefill the email in the embedded checkout form.
|
|
368
|
+
* This setting can be helpful when integrating the embed into a funnel that collects the email prior to payment already.
|
|
369
|
+
*/
|
|
370
|
+
prefill?: WhopEmbeddedCheckoutPrefillOptions;
|
|
371
|
+
/**
|
|
372
|
+
* **Optional** - The theme options to apply to the checkout embed.
|
|
373
|
+
*/
|
|
374
|
+
themeOptions?: WhopCheckoutEmbedThemeOptions;
|
|
375
|
+
/**
|
|
376
|
+
* **Optional** - Set to `true` to hide the submit button in the embedded checkout form.
|
|
377
|
+
*
|
|
378
|
+
* @default false
|
|
379
|
+
*/
|
|
380
|
+
hideSubmitButton?: boolean;
|
|
381
|
+
/**
|
|
382
|
+
* **Optional** - Set to `true` to hide the terms and conditions in the embedded checkout form.
|
|
383
|
+
*
|
|
384
|
+
* @default false
|
|
385
|
+
*/
|
|
386
|
+
hideTermsAndConditions?: boolean;
|
|
387
|
+
/**
|
|
388
|
+
* **Optional** - Set to `true` to hide the email input in the embedded checkout form.
|
|
389
|
+
*
|
|
390
|
+
* @default false
|
|
391
|
+
*/
|
|
392
|
+
hideEmail?: boolean;
|
|
393
|
+
/**
|
|
394
|
+
* **Optional** - Set to `true` to disable the email input in the embedded checkout form.
|
|
395
|
+
*
|
|
396
|
+
* @default false
|
|
397
|
+
*/
|
|
398
|
+
disableEmail?: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* **Optional** - Set to `true` to hide the address form in the embedded checkout form.
|
|
401
|
+
*
|
|
402
|
+
* @default false
|
|
403
|
+
*/
|
|
404
|
+
hideAddressForm?: boolean;
|
|
405
|
+
/**
|
|
406
|
+
* **Optional** - The affiliate code to use for the checkout.
|
|
407
|
+
*/
|
|
408
|
+
affiliateCode?: string;
|
|
409
|
+
/**
|
|
410
|
+
* **Optional** - The setup future usage to use for the checkout. When using the `chargeUser` API you need to set this to `off_session`. This will filter out payment methods that are not supported with that API.
|
|
411
|
+
*
|
|
412
|
+
* @default undefined
|
|
413
|
+
*/
|
|
414
|
+
setupFutureUsage?: "off_session";
|
|
415
|
+
} & {
|
|
416
|
+
/**
|
|
417
|
+
* **Required** - The session id to use for the checkout.
|
|
418
|
+
*
|
|
419
|
+
* This can be used to attach metadata to a checkout by first creating a session through the API and then passing the session id to the checkout element.
|
|
420
|
+
*/
|
|
421
|
+
sessionId: string;
|
|
422
|
+
} & {
|
|
170
423
|
/**
|
|
171
424
|
* **Optional** - The fallback content to show while the checkout is loading.
|
|
172
425
|
*/
|
|
173
426
|
fallback?: ReactNode;
|
|
174
|
-
}, "ref"> & React__default.RefAttributes<WhopCheckoutEmbedControls>>;
|
|
427
|
+
}, "ref">) & React__default.RefAttributes<WhopCheckoutEmbedControls>>;
|
|
175
428
|
|
|
176
|
-
declare function useCheckoutEmbedControls(): React.RefObject<WhopCheckoutEmbedControls>;
|
|
429
|
+
declare function useCheckoutEmbedControls(): React.RefObject<WhopCheckoutEmbedControls | null>;
|
|
177
430
|
|
|
178
431
|
export { type AccentColor, WhopCheckoutEmbed, type WhopCheckoutEmbedProps, type WhopCheckoutEmbedThemeOptions, WhopEmbeddedCheckoutPrefillOptions, WhopEmbeddedCheckoutStyleOptions, accentColorValues, isAccentColor, useCheckoutEmbedControls };
|