@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,6 +0,0 @@
1
- import {
2
- StripePaymentMethods
3
- } from "./chunk-RAGPQWRA.mjs";
4
- export {
5
- StripePaymentMethods
6
- };
@@ -1,280 +0,0 @@
1
- import type { CheckoutAccount, CheckoutButtonMethod, CheckoutSession, DeclineEvent, FloPayAppearance, PaymentResult } from '@flopay/shared';
2
- import { FloPayError } from '@flopay/shared';
3
- import { type PropType } from 'vue';
4
- /**
5
- * The approved Stripe-routed PayPal payment React's `PayPalButtonInner` hands
6
- * to the form's `onTokenizedBody` (`dispatchTokenizedBody` → `/process`).
7
- */
8
- export interface StripePayPalTokenizedBody {
9
- id?: string;
10
- type: 'card';
11
- threeDSecureActionResultTokenId?: string;
12
- isPaypal: true;
13
- }
14
- /** The overrides React's redirect tile passes with that body. */
15
- export interface StripePayPalTokenizedOverrides {
16
- accountPatch?: Partial<CheckoutAccount>;
17
- sessionId?: string;
18
- nonce?: string;
19
- paymentMethodCategory?: 'paypal';
20
- presentationMode: 'redirect';
21
- }
22
- /**
23
- * The form's click gate, as React's `runBeforeButtonClick` answers it: the
24
- * redirect tile asks for `paypal`, the wallet row for the wallet's button
25
- * method.
26
- */
27
- export type StripePayPalBeforeClick = (method: CheckoutButtonMethod) => Promise<{
28
- proceed: boolean;
29
- accountPatch?: Partial<CheckoutAccount>;
30
- sessionId?: string;
31
- nonce?: string;
32
- }>;
33
- /**
34
- * Advertised Stripe wallets and APMs, rendered on the session's own Stripe
35
- * account. Each Elements group's `setupFutureUsage` comes only from
36
- * {@link resolveSetupFutureUsage}; intents are created through the billing
37
- * API's session-scoped `/intents` with the session nonce, and client-observed
38
- * declines go to `/intents/decline` with no tokens or PII. Stripe.js is
39
- * imported lazily, so a card-only checkout never loads it.
40
- */
41
- export declare const StripePaymentMethods: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
42
- session: {
43
- type: PropType<CheckoutSession | null>;
44
- default: null;
45
- };
46
- sessionId: {
47
- type: StringConstructor;
48
- required: true;
49
- };
50
- nonce: {
51
- type: StringConstructor;
52
- default: undefined;
53
- };
54
- billingApiUrl: {
55
- type: StringConstructor;
56
- required: true;
57
- };
58
- publishableKey: {
59
- type: StringConstructor;
60
- required: true;
61
- };
62
- methods: {
63
- type: PropType<string[]>;
64
- required: true;
65
- };
66
- /** `payment` for checkout, `setup` for payment-method setup. */
67
- intentKind: {
68
- type: PropType<'payment' | 'setup'>;
69
- default: string;
70
- };
71
- currency: {
72
- type: StringConstructor;
73
- default: undefined;
74
- };
75
- amount: {
76
- type: NumberConstructor;
77
- default: number;
78
- };
79
- /**
80
- * React's `totalAmount`: the cart total due today, in minor units. When it
81
- * is given on a checkout (`intentKind: 'payment'`), the wallet row follows
82
- * React's wallet group: its Elements mode, amount and capture method come
83
- * from the shared `resolveWalletModeOptions` (setup mode for a $0 total),
84
- * and its intent is `totalAmount > 0 ? 'payment' : 'setup'`.
85
- */
86
- totalAmount: {
87
- type: NumberConstructor;
88
- default: undefined;
89
- };
90
- returnUrl: {
91
- type: StringConstructor;
92
- default: undefined;
93
- };
94
- /** The theme's appearance, normalized for Stripe Elements (React's setup branch does the same). */
95
- appearance: {
96
- type: PropType<FloPayAppearance>;
97
- default: undefined;
98
- };
99
- /**
100
- * React's `stripePayPalPresentation`, which the form resolves from its
101
- * `walletPresentation` prop through the shared
102
- * `resolveStripePayPalPresentation`. With `redirect`, Stripe-routed PayPal
103
- * leaves the wallet row and renders as React's full-page "Pay with PayPal"
104
- * redirect tile, which resumes the payment when the buyer returns.
105
- */
106
- paypalPresentation: {
107
- type: PropType<'popup' | 'redirect'>;
108
- default: string;
109
- };
110
- /**
111
- * The form's click gate (React's `runBeforeButtonClick`), run by the
112
- * redirect tile and by the wallet row's Express Checkout click.
113
- */
114
- runBeforeButtonClick: {
115
- type: PropType<StripePayPalBeforeClick>;
116
- default: undefined;
117
- };
118
- /**
119
- * React's `onTokenizedBody={dispatchTokenizedBody}` for the redirect tile:
120
- * the form posts `/process` with the approved payment. Without it, the
121
- * tile reports `complete` itself, as this component's wallet row does.
122
- */
123
- onTokenizedBody: {
124
- type: PropType<(body: StripePayPalTokenizedBody, overrides: StripePayPalTokenizedOverrides) => void>;
125
- default: undefined;
126
- };
127
- /**
128
- * React's `isProcessing={isSubmitting}`: while the form is processing, the
129
- * PayPal redirect tile and the APM button are disabled and ignore clicks.
130
- */
131
- isProcessing: {
132
- type: BooleanConstructor;
133
- default: boolean;
134
- };
135
- /**
136
- * The form's storage-free stand-in for the click-time account patch React
137
- * restores from its `localStorage` continuation (issue #410, triage AC 4:
138
- * Vue never stores it). On an authorized redirect return it is asked once
139
- * for the account, with the returned session id; what it answers goes to
140
- * `onTokenizedBody` as the attempt's `accountPatch`. A throw or no answer
141
- * continues without one, because the payment is already authorized.
142
- */
143
- recoverAccountPatch: {
144
- type: PropType<(sessionId: string) => Promise<Partial<CheckoutAccount> | undefined>>;
145
- default: undefined;
146
- };
147
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
148
- [key: string]: any;
149
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
150
- /** The buyer confirmed a wallet or APM and its element validated: the attempt starts. */
151
- submitting: () => true;
152
- complete: (_result: PaymentResult) => true;
153
- decline: (_decline: DeclineEvent) => true;
154
- error: (_error: FloPayError) => true;
155
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
156
- session: {
157
- type: PropType<CheckoutSession | null>;
158
- default: null;
159
- };
160
- sessionId: {
161
- type: StringConstructor;
162
- required: true;
163
- };
164
- nonce: {
165
- type: StringConstructor;
166
- default: undefined;
167
- };
168
- billingApiUrl: {
169
- type: StringConstructor;
170
- required: true;
171
- };
172
- publishableKey: {
173
- type: StringConstructor;
174
- required: true;
175
- };
176
- methods: {
177
- type: PropType<string[]>;
178
- required: true;
179
- };
180
- /** `payment` for checkout, `setup` for payment-method setup. */
181
- intentKind: {
182
- type: PropType<'payment' | 'setup'>;
183
- default: string;
184
- };
185
- currency: {
186
- type: StringConstructor;
187
- default: undefined;
188
- };
189
- amount: {
190
- type: NumberConstructor;
191
- default: number;
192
- };
193
- /**
194
- * React's `totalAmount`: the cart total due today, in minor units. When it
195
- * is given on a checkout (`intentKind: 'payment'`), the wallet row follows
196
- * React's wallet group: its Elements mode, amount and capture method come
197
- * from the shared `resolveWalletModeOptions` (setup mode for a $0 total),
198
- * and its intent is `totalAmount > 0 ? 'payment' : 'setup'`.
199
- */
200
- totalAmount: {
201
- type: NumberConstructor;
202
- default: undefined;
203
- };
204
- returnUrl: {
205
- type: StringConstructor;
206
- default: undefined;
207
- };
208
- /** The theme's appearance, normalized for Stripe Elements (React's setup branch does the same). */
209
- appearance: {
210
- type: PropType<FloPayAppearance>;
211
- default: undefined;
212
- };
213
- /**
214
- * React's `stripePayPalPresentation`, which the form resolves from its
215
- * `walletPresentation` prop through the shared
216
- * `resolveStripePayPalPresentation`. With `redirect`, Stripe-routed PayPal
217
- * leaves the wallet row and renders as React's full-page "Pay with PayPal"
218
- * redirect tile, which resumes the payment when the buyer returns.
219
- */
220
- paypalPresentation: {
221
- type: PropType<'popup' | 'redirect'>;
222
- default: string;
223
- };
224
- /**
225
- * The form's click gate (React's `runBeforeButtonClick`), run by the
226
- * redirect tile and by the wallet row's Express Checkout click.
227
- */
228
- runBeforeButtonClick: {
229
- type: PropType<StripePayPalBeforeClick>;
230
- default: undefined;
231
- };
232
- /**
233
- * React's `onTokenizedBody={dispatchTokenizedBody}` for the redirect tile:
234
- * the form posts `/process` with the approved payment. Without it, the
235
- * tile reports `complete` itself, as this component's wallet row does.
236
- */
237
- onTokenizedBody: {
238
- type: PropType<(body: StripePayPalTokenizedBody, overrides: StripePayPalTokenizedOverrides) => void>;
239
- default: undefined;
240
- };
241
- /**
242
- * React's `isProcessing={isSubmitting}`: while the form is processing, the
243
- * PayPal redirect tile and the APM button are disabled and ignore clicks.
244
- */
245
- isProcessing: {
246
- type: BooleanConstructor;
247
- default: boolean;
248
- };
249
- /**
250
- * The form's storage-free stand-in for the click-time account patch React
251
- * restores from its `localStorage` continuation (issue #410, triage AC 4:
252
- * Vue never stores it). On an authorized redirect return it is asked once
253
- * for the account, with the returned session id; what it answers goes to
254
- * `onTokenizedBody` as the attempt's `accountPatch`. A throw or no answer
255
- * continues without one, because the payment is already authorized.
256
- */
257
- recoverAccountPatch: {
258
- type: PropType<(sessionId: string) => Promise<Partial<CheckoutAccount> | undefined>>;
259
- default: undefined;
260
- };
261
- }>> & Readonly<{
262
- onComplete?: ((_result: PaymentResult) => any) | undefined;
263
- onDecline?: ((_decline: DeclineEvent) => any) | undefined;
264
- onError?: ((_error: FloPayError) => any) | undefined;
265
- onSubmitting?: (() => any) | undefined;
266
- }>, {
267
- session: CheckoutSession | null;
268
- nonce: string;
269
- intentKind: "payment" | "setup";
270
- currency: string;
271
- amount: number;
272
- totalAmount: number;
273
- returnUrl: string;
274
- appearance: FloPayAppearance;
275
- paypalPresentation: "popup" | "redirect";
276
- runBeforeButtonClick: StripePayPalBeforeClick;
277
- onTokenizedBody: (body: StripePayPalTokenizedBody, overrides: StripePayPalTokenizedOverrides) => void;
278
- isProcessing: boolean;
279
- recoverAccountPatch: (sessionId: string) => Promise<Partial<CheckoutAccount> | undefined>;
280
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,28 +0,0 @@
1
- export interface StripePayPalContinuation {
2
- attempt: string;
3
- sessionId: string;
4
- nonce?: string;
5
- }
6
- /** A random, URL-safe marker for one redirect attempt. */
7
- export declare function createStripePayPalAttempt(): string;
8
- /**
9
- * Saves the continuation before Stripe redirects. Returns whether storage
10
- * accepted it (a redirect must not start without it).
11
- */
12
- export declare function saveStripePayPalContinuation(continuation: StripePayPalContinuation): boolean;
13
- /** Removes the continuation (an inline confirm or a consumed return spends it). */
14
- export declare function clearStripePayPalContinuation(): void;
15
- /**
16
- * The PayPal `return_url`: this page without Stripe's redirect parameters or
17
- * an earlier attempt marker, carrying `attempt` when given.
18
- */
19
- export declare function stripePayPalReturnUrl(attempt?: string): string;
20
- /**
21
- * The saved continuation, only when this page is a Stripe return carrying its
22
- * attempt marker.
23
- */
24
- export declare function readStripePayPalReturnContinuation(): StripePayPalContinuation | null;
25
- /** Whether this page load is the return of a Stripe-routed PayPal redirect this tab started. */
26
- export declare function hasStripePayPalReturn(): boolean;
27
- /** Consumes the continuation and strips Stripe's parameters and the attempt marker from the URL. */
28
- export declare function consumeStripePayPalReturn(): void;
@@ -1,129 +0,0 @@
1
- import type { CardCaptureAdapter, VaultCardThemeColors } from '@flopay/shared';
2
- import { type CSSProperties, type PropType } from 'vue';
3
- /** Props for {@link VaultCardFields} (React's `VaultCardFieldsProps`; callbacks are emits). */
4
- export interface VaultCardFieldsProps {
5
- /** The vault block expiry, forwarded to the adapter mount. */
6
- expiresAt?: string | null;
7
- /** The card-capture adapter (typically `useFloPay().value.cardCapture()`). */
8
- capture: CardCaptureAdapter;
9
- /** Server-rendered hosted vault widget HTML (the session's `vault.html`). */
10
- html: string;
11
- /** Per-session integrity token (the vault block's `messageToken`). */
12
- messageToken?: string;
13
- /** Exact origin expected for the widget's terminal `postMessage` outcomes. */
14
- expectedOrigin?: string;
15
- /**
16
- * The form sits behind the backend's production human check (the vault
17
- * block's `verification.required`, sdk#414). Forwarded to the adapter so a
18
- * pre-submit frame `error` (check failed, expired or unavailable) is not
19
- * reported as a vault load failure; it is still emitted as `error`.
20
- */
21
- verificationRequired?: boolean;
22
- /** Theme colors pushed into the hosted widget live; `null` is the classic reset. */
23
- theme?: VaultCardThemeColors | null;
24
- /** Final, localized submit wording, applied live without a remount. */
25
- submitLabel?: string | null;
26
- /** Inline styles for the container the widget mounts into. */
27
- containerStyle?: CSSProperties;
28
- }
29
- /**
30
- * Renders the backend-served hosted vault card widget. The widget owns the
31
- * card fields, the submit button, the charge and 3DS; this component only
32
- * injects it through the {@link CardCaptureAdapter} (the SDK's `cardCapture`)
33
- * and relays its `ready` / `error` / `validation` lifecycle as Vue events.
34
- */
35
- export declare const VaultCardFields: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
36
- capture: {
37
- type: PropType<CardCaptureAdapter>;
38
- default: undefined;
39
- };
40
- html: {
41
- type: StringConstructor;
42
- default: undefined;
43
- };
44
- messageToken: {
45
- type: StringConstructor;
46
- default: undefined;
47
- };
48
- expectedOrigin: {
49
- type: StringConstructor;
50
- default: undefined;
51
- };
52
- expiresAt: {
53
- type: PropType<string | null>;
54
- default: undefined;
55
- };
56
- verificationRequired: {
57
- type: BooleanConstructor;
58
- default: undefined;
59
- };
60
- theme: {
61
- type: PropType<VaultCardThemeColors | null>;
62
- default: undefined;
63
- };
64
- submitLabel: {
65
- type: PropType<string | null>;
66
- default: undefined;
67
- };
68
- containerStyle: {
69
- type: PropType<CSSProperties>;
70
- default: undefined;
71
- };
72
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
73
- [key: string]: any;
74
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
75
- ready: () => true;
76
- error: (_message: string | null) => true;
77
- validation: (_message: string | null) => true;
78
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
79
- capture: {
80
- type: PropType<CardCaptureAdapter>;
81
- default: undefined;
82
- };
83
- html: {
84
- type: StringConstructor;
85
- default: undefined;
86
- };
87
- messageToken: {
88
- type: StringConstructor;
89
- default: undefined;
90
- };
91
- expectedOrigin: {
92
- type: StringConstructor;
93
- default: undefined;
94
- };
95
- expiresAt: {
96
- type: PropType<string | null>;
97
- default: undefined;
98
- };
99
- verificationRequired: {
100
- type: BooleanConstructor;
101
- default: undefined;
102
- };
103
- theme: {
104
- type: PropType<VaultCardThemeColors | null>;
105
- default: undefined;
106
- };
107
- submitLabel: {
108
- type: PropType<string | null>;
109
- default: undefined;
110
- };
111
- containerStyle: {
112
- type: PropType<CSSProperties>;
113
- default: undefined;
114
- };
115
- }>> & Readonly<{
116
- onError?: ((_message: string | null) => any) | undefined;
117
- onReady?: (() => any) | undefined;
118
- onValidation?: ((_message: string | null) => any) | undefined;
119
- }>, {
120
- capture: CardCaptureAdapter;
121
- html: string;
122
- messageToken: string;
123
- expectedOrigin: string;
124
- expiresAt: string | null;
125
- verificationRequired: boolean;
126
- theme: VaultCardThemeColors | null;
127
- submitLabel: string | null;
128
- containerStyle: CSSProperties;
129
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;