@flopay/vue 1.20.15 → 2.0.1

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.
Files changed (39) hide show
  1. package/README.md +56 -57
  2. package/dist/card-setup-entry.cjs +184 -569
  3. package/dist/card-setup-entry.d.ts +2 -2
  4. package/dist/card-setup-entry.mjs +3 -7
  5. package/dist/chunk-2VPPDVV7.mjs +218 -0
  6. package/dist/chunk-OCVTEXQA.mjs +20 -0
  7. package/dist/flopay-runtime-checkout.d.ts +11 -0
  8. package/dist/hosted-runtime-components.d.ts +587 -0
  9. package/dist/index.cjs +298 -5402
  10. package/dist/index.d.ts +3 -21
  11. package/dist/index.mjs +250 -3728
  12. package/dist/payment-method-setup-entry.cjs +194 -1852
  13. package/dist/payment-method-setup-entry.d.ts +2 -2
  14. package/dist/payment-method-setup-entry.mjs +4 -4
  15. package/dist/runtime-context.d.ts +11 -0
  16. package/package.json +3 -5
  17. package/dist/automatic-payment-button.d.ts +0 -296
  18. package/dist/buyer-identity-fallback.d.ts +0 -82
  19. package/dist/chunk-2USKULEH.mjs +0 -530
  20. package/dist/chunk-HH25IC76.mjs +0 -98
  21. package/dist/chunk-IJKGJSHH.mjs +0 -333
  22. package/dist/chunk-RAGPQWRA.mjs +0 -923
  23. package/dist/context.d.ts +0 -56
  24. package/dist/direct-paypal-button.d.ts +0 -325
  25. package/dist/flopay-card-setup.d.ts +0 -158
  26. package/dist/flopay-checkout.d.ts +0 -517
  27. package/dist/flopay-payment-method-setup-main.d.ts +0 -152
  28. package/dist/hooks.d.ts +0 -22
  29. package/dist/hosted-setup.d.ts +0 -116
  30. package/dist/payment-method-setup-paypal-D6FEQQJY.mjs +0 -151
  31. package/dist/payment-method-setup-paypal.d.ts +0 -108
  32. package/dist/processing-overlay.d.ts +0 -82
  33. package/dist/provider.d.ts +0 -76
  34. package/dist/saved-payment.d.ts +0 -44
  35. package/dist/split-card-form.d.ts +0 -777
  36. package/dist/stripe-elements-SI2PI6EO.mjs +0 -6
  37. package/dist/stripe-elements.d.ts +0 -280
  38. package/dist/stripe-paypal-continuation.d.ts +0 -28
  39. package/dist/vault-card-fields.d.ts +0 -129
