@flopay/react 1.14.4 → 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.
Files changed (46) hide show
  1. package/README.md +50 -2
  2. package/dist/automatic-payment-button.d.ts +81 -0
  3. package/dist/buyer-identity-fallback.d.ts +43 -0
  4. package/dist/card-button-content.d.ts +11 -0
  5. package/dist/card-setup-entry.d.ts +10 -104
  6. package/dist/card-setup-surface.d.ts +12 -0
  7. package/dist/card-setup-theme.d.ts +32 -0
  8. package/dist/checkout-utils.d.ts +163 -0
  9. package/dist/context.d.ts +46 -0
  10. package/dist/direct-paypal-button.d.ts +155 -0
  11. package/dist/error-banner.d.ts +21 -0
  12. package/dist/external-method-recovery.d.ts +1 -0
  13. package/dist/external-method-telemetry.d.ts +17 -0
  14. package/dist/{card-setup-entry.d.cts → flopay-card-setup.d.ts} +19 -11
  15. package/dist/flopay-checkout.d.ts +239 -0
  16. package/dist/flopay-payment-method-setup-main.d.ts +10 -0
  17. package/dist/flopay-payment-method-setup.d.ts +11 -0
  18. package/dist/hooks.d.ts +36 -0
  19. package/dist/in-app-browser.d.ts +5 -0
  20. package/dist/index.d.ts +20 -921
  21. package/dist/inline-session-cache.d.ts +1 -0
  22. package/dist/instruments.d.ts +5 -0
  23. package/dist/merchant-callback.d.ts +1 -0
  24. package/dist/payment-logos.generated.d.ts +1 -0
  25. package/dist/payment-method-setup-advertisement.d.ts +36 -0
  26. package/dist/payment-method-setup-entry.d.ts +12 -14
  27. package/dist/payment-method-setup-paypal.d.ts +25 -0
  28. package/dist/payment-method-setup-stripe.d.ts +31 -0
  29. package/dist/{payment-method-setup-surface-DWGNLM0I.d.cts → payment-method-setup-surface.d.ts} +27 -9
  30. package/dist/popup-capability.d.ts +12 -0
  31. package/dist/processing-overlay.d.ts +33 -0
  32. package/dist/provider.d.ts +40 -0
  33. package/dist/recent-completion.d.ts +1 -0
  34. package/dist/run-latest-abortable-action.d.ts +5 -0
  35. package/dist/saved-payment-flow.d.ts +124 -0
  36. package/dist/split-card-form.d.ts +319 -0
  37. package/dist/stripe-method-presentation.d.ts +115 -0
  38. package/dist/telemetry-bridge.d.ts +41 -0
  39. package/dist/use-external-attempt-reconciliation.d.ts +27 -0
  40. package/dist/use-isomorphic-layout-effect.d.ts +3 -0
  41. package/dist/vault-card-fields.d.ts +95 -0
  42. package/dist/vault-theme.d.ts +1 -0
  43. package/package.json +6 -6
  44. package/dist/index.d.cts +0 -921
  45. package/dist/payment-method-setup-entry.d.cts +0 -16
  46. package/dist/payment-method-setup-surface-B9TI-00C.d.ts +0 -72
