@flopay/vue 1.20.14 → 2.0.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.
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 +279 -5402
  10. package/dist/index.d.ts +3 -21
  11. package/dist/index.mjs +231 -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,2 +1,2 @@
1
- export type { FloPayPaymentMethodSetupCancelEvent, FloPayPaymentMethodSetupCompleteEvent, FloPayPaymentMethodSetupDeclineEvent, FloPayPaymentMethodSetupProps, } from './flopay-payment-method-setup-main.js';
2
- export { FloPayPaymentMethodSetup } from './flopay-payment-method-setup-main.js';
1
+ export type { FloPayRuntimePaymentMethodSetupProps as FloPayPaymentMethodSetupProps } from './flopay-runtime-payment-method-setup.js';
2
+ export { FloPayRuntimePaymentMethodSetup as FloPayPaymentMethodSetup } from './flopay-runtime-payment-method-setup.js';
@@ -1,7 +1,7 @@
1
1
  import {
2
- FloPayPaymentMethodSetup
3
- } from "./chunk-IJKGJSHH.mjs";
4
- import "./chunk-2USKULEH.mjs";
2
+ FloPayRuntimePaymentMethodSetup
3
+ } from "./chunk-OCVTEXQA.mjs";
4
+ import "./chunk-2VPPDVV7.mjs";
5
5
  export {
6
- FloPayPaymentMethodSetup
6
+ FloPayRuntimePaymentMethodSetup as FloPayPaymentMethodSetup
7
7
  };
@@ -0,0 +1,11 @@
1
+ import type { InjectionKey } from 'vue';
2
+ /**
3
+ * What `FloPayProvider` provides to the components below it: the publishable key and the
4
+ * Flo-origin runtime script, used when a component is not given its own. It holds no FloPay
5
+ * instance and loads nothing.
6
+ */
7
+ export interface FloPayRuntimeContextValue {
8
+ publishableKey?: string;
9
+ runtimeUrl?: string;
10
+ }
11
+ export declare const FLOPAY_RUNTIME_CONTEXT: InjectionKey<FloPayRuntimeContextValue>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/vue",
3
- "version": "1.20.14",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {
@@ -36,10 +36,8 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@flopay/js": "1.20.14",
40
- "@flopay/shared": "1.20.14",
41
- "@paypal/paypal-js": "^11.3.0",
42
- "@stripe/stripe-js": "^10.3.0"
39
+ "@flopay/js": "2.0.0",
40
+ "@flopay/shared": "2.0.0"
43
41
  },
