@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,116 +0,0 @@
1
- import type { ButtonsLayoutStyles, CardCaptureAdapter, CardCaptureMountOptions, FloPayAppearance, FloPayErrorType, NormalizedCheckoutSession, SavedCardDisplay, ThemeId, VaultCardThemeColors } from '@flopay/shared';
2
- import { FloPayError } from '@flopay/shared';
3
- import { type Ref, type ShallowRef } from 'vue';
4
- /** Verified terminal result from a no-charge setup. */
5
- export interface FloPayCardSetupCompleteEvent {
6
- status: 'succeeded';
7
- sessionId: string;
8
- /** Present when the backend terminal message includes the saved-card display DTO. */
9
- paymentMethod?: SavedCardDisplay;
10
- }
11
- /** Provider-neutral terminal decline from verification. */
12
- export interface FloPayCardSetupDeclineEvent {
13
- status: 'declined';
14
- sessionId: string;
15
- reason?: string;
16
- message?: string;
17
- }
18
- /** Abandoned setup result emitted when the component unmounts pre-terminally. */
19
- export interface FloPayCardSetupCancelEvent {
20
- status: 'cancelled';
21
- sessionId: string;
22
- }
23
- /** Structured technical/validation failure from a setup surface. */
24
- export declare class FloPayCardSetupError extends FloPayError {
25
- readonly retryable: boolean;
26
- constructor(message: string, type: FloPayErrorType, options: {
27
- code: string;
28
- retryable: boolean;
29
- param?: string;
30
- statusCode?: number;
31
- });
32
- }
33
- /** Unknown failures are retryable; FloPay errors only for network, rate-limit, 5xx or timeout. */
34
- export declare function asCardSetupError(error: unknown, overrides?: {
35
- code?: string;
36
- retryable?: boolean;
37
- }): FloPayCardSetupError;
38
- /**
39
- * React's `FloPayCardSetup` and `FloPayPaymentMethodSetup` theme resolution
40
- * (`resolveCardSetupTheme` in `@flopay/shared`): a `ThemeId` plus a client's stored `appearance` and
41
- * `buttonsStyles` resolve exactly as `FloPayCheckout` resolves them, so one
42
- * stored theme renders the same hosted card form on both surfaces. The
43
- * `appearance` override replaces the preset's, `buttonsStyles` merges over the
44
- * preset layout, empty `{}` groups count as absent, raw colors pass through
45
- * untouched (overrides ignored), `'classic'` without overrides keeps the
46
- * explicit `null` reset, and an unknown preset id renders `modern-light`. The
47
- * effective theme drives the hosted fields and submit button, the pane beneath
48
- * the merchant's `containerStyle`, and the outcome overlay; its `appearance`
49
- * also goes to the Stripe Elements of the payment-method setup form. Nothing
50
- * here is a mount input: a change only re-skins the mounted widget, its
51
- * container and the overlay.
52
- */
53
- export declare function useCardSetupTheme(source: {
54
- theme?: ThemeId | VaultCardThemeColors | undefined;
55
- appearance?: FloPayAppearance | undefined;
56
- buttonsStyles?: ButtonsLayoutStyles | undefined;
57
- containerStyle?: Record<string, string | number> | undefined;
58
- }): {
59
- vaultTheme: import("vue").ComputedRef<VaultCardThemeColors | null>;
60
- surfaceStyle: import("vue").ComputedRef<Record<string, string | number> | undefined>;
61
- overlayTheme: import("vue").ComputedRef<import("@flopay/shared").ProcessingOverlayThemeColors | undefined>;
62
- appearance: import("vue").ComputedRef<FloPayAppearance | undefined>;
63
- };
64
- interface SetupProps {
65
- sessionId?: string;
66
- nonce?: string;
67
- billingApiUrl?: string;
68
- telemetry?: boolean;
69
- }
70
- /** What the hosted card's outcome overlay shows; `null` hides it. */
71
- export interface HostedCardOverlay {
72
- status: 'processing' | 'success' | 'error';
73
- message: string | null;
74
- }
75
- interface SetupEmitters {
76
- complete: (event: FloPayCardSetupCompleteEvent) => void;
77
- decline: (event: FloPayCardSetupDeclineEvent) => void;
78
- cancel: (event: FloPayCardSetupCancelEvent) => void;
79
- error: (error: FloPayCardSetupError) => void;
80
- /**
81
- * React's processing / success / failure overlay over the hosted card:
82
- * processing from the widget's `submitting`, success held before
83
- * `complete`, failure held after a decline or a mid-submission error, then
84
- * cleared so the buyer can retry in place.
85
- */
86
- overlay: (state: HostedCardOverlay | null) => void;
87
- }
88
- interface HostedSetupState {
89
- capture: ShallowRef<CardCaptureAdapter | null>;
90
- /**
91
- * The adapter's mount options for the hosted card form: the block's `html`,
92
- * or, for a verification-required block without one, the billing API's
93
- * credential-free hosted form shell (sdk#414).
94
- */
95
- vault: ShallowRef<CardCaptureMountOptions | null>;
96
- session: ShallowRef<NormalizedCheckoutSession | null>;
97
- loadError: Ref<FloPayCardSetupError | null>;
98
- /** Marks a terminal outcome reached outside the hosted card (wallet/APM). */
99
- settle: () => void;
100
- /**
101
- * A hosted-widget error message. Mid-submission it flips the overlay to the
102
- * failure state (then clears it); a pre-submit load error never paints a
103
- * failure over a form the buyer has not submitted.
104
- */
105
- widgetFailed: (message: string) => void;
106
- }
107
- /**
108
- * Reads a merchant-created setup session with its nonce (`GET`, never a
109
- * `POST /sessions/setup`) and prepares the hosted card capture. The hosted
110
- * widget owns the charge-free verification and 3DS; this never posts a 3DS
111
- * completion of its own. Runs only in the browser (`onMounted`).
112
- */
113
- export declare function useHostedSetup(props: SetupProps, emitters: SetupEmitters, options: {
114
- requireVault: (session: NormalizedCheckoutSession) => boolean;
115
- }): HostedSetupState;
116
- export {};
@@ -1,151 +0,0 @@
1
- // src/payment-method-setup-paypal.ts
2
- import { PaymentAPI } from "@flopay/js/card-setup";
3
- import {
4
- buildExternalMethodRecoveryMessage,
5
- classifyExternalMethodFailure,
6
- detectPayPalEnvironment,
7
- FloPayError,
8
- isSettledSessionIntent,
9
- PAYPAL_VAULTED_PAYMENT_METHOD_TYPE,
10
- settledSessionIntentError
11
- } from "@flopay/shared";
12
- import { loadScript } from "@paypal/paypal-js";
13
- import { defineComponent, h, onBeforeUnmount, onMounted, ref } from "vue";
14
- var PayPalSetupMethod = defineComponent({
15
- name: "FloPayPayPalSetupMethod",
16
- props: {
17
- clientId: { type: String, required: true },
18
- environment: { type: String, default: void 0 },
19
- /** The setup session's own currency, when the read carries one. A vault flow needs none. */
20
- currency: { type: String, default: void 0 },
21
- sessionId: { type: String, required: true },
22
- nonce: { type: String, required: true },
23
- billingApiUrl: { type: String, required: true },
24
- telemetry: { type: Boolean, default: void 0 },
25
- customer: { type: Object, required: true }
26
- },
27
- emits: {
28
- /** The buyer started saving PayPal. */
29
- submitting: () => true,
30
- /** PayPal accepted the account and the billing API took the token. */
31
- confirmed: () => true,
32
- /** A technical failure; `retryable` says whether trying again can help. */
33
- failed: (_error, _options) => true,
34
- /** The buyer closed PayPal's window without an outcome (not a cancel). */
35
- abandoned: () => true
36
- },
37
- setup(props, { emit }) {
38
- const container = ref(null);
39
- let active = true;
40
- let close;
41
- let api = null;
42
- onMounted(() => {
43
- const { inAppBrowser } = detectPayPalEnvironment();
44
- const client = new PaymentAPI(props.billingApiUrl, { telemetry: props.telemetry });
45
- api = client;
46
- const { sessionId, nonce } = props;
47
- const customer = {
48
- userId: props.customer.userId,
49
- email: props.customer.email
50
- };
51
- const environment = props.environment;
52
- void (async () => {
53
- try {
54
- const paypal = await loadScript({
55
- clientId: props.clientId,
56
- ...props.currency ? { currency: props.currency.toUpperCase() } : {},
57
- components: "buttons",
58
- ...environment === "sandbox" || environment === "production" ? { environment } : {}
59
- });
60
- const target = container.value;
61
- if (!active || !target) return;
62
- if (!paypal?.Buttons) {
63
- throw new FloPayError("PayPal could not be loaded.", "api_error", {
64
- code: "paypal_unavailable"
65
- });
66
- }
67
- const buttons = paypal.Buttons({
68
- createVaultSetupToken: async () => {
69
- emit("submitting");
70
- const intent = await client.createSessionIntent(sessionId, nonce, {
71
- provider: "paypal",
72
- paymentMethodCategory: "wallet",
73
- paymentMethodType: PAYPAL_VAULTED_PAYMENT_METHOD_TYPE,
74
- paymentMethodId: null,
75
- intentKind: "setup"
76
- });
77
- if (isSettledSessionIntent(intent)) throw settledSessionIntentError(sessionId);
78
- if (intent.provider !== "paypal" || intent.providerObjectType !== "setup_token") {
79
- throw new FloPayError(
80
- "The billing API did not return a PayPal setup token.",
81
- "api_error",
82
- { code: "InvalidSessionIntentResponse" }
83
- );
84
- }
85
- return intent.providerObjectId;
86
- },
87
- onApprove: async (data) => {
88
- const token = data.vaultSetupToken;
89
- if (!token) {
90
- throw new FloPayError("PayPal approved without a setup token.", "api_error", {
91
- code: "paypal_setup_token_missing"
92
- });
93
- }
94
- const response = await client.processPayment(customer.userId, {
95
- sessionId,
96
- nonce,
97
- paymentMethodCategory: "paypal",
98
- tokenizedData: {
99
- id: token,
100
- type: "paypal_setup_token",
101
- isPaypal: true,
102
- gateway: "paypal",
103
- paymentMethodType: PAYPAL_VAULTED_PAYMENT_METHOD_TYPE
104
- },
105
- accountData: customer
106
- });
107
- if (!response.ok) {
108
- throw new FloPayError("PayPal could not be saved.", "api_error", {
109
- code: "paypal_setup_failed",
110
- statusCode: response.status
111
- });
112
- }
113
- if (active) emit("confirmed");
114
- },
115
- onCancel: () => {
116
- if (active) emit("abandoned");
117
- },
118
- onError: (error) => {
119
- if (!active) return;
120
- const { popupBlocked } = classifyExternalMethodFailure(error, {
121
- inAppBrowser,
122
- handoffObserved: false
123
- });
124
- emit(
125
- "failed",
126
- popupBlocked ? new Error(buildExternalMethodRecoveryMessage("PayPal", true, inAppBrowser)) : error,
127
- { code: popupBlocked ? "popup_blocked" : "paypal_setup_failed", retryable: true }
128
- );
129
- }
130
- });
131
- close = () => buttons.close();
132
- await buttons.render(target);
133
- } catch (error) {
134
- if (!active) return;
135
- emit("failed", error, { code: "paypal_unavailable", retryable: true });
136
- }
137
- })();
138
- });
139
- onBeforeUnmount(() => {
140
- active = false;
141
- void close?.().catch(() => {
142
- });
143
- api?.destroy();
144
- api = null;
145
- });
146
- return () => h("div", { ref: container, "data-flopay-paypal-setup": "" });
147
- }
148
- });
149
- export {
150
- PayPalSetupMethod
151
- };
@@ -1,108 +0,0 @@
1
- import { type PropType } from 'vue';
2
- /** How a setup branch reports a technical failure: whether trying again can help. */
3
- export interface SetupBranchFailure {
4
- code: string;
5
- retryable: boolean;
6
- }
7
- /** The setup session's customer, forwarded to the approval as checkout forwards it. */
8
- export interface SetupCustomer {
9
- userId: string;
10
- email: string;
11
- }
12
- /**
13
- * Renders PayPal's button in vault mode (save PayPal without a purchase). The
14
- * click mints a PayPal vault setup token through the session-scoped intents
15
- * contract (`paypal_vaulted`, `intentKind: 'setup'`); the approval hands the
16
- * token to the billing API the same way checkout does. The branch never
17
- * reports success itself: `confirmed` only says PayPal accepted the account,
18
- * and the surface then waits for the backend to verify it.
19
- */
20
- export declare const PayPalSetupMethod: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
21
- clientId: {
22
- type: StringConstructor;
23
- required: true;
24
- };
25
- environment: {
26
- type: StringConstructor;
27
- default: undefined;
28
- };
29
- /** The setup session's own currency, when the read carries one. A vault flow needs none. */
30
- currency: {
31
- type: StringConstructor;
32
- default: undefined;
33
- };
34
- sessionId: {
35
- type: StringConstructor;
36
- required: true;
37
- };
38
- nonce: {
39
- type: StringConstructor;
40
- required: true;
41
- };
42
- billingApiUrl: {
43
- type: StringConstructor;
44
- required: true;
45
- };
46
- telemetry: {
47
- type: BooleanConstructor;
48
- default: undefined;
49
- };
50
- customer: {
51
- type: PropType<SetupCustomer>;
52
- required: true;
53
- };
54
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
55
- [key: string]: any;
56
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
- /** The buyer started saving PayPal. */
58
- submitting: () => true;
59
- /** PayPal accepted the account and the billing API took the token. */
60
- confirmed: () => true;
61
- /** A technical failure; `retryable` says whether trying again can help. */
62
- failed: (_error: unknown, _options: SetupBranchFailure) => true;
63
- /** The buyer closed PayPal's window without an outcome (not a cancel). */
64
- abandoned: () => true;
65
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
66
- clientId: {
67
- type: StringConstructor;
68
- required: true;
69
- };
70
- environment: {
71
- type: StringConstructor;
72
- default: undefined;
73
- };
74
- /** The setup session's own currency, when the read carries one. A vault flow needs none. */
75
- currency: {
76
- type: StringConstructor;
77
- default: undefined;
78
- };
79
- sessionId: {
80
- type: StringConstructor;
81
- required: true;
82
- };
83
- nonce: {
84
- type: StringConstructor;
85
- required: true;
86
- };
87
- billingApiUrl: {
88
- type: StringConstructor;
89
- required: true;
90
- };
91
- telemetry: {
92
- type: BooleanConstructor;
93
- default: undefined;
94
- };
95
- customer: {
96
- type: PropType<SetupCustomer>;
97
- required: true;
98
- };
99
- }>> & Readonly<{
100
- onAbandoned?: (() => any) | undefined;
101
- onConfirmed?: (() => any) | undefined;
102
- onFailed?: ((_error: unknown, _options: SetupBranchFailure) => any) | undefined;
103
- onSubmitting?: (() => any) | undefined;
104
- }>, {
105
- environment: string;
106
- currency: string;
107
- telemetry: boolean;
108
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,82 +0,0 @@
1
- import type { ProcessingOverlayStatus, ProcessingOverlayThemeColors } from '@flopay/shared';
2
- import { type PropType } from 'vue';
3
- /** Success hold before a setup surface reports `complete` (React's `PROCESSING_OVERLAY_SUCCESS_DELAY_MS`). */
4
- export declare const PROCESSING_OVERLAY_SUCCESS_DELAY_MS = 600;
5
- /** Failure hold before the overlay clears for a retry (React's `PROCESSING_OVERLAY_ERROR_DELAY_MS`). */
6
- export declare const PROCESSING_OVERLAY_ERROR_DELAY_MS = 400;
7
- /**
8
- * React's `ProcessingOverlay`: the full-page processing / success / failure
9
- * modal the setup surfaces draw over the hosted card form (the widget paints
10
- * no in-iframe overlay). A named preset passes `theme` from
11
- * `computeCardSetupOverlayTheme`; without it the modal keeps the neutral look.
12
- */
13
- export declare const ProcessingOverlay: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
14
- status: {
15
- type: PropType<ProcessingOverlayStatus>;
16
- required: true;
17
- };
18
- errorMessage: {
19
- type: PropType<string | null>;
20
- default: null;
21
- };
22
- processingLabel: {
23
- type: StringConstructor;
24
- default: string;
25
- };
26
- successLabel: {
27
- type: StringConstructor;
28
- default: string;
29
- };
30
- errorLabel: {
31
- type: StringConstructor;
32
- default: string;
33
- };
34
- /** Success sub-note; `null` omits it (surfaces that do not redirect). */
35
- successNote: {
36
- type: PropType<string | null>;
37
- default: string;
38
- };
39
- theme: {
40
- type: PropType<ProcessingOverlayThemeColors>;
41
- default: undefined;
42
- };
43
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
44
- [key: string]: any;
45
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
46
- status: {
47
- type: PropType<ProcessingOverlayStatus>;
48
- required: true;
49
- };
50
- errorMessage: {
51
- type: PropType<string | null>;
52
- default: null;
53
- };
54
- processingLabel: {
55
- type: StringConstructor;
56
- default: string;
57
- };
58
- successLabel: {
59
- type: StringConstructor;
60
- default: string;
61
- };
62
- errorLabel: {
63
- type: StringConstructor;
64
- default: string;
65
- };
66
- /** Success sub-note; `null` omits it (surfaces that do not redirect). */
67
- successNote: {
68
- type: PropType<string | null>;
69
- default: string;
70
- };
71
- theme: {
72
- type: PropType<ProcessingOverlayThemeColors>;
73
- default: undefined;
74
- };
75
- }>> & Readonly<{}>, {
76
- errorMessage: string | null;
77
- processingLabel: string;
78
- successLabel: string;
79
- errorLabel: string;
80
- successNote: string | null;
81
- theme: ProcessingOverlayThemeColors;
82
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,76 +0,0 @@
1
- import type { FloPay } from '@flopay/js';
2
- import type { BuildTelemetryErrorEventInput, FloInstrumentEvent, FloInstrumentSource } from '@flopay/shared';
3
- import { type PropType } from 'vue';
4
- /** Props for the `FloPayProvider` component (React's `FloPayProviderProps`, minus `children`). */
5
- export interface FloPayProviderProps {
6
- /** A `FloPay` instance or a promise that resolves to one (from `loadFloPay()`). */
7
- flopay: Promise<FloPay> | FloPay | null;
8
- /** Stripe `FloPay` instance for the Stripe-rendered PayPal fallback. */
9
- paypalFlopay?: Promise<FloPay> | FloPay | null;
10
- /** Optional provider configuration. */
11
- options?: {
12
- billingApiUrl?: string;
13
- };
14
- /** Receives the versioned, privacy-safe checkout instrument feed (`@instrument`). */
15
- onInstrument?: (event: FloInstrumentEvent) => void;
16
- }
17
- interface TelemetryBridgeLike {
18
- subscribe?(observer: (event: FloInstrumentSource) => void): () => void;
19
- /**
20
- * React's `getFloPayTelemetryBridge(flopay)?.error(…)`: a privacy-safe
21
- * technical error on the instance's Flo-owned telemetry (the channel that
22
- * reaches Sentry). The reporter assigns the event id and sequence.
23
- */
24
- error?(input: Omit<BuildTelemetryErrorEventInput, 'eventId' | 'sequence'>): void;
25
- }
26
- /** The hidden telemetry bridge `@flopay/js` attaches to a `FloPay` instance, if any. */
27
- export declare function telemetryBridge(flopay: FloPay): TelemetryBridgeLike | undefined;
28
- /**
29
- * Provides FloPay SDK state to the component tree (provide/inject). Browser
30
- * work — resolving the SDK promise, telemetry, instruments — starts in
31
- * `onMounted`, so server rendering renders the pending state and nothing else.
32
- */
33
- export declare const FloPayProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
34
- flopay: {
35
- type: PropType<Promise<FloPay> | FloPay | null>;
36
- default: null;
37
- };
38
- paypalFlopay: {
39
- type: PropType<Promise<FloPay> | FloPay | null>;
40
- default: null;
41
- };
42
- options: {
43
- type: PropType<{
44
- billingApiUrl?: string;
45
- }>;
46
- default: undefined;
47
- };
48
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
49
- [key: string]: any;
50
- }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
51
- instrument: (_event: FloInstrumentEvent) => true;
52
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
53
- flopay: {
54
- type: PropType<Promise<FloPay> | FloPay | null>;
55
- default: null;
56
- };
57
- paypalFlopay: {
58
- type: PropType<Promise<FloPay> | FloPay | null>;
59
- default: null;
60
- };
61
- options: {
62
- type: PropType<{
63
- billingApiUrl?: string;
64
- }>;
65
- default: undefined;
66
- };
67
- }>> & Readonly<{
68
- onInstrument?: ((_event: FloInstrumentEvent) => any) | undefined;
69
- }>, {
70
- flopay: FloPay | Promise<FloPay> | null;
71
- paypalFlopay: FloPay | Promise<FloPay> | null;
72
- options: {
73
- billingApiUrl?: string;
74
- };
75
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
76
- export {};
@@ -1,44 +0,0 @@
1
- import { type PaymentAPI } from '@flopay/js';
2
- import type { CheckoutSession, NormalizedCheckoutSession, PaymentResult } from '@flopay/shared';
3
- import { FloPayError } from '@flopay/shared';
4
- /**
5
- * The saved-payment charge shared by `FloPayAutomaticPaymentButton` and
6
- * `FloPayCheckout`'s `confirm` / `auto` modes (React's saved-payment flow):
7
- * the session-scoped `/process` with no client-built `tokenizedData`, the
8
- * backend-owned 3DS challenge (one `/3ds/complete`, then the `/status`
9
- * reconcile) and the async `202` status follow-up. No browser payment
10
- * provider is loaded. Framework-free, so both Vue surfaces run the same code.
11
- */
12
- /** Success overlay hold before the completion callback (React's `PROCESSING_OVERLAY_SUCCESS_DELAY_MS`). */
13
- export declare const SAVED_PAYMENT_SUCCESS_DELAY_MS = 600;
14
- /** Whether the checkout reached a buyer-success terminal state. */
15
- export declare function isTerminalSuccess(session: CheckoutSession | null | undefined): session is CheckoutSession & {
16
- status: 'authorized' | 'complete';
17
- };
18
- /** React's `buildAuthorizedOrSucceededResult`: the merchant-facing terminal result. */
19
- export declare function terminalResult(session: CheckoutSession, sessionId: string | null): PaymentResult;
20
- export declare function readErrorCode(error: unknown): string | undefined;
21
- /** Any thrown value as a {@link FloPayError}, keeping a string `code` when it has one. */
22
- export declare function coerceError(error: unknown, fallback: string): FloPayError;
23
- export interface ChargeSavedPaymentOptions {
24
- api: PaymentAPI;
25
- billingApiUrl: string;
26
- /** The open (not terminal, not expired) session to charge. */
27
- session: CheckoutSession;
28
- /** Session-bound checkout token; defaults to the session's `clientSecret`. */
29
- nonce?: string;
30
- /**
31
- * The session read the session came from. When the backend's auto-checkout
32
- * already ran, its pending status URL (a `202`) or its challenge is followed
33
- * instead of posting `/process` again.
34
- */
35
- unified?: NormalizedCheckoutSession | null;
36
- /** Tears down an open 3DS challenge and its status poll (unmount). */
37
- signal?: AbortSignal;
38
- }
39
- /**
40
- * Charge the buyer's saved payment method for `session`. Resolves with the
41
- * merchant-facing result; rejects with a {@link FloPayError} (a challenge
42
- * cancelled through `signal` rejects with code `three_ds_aborted`).
43
- */
44
- export declare function chargeSavedPayment(options: ChargeSavedPaymentOptions): Promise<PaymentResult>;