@@ -0,0 +1 @@
1
+ export { clearCachedInlineCheckout, clearCachedInlineSession, hashCreateParams, legacyCachedSessionMatchesDraft, persistCachedInlineIdempotencyKey, persistCachedInlineSession, readCachedInlineIdempotencyKey, readCachedInlineSession, serializeCreateParams, } from '@flopay/shared';
@@ -0,0 +1,5 @@
1
+ import type { FloInstrumentEvent, FloInstrumentSource } from '@flopay/shared';
2
+ export { FLO_INSTRUMENT_ONCE_NAMES as INSTRUMENT_ONCE_NAMES } from '@flopay/shared';
3
+ export type EmitFloInstrument = (source: FloInstrumentSource) => void;
4
+ /** Dispatch instruments without letting merchant code alter checkout behavior. */
5
+ export declare function useFloInstrumentEmitter(onInstrument: ((event: FloInstrumentEvent) => void) | undefined, deduplicationKey?: string): EmitFloInstrument;
@@ -0,0 +1 @@
1
+ export { invokeMerchantCallback } from '@flopay/shared';
@@ -0,0 +1 @@
1
+ export declare const PAYMENT_METHOD_LOGO_URLS: Record<string, string>;
@@ -0,0 +1,36 @@
1
+ export { clearSetupRedirectParams, readSetupRedirectReturn } from '@flopay/js/card-setup';
2
+ export type { PaymentMethodSetupAdvertisement, SetupOverlayWording } from '@flopay/shared';
3
+ export { advertisedMethodKeys, advertisesAnyMethod, readSetupAdvertisement, setupOverlayLabels, stripeMethodCategory, } from '@flopay/shared';
4
+ /**
5
+ * Callbacks a lazily loaded wallet/APM/PayPal branch reports through. The
6
+ * surface owns every merchant-facing outcome: a branch never reports success
7
+ * itself, only that the provider accepted the method (`onConfirmed`), after
8
+ * which the surface waits for the backend to verify it.
9
+ */
10
+ export interface SetupBranchCallbacks {
11
+ /** The buyer started saving the method. */
12
+ onSubmitting: () => void;
13
+ /** The provider accepted the method; the surface now waits for the backend. */
14
+ onConfirmed: () => void;
15
+ /** The provider terminally declined the method. */
16
+ onDeclined: (event: {
17
+ reason?: string;
18
+ message?: string;
19
+ }) => void;
20
+ /** A technical failure; `retryable` says whether trying again can help. */
21
+ onFailed: (error: unknown, options: {
22
+ code: string;
23
+ retryable: boolean;
24
+ }) => void;
25
+ /** Live validation message, or `null` when it clears. */
26
+ onValidation: (message: string | null) => void;
27
+ /** The buyer left the provider flow without an outcome (not a cancel). */
28
+ onAbandoned: () => void;
29
+ /**
30
+ * The provider cannot offer this method here: a wallet this device does not
31
+ * have, or a method the session's currency does not support. Not a failure.
32
+ * The surface stops offering the method and says nothing, unless it was the
33
+ * last usable one.
34
+ */
35
+ onUnavailable: () => void;
36
+ }
@@ -1,16 +1,14 @@
1
- export { FloPayCardSetupError } from './card-setup-entry.js';
2
- import React from 'react';
3
- import { F as FloPayPaymentMethodSetupProps } from './payment-method-setup-surface-B9TI-00C.js';
4
- export { a as FloPayPaymentMethodSetupCancelEvent, b as FloPayPaymentMethodSetupCompleteEvent, c as FloPayPaymentMethodSetupDeclineEvent } from './payment-method-setup-surface-B9TI-00C.js';
5
- import '@flopay/shared';
6
-
7
1
  /**
8
- * Renders every payment method a setup session advertises — the hosted card
9
- * widget, Stripe wallets/APMs in setup mode, and the PayPal vault flow — and
10
- * saves the buyer's choice without a purchase. The advertisement is the single
11
- * source of truth. A card-only session behaves exactly like `FloPayCardSetup`
12
- * and never requests Stripe.js.
2
+ * Stripe-free entry for the payment-method setup surface
3
+ * (`@flopay/react/payment-method-setup`).
4
+ *
5
+ * The main entry's module graph reaches `@flopay/js`'s Stripe adapter, whose
6
+ * eager `@stripe/stripe-js` import starts downloading Stripe.js at evaluation
7
+ * time. Import `FloPayPaymentMethodSetup` from here instead: a session that
8
+ * advertises only cards (or only PayPal) then never requests Stripe.js, and
9
+ * Stripe loads lazily only when the session advertises a Stripe wallet or APM.
10
+ * The main entry exports the same surface with the same props and callbacks,
11
+ * with its wallet/APM and PayPal branches bound statically instead.
13
12
  */