44
42
  "peerDependencies": {
45
43
  "vue": ">=3.3.0"
@@ -1,296 +0,0 @@
1
- import type { ButtonsLayoutStyles, ButtonsLayoutTheme, CheckoutButtonMethod, CheckoutItem, CheckoutProduct, CheckoutSession, CheckoutSubscription, DeclineEvent, FloPayAppearance, InlineSessionDraft, OneClickSession, PaymentResult, ThemeId } from '@flopay/shared';
2
- import { FloPayError } from '@flopay/shared';
3
- import { type PropType } from 'vue';
4
- /** Fetches a server-minted one-click session on click; React's `getSession` prop. */
5
- type GetOneClickSession = (options: {
6
- signal: AbortSignal;
7
- }) => Promise<OneClickSession>;
8
- /** Payload of the `success` event — identical to React's `onSuccess` argument. */
9
- export interface FloPayAutomaticPaymentSuccessEvent {
10
- result: PaymentResult;
11
- session: CheckoutSession | null;
12
- sessionId: string | null;
13
- autoCompleted: boolean;
14
- }
15
- /**
16
- * Props for {@link FloPayAutomaticPaymentButton} (React's props; callbacks are
17
- * emits). React's props also extend the native `<button>` attributes (minus
18
- * `children` and `onError`) and spread them onto the button; in Vue those
19
- * arrive as fallthrough attributes (`id`, `class`, `style`, `aria-*`,
20
- * `data-*`, `type`, `@click`, …) and land on the same `<button>`.
21
- */
22
- export interface FloPayAutomaticPaymentButtonProps {
23
- sessionId?: string;
24
- /** Session-bound checkout token for a supplied {@link sessionId}. */
25
- nonce?: string;
26
- createSession?: InlineSessionDraft;
27
- /**
28
- * Called on click to fetch a server-minted one-click session (`{ sessionId, nonce }`),
29
- * as in React. Give exactly one of `sessionId`, `getSession` or an inline draft.
30
- */
31
- getSession?: GetOneClickSession;
32
- /**
33
- * @deprecated Ignored, as in React: the backend picks the customer's most
34
- * recent vaulted method. Accepted only so existing integrations keep working.
35
- */
36
- paymentMethodId?: string;
37
- /**
38
- * @deprecated Ignored, as in React: the backend orchestrates gateway
39
- * routing. Accepted only so existing integrations keep working.
40
- */
41
- checkoutMethod?: CheckoutButtonMethod;
42
- clientId?: string;
43
- products?: CheckoutProduct[];
44
- items?: CheckoutItem[];
45
- subscriptions?: CheckoutSubscription[];
46
- account?: InlineSessionDraft['account'];
47
- successUrl?: string;
48
- cancelUrl?: string;
49
- couponCodes?: string[];
50
- tagsData?: InlineSessionDraft['tagsData'];
51
- utmMetadata?: InlineSessionDraft['utmMetadata'];
52
- billingApiUrl?: string;
53
- locale?: string;
54
- disabled?: boolean;
55
- /** Theme bundle that styles the button and the fallback checkout. */
56
- theme?: ThemeId;
57
- /**
58
- * Appearance overrides layered on top of the chosen `theme` (variables merge
59
- * per key). Its `colorPrimary` / `colorPrimaryHover` re-skin the button.
60
- */
61
- appearance?: FloPayAppearance;
62
- /** @deprecated Use `theme`. Legacy buttons-layout preset, used only without `theme`. */
63
- buttonsTheme?: ButtonsLayoutTheme;
64
- /** Style overrides merged on top of the resolved theme bundle / `buttonsTheme` preset. */
65
- buttonsStyles?: ButtonsLayoutStyles;
66
- }
67
- /**
68
- * The one-click button: charges the buyer's saved payment method through the
69
- * session-scoped `/process` with no client-built `tokenizedData`. The backend
70
- * picks the vaulted method and its gateway. A session the backend already
71
- * auto-completed emits `success` with `autoCompleted: true`.
72
- */
73
- export declare const FloPayAutomaticPaymentButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
74
- sessionId: {
75
- type: StringConstructor;
76
- default: undefined;
77
- };
78
- nonce: {
79
- type: StringConstructor;
80
- default: undefined;
81
- };
82
- createSession: {
83
- type: PropType<InlineSessionDraft>;
84
- default: undefined;
85
- };
86
- getSession: {
87
- type: PropType<GetOneClickSession>;
88
- default: undefined;
89
- };
90
- paymentMethodId: {
91
- type: StringConstructor;
92
- default: undefined;
93
- };
94
- checkoutMethod: {
95
- type: PropType<CheckoutButtonMethod>;
96
- default: undefined;
97
- };
98
- clientId: {
99
- type: StringConstructor;
100
- default: undefined;
101
- };
102
- products: {
103
- type: PropType<CheckoutProduct[]>;
104
- default: undefined;
105
- };
106
- items: {
107
- type: PropType<CheckoutItem[]>;
108
- default: undefined;
109
- };
110
- subscriptions: {
111
- type: PropType<CheckoutSubscription[]>;
112
- default: undefined;
113
- };
114
- account: {
115
- type: PropType<InlineSessionDraft['account']>;
116
- default: undefined;
117
- };
118
- successUrl: {
119
- type: StringConstructor;
120
- default: undefined;
121
- };
122
- cancelUrl: {
123
- type: StringConstructor;
124
- default: undefined;
125
- };
126
- couponCodes: {
127
- type: PropType<string[]>;
128
- default: undefined;
129
- };
130
- tagsData: {
131
- type: PropType<InlineSessionDraft['tagsData']>;
132
- default: undefined;
133
- };
134
- utmMetadata: {
135
- type: PropType<InlineSessionDraft['utmMetadata']>;
136
- default: undefined;
137
- };
138
- billingApiUrl: {
139
- type: StringConstructor;
140
- default: undefined;
141
- };
142
- locale: {
143
- type: StringConstructor;
144
- default: undefined;
145
- };
146
- disabled: {
147
- type: BooleanConstructor;
148
- default: boolean;
149
- };
150
- theme: {
151
- type: PropType<ThemeId>;
152
- default: undefined;
153
- };
154
- appearance: {
155
- type: PropType<FloPayAppearance>;
156
- default: undefined;
157
- };
158
- buttonsTheme: {
159
- type: PropType<ButtonsLayoutTheme>;
160
- default: undefined;
161
- };
162
- buttonsStyles: {
163
- type: PropType<ButtonsLayoutStyles>;
164
- default: undefined;
165
- };
166
- }>, () => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
167
- [key: string]: any;
168
- }> | null)[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
169
- success: (_event: FloPayAutomaticPaymentSuccessEvent) => true;
170
- error: (_error: FloPayError) => true;
171
- decline: (_decline: DeclineEvent) => true;
172
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
173
- sessionId: {
174
- type: StringConstructor;
175
- default: undefined;
176
- };
177
- nonce: {
178
- type: StringConstructor;
179
- default: undefined;
180
- };
181
- createSession: {
182
- type: PropType<InlineSessionDraft>;
183
- default: undefined;
184
- };
185
- getSession: {
186
- type: PropType<GetOneClickSession>;
187
- default: undefined;
188
- };
189
- paymentMethodId: {
190
- type: StringConstructor;
191
- default: undefined;
192
- };
193
- checkoutMethod: {
194
- type: PropType<CheckoutButtonMethod>;
195
- default: undefined;
196
- };
197
- clientId: {
198
- type: StringConstructor;
199
- default: undefined;
200
- };
201
- products: {
202
- type: PropType<CheckoutProduct[]>;
203
- default: undefined;
204
- };
205
- items: {
206
- type: PropType<CheckoutItem[]>;
207
- default: undefined;
208
- };
209
- subscriptions: {
210
- type: PropType<CheckoutSubscription[]>;
211
- default: undefined;
212
- };
213
- account: {
214
- type: PropType<InlineSessionDraft['account']>;
215
- default: undefined;
216
- };
217
- successUrl: {
218
- type: StringConstructor;
219
- default: undefined;
220
- };
221
- cancelUrl: {
222
- type: StringConstructor;
223
- default: undefined;
224
- };
225
- couponCodes: {
226
- type: PropType<string[]>;
227
- default: undefined;
228
- };
229
- tagsData: {
230
- type: PropType<InlineSessionDraft['tagsData']>;
231
- default: undefined;
232
- };
233
- utmMetadata: {
234
- type: PropType<InlineSessionDraft['utmMetadata']>;
235
- default: undefined;
236
- };
237
- billingApiUrl: {
238
- type: StringConstructor;
239
- default: undefined;
240
- };
241
- locale: {
242
- type: StringConstructor;
243
- default: undefined;
244
- };
245
- disabled: {
246
- type: BooleanConstructor;
247
- default: boolean;
248
- };
249
- theme: {
250
- type: PropType<ThemeId>;
251
- default: undefined;
252
- };
253
- appearance: {
254
- type: PropType<FloPayAppearance>;
255
- default: undefined;
256
- };
257
- buttonsTheme: {
258
- type: PropType<ButtonsLayoutTheme>;
259
- default: undefined;
260
- };
261
- buttonsStyles: {
262
- type: PropType<ButtonsLayoutStyles>;
263
- default: undefined;
264
- };
265
- }>> & Readonly<{
266
- onDecline?: ((_decline: DeclineEvent) => any) | undefined;
267
- onError?: ((_error: FloPayError) => any) | undefined;
268
- onSuccess?: ((_event: FloPayAutomaticPaymentSuccessEvent) => any) | undefined;
269
- }>, {
270
- sessionId: string;
271
- nonce: string;
272
- createSession: InlineSessionDraft;
273
- getSession: GetOneClickSession;
274
- paymentMethodId: string;
275
- checkoutMethod: CheckoutButtonMethod;
276
- clientId: string;
277
- products: CheckoutProduct[];
278
- items: CheckoutItem[];
279
- subscriptions: CheckoutSubscription[];
280
- account: Omit<import("@flopay/shared").CheckoutAccount, "email"> & {
281
- email?: string;
282
- };
283
- successUrl: string;
284
- cancelUrl: string;
285
- couponCodes: string[];
286
- tagsData: import("@flopay/shared").TagsData | undefined;
287
- utmMetadata: Record<string, string | null | undefined>[] | undefined;
288
- billingApiUrl: string;
289
- locale: string;
290
- disabled: boolean;
291
- theme: ThemeId;
292
- appearance: FloPayAppearance;
293
- buttonsTheme: ButtonsLayoutTheme;
294
- buttonsStyles: ButtonsLayoutStyles;
295
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
296
- export {};
@@ -1,82 +0,0 @@
1
- import type { PayPalBuyerIdentity } from '@flopay/shared';
2
- import { type PropType } from 'vue';
3
- /** One pending identity request (React's `BuyerIdentityFallbackRequest`). */
4
- export interface BuyerIdentityFallbackRequest {
5
- id: number;
6
- methodLabel: string;
7
- identity: PayPalBuyerIdentity;
8
- }
9
- /**
10
- * React's `useBuyerIdentityFallback`: a single-request identity collector.
11
- * `collect(methodLabel, identity)` opens the panel seeded with what the
12
- * provider returned and resolves with the buyer's identity, or `null` when
13
- * they cancel or the component unmounts. A new request supersedes a pending
14
- * one. Call it from `setup()`: it registers an unmount hook.
15
- */
16
- export declare function createBuyerIdentityFallback(): {
17
- request: import("vue").ShallowRef<BuyerIdentityFallbackRequest | null, BuyerIdentityFallbackRequest | null>;
18
- collect: (methodLabel: string, identity: PayPalBuyerIdentity) => Promise<PayPalBuyerIdentity | null>;
19
- finish: (identity: PayPalBuyerIdentity | null) => void;
20
- };
21
- /**
22
- * React's `BuyerIdentityFallbackPanel`: collects the missing email before an
23
- * express payment continues. Provider- or merchant-supplied names are kept,
24
- * but the SDK never asks the buyer for a name itself.
25
- */
26
- export declare const BuyerIdentityFallbackPanel: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
27
- identity: {
28
- type: PropType<PayPalBuyerIdentity>;
29
- required: true;
30
- };
31
- methodLabel: {
32
- type: StringConstructor;
33
- required: true;
34
- };
35
- /** Renders a Cancel button (React renders it when `onCancel` is passed). */
36
- cancellable: {
37
- type: BooleanConstructor;
38
- default: boolean;
39
- };
40
- submitting: {
41
- type: BooleanConstructor;
42
- default: boolean;
43
- };
44
- testId: {
45
- type: StringConstructor;
46
- default: string;
47
- };
48
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
49
- [key: string]: any;
50
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
51
- complete: (_identity: PayPalBuyerIdentity) => true;
52
- cancel: () => true;
53
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
54
- identity: {
55
- type: PropType<PayPalBuyerIdentity>;
56
- required: true;
57
- };
58
- methodLabel: {
59
- type: StringConstructor;
60
- required: true;
61
- };
62
- /** Renders a Cancel button (React renders it when `onCancel` is passed). */
63
- cancellable: {
64
- type: BooleanConstructor;
65
- default: boolean;
66
- };
67
- submitting: {
68
- type: BooleanConstructor;
69
- default: boolean;
70
- };
71
- testId: {
72
- type: StringConstructor;
73
- default: string;
74
- };
75
- }>> & Readonly<{
76
- onCancel?: (() => any) | undefined;
77
- onComplete?: ((_identity: Partial<import("@flopay/shared").CheckoutAccount>) => any) | undefined;
78
- }>, {
79
- cancellable: boolean;
80
- submitting: boolean;
81
- testId: string;
82
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;