@@ -1,517 +0,0 @@
1
- import type { AVSFieldConfig, ButtonsLayoutStyles, ButtonsLayoutTheme, CardFieldLabels, CardFieldPlaceholders, CardFieldsFailedEvent, CardFieldsReadyEvent, CheckoutButtonMethod, CheckoutMode, DeclineEvent, FloInstrumentEvent, FloPayAppearance, FloPayPaymentCancelEvent, InlineSessionDraft, PaymentResult, ThemeId, VaultCardFieldKey, WalletPresentation } from '@flopay/shared';
2
- import { FloPayError } from '@flopay/shared';
3
- import { type PropType } from 'vue';
4
- import { type SplitCardFormBeforeButtonClick } from './split-card-form.js';
5
- /** Props for {@link FloPayCheckout} (React's `FloPayCheckoutProps`; callbacks are emits). */
6
- export interface FloPayCheckoutProps {
7
- /** An existing checkout session id (with its `nonce`). */
8
- sessionId?: string;
9
- /** Session-bound checkout token returned with {@link FloPayCheckoutProps.sessionId}. */
10
- nonce?: string;
11
- /** Inline session draft: the checkout creates the session itself. */
12
- createSession?: InlineSessionDraft;
13
- billingApiUrl?: string;
14
- telemetry?: boolean;
15
- locale?: string;
16
- layout?: 'default' | 'buttons';
17
- showPayPal?: boolean;
18
- showStripe?: boolean;
19
- /** Explicit Stripe method list (`[]` = card only); defaults to the session's. */
20
- enabledPaymentMethods?: string[];
21
- /** @deprecated Session-driven visibility (`enabledPaymentMethods`) decides. */
22
- showApplePay?: boolean;
23
- /** @deprecated Session-driven visibility (`enabledPaymentMethods`) decides. */
24
- showGooglePay?: boolean;
25
- /**
26
- * Theme bundle (`'classic'`, `'modern-light'`, `'modern-dark'`, `'bold-light'`,
27
- * `'bold-dark'`, `'glass-light'`, `'glass-dark'`) for the card form, the
28
- * hosted vault widget and the Stripe methods. Explicit `appearance` /
29
- * `buttonsStyles` still override their halves.
30
- */
31
- theme?: ThemeId;
32
- /** Visual appearance for the payment elements; wins over the theme bundle's. */
33
- appearance?: FloPayAppearance;
34
- /** @deprecated Use `theme`. Legacy buttons-layout preset, used only without `theme`. */
35
- buttonsTheme?: ButtonsLayoutTheme;
36
- /** Style overrides merged on top of the resolved theme bundle / `buttonsTheme` preset. */
37
- buttonsStyles?: ButtonsLayoutStyles;
38
- /** Additional CSS class for the form wrapper. */
39
- className?: string;
40
- /** Final, localized wording for the hosted card form's submit button. */
41
- submitLabel?: string | null;
42
- /** Address verification: `true` (country + postcode) or per-field {@link AVSFieldConfig}. */
43
- enableAVS?: boolean | AVSFieldConfig;
44
- /** Layout for AVS fields: `row` (side by side, default) or `column` (stacked). */
45
- avsLayout?: 'row' | 'column';
46
- /**
47
- * Order of the hosted vault card rows, a permutation of
48
- * `['name', 'number', 'expiry']` (visual and tab order). Vault card path only.
49
- */
50
- cardFieldOrder?: VaultCardFieldKey[];
51
- /**
52
- * Show the Visa, Mastercard, Amex and Discover icons in the hosted card
53
- * number field. Only `true` turns them on; omitted or `false` keeps the
54
- * field as it is. Vault card path only. See React.
55
- */
56
- showCardBrandIcons?: boolean;
57
- /** Show the visible labels above the hosted card fields. See React. */
58
- showCardFieldLabels?: boolean;
59
- /** Replace the text of the labels (`number`, `expiry`, `cvv`, `name`). See React. */
60
- cardFieldLabels?: CardFieldLabels;
61
- /**
62
- * Placeholder text for the hosted card fields (`number`, `expiry`, `cvv`,
63
- * `name`), each optional. Only the fields given are sent; `''` shows no
64
- * placeholder. A change updates the mounted form live. Omitted sends
65
- * nothing. Vault card path only. See React.
66
- */
67
- cardFieldPlaceholders?: CardFieldPlaceholders;
68
- /**
69
- * `false` turns off the card form's automatic initial focus when the
70
- * checkout opens. Omitted or `true` keeps the default. See React.
71
- */
72
- cardAutoFocus?: boolean;
73
- /** Milliseconds the card fields may take to become ready before `timeout` (default 15 000). */
74
- cardFieldsTimeoutMs?: number;
75
- /**
76
- * @deprecated Not rendered, as in React: the default-layout security footer
77
- * was removed. Accepted so integrations ported from React keep compiling.
78
- */
79
- showSecurityFooter?: boolean;
80
- /**
81
- * @deprecated Ignored, as in React: the Stripe publishable key comes only
82
- * from the session's `gateways.stripe.publishableKey`.
83
- */
84
- fallbackPublishableKey?: string;
85
- /**
86
- * Override the session's `checkoutMode`: `'full'` shows the payment form
87
- * (default), `'confirm'` a confirm button that charges the saved payment
88
- * method, `'auto'` charges it on mount and falls back to `'full'` on failure.
89
- */
90
- checkoutMode?: CheckoutMode;
91
- /**
92
- * Label for the saved-payment confirm button in `confirm` mode. Default:
93
- * `'Confirm Purchase'`. The hosted card button uses `submitLabel` instead.
94
- * React's `renderConfirmButton` is the `renderConfirmButton` slot, which
95
- * receives `{ onConfirm, isProcessing }`.
96
- */
97
- confirmLabel?: string;
98
- /**
99
- * Seed a checkout error message: shown above the confirm button or the
100
- * payment form until the buyer's next attempt.
101
- */
102
- initialErrorMessage?: string | null;
103
- /**
104
- * React's `initialPayPalOrderId`: a backend-created PayPal order to resume
105
- * instead of creating a new one. It goes to the built-in form's
106
- * `directPaypal.existingOrderId`.
107
- */
108
- initialPayPalOrderId?: string;
109
- /** React's `debug`: the built-in form's gating panels and PayPal tracer. Off by default. */
110
- debug?: boolean;
111
- }
112
- /**
113
- * The all-in-one checkout. Given `createSession`, an inline full-mode session
114
- * is created detached (`deferDataAttachment: true`): the hosted card form
115
- * mounts from the shell while the catalog is attached by a background claim,
116
- * and payment is gated only until that claim settles. `deferDataAttachment:
117
- * false` keeps the one-shot create. It renders exactly the methods the
118
- * session advertises and sends no gateway hint or provider selection.
119
- *
120
- * Slots: `default` renders inside the checkout context (alongside the form);
121
- * `layout` replaces the built-in `SplitCardForm` with a custom layout, whose
122
- * `SplitCardForm` receives the session, nonce and `submitLabel` unless it
123
- * sets them itself. `cardButtonContent`, `cardBackButtonContent`,
124
- * `cardTitleContent` and `cardPreFormSlot` (React's content props) pass to
125
- * the built-in `SplitCardForm`. `renderConfirmButton` (React's render prop)
126
- * replaces the `confirm`-mode button and receives `{ onConfirm, isProcessing }`.
127
- *
128
- * Modes (React's): `full` renders the payment form; `confirm` renders a
129
- * confirm button that charges the buyer's saved payment method; `auto`
130
- * charges it on mount. A failed saved payment shows its error and falls back
131
- * to `full`. A session that is already paid emits `sessionCompleted` with its
132
- * success URL (an authorized one also `complete`) and renders no form.
133
- */
134
- export declare const FloPayCheckout: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
135
- sessionId: {
136
- type: StringConstructor;
137
- default: undefined;
138
- };
139
- nonce: {
140
- type: StringConstructor;
141
- default: undefined;
142
- };
143
- createSession: {
144
- type: PropType<InlineSessionDraft>;
145
- default: undefined;
146
- };
147
- checkoutMode: {
148
- type: PropType<CheckoutMode>;
149
- default: undefined;
150
- };
151
- billingApiUrl: {
152
- type: StringConstructor;
153
- default: undefined;
154
- };
155
- telemetry: {
156
- type: BooleanConstructor;
157
- default: undefined;
158
- };
159
- locale: {
160
- type: StringConstructor;
161
- default: undefined;
162
- };
163
- layout: {
164
- type: PropType<'default' | 'buttons'>;
165
- default: string;
166
- };
167
- /**
168
- * React's `walletPresentation` (default `'auto'`): the preferred approval
169
- * presentation for Stripe-routed PayPal, passed to the built-in form and
170
- * to a custom-layout form that leaves its own unset.
171
- */
172
- walletPresentation: {
173
- type: PropType<WalletPresentation>;
174
- default: string;
175
- };
176
- showPayPal: {
177
- type: BooleanConstructor;
178
- default: boolean;
179
- };
180
- showStripe: {
181
- type: BooleanConstructor;
182
- default: boolean;
183
- };
184
- enabledPaymentMethods: {
185
- type: PropType<string[]>;
186
- default: undefined;
187
- };
188
- /** @deprecated Session-driven visibility decides (React parity). */
189
- showApplePay: {
190
- type: BooleanConstructor;
191
- default: boolean;
192
- };
193
- /** @deprecated Session-driven visibility decides (React parity). */
194
- showGooglePay: {
195
- type: BooleanConstructor;
196
- default: boolean;
197
- };
198
- theme: {
199
- type: PropType<ThemeId>;
200
- default: undefined;
201
- };
202
- appearance: {
203
- type: PropType<FloPayAppearance>;
204
- default: undefined;
205
- };
206
- buttonsTheme: {
207
- type: PropType<ButtonsLayoutTheme>;
208
- default: undefined;
209
- };
210
- buttonsStyles: {
211
- type: PropType<ButtonsLayoutStyles>;
212
- default: undefined;
213
- };
214
- className: {
215
- type: StringConstructor;
216
- default: undefined;
217
- };
218
- submitLabel: {
219
- type: PropType<string | null>;
220
- default: undefined;
221
- };
222
- enableAVS: {
223
- type: PropType<boolean | AVSFieldConfig>;
224
- default: undefined;
225
- };
226
- avsLayout: {
227
- type: PropType<'row' | 'column'>;
228
- default: undefined;
229
- };
230
- cardFieldOrder: {
231
- type: PropType<VaultCardFieldKey[]>;
232
- default: undefined;
233
- };
234
- showCardBrandIcons: {
235
- type: BooleanConstructor;
236
- default: boolean;
237
- };
238
- showCardFieldLabels: {
239
- type: BooleanConstructor;
240
- default: undefined;
241
- };
242
- cardFieldLabels: {
243
- type: PropType<CardFieldLabels>;
244
- default: undefined;
245
- };
246
- cardFieldPlaceholders: {
247
- type: PropType<CardFieldPlaceholders>;
248
- default: undefined;
249
- };
250
- cardAutoFocus: {
251
- type: BooleanConstructor;
252
- default: boolean;
253
- };
254
- cardFieldsTimeoutMs: {
255
- type: NumberConstructor;
256
- default: undefined;
257
- };
258
- /** @deprecated Not rendered (React parity); see {@link FloPayCheckoutProps.showSecurityFooter}. */
259
- showSecurityFooter: {
260
- type: BooleanConstructor;
261
- default: undefined;
262
- };
263
- /** @deprecated Ignored (React parity); see {@link FloPayCheckoutProps.fallbackPublishableKey}. */
264
- fallbackPublishableKey: {
265
- type: StringConstructor;
266
- default: undefined;
267
- };
268
- confirmLabel: {
269
- type: StringConstructor;
270
- default: undefined;
271
- };
272
- initialErrorMessage: {
273
- type: PropType<string | null>;
274
- default: null;
275
- };
276
- /**
277
- * React's `onBeforeButtonClick` (a function prop: its result is read),
278
- * passed to the built-in `SplitCardForm`. It runs before the buttons-layout
279
- * card tile opens and before PayPal creates its order.
280
- */
281
- onBeforeButtonClick: {
282
- type: PropType<SplitCardFormBeforeButtonClick>;
283
- default: undefined;
284
- };
285
- initialPayPalOrderId: {
286
- type: StringConstructor;
287
- default: undefined;
288
- };
289
- debug: {
290
- type: BooleanConstructor;
291
- default: boolean;
292
- };
293
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
294
- [key: string]: any;
295
- }>[] | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
296
- [key: string]: any;
297
- }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
298
- complete: (_result: PaymentResult) => true;
299
- error: (_error: FloPayError) => true;
300
- instrument: (_event: FloInstrumentEvent) => true;
301
- decline: (_decline: DeclineEvent) => true;
302
- cardFieldsReady: (_event: CardFieldsReadyEvent) => true;
303
- cardFieldsFailed: (_event: CardFieldsFailedEvent) => true;
304
- cancel: (_event: FloPayPaymentCancelEvent) => true;
305
- buttonClick: (_method: CheckoutButtonMethod) => true;
306
- countryChange: (_country: string) => true;
307
- zipChange: (_zip: string) => true;
308
- sessionCompleted: (_successUrl: string) => true;
309
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
310
- sessionId: {
311
- type: StringConstructor;
312
- default: undefined;
313
- };
314
- nonce: {
315
- type: StringConstructor;
316
- default: undefined;
317
- };
318
- createSession: {
319
- type: PropType<InlineSessionDraft>;
320
- default: undefined;
321
- };
322
- checkoutMode: {
323
- type: PropType<CheckoutMode>;
324
- default: undefined;
325
- };
326
- billingApiUrl: {
327
- type: StringConstructor;
328
- default: undefined;
329
- };
330
- telemetry: {
331
- type: BooleanConstructor;
332
- default: undefined;
333
- };
334
- locale: {
335
- type: StringConstructor;
336
- default: undefined;
337
- };
338
- layout: {
339
- type: PropType<'default' | 'buttons'>;
340
- default: string;
341
- };
342
- /**
343
- * React's `walletPresentation` (default `'auto'`): the preferred approval
344
- * presentation for Stripe-routed PayPal, passed to the built-in form and
345
- * to a custom-layout form that leaves its own unset.
346
- */
347
- walletPresentation: {
348
- type: PropType<WalletPresentation>;
349
- default: string;
350
- };
351
- showPayPal: {
352
- type: BooleanConstructor;
353
- default: boolean;
354
- };
355
- showStripe: {
356
- type: BooleanConstructor;
357
- default: boolean;
358
- };
359
- enabledPaymentMethods: {
360
- type: PropType<string[]>;
361
- default: undefined;
362
- };
363
- /** @deprecated Session-driven visibility decides (React parity). */
364
- showApplePay: {
365
- type: BooleanConstructor;
366
- default: boolean;
367
- };
368
- /** @deprecated Session-driven visibility decides (React parity). */
369
- showGooglePay: {
370
- type: BooleanConstructor;
371
- default: boolean;
372
- };
373
- theme: {
374
- type: PropType<ThemeId>;
375
- default: undefined;
376
- };
377
- appearance: {
378
- type: PropType<FloPayAppearance>;
379
- default: undefined;
380
- };
381
- buttonsTheme: {
382
- type: PropType<ButtonsLayoutTheme>;
383
- default: undefined;
384
- };
385
- buttonsStyles: {
386
- type: PropType<ButtonsLayoutStyles>;
387
- default: undefined;
388
- };
389
- className: {
390
- type: StringConstructor;
391
- default: undefined;
392
- };
393
- submitLabel: {
394
- type: PropType<string | null>;
395
- default: undefined;
396
- };
397
- enableAVS: {
398
- type: PropType<boolean | AVSFieldConfig>;
399
- default: undefined;
400
- };
401
- avsLayout: {
402
- type: PropType<'row' | 'column'>;
403
- default: undefined;
404
- };
405
- cardFieldOrder: {
406
- type: PropType<VaultCardFieldKey[]>;
407
- default: undefined;
408
- };
409
- showCardBrandIcons: {
410
- type: BooleanConstructor;
411
- default: boolean;
412
- };
413
- showCardFieldLabels: {
414
- type: BooleanConstructor;
415
- default: undefined;
416
- };
417
- cardFieldLabels: {
418
- type: PropType<CardFieldLabels>;
419
- default: undefined;
420
- };
421
- cardFieldPlaceholders: {
422
- type: PropType<CardFieldPlaceholders>;
423
- default: undefined;
424
- };
425
- cardAutoFocus: {
426
- type: BooleanConstructor;
427
- default: boolean;
428
- };
429
- cardFieldsTimeoutMs: {
430
- type: NumberConstructor;
431
- default: undefined;
432
- };
433
- /** @deprecated Not rendered (React parity); see {@link FloPayCheckoutProps.showSecurityFooter}. */
434
- showSecurityFooter: {
435
- type: BooleanConstructor;
436
- default: undefined;
437
- };
438
- /** @deprecated Ignored (React parity); see {@link FloPayCheckoutProps.fallbackPublishableKey}. */
439
- fallbackPublishableKey: {
440
- type: StringConstructor;
441
- default: undefined;
442
- };
443
- confirmLabel: {
444
- type: StringConstructor;
445
- default: undefined;
446
- };
447
- initialErrorMessage: {
448
- type: PropType<string | null>;
449
- default: null;
450
- };
451
- /**
452
- * React's `onBeforeButtonClick` (a function prop: its result is read),
453
- * passed to the built-in `SplitCardForm`. It runs before the buttons-layout
454
- * card tile opens and before PayPal creates its order.
455
- */
456
- onBeforeButtonClick: {
457
- type: PropType<SplitCardFormBeforeButtonClick>;
458
- default: undefined;
459
- };
460
- initialPayPalOrderId: {
461
- type: StringConstructor;
462
- default: undefined;
463
- };
464
- debug: {
465
- type: BooleanConstructor;
466
- default: boolean;
467
- };
468
- }>> & Readonly<{
469
- onButtonClick?: ((_method: CheckoutButtonMethod) => any) | undefined;
470
- onCancel?: ((_event: FloPayPaymentCancelEvent) => any) | undefined;
471
- onCardFieldsFailed?: ((_event: CardFieldsFailedEvent) => any) | undefined;
472
- onCardFieldsReady?: ((_event: CardFieldsReadyEvent) => any) | undefined;
473
- onComplete?: ((_result: PaymentResult) => any) | undefined;
474
- onCountryChange?: ((_country: string) => any) | undefined;
475
- onDecline?: ((_decline: DeclineEvent) => any) | undefined;
476
- onError?: ((_error: FloPayError) => any) | undefined;
477
- onInstrument?: ((_event: FloInstrumentEvent) => any) | undefined;
478
- onSessionCompleted?: ((_successUrl: string) => any) | undefined;
479
- onZipChange?: ((_zip: string) => any) | undefined;
480
- }>, {
481
- sessionId: string;
482
- nonce: string;
483
- createSession: InlineSessionDraft;
484
- checkoutMode: CheckoutMode;
485
- billingApiUrl: string;
486
- telemetry: boolean;
487
- locale: string;
488
- layout: "buttons" | "default";
489
- walletPresentation: WalletPresentation;
490
- showPayPal: boolean;
491
- showStripe: boolean;
492
- enabledPaymentMethods: string[];
493
- showApplePay: boolean;
494
- showGooglePay: boolean;
495
- theme: ThemeId;
496
- appearance: FloPayAppearance;
497
- buttonsTheme: ButtonsLayoutTheme;
498
- buttonsStyles: ButtonsLayoutStyles;
499
- className: string;
500
- submitLabel: string | null;
501
- enableAVS: boolean | AVSFieldConfig;
502
- avsLayout: "column" | "row";
503
- cardFieldOrder: VaultCardFieldKey[];
504
- showCardBrandIcons: boolean;
505
- showCardFieldLabels: boolean;
506
- cardFieldLabels: CardFieldLabels;
507
- cardFieldPlaceholders: CardFieldPlaceholders;
508
- cardAutoFocus: boolean;
509
- cardFieldsTimeoutMs: number;
510
- showSecurityFooter: boolean;
511
- fallbackPublishableKey: string;
512
- confirmLabel: string;
513
- initialErrorMessage: string | null;
514
- onBeforeButtonClick: SplitCardFormBeforeButtonClick;
515
- initialPayPalOrderId: string;
516
- debug: boolean;
517
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,152 +0,0 @@
1
- import type { ButtonsLayoutStyles, FloPayAppearance, ThemeId, VaultCardThemeColors } from '@flopay/shared';
2
- import { type PropType, type VNode } from 'vue';
3
- import { type FloPayCardSetupCancelEvent, type FloPayCardSetupCompleteEvent, type FloPayCardSetupDeclineEvent, type FloPayCardSetupError } from './hosted-setup.js';
4
- /** Verified terminal result from saving any advertised payment method. */
5
- export type FloPayPaymentMethodSetupCompleteEvent = FloPayCardSetupCompleteEvent;
6
- /** Provider-neutral terminal decline from saving a payment method. */
7
- export type FloPayPaymentMethodSetupDeclineEvent = FloPayCardSetupDeclineEvent;
8
- /** Abandoned setup emitted when the surface unmounts before an outcome. */
9
- export type FloPayPaymentMethodSetupCancelEvent = FloPayCardSetupCancelEvent;
10
- /** Props for {@link FloPayPaymentMethodSetup} (callbacks are emits). */
11
- export interface FloPayPaymentMethodSetupProps {
12
- sessionId: string;
13
- nonce: string;
14
- billingApiUrl?: string;
15
- telemetry?: boolean;
16
- /**
17
- * The same `ThemeId` bundle `FloPayCheckout` and `FloPayCardSetup` resolve,
18
- * or raw `VaultCardThemeColors` for the hosted card widget. A preset also
19
- * themes the Stripe wallets and APMs and the outcome overlay. Defaults to
20
- * `'modern-light'`, which an unrecognized preset id also falls back to;
21
- * pass `'classic'` for the historic FloPay look.
22
- */
23
- theme?: ThemeId | VaultCardThemeColors;
24
- /**
25
- * Inline styles for the hosted card-widget container, with the same
26
- * precedence over the preset's pane surface (and a stored
27
- * `buttonsStyles.cardFormContainer`) as `FloPayCardSetup`.
28
- */
29
- containerStyle?: Record<string, string | number>;
30
- /**
31
- * Appearance override, the same prop and type as `FloPayCheckout`'s and
32
- * `FloPayCardSetup`'s (for example a client's saved embed theme
33
- * `appearance`). It replaces the preset's appearance outright, as checkout
34
- * does: its variables drive the hosted card fields and submit button, the
35
- * Stripe Elements of every wallet and APM, and the outcome overlay. Ignored
36
- * with raw `VaultCardThemeColors`; an empty `{}` is the same as omitting it.
37
- */
38
- appearance?: FloPayAppearance;
39
- /**
40
- * Buttons-layout style overrides, the same prop and type as
41
- * `FloPayCheckout`'s and `FloPayCardSetup`'s (for example a client's saved
42
- * embed theme `buttonsStyles`), merged over the preset's buttons layout the
43
- * way checkout merges them. `submitButton` and the `cardInput*` members style
44
- * the hosted card form, and `cardFormContainer` the pane around it and the
45
- * outcome overlay's panel. Ignored with raw `VaultCardThemeColors`; an empty
46
- * `{}` is the same as omitting it.
47
- */
48
- buttonsStyles?: ButtonsLayoutStyles;
49
- }
50
- /**
51
- * Saves any payment method the setup session advertises: the hosted vault
52
- * card, advertised Stripe wallets/APMs (each on the account the backend chose
53
- * for it) and the PayPal vault flow. Takes only `sessionId` + `nonce`, never
54
- * creates a session. Success is the backend's call, never the provider's: once
55
- * a wallet, APM or PayPal is accepted, the session is re-read until the
56
- * backend reports the method saved, and only then is `complete` emitted, once.
57
- * A `decline` is never paired with a `complete`.
58
- */
59
- export declare const FloPayPaymentMethodSetup: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
60
- sessionId: {
61
- type: StringConstructor;
62
- default: undefined;
63
- };
64
- nonce: {
65
- type: StringConstructor;
66
- default: undefined;
67
- };
68
- billingApiUrl: {
69
- type: StringConstructor;
70
- default: undefined;
71
- };
72
- telemetry: {
73
- type: BooleanConstructor;
74
- default: undefined;
75
- };
76
- theme: {
77
- type: PropType<ThemeId | VaultCardThemeColors>;
78
- default: string;
79
- };
80
- containerStyle: {
81
- type: PropType<Record<string, string | number>>;
82
- default: undefined;
83
- };
84
- appearance: {
85
- type: PropType<FloPayAppearance>;
86
- default: undefined;
87
- };
88
- buttonsStyles: {
89
- type: PropType<ButtonsLayoutStyles>;
90
- default: undefined;
91
- };
92
- }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
93
- [key: string]: any;
94
- }>[] | VNode<import("vue").RendererNode, import("vue").RendererElement, {
95
- [key: string]: any;
96
- }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
97
- ready: () => true;
98
- complete: (_event: FloPayPaymentMethodSetupCompleteEvent) => true;
99
- cancel: (_event: FloPayPaymentMethodSetupCancelEvent) => true;
100
- decline: (_event: FloPayPaymentMethodSetupDeclineEvent) => true;
101
- validation: (_message: string | null) => true;
102
- error: (_error: FloPayCardSetupError) => true;
103
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
104
- sessionId: {
105
- type: StringConstructor;
106
- default: undefined;
107
- };
108
- nonce: {
109
- type: StringConstructor;
110
- default: undefined;
111
- };
112
- billingApiUrl: {
113
- type: StringConstructor;
114
- default: undefined;
115
- };
116
- telemetry: {
117
- type: BooleanConstructor;
118
- default: undefined;
119
- };
120
- theme: {
121
- type: PropType<ThemeId | VaultCardThemeColors>;
122
- default: string;
123
- };
124
- containerStyle: {
125
- type: PropType<Record<string, string | number>>;
126
- default: undefined;
127
- };
128
- appearance: {
129
- type: PropType<FloPayAppearance>;
130
- default: undefined;
131
- };
132
- buttonsStyles: {
133
- type: PropType<ButtonsLayoutStyles>;
134
- default: undefined;
135
- };
136
- }>> & Readonly<{
137
- onCancel?: ((_event: FloPayCardSetupCancelEvent) => any) | undefined;
138
- onComplete?: ((_event: FloPayCardSetupCompleteEvent) => any) | undefined;
139
- onDecline?: ((_event: FloPayCardSetupDeclineEvent) => any) | undefined;
140
- onError?: ((_error: FloPayCardSetupError) => any) | undefined;
141
- onReady?: (() => any) | undefined;
142
- onValidation?: ((_message: string | null) => any) | undefined;
143
- }>, {
144
- sessionId: string;
145
- nonce: string;
146
- billingApiUrl: string;
147
- telemetry: boolean;
148
- theme: VaultCardThemeColors | ThemeId;
149
- containerStyle: Record<string, string | number>;
150
- appearance: FloPayAppearance;
151
- buttonsStyles: ButtonsLayoutStyles;
152
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/hooks.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import type { FloPay } from '@flopay/js';
2
- import { type ShallowRef } from 'vue';
3
- import { type CheckoutState } from './context.js';
4
- export type { CheckoutState } from './context.js';
5
- /**
6
- * The current `FloPay` instance as a ref: `null` while the provider's
7
- * `loadFloPay()` promise is pending (or outside a `FloPayProvider`), then the
8
- * instance. Read it as `useFloPay().value`.
9
- */
10
- export declare function useFloPay(): Readonly<ShallowRef<FloPay | null>>;
11
- /**
12
- * The Stripe `FloPay` instance dedicated to the Stripe-rendered PayPal
13
- * fallback, or `null` when PayPal is disabled. Direct PayPal
14
- * (`gateways.paypal`) does not use this instance.
15
- */
16
- export declare function usePayPalFloPay(): Readonly<ShallowRef<FloPay | null>>;
17
- /**
18
- * Reactive checkout state from the enclosing `FloPayCheckout`
19
- * (`session`, `loading`, `error`, `claimPending`). Outside a checkout it is
20
- * the same idle default the React hook returns.
21
- */
22
- export declare function useCheckout(): CheckoutState;