14
- declare function FloPayPaymentMethodSetup(props: FloPayPaymentMethodSetupProps): React.ReactElement;
15
-
16
- export { FloPayPaymentMethodSetup, FloPayPaymentMethodSetupProps };
13
+ export { FloPayCardSetupError } from './flopay-card-setup.js';
14
+ export { FloPayPaymentMethodSetup, type FloPayPaymentMethodSetupCancelEvent, type FloPayPaymentMethodSetupCompleteEvent, type FloPayPaymentMethodSetupDeclineEvent, type FloPayPaymentMethodSetupProps, } from './flopay-payment-method-setup.js';
@@ -0,0 +1,25 @@
1
+ import type React from 'react';
2
+ import type { SetupBranchCallbacks } from './payment-method-setup-advertisement.js';
3
+ /** Props for the advertised PayPal vault flow (save PayPal without a purchase). */
4
+ export interface PayPalSetupMethodProps extends SetupBranchCallbacks {
5
+ clientId: string;
6
+ environment?: string;
7
+ /** The setup session's own currency, when the read carries one. A vault flow needs none. */
8
+ currency?: string;
9
+ sessionId: string;
10
+ nonce: string;
11
+ billingApiUrl: string;
12
+ telemetry?: boolean;
13
+ /** The setup session's customer, forwarded as checkout forwards it. */
14
+ customer: {
15
+ userId: string;
16
+ email: string;
17
+ };
18
+ }
19
+ /**
20
+ * Renders PayPal's button in vault mode. The click mints a PayPal vault setup
21
+ * token through the session-scoped intents contract (`paypal_vaulted`,
22
+ * `intentKind: 'setup'`); the approval hands the token to the billing API the
23
+ * same way checkout does. The surface then waits for backend verification.
24
+ */
25
+ export declare function PayPalSetupMethod({ clientId, environment, currency, sessionId, nonce, billingApiUrl, telemetry, customer: { userId, email }, onSubmitting, onConfirmed, onFailed, onAbandoned, }: PayPalSetupMethodProps): React.ReactElement;
@@ -0,0 +1,31 @@
1
+ import type { ButtonsLayoutStyles, CardSetupFutureUse, FloPayAppearance, FutureUseUnsupportedMethod, ThemeId } from '@flopay/shared';
2
+ import type React from 'react';
3
+ import type { SetupBranchCallbacks } from './payment-method-setup-advertisement.js';
4
+ /** Props for one advertised Stripe wallet/APM in setup mode. */
5
+ export interface StripeSetupMethodProps extends SetupBranchCallbacks {
6
+ method: string;
7
+ category: 'wallet' | 'apm';
8
+ publishableKey: string;
9
+ currency: string;
10
+ /**
11
+ * The usage the billing API set the session up for, from the session read's
12
+ * `futureUse`. Declared to Stripe as `setupFutureUsage` (through
13
+ * `resolveSetupFutureUsage`) so Elements collect for what the SetupIntent is
14
+ * configured for. Absent when the read does not carry it: nothing is
15
+ * declared then, and the SDK never picks a usage.
16
+ */
17
+ futureUse?: CardSetupFutureUse | null;
18
+ /** The read's `futureUseUnsupported`: a listed method declares no usage. */
19
+ futureUseUnsupported?: FutureUseUnsupportedMethod[];
20
+ sessionId: string;
21
+ nonce: string;
22
+ billingApiUrl: string;
23
+ telemetry?: boolean;
24
+ appearance?: FloPayAppearance;
25
+ /** The surface's theme id, for the method tile's brand variant. */
26
+ themeId?: ThemeId | null;
27
+ /** The theme bundle's wrapper styles, for the tile and the save button. */
28
+ buttonsLayout?: ButtonsLayoutStyles;
29
+ }
30
+ /** Renders one advertised Stripe wallet/APM and saves it without a charge. */
31
+ export declare function StripeSetupMethod(props: StripeSetupMethodProps): React.ReactElement;
@@ -1,15 +1,25 @@
1
- import { ThemeId, VaultCardThemeColors, FloPayAppearance, ButtonsLayoutStyles } from '@flopay/shared';
1
+ import type { ButtonsLayoutStyles, FloPayAppearance, ThemeId, VaultCardThemeColors } from '@flopay/shared';
2
2
  import React from 'react';
