@flopay/vue 1.14.5 → 1.14.6
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/automatic-payment-button.d.ts +277 -0
- package/dist/buyer-identity-fallback.d.ts +82 -0
- package/dist/card-setup-entry.d.ts +2 -160
- package/dist/context.d.ts +56 -0
- package/dist/direct-paypal-button.d.ts +325 -0
- package/dist/{card-setup-entry.d.cts → flopay-card-setup.d.ts} +17 -19
- package/dist/flopay-checkout.d.ts +435 -0
- package/dist/{payment-method-setup-entry.d.cts → flopay-payment-method-setup-main.d.ts} +17 -21
- package/dist/hooks.d.ts +22 -0
- package/dist/hosted-setup.d.ts +116 -0
- package/dist/index.d.ts +20 -1947
- package/dist/payment-method-setup-entry.d.ts +2 -156
- package/dist/payment-method-setup-paypal.d.ts +108 -0
- package/dist/processing-overlay.d.ts +82 -0
- package/dist/provider.d.ts +76 -0
- package/dist/saved-payment.d.ts +44 -0
- package/dist/split-card-form.d.ts +691 -0
- package/dist/stripe-elements.d.ts +280 -0
- package/dist/stripe-paypal-continuation.d.ts +28 -0
- package/dist/vault-card-fields.d.ts +118 -0
- package/package.json +5 -5
- package/dist/hosted-setup-jpaaXDFA.d.cts +0 -33
- package/dist/hosted-setup-jpaaXDFA.d.ts +0 -33
- package/dist/index.d.cts +0 -1947
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import type { ButtonsLayoutStyles, ButtonsLayoutTheme, CheckoutButtonMethod, CheckoutItem, CheckoutProduct, CheckoutSession, CheckoutSubscription, DeclineEvent, FloPayAppearance, InlineSessionDraft, PaymentResult, ThemeId } from '@flopay/shared';
|
|
2
|
+
import { FloPayError } from '@flopay/shared';
|
|
3
|
+
import { type PropType } from 'vue';
|
|
4
|
+
/** Payload of the `success` event — identical to React's `onSuccess` argument. */
|
|
5
|
+
export interface FloPayAutomaticPaymentSuccessEvent {
|
|
6
|
+
result: PaymentResult;
|
|
7
|
+
session: CheckoutSession | null;
|
|
8
|
+
sessionId: string | null;
|
|
9
|
+
autoCompleted: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Props for {@link FloPayAutomaticPaymentButton} (React's props; callbacks are
|
|
13
|
+
* emits). React's props also extend the native `<button>` attributes (minus
|
|
14
|
+
* `children` and `onError`) and spread them onto the button; in Vue those
|
|
15
|
+
* arrive as fallthrough attributes (`id`, `class`, `style`, `aria-*`,
|
|
16
|
+
* `data-*`, `type`, `@click`, …) and land on the same `<button>`.
|
|
17
|
+
*/
|
|
18
|
+
export interface FloPayAutomaticPaymentButtonProps {
|
|
19
|
+
sessionId?: string;
|
|
20
|
+
/** Session-bound checkout token for a supplied {@link sessionId}. */
|
|
21
|
+
nonce?: string;
|
|
22
|
+
createSession?: InlineSessionDraft;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Ignored, as in React: the backend picks the customer's most
|
|
25
|
+
* recent vaulted method. Accepted only so existing integrations keep working.
|
|
26
|
+
*/
|
|
27
|
+
paymentMethodId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Ignored, as in React: the backend orchestrates gateway
|
|
30
|
+
* routing. Accepted only so existing integrations keep working.
|
|
31
|
+
*/
|
|
32
|
+
checkoutMethod?: CheckoutButtonMethod;
|
|
33
|
+
clientId?: string;
|
|
34
|
+
products?: CheckoutProduct[];
|
|
35
|
+
items?: CheckoutItem[];
|
|
36
|
+
subscriptions?: CheckoutSubscription[];
|
|
37
|
+
account?: InlineSessionDraft['account'];
|
|
38
|
+
successUrl?: string;
|
|
39
|
+
cancelUrl?: string;
|
|
40
|
+
couponCodes?: string[];
|
|
41
|
+
tagsData?: InlineSessionDraft['tagsData'];
|
|
42
|
+
utmMetadata?: InlineSessionDraft['utmMetadata'];
|
|
43
|
+
billingApiUrl?: string;
|
|
44
|
+
locale?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/** Theme bundle that styles the button and the fallback checkout. */
|
|
47
|
+
theme?: ThemeId;
|
|
48
|
+
/**
|
|
49
|
+
* Appearance overrides layered on top of the chosen `theme` (variables merge
|
|
50
|
+
* per key). Its `colorPrimary` / `colorPrimaryHover` re-skin the button.
|
|
51
|
+
*/
|
|
52
|
+
appearance?: FloPayAppearance;
|
|
53
|
+
/** @deprecated Use `theme`. Legacy buttons-layout preset, used only without `theme`. */
|
|
54
|
+
buttonsTheme?: ButtonsLayoutTheme;
|
|
55
|
+
/** Style overrides merged on top of the resolved theme bundle / `buttonsTheme` preset. */
|
|
56
|
+
buttonsStyles?: ButtonsLayoutStyles;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The one-click button: charges the buyer's saved payment method through the
|
|
60
|
+
* session-scoped `/process` with no client-built `tokenizedData`. The backend
|
|
61
|
+
* picks the vaulted method and its gateway. A session the backend already
|
|
62
|
+
* auto-completed emits `success` with `autoCompleted: true`.
|
|
63
|
+
*/
|
|
64
|
+
export declare const FloPayAutomaticPaymentButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
65
|
+
sessionId: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: undefined;
|
|
68
|
+
};
|
|
69
|
+
nonce: {
|
|
70
|
+
type: StringConstructor;
|
|
71
|
+
default: undefined;
|
|
72
|
+
};
|
|
73
|
+
createSession: {
|
|
74
|
+
type: PropType<InlineSessionDraft>;
|
|
75
|
+
default: undefined;
|
|
76
|
+
};
|
|
77
|
+
paymentMethodId: {
|
|
78
|
+
type: StringConstructor;
|
|
79
|
+
default: undefined;
|
|
80
|
+
};
|
|
81
|
+
checkoutMethod: {
|
|
82
|
+
type: PropType<CheckoutButtonMethod>;
|
|
83
|
+
default: undefined;
|
|
84
|
+
};
|
|
85
|
+
clientId: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
default: undefined;
|
|
88
|
+
};
|
|
89
|
+
products: {
|
|
90
|
+
type: PropType<CheckoutProduct[]>;
|
|
91
|
+
default: undefined;
|
|
92
|
+
};
|
|
93
|
+
items: {
|
|
94
|
+
type: PropType<CheckoutItem[]>;
|
|
95
|
+
default: undefined;
|
|
96
|
+
};
|
|
97
|
+
subscriptions: {
|
|
98
|
+
type: PropType<CheckoutSubscription[]>;
|
|
99
|
+
default: undefined;
|
|
100
|
+
};
|
|
101
|
+
account: {
|
|
102
|
+
type: PropType<InlineSessionDraft['account']>;
|
|
103
|
+
default: undefined;
|
|
104
|
+
};
|
|
105
|
+
successUrl: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
default: undefined;
|
|
108
|
+
};
|
|
109
|
+
cancelUrl: {
|
|
110
|
+
type: StringConstructor;
|
|
111
|
+
default: undefined;
|
|
112
|
+
};
|
|
113
|
+
couponCodes: {
|
|
114
|
+
type: PropType<string[]>;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
tagsData: {
|
|
118
|
+
type: PropType<InlineSessionDraft['tagsData']>;
|
|
119
|
+
default: undefined;
|
|
120
|
+
};
|
|
121
|
+
utmMetadata: {
|
|
122
|
+
type: PropType<InlineSessionDraft['utmMetadata']>;
|
|
123
|
+
default: undefined;
|
|
124
|
+
};
|
|
125
|
+
billingApiUrl: {
|
|
126
|
+
type: StringConstructor;
|
|
127
|
+
default: undefined;
|
|
128
|
+
};
|
|
129
|
+
locale: {
|
|
130
|
+
type: StringConstructor;
|
|
131
|
+
default: undefined;
|
|
132
|
+
};
|
|
133
|
+
disabled: {
|
|
134
|
+
type: BooleanConstructor;
|
|
135
|
+
default: boolean;
|
|
136
|
+
};
|
|
137
|
+
theme: {
|
|
138
|
+
type: PropType<ThemeId>;
|
|
139
|
+
default: undefined;
|
|
140
|
+
};
|
|
141
|
+
appearance: {
|
|
142
|
+
type: PropType<FloPayAppearance>;
|
|
143
|
+
default: undefined;
|
|
144
|
+
};
|
|
145
|
+
buttonsTheme: {
|
|
146
|
+
type: PropType<ButtonsLayoutTheme>;
|
|
147
|
+
default: undefined;
|
|
148
|
+
};
|
|
149
|
+
buttonsStyles: {
|
|
150
|
+
type: PropType<ButtonsLayoutStyles>;
|
|
151
|
+
default: undefined;
|
|
152
|
+
};
|
|
153
|
+
}>, () => (import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
154
|
+
[key: string]: any;
|
|
155
|
+
}> | null)[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
156
|
+
success: (_event: FloPayAutomaticPaymentSuccessEvent) => true;
|
|
157
|
+
error: (_error: FloPayError) => true;
|
|
158
|
+
decline: (_decline: DeclineEvent) => true;
|
|
159
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
160
|
+
sessionId: {
|
|
161
|
+
type: StringConstructor;
|
|
162
|
+
default: undefined;
|
|
163
|
+
};
|
|
164
|
+
nonce: {
|
|
165
|
+
type: StringConstructor;
|
|
166
|
+
default: undefined;
|
|
167
|
+
};
|
|
168
|
+
createSession: {
|
|
169
|
+
type: PropType<InlineSessionDraft>;
|
|
170
|
+
default: undefined;
|
|
171
|
+
};
|
|
172
|
+
paymentMethodId: {
|
|
173
|
+
type: StringConstructor;
|
|
174
|
+
default: undefined;
|
|
175
|
+
};
|
|
176
|
+
checkoutMethod: {
|
|
177
|
+
type: PropType<CheckoutButtonMethod>;
|
|
178
|
+
default: undefined;
|
|
179
|
+
};
|
|
180
|
+
clientId: {
|
|
181
|
+
type: StringConstructor;
|
|
182
|
+
default: undefined;
|
|
183
|
+
};
|
|
184
|
+
products: {
|
|
185
|
+
type: PropType<CheckoutProduct[]>;
|
|
186
|
+
default: undefined;
|
|
187
|
+
};
|
|
188
|
+
items: {
|
|
189
|
+
type: PropType<CheckoutItem[]>;
|
|
190
|
+
default: undefined;
|
|
191
|
+
};
|
|
192
|
+
subscriptions: {
|
|
193
|
+
type: PropType<CheckoutSubscription[]>;
|
|
194
|
+
default: undefined;
|
|
195
|
+
};
|
|
196
|
+
account: {
|
|
197
|
+
type: PropType<InlineSessionDraft['account']>;
|
|
198
|
+
default: undefined;
|
|
199
|
+
};
|
|
200
|
+
successUrl: {
|
|
201
|
+
type: StringConstructor;
|
|
202
|
+
default: undefined;
|
|
203
|
+
};
|
|
204
|
+
cancelUrl: {
|
|
205
|
+
type: StringConstructor;
|
|
206
|
+
default: undefined;
|
|
207
|
+
};
|
|
208
|
+
couponCodes: {
|
|
209
|
+
type: PropType<string[]>;
|
|
210
|
+
default: undefined;
|
|
211
|
+
};
|
|
212
|
+
tagsData: {
|
|
213
|
+
type: PropType<InlineSessionDraft['tagsData']>;
|
|
214
|
+
default: undefined;
|
|
215
|
+
};
|
|
216
|
+
utmMetadata: {
|
|
217
|
+
type: PropType<InlineSessionDraft['utmMetadata']>;
|
|
218
|
+
default: undefined;
|
|
219
|
+
};
|
|
220
|
+
billingApiUrl: {
|
|
221
|
+
type: StringConstructor;
|
|
222
|
+
default: undefined;
|
|
223
|
+
};
|
|
224
|
+
locale: {
|
|
225
|
+
type: StringConstructor;
|
|
226
|
+
default: undefined;
|
|
227
|
+
};
|
|
228
|
+
disabled: {
|
|
229
|
+
type: BooleanConstructor;
|
|
230
|
+
default: boolean;
|
|
231
|
+
};
|
|
232
|
+
theme: {
|
|
233
|
+
type: PropType<ThemeId>;
|
|
234
|
+
default: undefined;
|
|
235
|
+
};
|
|
236
|
+
appearance: {
|
|
237
|
+
type: PropType<FloPayAppearance>;
|
|
238
|
+
default: undefined;
|
|
239
|
+
};
|
|
240
|
+
buttonsTheme: {
|
|
241
|
+
type: PropType<ButtonsLayoutTheme>;
|
|
242
|
+
default: undefined;
|
|
243
|
+
};
|
|
244
|
+
buttonsStyles: {
|
|
245
|
+
type: PropType<ButtonsLayoutStyles>;
|
|
246
|
+
default: undefined;
|
|
247
|
+
};
|
|
248
|
+
}>> & Readonly<{
|
|
249
|
+
onDecline?: ((_decline: DeclineEvent) => any) | undefined;
|
|
250
|
+
onError?: ((_error: FloPayError) => any) | undefined;
|
|
251
|
+
onSuccess?: ((_event: FloPayAutomaticPaymentSuccessEvent) => any) | undefined;
|
|
252
|
+
}>, {
|
|
253
|
+
sessionId: string;
|
|
254
|
+
nonce: string;
|
|
255
|
+
createSession: InlineSessionDraft;
|
|
256
|
+
paymentMethodId: string;
|
|
257
|
+
checkoutMethod: CheckoutButtonMethod;
|
|
258
|
+
clientId: string;
|
|
259
|
+
products: CheckoutProduct[];
|
|
260
|
+
items: CheckoutItem[];
|
|
261
|
+
subscriptions: CheckoutSubscription[];
|
|
262
|
+
account: Omit<import("@flopay/shared").CheckoutAccount, "email"> & {
|
|
263
|
+
email?: string;
|
|
264
|
+
};
|
|
265
|
+
successUrl: string;
|
|
266
|
+
cancelUrl: string;
|
|
267
|
+
couponCodes: string[];
|
|
268
|
+
tagsData: import("@flopay/shared").TagsData | undefined;
|
|
269
|
+
utmMetadata: Record<string, string | null | undefined>[] | undefined;
|
|
270
|
+
billingApiUrl: string;
|
|
271
|
+
locale: string;
|
|
272
|
+
disabled: boolean;
|
|
273
|
+
theme: ThemeId;
|
|
274
|
+
appearance: FloPayAppearance;
|
|
275
|
+
buttonsTheme: ButtonsLayoutTheme;
|
|
276
|
+
buttonsStyles: ButtonsLayoutStyles;
|
|
277
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,82 @@
|
|
|
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>;
|
|
@@ -1,160 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { ThemeId, VaultCardThemeColors, FloPayAppearance, ButtonsLayoutStyles } from '@flopay/shared';
|
|
4
|
-
import { a as FloPayCardSetupCompleteEvent, F as FloPayCardSetupCancelEvent, b as FloPayCardSetupDeclineEvent, c as FloPayCardSetupError } from './hosted-setup-jpaaXDFA.js';
|
|
5
|
-
|
|
6
|
-
/** Props for the browser-only secure card-setup surface (callbacks are emits). */
|
|
7
|
-
interface FloPayCardSetupProps {
|
|
8
|
-
/** Opaque id returned by the merchant-authenticated setup-session endpoint. */
|
|
9
|
-
sessionId: string;
|
|
10
|
-
/** Session-bound token returned alongside `sessionId`. */
|
|
11
|
-
nonce: string;
|
|
12
|
-
billingApiUrl?: string;
|
|
13
|
-
/** Flo-owned privacy-safe telemetry is enabled by default; set false to opt out. */
|
|
14
|
-
telemetry?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Theme for FloPay's hosted, PCI-compliant card widget. Accepts the same
|
|
17
|
-
* high-level `ThemeId` as `FloPayCheckout` (resolved through the same
|
|
18
|
-
* bundle, so one value styles both surfaces identically) or raw
|
|
19
|
-
* `VaultCardThemeColors` for full manual control. Defaults to
|
|
20
|
-
* `'modern-light'`, which an unrecognized preset id also falls back to; pass
|
|
21
|
-
* `'classic'` for the historic FloPay look.
|
|
22
|
-
*/
|
|
23
|
-
theme?: ThemeId | VaultCardThemeColors;
|
|
24
|
-
/**
|
|
25
|
-
* Inline styles for the hosted-widget container. A named preset first gives
|
|
26
|
-
* that container the checkout credit-card pane's surface, with any stored
|
|
27
|
-
* `buttonsStyles.cardFormContainer` merged over it; each `containerStyle`
|
|
28
|
-
* property then wins over that surface, and any `background*` member
|
|
29
|
-
* replaces the surface background entirely.
|
|
30
|
-
*/
|
|
31
|
-
containerStyle?: Record<string, string | number>;
|
|
32
|
-
/**
|
|
33
|
-
* Appearance override, the same prop and type as `FloPayCheckout`'s (for
|
|
34
|
-
* example a client's saved embed theme `appearance`). It replaces the
|
|
35
|
-
* preset's appearance outright, as checkout does: its variables drive the
|
|
36
|
-
* hosted card fields, the hosted submit button and the outcome overlay.
|
|
37
|
-
* Ignored with raw `VaultCardThemeColors`; an empty `{}` is the same as
|
|
38
|
-
* omitting it. Changes restyle in place.
|
|
39
|
-
*/
|
|
40
|
-
appearance?: FloPayAppearance;
|
|
41
|
-
/**
|
|
42
|
-
* Buttons-layout style overrides, the same prop and type as
|
|
43
|
-
* `FloPayCheckout`'s (for example a client's saved embed theme
|
|
44
|
-
* `buttonsStyles`), merged over the preset's buttons layout the way checkout
|
|
45
|
-
* merges them. `submitButton` and the `cardInput*` members style the hosted
|
|
46
|
-
* card form, and `cardFormContainer` the pane around it and the outcome
|
|
47
|
-
* overlay's panel. Ignored with raw `VaultCardThemeColors`; an empty `{}` is
|
|
48
|
-
* the same as omitting it. Changes restyle in place.
|
|
49
|
-
*/
|
|
50
|
-
buttonsStyles?: ButtonsLayoutStyles;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Mounts FloPay's hosted card capture (the SDK's `cardCapture` adapter) for a
|
|
54
|
-
* setup session the merchant's server created. It takes only `sessionId` +
|
|
55
|
-
* `nonce`, never creates a session, never loads Stripe.js, and leaves the
|
|
56
|
-
* verification and its 3DS to the hosted widget. Emits `ready`, `complete`,
|
|
57
|
-
* `decline`, `cancel` (unmounted before an outcome), `validation` and `error`.
|
|
58
|
-
*
|
|
59
|
-
* Like React's, it draws the full-page processing / success / failure overlay
|
|
60
|
-
* over the hosted form ("SAVING CARD...", "CARD SAVED", "CARD NOT SAVED"),
|
|
61
|
-
* themed with the preset's credit-card pane. A client's stored `appearance`
|
|
62
|
-
* and `buttonsStyles` resolve over the preset exactly as in React and
|
|
63
|
-
* `FloPayCheckout`, and restyle the mounted form in place.
|
|
64
|
-
*/
|
|
65
|
-
declare const FloPayCardSetup: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
66
|
-
sessionId: {
|
|
67
|
-
type: StringConstructor;
|
|
68
|
-
default: undefined;
|
|
69
|
-
};
|
|
70
|
-
nonce: {
|
|
71
|
-
type: StringConstructor;
|
|
72
|
-
default: undefined;
|
|
73
|
-
};
|
|
74
|
-
billingApiUrl: {
|
|
75
|
-
type: StringConstructor;
|
|
76
|
-
default: undefined;
|
|
77
|
-
};
|
|
78
|
-
telemetry: {
|
|
79
|
-
type: BooleanConstructor;
|
|
80
|
-
default: undefined;
|
|
81
|
-
};
|
|
82
|
-
theme: {
|
|
83
|
-
type: PropType<ThemeId | VaultCardThemeColors>;
|
|
84
|
-
default: string;
|
|
85
|
-
};
|
|
86
|
-
containerStyle: {
|
|
87
|
-
type: PropType<Record<string, string | number>>;
|
|
88
|
-
default: undefined;
|
|
89
|
-
};
|
|
90
|
-
appearance: {
|
|
91
|
-
type: PropType<FloPayAppearance>;
|
|
92
|
-
default: undefined;
|
|
93
|
-
};
|
|
94
|
-
buttonsStyles: {
|
|
95
|
-
type: PropType<ButtonsLayoutStyles>;
|
|
96
|
-
default: undefined;
|
|
97
|
-
};
|
|
98
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
99
|
-
[key: string]: any;
|
|
100
|
-
}> | (vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
101
|
-
[key: string]: any;
|
|
102
|
-
}> | null)[] | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
103
|
-
ready: () => true;
|
|
104
|
-
complete: (_event: FloPayCardSetupCompleteEvent) => true;
|
|
105
|
-
cancel: (_event: FloPayCardSetupCancelEvent) => true;
|
|
106
|
-
decline: (_event: FloPayCardSetupDeclineEvent) => true;
|
|
107
|
-
validation: (_message: string | null) => true;
|
|
108
|
-
error: (_error: FloPayCardSetupError) => true;
|
|
109
|
-
}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
110
|
-
sessionId: {
|
|
111
|
-
type: StringConstructor;
|
|
112
|
-
default: undefined;
|
|
113
|
-
};
|
|
114
|
-
nonce: {
|
|
115
|
-
type: StringConstructor;
|
|
116
|
-
default: undefined;
|
|
117
|
-
};
|
|
118
|
-
billingApiUrl: {
|
|
119
|
-
type: StringConstructor;
|
|
120
|
-
default: undefined;
|
|
121
|
-
};
|
|
122
|
-
telemetry: {
|
|
123
|
-
type: BooleanConstructor;
|
|
124
|
-
default: undefined;
|
|
125
|
-
};
|
|
126
|
-
theme: {
|
|
127
|
-
type: PropType<ThemeId | VaultCardThemeColors>;
|
|
128
|
-
default: string;
|
|
129
|
-
};
|
|
130
|
-
containerStyle: {
|
|
131
|
-
type: PropType<Record<string, string | number>>;
|
|
132
|
-
default: undefined;
|
|
133
|
-
};
|
|
134
|
-
appearance: {
|
|
135
|
-
type: PropType<FloPayAppearance>;
|
|
136
|
-
default: undefined;
|
|
137
|
-
};
|
|
138
|
-
buttonsStyles: {
|
|
139
|
-
type: PropType<ButtonsLayoutStyles>;
|
|
140
|
-
default: undefined;
|
|
141
|
-
};
|
|
142
|
-
}>> & Readonly<{
|
|
143
|
-
onError?: ((_error: FloPayCardSetupError) => any) | undefined;
|
|
144
|
-
onCancel?: ((_event: FloPayCardSetupCancelEvent) => any) | undefined;
|
|
145
|
-
onReady?: (() => any) | undefined;
|
|
146
|
-
onComplete?: ((_event: FloPayCardSetupCompleteEvent) => any) | undefined;
|
|
147
|
-
onDecline?: ((_event: FloPayCardSetupDeclineEvent) => any) | undefined;
|
|
148
|
-
onValidation?: ((_message: string | null) => any) | undefined;
|
|
149
|
-
}>, {
|
|
150
|
-
theme: ThemeId | VaultCardThemeColors;
|
|
151
|
-
telemetry: boolean;
|
|
152
|
-
sessionId: string;
|
|
153
|
-
nonce: string;
|
|
154
|
-
containerStyle: Record<string, string | number>;
|
|
155
|
-
billingApiUrl: string;
|
|
156
|
-
appearance: FloPayAppearance;
|
|
157
|
-
buttonsStyles: ButtonsLayoutStyles;
|
|
158
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
159
|
-
|
|
160
|
-
export { FloPayCardSetup, FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupError, type FloPayCardSetupProps };
|
|
1
|
+
export type { FloPayCardSetupCancelEvent, FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupProps, } from './flopay-card-setup.js';
|
|
2
|
+
export { FloPayCardSetup, FloPayCardSetupError } from './flopay-card-setup.js';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { FloPay } from '@flopay/js';
|
|
2
|
+
import type { CheckoutSession, FloInstrumentSource, FloPayError, InlineSessionDraft, WalletPresentation } from '@flopay/shared';
|
|
3
|
+
import type { InjectionKey, ShallowRef } from 'vue';
|
|
4
|
+
/** Provider state shared with every FloPay component and composable below it. */
|
|
5
|
+
interface FloPayContextValue {
|
|
6
|
+
flopay: Readonly<ShallowRef<FloPay | null>>;
|
|
7
|
+
paypalFlopay: Readonly<ShallowRef<FloPay | null>>;
|
|
8
|
+
billingApiUrl: () => string;
|
|
9
|
+
emitInstrument: (source: FloInstrumentSource) => void;
|
|
10
|
+
}
|
|
11
|
+
/** Checkout state exposed by `useCheckout()`. */
|
|
12
|
+
export interface CheckoutState {
|
|
13
|
+
session: CheckoutSession | null;
|
|
14
|
+
loading: boolean;
|
|
15
|
+
error: FloPayError | null;
|
|
16
|
+
/** True while a detached session shell is not yet safe to charge. */
|
|
17
|
+
claimPending?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* True when the pending claim waits for a `SplitCardForm` to collect the
|
|
20
|
+
* buyer's identity (React's `claimRequiresIdentity`). A form below the
|
|
21
|
+
* checkout reads it even when its own `dataAttachmentRequiresIdentity` is
|
|
22
|
+
* unset, as React's form reads `CheckoutContext`.
|
|
23
|
+
*/
|
|
24
|
+
claimRequiresIdentity?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The inline `createSession` draft (React's `inlineSessionDraft`). A
|
|
27
|
+
* `SplitCardForm` passes it to `onBeforeButtonClick` as `createSession`.
|
|
28
|
+
*/
|
|
29
|
+
inlineSessionDraft?: InlineSessionDraft;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Values `FloPayCheckout` hands a custom-layout `SplitCardForm` (React's
|
|
33
|
+
* `SessionInjector`). A prop the form sets itself always wins.
|
|
34
|
+
*/
|
|
35
|
+
export interface CheckoutFormDefaults {
|
|
36
|
+
sessionId?: string;
|
|
37
|
+
nonce?: string;
|
|
38
|
+
billingApiUrl?: string;
|
|
39
|
+
session?: CheckoutSession | null;
|
|
40
|
+
submitLabel?: string | null;
|
|
41
|
+
dataAttachmentPending?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The session customer's id (React's `SessionInjector` injects
|
|
44
|
+
* `session.customer.id` as `userId` when the child's own `userId` is empty).
|
|
45
|
+
*/
|
|
46
|
+
userId?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The checkout's `walletPresentation` (React's `SessionInjector` injects it
|
|
49
|
+
* when the child's own `walletPresentation` is `undefined`).
|
|
50
|
+
*/
|
|
51
|
+
walletPresentation?: WalletPresentation;
|
|
52
|
+
}
|
|
53
|
+
export declare const FLOPAY_CONTEXT: InjectionKey<FloPayContextValue>;
|
|
54
|
+
export declare const CHECKOUT_STATE: InjectionKey<CheckoutState>;
|
|
55
|
+
export declare const CHECKOUT_FORM_DEFAULTS: InjectionKey<() => CheckoutFormDefaults>;
|
|
56
|
+
export {};
|