3
- import { FloPayCardSetupCompleteEvent, FloPayCardSetupDeclineEvent, FloPayCardSetupCancelEvent, FloPayCardSetupError } from './card-setup-entry.cjs';
4
-
3
+ import { type FloPayCardSetupCancelEvent, type FloPayCardSetupCompleteEvent, type FloPayCardSetupDeclineEvent, type FloPayCardSetupError } from './flopay-card-setup.js';
4
+ import type { PayPalSetupMethodProps } from './payment-method-setup-paypal.js';
5
+ import type { StripeSetupMethodProps } from './payment-method-setup-stripe.js';
6
+ /**
7
+ * The Stripe wallet/APM and PayPal branch components the surface renders. Either
8
+ * the modules' own exports or `React.lazy` wrappers around them: the surface
9
+ * renders both inside a `Suspense` and a load-failure boundary.
10
+ */
11
+ export interface PaymentMethodSetupBranches {
12
+ StripeSetupMethod: React.ComponentType<StripeSetupMethodProps>;
13
+ PayPalSetupMethod: React.ComponentType<PayPalSetupMethodProps>;
14
+ }
5
15
  /** Verified terminal result from a no-charge payment-method setup. */
6
- type FloPayPaymentMethodSetupCompleteEvent = FloPayCardSetupCompleteEvent;
16
+ export type FloPayPaymentMethodSetupCompleteEvent = FloPayCardSetupCompleteEvent;
7
17
  /** Provider-neutral terminal decline from payment-method verification. */
8
- type FloPayPaymentMethodSetupDeclineEvent = FloPayCardSetupDeclineEvent;
18
+ export type FloPayPaymentMethodSetupDeclineEvent = FloPayCardSetupDeclineEvent;
9
19
  /** Abandoned setup result emitted when the surface unmounts pre-terminally. */
10
- type FloPayPaymentMethodSetupCancelEvent = FloPayCardSetupCancelEvent;
20
+ export type FloPayPaymentMethodSetupCancelEvent = FloPayCardSetupCancelEvent;
11
21
  /** Props for the browser-only payment-method setup surface. */
12
- interface FloPayPaymentMethodSetupProps {
22
+ export interface FloPayPaymentMethodSetupProps {
13
23
  /** Opaque id returned by the merchant-authenticated setup-session endpoint. */
14
24
  sessionId: string;
15
25
  /** Session-bound token returned alongside {@link FloPayPaymentMethodSetupProps.sessionId}. */
@@ -68,5 +78,13 @@ interface FloPayPaymentMethodSetupProps {
68
78
  /** Fired for session validation, transport, provider or widget failures. */
69
79
  onError?: (error: FloPayCardSetupError) => void;
70
80
  }
71
-
72
- export type { FloPayPaymentMethodSetupProps as F, FloPayPaymentMethodSetupCancelEvent as a, FloPayPaymentMethodSetupCompleteEvent as b, FloPayPaymentMethodSetupDeclineEvent as c };
81
+ /**
82
+ * Renders every payment method a setup session advertises — the hosted card
83
+ * widget, Stripe wallets/APMs in setup mode, and the PayPal vault flow — and
84
+ * saves the buyer's choice without a purchase. The advertisement is the single
85
+ * source of truth. `FloPayPaymentMethodSetup` is this surface with its branch
86
+ * components bound; see the module header for which entry binds which.
87
+ */
88
+ export declare function PaymentMethodSetupSurface({ branches: { StripeSetupMethod, PayPalSetupMethod }, sessionId, nonce, billingApiUrl, telemetry, theme, containerStyle, appearance, buttonsStyles, loading, onReady, onComplete, onDecline, onCancel, onValidation, onError, }: FloPayPaymentMethodSetupProps & {
89
+ branches: PaymentMethodSetupBranches;
90
+ }): React.ReactElement;
@@ -0,0 +1,12 @@
1
+ import type { TelemetryPopupCapability } from '@flopay/shared';
2
+ export interface PopupCapabilityOwner {
3
+ current(): TelemetryPopupCapability;
4
+ /** Returns true only when this observation changed the current capability. */
5
+ markAvailable(): boolean;
6
+ /** Returns true only when this observation changed the current capability. */
7
+ markBlocked(): boolean;
8
+ }
9
+ /** Internal checkout-mount owner shared with nested external-method surfaces. */
10
+ export declare const PopupCapabilityContext: import("react").Context<PopupCapabilityOwner | null>;
11
+ /** Creates the monotonic capability state owned by one checkout mount. */
12
+ export declare function createPopupCapabilityOwner(): PopupCapabilityOwner;
@@ -0,0 +1,33 @@
1
+ import type React from 'react';
2
+ export type OverlayStatus = 'processing' | 'success' | 'error';
3
+ export declare const PROCESSING_OVERLAY_SUCCESS_DELAY_MS = 600;
4
+ export declare const PROCESSING_OVERLAY_ERROR_DELAY_MS = 400;
5
+ /**
6
+ * Optional visual treatment for the overlay. Absent, the modal keeps its
7
+ * historical neutral look (white panel, gray/indigo spinner, green/red labels).
8
+ */
9
+ export interface ProcessingOverlayTheme {
10
+ /** Panel surface (background, border, radius, shadow) plus base text color and font. */
11
+ panel: React.CSSProperties;
12
+ spinnerTrackColor: string;
13
+ spinnerAccentColor: string;
14
+ labelColors: Record<OverlayStatus, string>;
15
+ /** Secondary copy: the success note and the failure message. */
16
+ noteColor: string;
17
+ }
18
+ export declare function ProcessingOverlay({ status, errorMessage, authorized, processingLabel, successLabel, errorLabel, successNote, theme, }: {
19
+ status: OverlayStatus;
20
+ errorMessage?: string | null;
21
+ /** Labels a successful authorization hold without implying that funds settled. */
22
+ authorized?: boolean;
23
+ /** Override the spinner label for non-payment surfaces (e.g. card setup). */
24
+ processingLabel?: string;
25
+ /** Override the success label; defaults to the payment wording (authorized-aware). */
26
+ successLabel?: string;
27
+ /** Override the failure label for non-payment surfaces. */
28
+ errorLabel?: string;
29
+ /** Success sub-note; pass `null` to omit (surfaces that do not redirect). */
30
+ successNote?: string | null;
31
+ /** Preset treatment (card setup); omit for the neutral modal. */
32
+ theme?: ProcessingOverlayTheme;
33
+ }): React.JSX.Element;
@@ -0,0 +1,40 @@
1
+ import type { FloPay } from '@flopay/js';
2
+ import type { FloInstrumentEvent } from '@flopay/shared';
3
+ import type React from 'react';
4
+ /** Props for the `FloPayProvider` component. */
5
+ export interface FloPayProviderProps {
6
+ /** A `FloPay` instance or a promise that resolves to one (from `loadFloPay()`). */
7
+ flopay: Promise<FloPay> | FloPay | null;
8
+ /**
9
+ * Optional Stripe `FloPay` instance used to drive the Stripe-rendered PayPal
10
+ * fallback. When omitted or `null`, the Stripe-rendered PayPal button is
11
+ * not rendered. Direct PayPal (`gateways.paypal`) does not use this prop.
12
+ */
13
+ paypalFlopay?: Promise<FloPay> | FloPay | null;
14
+ /** Optional provider configuration. */
15
+ options?: {
16
+ /** Billing API base URL. Set once here so child components don't need to repeat it. */
17
+ billingApiUrl?: string;
18
+ };
19
+ /** Receives the versioned, privacy-safe checkout instrument feed. */
20
+ onInstrument?: (event: FloInstrumentEvent) => void;
21
+ children: React.ReactNode;
22
+ }
23
+ /**
24
+ * Provides FloPay SDK context to the component tree.
25
+ *
26
+ * Wrap components that consume FloPay context with this provider:
27
+ *
28
+ * ```tsx
29
+ * <FloPayProvider flopay={loadFloPay('pk_test_...')}>
30
+ * <YourCheckout />
31
+ * </FloPayProvider>
32
+ * ```
33
+ *
34
+ * `FloPayCheckout` is a standalone integration that owns its provider:
35
+ *
36
+ * ```tsx
37
+ * <FloPayCheckout sessionId="sess_..." />
38
+ * ```
39
+ */
40
+ export declare function FloPayProvider({ flopay: floPayProp, paypalFlopay: paypalFloPayProp, options, onInstrument, children, }: FloPayProviderProps): React.ReactElement;
@@ -0,0 +1 @@
1
+ export { markSessionRecentlyCompleted, wasSessionRecentlyCompleted } from '@flopay/shared';
@@ -0,0 +1,5 @@
1
+ type AbortControllerRef = {
2
+ current: AbortController | null;
3
+ };
4
+ export declare function runLatestAbortableAction<T>(controllerRef: AbortControllerRef, action: (signal: AbortSignal) => Promise<T>): Promise<T>;
5
+ export {};
@@ -0,0 +1,124 @@
1
+ import type { FloPay, SavedCardChallengeInput, SavedCardChallengeOutcome } from '@flopay/js';
2
+ import type { CheckoutButtonMethod, CheckoutProcessError, CheckoutSession, NormalizedCheckoutSession, PaymentResult, TelemetryExpectedOutcome, TelemetryFailureCategory, TelemetryRequestCategory, TokenizedBody } from '@flopay/shared';
3
+ import { FloPayError } from '@flopay/shared';
4
+ export declare const DEFAULT_SAVED_PAYMENT_DECLINE_METHOD: CheckoutButtonMethod;
5
+ export type ProcessRedirectResult = {
6
+ type: 'paypal_redirect_required' | '3ds_required';
7
+ threeDSecureToken: string;
8
+ paymentMethodId?: string;
9
+ };
10
+ export type ProviderNeutralNextAction = {
11
+ type: 'next_action_required';
12
+ nextActionRedirectUrl: string;
13
+ };
14
+ export type SavedPaymentProcessResult = ProcessRedirectResult | ProviderNeutralNextAction | {
15
+ type: 'success';
16
+ result: PaymentResult;
17
+ };
18
+ export type SavedPaymentFlowError = FloPayError & {
19
+ checkoutMethod?: CheckoutButtonMethod;
20
+ /** Fresh PayPal Order/Subscription id retained for direct approval recovery. */
21
+ orderId?: string;
22
+ telemetryFailureCategory?: TelemetryFailureCategory;
23
+ telemetryOutcome?: Extract<TelemetryExpectedOutcome, 'payment_declined' | 'validation_rejected'>;
24
+ telemetryRequestCategory?: TelemetryRequestCategory;
25
+ };
26
+ /** Build the cancellation sentinel consumed by lifecycle-bound React payment flows. */
27
+ export declare function createThreeDsAbortedError(cause?: unknown): FloPayError;
28
+ export declare function getRedirectResultFromCheckoutProcessError(error?: CheckoutProcessError | null): ProcessRedirectResult | null;
29
+ /**
30
+ * The saved-card 3DS challenge runner lives once, in `@flopay/js`
31
+ * (TeamFloPay/sdk#410, CTO decision 1): `@flopay/react` and `@flopay/vue` both
32
+ * use it. It renders the provider-hosted challenge in a modal overlay, accepts
33
+ * the `flopay-vault-3ds-return` message only from the challenge frame and the
34
+ * billing API origin, and then drives `/3ds/complete`.
35
+ */
36
+ export type AutoCheckoutThreeDsOutcome = SavedCardChallengeOutcome;
37
+ /** React's name for the shared `@flopay/js` saved-card challenge runner. */
38
+ export declare function runAutoCheckoutThreeDsChallenge(input: SavedCardChallengeInput): Promise<AutoCheckoutThreeDsOutcome>;
39
+ type ProviderNeutralActionInput = {
40
+ billingApiUrl: string;
41
+ sessionId: string;
42
+ nonce?: string;
43
+ session: CheckoutSession;
44
+ signal: AbortSignal;
45
+ /**
46
+ * Record an unfinished challenge in SDK telemetry. Components that own their
47
+ * telemetry for this flow (FloPayCheckout) leave it off.
48
+ */
49
+ telemetry?: boolean;
50
+ };
51
+ /** Complete a backend-owned saved-card challenge without loading a browser payment provider. */
52
+ export declare function completeProviderNeutralSavedPaymentAction(action: ProviderNeutralNextAction, input: ProviderNeutralActionInput): Promise<PaymentResult>;
53
+ export declare function checkoutProcessErrorToFloPayError(error?: CheckoutProcessError | null, fallbackMessage?: string, options?: {
54
+ checkoutMethod?: CheckoutButtonMethod;
55
+ }): SavedPaymentFlowError;
56
+ export declare function processSavedPaymentForMode({ billingApiUrl, sessionId, session, nonce, tokenizedData, returnUrl, telemetry, }: {
57
+ billingApiUrl: string;
58
+ sessionId?: string | null;
59
+ session: CheckoutSession;
60
+ /**
61
+ * Session-bound checkout token. Defaults to `session.clientSecret`, but
62
+ * callers that resolved the session via a GET (which doesn't echo the nonce)
63
+ * must pass it explicitly so `/process` and 3DS recovery stay authorized.
64
+ */
65
+ nonce?: string;
66
+ tokenizedData?: TokenizedBody;
67
+ returnUrl?: string;
68
+ /** Disable the JS reporter when an enclosing React operation owns telemetry. */
69
+ telemetry?: boolean;
70
+ }): Promise<SavedPaymentProcessResult>;
71
+ export declare function handleSavedPaymentRedirectResult(redirectResult: ProcessRedirectResult, { flopay, paypalFlopay, attempt3DS, billingApiUrl, sessionId, session, returnUrl, telemetry, signal, }: {
72
+ flopay: FloPay | null;
73
+ paypalFlopay: FloPay | null;
74
+ attempt3DS?: boolean;
75
+ billingApiUrl: string;
76
+ sessionId?: string | null;
77
+ session: CheckoutSession;
78
+ returnUrl?: string;
79
+ /** Disable nested JS reporting when the enclosing React recovery owns telemetry. */
80
+ telemetry?: boolean;
81
+ /** Lifecycle-bound cancellation for any provider-neutral follow-up challenge. */
82
+ signal: AbortSignal;
83
+ }): Promise<PaymentResult>;
84
+ export declare function normalizeSavedPaymentError(err: unknown): SavedPaymentFlowError;
85
+ /**
86
+ * Resolve the generic, provider-agnostic payment method id for a card already
87
+ * on file for a returning customer, or `null` when none is present.
88
+ *
89
+ * For the vault flow (TeamFloPay/backend#823) the backend attaches a generic
90
+ * `providerPaymentMethodId` to the session when a card is on file. The id is
91
+ * opaque to the SDK — Stripe behind the vault returns a `pm_…`, but other card
92
+ * providers can return their own token. Under the Model-A hosted-widget flow
93
+ * the backend's auto-checkout cascade owns returning-customer charging; this
94
+ * helper remains for callers that surface "card on file" affordances.
95
+ */
96
+ export declare function resolveReturningCustomerPaymentMethodId(session: CheckoutSession): string | null;
97
+ /**
98
+ * Stripe Elements publishable keys resolved from a normalized session. The
99
+ * "PayPal" entry here refers to the legacy Stripe-rendered PayPal account
100
+ * (`gateways.stripe`'s dedicated PayPal sub-account), not the new direct
101
+ * PayPal gateway — direct PayPal lives in `gateways.paypal` and is rendered
102
+ * via the official PayPal JS SDK rather than through Stripe Elements.
103
+ *
104
+ * PayPal-only and hosted-vault-only sessions have no Stripe publishable key;
105
+ * callers should skip Stripe Elements entirely. A server-side card gateway
106
+ * (Worldpay) is a hosted-vault surface even when the read omitted its embedded
107
+ * block, which the card form recovers from `/vault/capture`. Only throws when
108
+ * the session advertises no supported payment surface at all.
109
+ */
110
+ export declare function resolveSavedPaymentPublishableKeys(unified: NormalizedCheckoutSession): {
111
+ publishableKey?: string;
112
+ paypalPublishableKey?: string;
113
+ };
114
+ export declare function loadSavedPaymentProviders({ publishableKey, paypalPublishableKey, billingApiUrl, locale, telemetry, }: {
115
+ publishableKey?: string;
116
+ paypalPublishableKey?: string;
117
+ billingApiUrl: string;
118
+ locale?: string;
119
+ telemetry?: boolean;
120
+ }): Promise<{
121
+ flopay: FloPay | null;
122
+ paypalFlopay: FloPay | null;
123
+ }>;
124
+ export {};