@flopay/shared 1.11.5 → 1.12.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.
package/dist/index.d.ts CHANGED
@@ -2041,6 +2041,16 @@ interface CountryOption {
2041
2041
  flag: string;
2042
2042
  }
2043
2043
 
2044
+ /** The buyer-facing name of a checkout button method ("Card" for anything unknown). */
2045
+ declare function getButtonMethodLabel(method: CheckoutButtonMethod): string;
2046
+ /**
2047
+ * A value thrown by a merchant's before-click hook, as the `FloPayError` the
2048
+ * checkout shows and reports: a `FloPayError` is kept, an `Error` keeps its
2049
+ * message, anything else becomes "<Method> before-click hook failed.". All are
2050
+ * `validation_error`s unless the hook threw a `FloPayError` of its own.
2051
+ */
2052
+ declare function normalizeBeforeButtonClickError(method: CheckoutButtonMethod, err: unknown): FloPayError;
2053
+
2044
2054
  /**
2045
2055
  * Whether a read session is safe to mount in a no-charge card-setup surface.
2046
2056
  * Both the explicit setup mode and the empty, zero-amount cart are required so
@@ -2048,6 +2058,162 @@ interface CountryOption {
2048
2058
  */
2049
2059
  declare function isCardSetupCheckoutSession(session: CheckoutSession): boolean;
2050
2060
 
2061
+ /** The states of the processing / outcome modal a setup surface draws. */
2062
+ type ProcessingOverlayStatus = 'processing' | 'success' | 'error';
2063
+ /**
2064
+ * Visual treatment for the processing / outcome modal. Framework-free: the
2065
+ * panel is a plain style object, so every UI binding draws the same modal
2066
+ * from one derivation (TeamFloPay/sdk#410, CTO decision 1).
2067
+ */
2068
+ interface ProcessingOverlayThemeColors {
2069
+ /** Panel surface (background, border, radius, shadow) plus base text color and font. */
2070
+ panel: Record<string, string | number>;
2071
+ spinnerTrackColor: string;
2072
+ spinnerAccentColor: string;
2073
+ labelColors: Record<ProcessingOverlayStatus, string>;
2074
+ /** Secondary copy: the success note and the failure message. */
2075
+ noteColor: string;
2076
+ }
2077
+ /**
2078
+ * The resolved look an overlay is drawn from: a preset bundle, or the
2079
+ * effective appearance and buttons layout once a stored theme's overrides are
2080
+ * merged over it. A `ThemeBundle` is one.
2081
+ */
2082
+ interface CardSetupOverlaySource {
2083
+ appearance?: FloPayAppearance | undefined;
2084
+ buttonsLayout: ButtonsLayoutStyles;
2085
+ }
2086
+ /**
2087
+ * The card-setup processing / success / error modal for a named preset (or a
2088
+ * stored theme resolved over one): the panel reuses the credit-card pane
2089
+ * surface and typography; processing wears the primary on the spinner; success
2090
+ * and error keep semantic accents. A missing appearance reads as an empty one,
2091
+ * which resolves to the neutral light defaults.
2092
+ */
2093
+ declare function computeCardSetupOverlayTheme({ appearance, buttonsLayout, }: CardSetupOverlaySource): ProcessingOverlayThemeColors;
2094
+
2095
+ /**
2096
+ * Surface treatment for the card-setup container — the same complete
2097
+ * `cardFormContainer` look the checkout's credit-card pane wears for a preset —
2098
+ * merged beneath the merchant's `containerStyle` with deterministic precedence:
2099
+ *
2100
+ * 1. Every `containerStyle` property wins over the preset value for the same
2101
+ * property.
2102
+ * 2. Declarations are applied preset-first, then `containerStyle` in the
2103
+ * merchant's own order, so a `containerStyle` longhand refines a preset
2104
+ * shorthand of the same family (`borderColor` recolors the preset `border`;
2105
+ * `paddingTop` adjusts one side) exactly as CSS cascades a later declaration.
2106
+ * 3. Background is the one family a longhand cannot refine: a color cannot
2107
+ * displace a preset gradient's image layer. Any `background*` member in
2108
+ * `containerStyle` therefore replaces the preset's background family
2109
+ * entirely, so a merchant color never shows a glass gradient through it.
2110
+ *
2111
+ * Raw `VaultCardThemeColors` supply no surface, and neither does `classic`
2112
+ * unless a stored `buttonsStyles.cardFormContainer` is given (sdk#447); without
2113
+ * a surface `containerStyle` applies alone — byte-for-byte the released behavior.
2114
+ *
2115
+ * Framework-free (any style-object type), so every UI binding merges the same
2116
+ * way (TeamFloPay/sdk#410, CTO decision 1).
2117
+ */
2118
+ declare function mergeCardSetupSurface<Style extends object>(surface: Style | undefined, containerStyle: Style | undefined): Style | undefined;
2119
+
2120
+ /**
2121
+ * Merge a `buttonsStyles` override over a base buttons layout exactly as
2122
+ * `FloPayCheckout` (its `SplitCardForm`) does: top-level members replace the
2123
+ * base's, and each style group in {@link MERGED_BUTTONS_GROUPS} merges property
2124
+ * by property. A group that is not an object (malformed persisted data) is
2125
+ * ignored rather than spread, so it can never throw or leak junk keys.
2126
+ */
2127
+ declare function mergeButtonsStyles(base: ButtonsLayoutStyles, override: ButtonsLayoutStyles | undefined): ButtonsLayoutStyles;
2128
+ /** Inputs for {@link resolveCardSetupTheme}: the `FloPayCardSetup` theming props. */
2129
+ interface CardSetupThemeSource {
2130
+ theme: ThemeId | VaultCardThemeColors;
2131
+ appearance?: FloPayAppearance | undefined;
2132
+ buttonsStyles?: ButtonsLayoutStyles | undefined;
2133
+ }
2134
+ /** Everything the card-setup surface paints, resolved from one stored theme. */
2135
+ interface CardSetupThemeResolution {
2136
+ /**
2137
+ * The hosted-widget directive: computed colors, raw colors passed through
2138
+ * untouched, or `null` — the explicit classic reset.
2139
+ */
2140
+ vaultTheme: VaultCardThemeColors | null;
2141
+ /** The pane surface laid beneath the merchant's `containerStyle`, if any. */
2142
+ surface: Record<string, string | number> | undefined;
2143
+ /** The outcome overlay's theme; `undefined` keeps the neutral modal. */
2144
+ overlayTheme: ProcessingOverlayThemeColors | undefined;
2145
+ }
2146
+ /**
2147
+ * Resolve the card-setup theming props the same way `FloPayCheckout` resolves
2148
+ * its own, so one stored theme (`themePreset` → `theme`, plus `appearance` and
2149
+ * `buttonsStyles`) renders the hosted card form identically on both surfaces:
2150
+ *
2151
+ * - An `appearance` override replaces the preset's appearance outright.
2152
+ * - `buttonsStyles` merges over the preset's buttons layout
2153
+ * ({@link mergeButtonsStyles}).
2154
+ * - `'classic'` only means "no bundle base": overrides still apply over the
2155
+ * default (empty) layout, and with none it keeps the historic `null` reset,
2156
+ * no surface and the neutral overlay.
2157
+ * - Raw `VaultCardThemeColors` pass through untouched; overrides are ignored.
2158
+ * - Empty override groups count as absent; an unknown preset id resolves to
2159
+ * `modern-light`.
2160
+ *
2161
+ * The effective appearance and layout drive all four outputs: the hosted field
2162
+ * colors and font, the hosted submit snapshot, the container surface and the
2163
+ * outcome overlay.
2164
+ */
2165
+ declare function resolveCardSetupTheme({ theme, appearance, buttonsStyles, }: CardSetupThemeSource): CardSetupThemeResolution;
2166
+
2167
+ /**
2168
+ * The PayPal gateway fields the direct PayPal button needs: the session's
2169
+ * `gateways.paypal`, or the normalized `data.paypal` copy of it.
2170
+ */
2171
+ interface DirectPayPalGatewaySource {
2172
+ /** The PayPal client id. */
2173
+ publishableKey?: string | null;
2174
+ environment?: GatewayEnvironment;
2175
+ providerObjectType?: PayPalProviderObjectType;
2176
+ approvalPresentation?: PayPalApprovalPresentation;
2177
+ }
2178
+ /** What the checkout hands its card form as `directPaypal`. */
2179
+ interface DirectPayPalConfig {
2180
+ clientId: string;
2181
+ environment?: GatewayEnvironment;
2182
+ providerObjectType?: PayPalProviderObjectType;
2183
+ approvalPresentation?: PayPalApprovalPresentation;
2184
+ existingOrderId?: string;
2185
+ }
2186
+ /**
2187
+ * The direct PayPal config for a session's PayPal gateway: its
2188
+ * `publishableKey` is the PayPal client id, and `existingOrderId` is an order
2189
+ * to resume instead of creating one. `undefined` when the gateway has no
2190
+ * client id.
2191
+ */
2192
+ declare function resolveDirectPaypalConfig(paypal: DirectPayPalGatewaySource | null | undefined, existingOrderId?: string): DirectPayPalConfig | undefined;
2193
+ /**
2194
+ * The buyer-country gate on the Stripe methods outside the wallet row (iDEAL,
2195
+ * Bancontact, …). The buyer's live country (the AVS select, else the static
2196
+ * `country`) is matched against `enabledPaymentMethodCountries`: a method
2197
+ * without an entry, or with an empty list, has no gate. Without the map, the
2198
+ * built-in country table ({@link filterStripeMethodsByCountry}) decides. With
2199
+ * no country, nothing is filtered and `methods` is returned as it is.
2200
+ */
2201
+ declare function filterStripeMethodsByCountryGate(methods: string[], country: string | null | undefined, enabledPaymentMethodCountries: Record<string, string[]> | undefined): string[];
2202
+ /**
2203
+ * Whether the session can route cards to a gateway the billing API processes
2204
+ * entirely server-side behind the hosted vault form — today the Worldpay
2205
+ * Corporate Gateway (TeamFloPay/backend#1563). Such a gateway has no browser
2206
+ * runtime or credentials, and its payment references are not Stripe objects.
2207
+ */
2208
+ declare function hasServerSideCardGateway(session: CheckoutSession | null | undefined): boolean;
2209
+ /**
2210
+ * Whether an open session can recover its hosted card form from
2211
+ * `/vault/capture` when the read omitted the embedded block. A server-side
2212
+ * card gateway is the explicit card capability; a terminal session has no
2213
+ * form left to recover.
2214
+ */
2215
+ declare function canRecoverHostedCardForm(session: CheckoutSession | null | undefined): boolean;
2216
+
2051
2217
  /** Returns whether a checkout deliberately stops after placing an authorization hold. */
2052
2218
  declare function isAuthorizationOnlySession(session?: {
2053
2219
  captureMethod?: CaptureMethod;
@@ -2147,6 +2313,62 @@ declare function buildItemPayload(item: CheckoutItem, sessionCurrency: string):
2147
2313
  */
2148
2314
  declare function buildSubscriptionPayload(subscription: CheckoutSubscription, sessionCurrency: string): Record<string, unknown>;
2149
2315
 
2316
+ /**
2317
+ * The `/process` request a checkout form sends when it continues a tokenized
2318
+ * payment itself (React's `SplitCardForm` `processPaymentInternal`, moved here
2319
+ * so every UI binding sends the same billing fields and analytics metadata).
2320
+ */
2321
+ /** The billing inputs a checkout form holds when it posts `/process`. */
2322
+ interface CheckoutProcessAvsInput {
2323
+ /** The resolved AVS config (`resolveAVSConfig(enableAVS)`), or none when AVS is off. */
2324
+ avsConfig: AVSFieldConfig | null | undefined;
2325
+ /** The buyer's selected billing country (ISO 3166-1 alpha-2). */
2326
+ country: string;
2327
+ zip?: string | null;
2328
+ city?: string | null;
2329
+ state?: string | null;
2330
+ addressLine1?: string | null;
2331
+ addressLine2?: string | null;
2332
+ }
2333
+ /** The analytics metadata a checkout form adds to its `/process` request. */
2334
+ interface CheckoutProcessMetadataInput extends CheckoutProcessAvsInput {
2335
+ /** The form's `chv` prop, forwarded as is. */
2336
+ chv?: string;
2337
+ /** Whether AVS was enabled (the form's `avsCheck` prop). Sent as `false` when not set. */
2338
+ avsCheck?: boolean;
2339
+ /** `standard_checkout` or `embedded_checkout`. */
2340
+ checkoutType?: string;
2341
+ /** `default_layout`, `buttons_layout` or `custom_layout`. */
2342
+ checkoutLayout?: string;
2343
+ }
2344
+ type ProcessAccountAddress = Pick<ProcessPaymentParams['accountData'], 'country' | 'zip' | 'city' | 'state' | 'addressLine1' | 'addressLine2'>;
2345
+ /**
2346
+ * The address part of `/process`'s `accountData`: nothing without AVS.
2347
+ * With AVS, the country and each field that is visible for that country and
2348
+ * filled. When line 1 is collected but the state is hidden, the state is
2349
+ * derived from the postcode (US/CA) so the provider's AVS still gets one.
2350
+ */
2351
+ declare function buildProcessPaymentAvsAccount(input: CheckoutProcessAvsInput): ProcessAccountAddress;
2352
+ /**
2353
+ * Which AVS fields were actually shown for the buyer's country, for
2354
+ * analytics. Country-scoped rules (e.g. `['US', 'CA']`) are flattened to
2355
+ * booleans. `undefined` without AVS.
2356
+ */
2357
+ declare function buildProcessPaymentAvsExposure(avsConfig: AVSFieldConfig | null | undefined, country: string): AVSFieldConfig | undefined;
2358
+ /**
2359
+ * The checkout analytics metadata on `/process`, in the order the released
2360
+ * form sends it: `chv`, `avsCheck` (`false` when not set), `checkoutType`,
2361
+ * `checkoutLayout` and the AVS exposure.
2362
+ */
2363
+ declare function buildCheckoutProcessMetadata(input: CheckoutProcessMetadataInput): Pick<ProcessPaymentParams, 'chv' | 'avsCheck' | 'checkoutType' | 'checkoutLayout' | 'avsConfig'>;
2364
+ /** How the checkout is logged: React's `resolveCheckoutLogLayout`. */
2365
+ type CheckoutLogLayout = 'default_layout' | 'buttons_layout' | 'custom_layout';
2366
+ /**
2367
+ * The checkout layout a `FloPayCheckout` reports: `custom_layout` when the
2368
+ * merchant renders its own layout, else the built-in form's layout.
2369
+ */
2370
+ declare function resolveCheckoutLogLayout(hasCustomLayout: boolean, layout: 'default' | 'buttons' | undefined): CheckoutLogLayout;
2371
+
2150
2372
  /** FloPay environment — determines which billing API URL is used. */
2151
2373
  type FloPayEnvironment = 'staging' | 'production' | 'local';
2152
2374
  /**
@@ -2178,7 +2400,7 @@ declare function getConfiguredBillingApiUrl(): string;
2178
2400
  declare function getFloPayEnvironment(): FloPayEnvironment;
2179
2401
 
2180
2402
  /** Current SDK version. */
2181
- declare const SDK_VERSION = "1.11.5";
2403
+ declare const SDK_VERSION = "1.12.0";
2182
2404
  /**
2183
2405
  * HTTP header the SDK sends on checkout-session create/read requests so the
2184
2406
  * backend can observe compatibility. Version 1.4.9 is the first release that
@@ -2696,6 +2918,36 @@ declare function buildCheckoutDisplayData(session: CheckoutSession, options?: Bu
2696
2918
  /** Return true only for a non-blank email accepted by the backend validator. */
2697
2919
  declare function isValidEmail(email: string | null | undefined): email is string;
2698
2920
 
2921
+ declare const EXTERNAL_METHOD_CALLBACK_GRACE_MS = 600;
2922
+ interface ExternalMethodFailureContext {
2923
+ inAppBrowser: boolean;
2924
+ handoffObserved: boolean;
2925
+ /** May corroborate a recognized signal, but never determines classification. */
2926
+ elapsedMs?: number;
2927
+ }
2928
+ interface ExternalMethodFailureClassification {
2929
+ errorCode: 'POPUP_BLOCKED' | 'PROVIDER_RUNTIME_FAILED';
2930
+ popupBlocked: boolean;
2931
+ providerDeclined: boolean;
2932
+ terminalReason: TelemetryTerminalReason;
2933
+ }
2934
+ /** One buyer-copy contract shared by wallets and both PayPal integrations. */
2935
+ declare function buildExternalMethodRecoveryMessage(displayName: string, popupBlocked: boolean, inAppBrowser: boolean): string;
2936
+ declare function sanitizeExternalFailureCode(value: unknown): string | undefined;
2937
+ declare function getProviderErrorCode(err: unknown): string | undefined;
2938
+ declare function getProviderDeclineCode(err: unknown): string | undefined;
2939
+ declare function isProviderDecline(err: unknown): boolean;
2940
+ declare function isPayPalAcknowledgementDeadWindow(err: unknown): boolean;
2941
+ /** Classifies only bounded, positive evidence; time by itself is never evidence. */
2942
+ declare function classifyExternalMethodFailure(err: unknown, context: ExternalMethodFailureContext): ExternalMethodFailureClassification;
2943
+ declare function isPopupBlockedError(err: unknown): boolean;
2944
+
2945
+ /**
2946
+ * The buyer-facing copy for a raw failure message: a known backend message is
2947
+ * replaced, anything else is returned unchanged (`undefined` for a non-string).
2948
+ */
2949
+ declare function applyFriendlyMessageOverride(message: string | undefined | null): string | undefined;
2950
+
2699
2951
  /**
2700
2952
  * The Stripe Elements group asking for a usage. It only selects which of
2701
2953
  * today's values a legacy read (one without `futureUse`) keeps.
@@ -2776,6 +3028,25 @@ declare function generateIdempotencyKey(): string | undefined;
2776
3028
  */
2777
3029
  declare function resolveIdempotencyKey(supplied?: string): string | undefined;
2778
3030
 
3031
+ interface CachedInlineSession {
3032
+ canonicalIdentity?: string;
3033
+ sid: string;
3034
+ nonce?: string;
3035
+ }
3036
+ interface CachedInlineIdempotencyKey {
3037
+ canonicalIdentity?: string;
3038
+ idempotencyKey: string;
3039
+ }
3040
+ declare function readCachedInlineSession(cacheKey: string, canonicalIdentity: string): CachedInlineSession | null;
3041
+ declare function readCachedInlineIdempotencyKey(cacheKey: string, canonicalIdentity: string): CachedInlineIdempotencyKey | null;
3042
+ declare function clearCachedInlineSession(cacheKey: string, canonicalIdentity: string): void;
3043
+ declare function clearCachedInlineCheckout(cacheKey: string, canonicalIdentity: string): void;
3044
+ declare function persistCachedInlineSession(cacheKey: string, canonicalIdentity: string, sid: string, nonce?: string): void;
3045
+ declare function persistCachedInlineIdempotencyKey(cacheKey: string, canonicalIdentity: string, idempotencyKey: string): void;
3046
+ declare function serializeCreateParams(params: InlineSessionDraft | undefined, includeRequestContext?: boolean): string;
3047
+ declare function hashCreateParams(params: InlineSessionDraft | undefined, includeRequestContext?: boolean): string;
3048
+ declare function legacyCachedSessionMatchesDraft(session: CheckoutSession | undefined, params: InlineSessionDraft): boolean;
3049
+
2779
3050
  /** Schema version for the privacy-safe instrument callback contract. */
2780
3051
  declare const FLO_INSTRUMENT_SCHEMA_VERSION: 1;
2781
3052
  /**
@@ -2826,6 +3097,229 @@ type FloInstrumentEvent = (FloInstrumentCommonFields & {
2826
3097
  phase: FloInstrumentErrorPhase;
2827
3098
  });
2828
3099
 
3100
+ /**
3101
+ * Invoke merchant-owned code without allowing its failure to alter checkout.
3102
+ * Failures stay local to the merchant console and are never sent as Flo
3103
+ * telemetry because the SDK cannot act on merchant implementation errors.
3104
+ * Every UI binding (`@flopay/react`, `@flopay/vue`) calls merchant callbacks
3105
+ * through this one invoker.
3106
+ */
3107
+ declare function invokeMerchantCallback(callback: (() => unknown) | undefined): void;
3108
+ /** An internal observation a UI binding may project onto the merchant instrument feed. */
3109
+ type FloInstrumentSource = {
3110
+ class: 'lifecycle';
3111
+ name: TelemetryLogName;
3112
+ provider?: TelemetryProviderInput;
3113
+ } | {
3114
+ class: 'technical_error';
3115
+ errorCode: TelemetryErrorCode;
3116
+ requestCategory?: TelemetryRequestCategory;
3117
+ provider?: TelemetryProviderInput;
3118
+ } | {
3119
+ class: 'card_surface';
3120
+ provider?: TelemetryProviderInput;
3121
+ };
3122
+ /** Project the closed internal taxonomy onto the smaller merchant-safe v1 contract. */
3123
+ declare function projectFloInstrument(source: FloInstrumentSource): FloInstrumentEvent | null;
3124
+ /** Instruments a checkout emits at most once per checkout identity. */
3125
+ declare const FLO_INSTRUMENT_ONCE_NAMES: ReadonlySet<FloInstrumentEvent['name']>;
3126
+
3127
+ /** One advertised Stripe wallet/APM, with the account the backend chose for it. */
3128
+ interface StripeSetupAdvertisement {
3129
+ /** The Stripe payment method type (`apple_pay`, `sepa_debit`, ...). */
3130
+ method: string;
3131
+ /** This entry's own publishable key: the backend can pick an account per method. */
3132
+ publishableKey: string;
3133
+ /** The setup session's own currency, from the read. Never guessed. */
3134
+ currency: string;
3135
+ }
3136
+ /** Direct PayPal vault flow a setup session advertises. */
3137
+ interface PayPalSetupAdvertisement {
3138
+ clientId: string;
3139
+ environment?: string;
3140
+ }
3141
+ /**
3142
+ * The methods a setup session advertises. The SDK renders exactly these: no
3143
+ * gateway selection, filtering or inference happens on the client.
3144
+ */
3145
+ interface PaymentMethodSetupAdvertisement {
3146
+ /** The hosted vault card widget (a `card` entry, or no advertisement at all). */
3147
+ card: boolean;
3148
+ /** Stripe wallets/APMs in advertised order. */
3149
+ stripe: StripeSetupAdvertisement[];
3150
+ paypal: PayPalSetupAdvertisement | null;
3151
+ /** The setup session's own currency from the read, or `null` when it carries none. */
3152
+ currency: string | null;
3153
+ /**
3154
+ * Stripe wallets/APMs the session advertises that are not rendered only
3155
+ * because the read carries no currency, so a session that offers nothing
3156
+ * else can say why instead of claiming it advertises nothing.
3157
+ */
3158
+ skippedForMissingCurrency: string[];
3159
+ }
3160
+ /**
3161
+ * Read the advertisement from a normalized setup session. Only the session's
3162
+ * `advertisedPaymentMethods` decides it (backend docs/card-setup.md,
3163
+ * "Advertised payment methods"); the purchase-checkout gateway block is never
3164
+ * read, since it lists nothing on a setup session.
3165
+ *
3166
+ * - Field absent (an older backend): the card only, exactly as `FloPayCardSetup`.
3167
+ * - `family: "card"`: the hosted vault card widget.
3168
+ * - `family: "wallet"` / `"apm"` with `providerType: "stripe"`: that Stripe
3169
+ * method, with the entry's own publishable key. Skipped when the read carries
3170
+ * no currency, and listed in `skippedForMissingCurrency`.
3171
+ * - `family: "paypal"` (`paypal_vaulted`): the PayPal vault flow, with the
3172
+ * entry's key as the client id and its environment. It owns `paypal`, so a
3173
+ * Stripe-rendered `paypal` entry is not drawn a second time.
3174
+ * - Anything else is skipped, never thrown on. The first entry for a
3175
+ * `paymentMethodType` wins.
3176
+ */
3177
+ declare function readSetupAdvertisement(normalized: NormalizedCheckoutSession): PaymentMethodSetupAdvertisement;
3178
+ /** The marker of every method the advertisement renders, card first. */
3179
+ declare function advertisedMethodKeys(advertisement: PaymentMethodSetupAdvertisement): string[];
3180
+ /** Whether the advertisement offers anything to render. */
3181
+ declare function advertisesAnyMethod(advertisement: PaymentMethodSetupAdvertisement): boolean;
3182
+ /** The session-intent category for an advertised Stripe method. */
3183
+ declare function stripeMethodCategory(method: string): 'wallet' | 'apm';
3184
+ /** Which wording the outcome overlay uses: card wording only for the card widget. */
3185
+ type SetupOverlayWording = 'card' | 'payment_method';
3186
+ /** Processing / success / failure overlay labels for a setup outcome. */
3187
+ declare function setupOverlayLabels(wording: SetupOverlayWording): {
3188
+ processingLabel: string;
3189
+ successLabel: string;
3190
+ errorLabel: string;
3191
+ };
3192
+
3193
+ /**
3194
+ * The buyer identity an express surface attaches to the checkout: the
3195
+ * session-patch `account` shape (email and names, plus any other account
3196
+ * fields the click-time patch carried).
3197
+ */
3198
+ type PayPalBuyerIdentity = NonNullable<InlineSessionPatch['account']>;
3199
+ /**
3200
+ * Trims the names and drops empty ones. Express continuations use empty name
3201
+ * markers to clear hydrated fallbacks through JSON checkpoints
3202
+ * (`preserveMissingNames`); the final process payload strips them again.
3203
+ */
3204
+ declare function compactBuyerIdentity(identity: PayPalBuyerIdentity, preserveMissingNames?: boolean): PayPalBuyerIdentity;
3205
+ /** Splits a full name at the first whitespace run; a card-holder placeholder is no name. */
3206
+ declare function splitFullName(name: string | null | undefined): {
3207
+ firstName?: string;
3208
+ lastName?: string;
3209
+ };
3210
+ /** The payer PayPal reports for an approved order (`actions.order.get()`). */
3211
+ declare function readPayPalPayerIdentity(details: unknown): PayPalBuyerIdentity;
3212
+ /**
3213
+ * The buyer identity a PayPal approval starts from: the click-time account
3214
+ * patch wins, then the host's `email` and `billingName`, then the session's
3215
+ * customer.
3216
+ */
3217
+ declare function resolvePayPalApprovalIdentity(input: {
3218
+ accountPatch?: InlineSessionPatch['account'] | null;
3219
+ email?: string | null;
3220
+ billingName?: string | null;
3221
+ session?: CheckoutSession | null;
3222
+ }): PayPalBuyerIdentity;
3223
+ /** Whether the approval still lacks a valid email or any name, so PayPal's payer is read. */
3224
+ declare function needsPayPalPayerDetails(identity: PayPalBuyerIdentity): boolean;
3225
+ /** Fills the approval identity's gaps from PayPal's order details; PayPal's payer wins per field. */
3226
+ declare function mergePayPalPayerIdentity(identity: PayPalBuyerIdentity, details: unknown): PayPalBuyerIdentity;
3227
+ /**
3228
+ * Whether a PayPal approval must collect the buyer's email itself: no valid
3229
+ * email is known from the host or the session.
3230
+ */
3231
+ declare function paypalProviderIdentityRequired(email: string | null | undefined, session: CheckoutSession | null | undefined): boolean;
3232
+ /**
3233
+ * Chooses a PayPal presentation without ever hiding PayPal. Deterministic
3234
+ * non-popup modes are limited to one-time Orders in an in-app browser and
3235
+ * require the backend's advertisement.
3236
+ */
3237
+ declare function resolvePayPalPresentationMode(environment: PayPalBrowserEnvironment, advertisedCapability: TelemetryPresentationMode | undefined, providerObjectType: PayPalProviderObjectType): TelemetryPresentationMode;
3238
+
3239
+ /**
3240
+ * Whether the configured PayPal object rides the Flo-owned `paypal_vaulted`
3241
+ * channel. An explicitly configured `order` or `setup_token` (the session's
3242
+ * advertisement, or the deprecated prop as a fallback) does. A legacy session
3243
+ * with neither, and an advertised provider-managed `subscription`, keep the
3244
+ * released `paypal` requests byte-identical.
3245
+ */
3246
+ declare function usesPayPalVaultedChannel(configuredObjectType: PayPalProviderObjectType | undefined): boolean;
3247
+ /**
3248
+ * The `/intents` request body for a direct PayPal button. The payment-method
3249
+ * type is the in-band channel selector: the Flo-owned channel asks for
3250
+ * `paypal_vaulted` (with `intentKind: 'setup'` for a vault setup token); the
3251
+ * legacy channel asks for `paypal` with `intentKind: 'payment'`.
3252
+ */
3253
+ declare function buildPayPalSessionIntentRequest(configuredObjectType: PayPalProviderObjectType | undefined): PayPalSessionIntentRequest;
3254
+ /**
3255
+ * The tokenized body for PayPal's approval token. A vault setup token and an
3256
+ * advertised order carry the Flo-owned channel so the backend can continue on
3257
+ * it; the legacy fallback keeps the released body byte-identical.
3258
+ */
3259
+ declare function buildPayPalTokenizedBody(token: string, configuredObjectType: PayPalProviderObjectType | undefined): TokenizedBody;
3260
+ /** What a direct PayPal button knows when it completes an approval itself. */
3261
+ interface PayPalProcessPaymentInput {
3262
+ /** The approval's tokenized body ({@link buildPayPalTokenizedBody}). */
3263
+ body: TokenizedBody;
3264
+ /** The session the attempt runs on (the click-time patch's, else the button's). */
3265
+ sessionId: string;
3266
+ /** The checkout session token for the attempt. */
3267
+ nonce: string | undefined;
3268
+ /** The click-time account patch from `runBeforeButtonClick`. */
3269
+ accountPatch?: InlineSessionPatch['account'];
3270
+ /** The checkout session, for the buyer's identity and address. */
3271
+ session?: CheckoutSession | null;
3272
+ /** The button's `email` prop. */
3273
+ email?: string;
3274
+ }
3275
+ /**
3276
+ * The `/process` call a direct PayPal button makes when no host takes the
3277
+ * tokenized body: the click-time account patch wins, then the session's
3278
+ * customer, then its account data. Returns the (vestigial) user id argument
3279
+ * and the request, in the field order the released button sends.
3280
+ */
3281
+ declare function buildPayPalProcessPaymentRequest(input: PayPalProcessPaymentInput): {
3282
+ userId: string;
3283
+ params: ProcessPaymentParams;
3284
+ };
3285
+ /**
3286
+ * The buyer-facing message for a failed PayPal payment: the raw message (or
3287
+ * the generic fallback) through the shared friendly-message override.
3288
+ */
3289
+ declare function friendlyPayPalFailureMessage(rawMessage: string | undefined): string;
3290
+ /** A rejected PayPal `/process` response body, read for the buyer message and the decline codes. */
3291
+ declare function describePayPalProcessFailure(json: Record<string, unknown> | null): {
3292
+ message: string;
3293
+ code: string | undefined;
3294
+ declineCode: string | undefined;
3295
+ };
3296
+ /**
3297
+ * The `providerDeclineReason` a PayPal decline reports to `/intents/decline`:
3298
+ * the provider's decline code, then its error code, then the generic reason.
3299
+ */
3300
+ declare function resolvePayPalDeclineReason(error: unknown): string;
3301
+ /**
3302
+ * Zoid (PayPal's iframe framework) reports its own teardown through `onError`:
3303
+ * "zoid destroyed all components", a closed window, a removed container. Those
3304
+ * are page navigation or unmounting, not payment errors, so no binding shows
3305
+ * them to the buyer.
3306
+ */
3307
+ declare function isPayPalTeardownMessage(message: string | undefined): boolean;
3308
+
3309
+ /** Privacy-bounded browser context shared by PayPal presentation and telemetry. */
3310
+ interface PayPalBrowserEnvironment {
3311
+ inAppBrowser: boolean;
3312
+ appFamily: TelemetryAppFamily;
3313
+ popupCapability: TelemetryPopupCapability;
3314
+ }
3315
+ /**
3316
+ * Classifies an in-app browser without retaining or returning its user agent.
3317
+ *
3318
+ * Static UA evidence cannot prove that a popup will open, so capability stays
3319
+ * `unknown`; runtime lifecycle evidence is reported separately.
3320
+ */
3321
+ declare function detectPayPalEnvironment(userAgent?: string): PayPalBrowserEnvironment;
3322
+
2829
3323
  /**
2830
3324
  * Postal-code → state derivation for AVS.
2831
3325
  *
@@ -2878,6 +3372,55 @@ declare function isValidPostalCode(country: string, postalCode: string): boolean
2878
3372
  */
2879
3373
  declare function getPostalCodeExample(country: string): string | undefined;
2880
3374
 
3375
+ /** The submit-button style fields a themed tile copies (any CSS-like record). */
3376
+ interface PrimaryTileSubmitStyle {
3377
+ color?: unknown;
3378
+ border?: unknown;
3379
+ borderRadius?: unknown;
3380
+ boxShadow?: unknown;
3381
+ }
3382
+ /** Inputs for {@link derivePrimaryTileStyle}. */
3383
+ interface PrimaryTileStyleSource {
3384
+ themeBundle: ThemeBundle | null | undefined;
3385
+ resolvedPrimaryColor: string;
3386
+ resolvedBorderRadius: string;
3387
+ submitButtonStyle?: PrimaryTileSubmitStyle | undefined;
3388
+ /**
3389
+ * Raw `appearance.colorPrimary` (undefined when the merchant didn't set one).
3390
+ * When present it forces a primary-filled tile even with no theme bundle
3391
+ * (the `classic` preset), so an explicit `colorPrimary` override always wins
3392
+ * over the historic white tile.
3393
+ */
3394
+ explicitPrimaryColor?: string | undefined;
3395
+ }
3396
+ /** The colour and shape of a primary tile. */
3397
+ interface PrimaryTileStyle {
3398
+ backgroundColor: string;
3399
+ color: string;
3400
+ border: string;
3401
+ borderRadius: string | number;
3402
+ boxShadow?: string | undefined;
3403
+ }
3404
+ /**
3405
+ * Base colours for a primary tile (the buttons-layout card tile and the
3406
+ * one-click button):
3407
+ *
3408
+ * - `'classic'` / no theme: white background, grey border — historic look
3409
+ * that lines up with the wallet ECE row's flat tiles.
3410
+ * - Any theme bundle (`modern-*`, `bold-*`, `glass-*`): `colorPrimary`
3411
+ * (`resolvedPrimaryColor` — already merged with any `appearance` override)
3412
+ * drives the `backgroundColor`, exactly like the "Confirm Payment" submit
3413
+ * CTA, so all three flo buttons (submit, card, auto-pay) share one fill and
3414
+ * a per-checkout `colorPrimary` override re-skins every one of them. The
3415
+ * bundle's `submitButton` still supplies `color` / `border` / `borderRadius`
3416
+ * / `boxShadow` so typography + shape stay on-theme. Hover (`colorPrimaryHover`)
3417
+ * is applied by each button's mouse-enter / mouse-leave at the call site.
3418
+ */
3419
+ declare function derivePrimaryTileStyle(opts: PrimaryTileStyleSource): PrimaryTileStyle;
3420
+
3421
+ declare function markSessionRecentlyCompleted(sessionId: string | null | undefined): void;
3422
+ declare function wasSessionRecentlyCompleted(sessionId: string | null | undefined): boolean;
3423
+
2881
3424
  interface SentryStackFrameLike {
2882
3425
  in_app?: boolean;
2883
3426
  filename?: string;
@@ -2900,6 +3443,67 @@ interface SentryEventLike {
2900
3443
  */
2901
3444
  declare function dropThirdPartyOnlyError<T extends SentryEventLike>(event: T): T | null;
2902
3445
 
3446
+ /**
3447
+ * A `FloPayAppearance` whose `theme` has been normalized to the set Stripe's
3448
+ * Appearance API accepts, so it can be handed straight to Stripe Elements
3449
+ * without tripping Stripe.js's `Invalid value … provided to "theme"` warning.
3450
+ */
3451
+ interface StripeSafeAppearance {
3452
+ theme: 'stripe' | 'night' | 'flat';
3453
+ variables?: FloPayThemeVariables;
3454
+ rules?: Record<string, Record<string, string>>;
3455
+ }
3456
+ /** Maps FloPay's public appearance token to Stripe's accepted theme set. */
3457
+ declare function toStripeAppearanceTheme(theme: 'default' | 'flat' | 'night' | 'none' | undefined): 'stripe' | 'night' | 'flat';
3458
+ /**
3459
+ * Normalizes a FloPay appearance before a UI binding passes it to Stripe
3460
+ * Elements. Lives here, free of Stripe.js, so the Stripe-free entries and
3461
+ * every UI binding share one mapping (TeamFloPay/sdk#410, CTO decision 1).
3462
+ */
3463
+ declare function toStripeAppearance(appearance: FloPayAppearance): StripeSafeAppearance;
3464
+
3465
+ /**
3466
+ * Selects the safe Stripe-routed PayPal surface for the active checkout mount
3467
+ * from the merchant's `walletPresentation` preference. An in-app browser, a
3468
+ * pop-up the browser blocked, or `prefer_redirect` gives the full-page
3469
+ * redirect; anything else keeps the pop-up. Moved from @flopay/react's
3470
+ * `in-app-browser.ts` so @flopay/vue resolves `walletPresentation` the same way.
3471
+ */
3472
+ declare function resolveStripePayPalPresentation(environment: PayPalBrowserEnvironment, preference: WalletPresentation, popupCapability?: TelemetryPopupCapability): 'popup' | 'redirect';
3473
+ /**
3474
+ * Storage key carrying the effective session / nonce / account patch across a
3475
+ * Stripe-routed PayPal redirect, so the return can `/process` against the same
3476
+ * session PayPal authorized (an inline-session bootstrap inside the click gate
3477
+ * would otherwise be lost when the page reloads after the PayPal round-trip).
3478
+ */
3479
+ declare const STRIPE_PAYPAL_RESUME_KEY = "flopay_paypal_resume";
3480
+ /** The query parameters Stripe appends to the return URL after a redirect. */
3481
+ declare const STRIPE_REDIRECT_PARAMS: readonly ["payment_intent", "payment_intent_client_secret", "redirect_status"];
3482
+ interface StripePayPalResumeContinuation<TAccount = unknown> {
3483
+ clientSecret?: string;
3484
+ sessionId?: string;
3485
+ nonce?: string;
3486
+ accountPatch?: TAccount;
3487
+ }
3488
+ /** `[payment_intent, payment_intent_client_secret, redirect_status]` from the current URL. */
3489
+ declare function readStripeRedirectParams(): [string | null, string | null, string | null];
3490
+ /** The current URL without Stripe's redirect parameters (the PayPal `return_url`). */
3491
+ declare function stripeRedirectReturnUrl(): string;
3492
+ /**
3493
+ * The saved continuation, only when it belongs to `clientSecret`, so a stale
3494
+ * payload from a prior attempt can't replay against a different PaymentIntent.
3495
+ */
3496
+ declare function readMatchingStripePayPalContinuation<TAccount = unknown>(clientSecret: string | null): StripePayPalResumeContinuation<TAccount> | null;
3497
+ /** Whether this page load is the return of a Stripe-routed PayPal redirect this browser started. */
3498
+ declare function hasMatchingStripePayPalReturn(): boolean;
3499
+ /**
3500
+ * Saves the continuation, or removes it when called without one. Returns
3501
+ * whether storage accepted the change (a redirect must not start without it).
3502
+ */
3503
+ declare function writeStripePayPalContinuation(continuation?: StripePayPalResumeContinuation): boolean;
3504
+ /** Consumes the continuation and strips Stripe's redirect parameters from the URL. */
3505
+ declare function clearStripePayPalReturn(): void;
3506
+
2903
3507
  interface ClassifiedTelemetryFailure {
2904
3508
  errorCode: TelemetryErrorCode;
2905
3509
  statusClass: TelemetryStatusClass;
@@ -2953,6 +3557,34 @@ declare function isSetupIntentClientSecret(clientSecret: string | null | undefin
2953
3557
  /** Treat the checkout's normalized fallback cardholder sentinel as absent. */
2954
3558
  declare function isCardHolderNamePlaceholder(...nameParts: Array<string | null | undefined>): boolean;
2955
3559
 
3560
+ /**
3561
+ * Darken a `#rrggbb` color by `amount` (0–1) — used to derive a flo-button hover
3562
+ * shade from the primary when the theme doesn't supply an explicit
3563
+ * `colorPrimaryHover`. Returns the input unchanged for non-hex values.
3564
+ */
3565
+ declare function darkenHex(hex: string, amount?: number): string;
3566
+ /** Pass through CSS font-weight values; anything else resolves to undefined. */
3567
+ declare function toCssWeight(value: string | number | undefined): string | number | undefined;
3568
+ /** Inputs for {@link computeVaultCardThemeColors}. */
3569
+ interface VaultThemeSource {
3570
+ /** Stripe-side appearance (a theme bundle's, or the merchant's override). */
3571
+ appearance?: FloPayAppearance | undefined;
3572
+ /** Resolved buttons-layout styles (bundle + merchant overrides merged). */
3573
+ buttonsStyles: ButtonsLayoutStyles;
3574
+ /** Surrounding layout — affects the neutral border fallback. */
3575
+ layout?: 'default' | 'buttons';
3576
+ }
3577
+ /**
3578
+ * Colors pushed into the hosted vault widget so the backend-rendered card form
3579
+ * matches the merchant's theme. The SDK owns *all* theming here — every value
3580
+ * resolves from the theme bundle / appearance overrides (same precedence the
3581
+ * SDK uses for its merchant-hosted AVS inputs); the backend ships only neutral
3582
+ * fallbacks for when a var is absent. Shared by `SplitCardForm` (checkout) and
3583
+ * `FloPayCardSetup` (no-charge card setup) so one `theme` value renders the
3584
+ * same hosted card form everywhere.
3585
+ */
3586
+ declare function computeVaultCardThemeColors({ appearance, buttonsStyles, layout, }: VaultThemeSource): VaultCardThemeColors;
3587
+
2956
3588
  /**
2957
3589
  * Production card-capture verification (TeamFloPay/backend#1920, sdk#414).
2958
3590
  *
@@ -2998,4 +3630,31 @@ interface VaultMountContext {
2998
3630
  */
2999
3631
  declare function resolveVaultMountOptions(block: VaultCaptureBlock | null | undefined, context: VaultMountContext): CardCaptureMountOptions | null;
3000
3632
 
3001
- export { ASYNC_AUTO_CHECKOUT_CAPABILITY, type AVSFieldConfig, type AdvertisedPaymentMethod, BILLING_API_URL, BILLING_API_URL_PRODUCTION, BILLING_API_URL_STAGING, BOLD_DARK_APPEARANCE, BOLD_LIGHT_APPEARANCE, BUTTONS_LAYOUT_BOLD_DARK, BUTTONS_LAYOUT_BOLD_LIGHT, BUTTONS_LAYOUT_DARK, BUTTONS_LAYOUT_DEFAULT, BUTTONS_LAYOUT_GLASS_DARK, BUTTONS_LAYOUT_GLASS_LIGHT, BUTTONS_LAYOUT_MINIMAL, BUTTONS_LAYOUT_MODERN_DARK, BUTTONS_LAYOUT_MODERN_LIGHT, BUTTONS_LAYOUT_ROUNDED, type BeforeButtonClickEvent, type BillingDetails, type BillingProvider, type BuildCheckoutDisplayDataOptions, type BuildTelemetryErrorEventInput, type BuildTelemetryLogEventInput, type BuildTelemetryPerformanceEventInput, type BuildTelemetryTerminalEventInput, type ButtonsLayoutStyles, type ButtonsLayoutTheme, CA_PROVINCES, CHECKOUT_PROCESSING_TIMEOUT_MESSAGE, COUNTRY_OPTIONS, CURRENCY_MAP, type CaptureMethod, type CardCaptureAdapter, type CardCaptureEventType, type CardCaptureMountOptions, type CardCaptureOutcomeEvent, type CardCaptureProviderId, type CardSetupFutureUse, type CheckoutAccount, type CheckoutButtonMethod, type CheckoutDisplayData, type CheckoutFailureOutcome, type CheckoutGateway, type CheckoutGateways, type CheckoutItem, type CheckoutMetadata, type CheckoutMode, type CheckoutModeKind, type CheckoutProcessError, type CheckoutProcessingPending, type CheckoutProduct, type CheckoutProductType, type CheckoutSession, type CheckoutSessionMode, type CheckoutSessionProduct, type CheckoutSessionResult, type CheckoutSubscription, type ClassifiedTelemetryFailure, type CountryOption, type CreateCardSetupSessionRequest, type CreateCustomerParams, type CreateSessionIntentRequest, type CreateSessionParams, type CurrencyInfo, type Customer, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_APPEARANCE, DEFAULT_CURRENCY, type DeclineEvent, type DetachedCheckoutSession, type DisplayLineItem, type ExternalMethodFailureDetails, FLAT_APPEARANCE, FLO_INSTRUMENT_CATALOG, FLO_INSTRUMENT_SCHEMA_VERSION, FLO_SDK_CAPABILITIES_HEADER, FLO_SDK_VERSION_HEADER, type FloInstrumentErrorPhase, type FloInstrumentEvent, type FloInstrumentLifecycleName, type FloPayAppearance, type FloPayConfig, type FloPayEnvironment, FloPayError, type FloPayErrorType, type FloPayThemeVariables, type FutureUseSessionFields, type FutureUseSurface, type FutureUseUnsupportedMethod, GLASS_DARK_APPEARANCE, GLASS_LIGHT_APPEARANCE, type GatewayEnvironment, IDEMPOTENCY_IN_PROGRESS_CODE, IDEMPOTENCY_KEY_HEADER, type InlineSessionDraft, type InlineSessionParams, type InlineSessionPatch, type LineItem, type ListSavedPaymentMethodsQuery, MAX_IDEMPOTENCY_KEY_LENGTH, MODERN_DARK_APPEARANCE, MODERN_LIGHT_APPEARANCE, NIGHT_APPEARANCE, type NonCardPaymentMethodCategory, type NormalizedCheckoutSession, type NormalizedGatewayEnvironment, PAYPAL_VAULTED_PAYMENT_METHOD_TYPE, type PayPalApprovalPresentation, type PayPalPaymentResult, type PayPalProviderObjectType, type PayPalSessionIntent, type PayPalSessionIntentRequest, type PaymentMethodRemovalConflictCode, type PaymentMethodRemovalConflictError, type PaymentMethodRemovalError, type PaymentMethodRemovalFailureReason, type PaymentMethodRemovalNotFoundError, type PaymentMethodRemovalRetryableError, type PaymentProviderAdapter, type PaymentResult, type PriceData, type ProcessPaymentParams, type RecurringInterval, SAVED_PAYMENT_METHOD_FAMILIES, SAVED_PAYMENT_METHOD_LIST_TYPES, SAVED_PAYMENT_METHOD_TYPES, SDK_VERSION, STORED_PAYMENT_METHOD_UNSUPPORTED_CODE, STORED_PAYMENT_METHOD_UNSUPPORTED_MESSAGE, STRIPE_EXPRESS_METHODS, STRIPE_METHOD_AMOUNT_LIMITS, STRIPE_METHOD_COUNTRIES, STRIPE_METHOD_CURRENCIES, STRIPE_METHOD_MATRIX, SUPPORTED_CARD_BRANDS, type SavedCardDisplay, type SavedCardPaymentMethodDisplay, type SavedOtherPaymentMethodDisplay, type SavedPaymentMethodDisplay, type SavedPaymentMethodFamily, type SavedPaymentMethodListType, type SavedPaymentMethodStatus, type SavedPaymentMethodType, type SentryEventLike, type SentryStackFrameLike, type SerializeTelemetryBatchOptions, type SessionIntent, type SessionIntentDeclineRequest, type StateOption, type StoredPaymentMethodOutcomeCode, type StripeMethodEntry, type StripeMethodThemeVariant, type StripeSessionIntent, type StripeSessionIntentRequest, TELEMETRY_ERROR_CODES, TELEMETRY_FAILURE_CATEGORIES, TELEMETRY_LOG_NAMES, TELEMETRY_MAX_BATCH_BYTES, TELEMETRY_MAX_BATCH_EVENTS, TELEMETRY_SCHEMA_VERSION, TELEMETRY_SDK_PACKAGES, THEMES, THREE_DS_CHALLENGE_WINDOW_MS, type TagsData, type TelemetryAppFamily, type TelemetryBatchEnvelope, type TelemetryCheckoutMode, type TelemetryDurationMode, type TelemetryErrorCode, type TelemetryErrorEvent, type TelemetryErrorReason, type TelemetryEvent, type TelemetryEventClass, type TelemetryExpectedOutcome, type TelemetryExpectedOutcomeEvent, type TelemetryFailureCategory, type TelemetryLayout, type TelemetryLogEvent, type TelemetryLogName, type TelemetryPaymentMethodCategory, type TelemetryPerformanceEvent, type TelemetryPopupCapability, type TelemetryPresentationMode, type TelemetryProvider, type TelemetryProviderInput, type TelemetryRequestCategory, type TelemetrySdkPackage, type TelemetryStage, type TelemetryStatusClass, type TelemetryTerminalReason, type ThemeBundle, type ThemeBundleId, type ThemeId, type TokenizedBody, US_STATES, UUID_V4, type UpdateCustomerParams, VAULT_CAPTURE_FORM_PATH, type VaultCaptureBlock, type VaultCaptureResultMessage, type VaultCardFieldKey, type VaultCardThemeColors, type VaultGradientStop, type VaultLinearGradientBackground, type VaultMountContext, type VaultShadowLayer, type VaultSolidBackground, type VaultSubmitBackground, type VaultSubmitButtonTheme, type VaultSubmitSpacing, type VaultSubmitTypography, type VaultThemeColor, type WalletPresentation, type WebhookEvent, apiError, assertCaptureMethodEligible, authenticationError, buildCheckoutDisplayData, buildItemPayload, buildProductPayload, buildSubscriptionPayload, buildTelemetryErrorEvent, buildTelemetryLogEvent, buildTelemetryPerformanceEvent, buildTelemetryTerminalEvent, classifyPaymentRejection, classifyTelemetryFailure, configureFlopay, dropThirdPartyOnlyError, filterStripeMethodsByAmount, filterStripeMethodsByCountry, filterStripeMethodsByCurrency, foldIntoProducts, generateIdempotencyKey, getConfiguredBillingApiUrl, getCountryByCode, getCurrencyByCountry, getFloPayEnvironment, getPostalCodeExample, getPostalCodeLabel, getStateFromPostalCode, getStateLabel, getStateOptions, getStripeMethodDisplayName, hasVendoredStripeMethodLogo, isAVSEnabled, isAVSFieldVisible, isAuthorizationOnlySession, isCardHolderNamePlaceholder, isCardSetupCheckoutSession, isDetachedSessionEligible, isMoneySettledOutcome, isMountableVaultBlock, isPostalCodeSupported, isSetupCheckoutSession, isSetupIntentClientSecret, isUuidV4, isValidEmail, isValidPostalCode, isValidPublishableKey, isValidSecretKey, isVaultVerificationRequired, needsStripeMethodExplicitConfirm, networkError, normalizeCheckoutFailureOutcome, normalizeGatewayEnvironment, partitionStripeMethods, randomUuidV4, rateLimitError, resolveAVSConfig, resolveBillingApiUrl, resolveButtonsLayoutTheme, resolveIdempotencyKey, resolveSessionCurrency, resolveSetupFutureUsage, resolveStripeMethodBrandVariant, resolveTheme, resolveVaultMountOptions, serializeTelemetryBatch, stripeExpressMethodToOptionKey, telemetryStatusClass, validationError };
3633
+ /**
3634
+ * Deferred Stripe Elements mode for the wallet / Express Checkout row
3635
+ * (Apple Pay, Google Pay), from the cart total due today.
3636
+ *
3637
+ * A $0-today cart (free trial) cannot run in `payment` mode: Stripe rejects a
3638
+ * `$0` amount with "amount must be greater than 0", and the historic
3639
+ * `amount: totalAmount || 100` floor surfaced a misleading **$1.00** charge on
3640
+ * the wallet sheet. Those carts run in `setup` mode instead — the wallet
3641
+ * collects the card for the trial with no amount shown, matching the backend's
3642
+ * SetupIntent. Any positive amount keeps `payment` mode with the real total.
3643
+ *
3644
+ * Moved from `@flopay/react`'s `resolveWalletElementsMode` so `@flopay/react`
3645
+ * and `@flopay/vue` decide the wallet row's mode, amount and capture method
3646
+ * with one implementation. Each caller adds its method list and the usage
3647
+ * from `resolveSetupFutureUsage`.
3648
+ *
3649
+ * @param amountInMinorUnits cart total due today, in the smallest currency unit.
3650
+ * @param captureMethod capture contract used by the subsequently created intent.
3651
+ */
3652
+ declare function resolveWalletModeOptions(amountInMinorUnits: number | undefined, captureMethod?: CaptureMethod): {
3653
+ mode: 'setup';
3654
+ } | {
3655
+ mode: 'payment';
3656
+ amount: number;
3657
+ captureMethod: 'automatic_async' | 'manual';
3658
+ };
3659
+
3660
+ export { ASYNC_AUTO_CHECKOUT_CAPABILITY, type AVSFieldConfig, type AdvertisedPaymentMethod, BILLING_API_URL, BILLING_API_URL_PRODUCTION, BILLING_API_URL_STAGING, BOLD_DARK_APPEARANCE, BOLD_LIGHT_APPEARANCE, BUTTONS_LAYOUT_BOLD_DARK, BUTTONS_LAYOUT_BOLD_LIGHT, BUTTONS_LAYOUT_DARK, BUTTONS_LAYOUT_DEFAULT, BUTTONS_LAYOUT_GLASS_DARK, BUTTONS_LAYOUT_GLASS_LIGHT, BUTTONS_LAYOUT_MINIMAL, BUTTONS_LAYOUT_MODERN_DARK, BUTTONS_LAYOUT_MODERN_LIGHT, BUTTONS_LAYOUT_ROUNDED, type BeforeButtonClickEvent, type BillingDetails, type BillingProvider, type BuildCheckoutDisplayDataOptions, type BuildTelemetryErrorEventInput, type BuildTelemetryLogEventInput, type BuildTelemetryPerformanceEventInput, type BuildTelemetryTerminalEventInput, type ButtonsLayoutStyles, type ButtonsLayoutTheme, CA_PROVINCES, CHECKOUT_PROCESSING_TIMEOUT_MESSAGE, COUNTRY_OPTIONS, CURRENCY_MAP, type CaptureMethod, type CardCaptureAdapter, type CardCaptureEventType, type CardCaptureMountOptions, type CardCaptureOutcomeEvent, type CardCaptureProviderId, type CardSetupFutureUse, type CardSetupOverlaySource, type CardSetupThemeResolution, type CardSetupThemeSource, type CheckoutAccount, type CheckoutButtonMethod, type CheckoutDisplayData, type CheckoutFailureOutcome, type CheckoutGateway, type CheckoutGateways, type CheckoutItem, type CheckoutLogLayout, type CheckoutMetadata, type CheckoutMode, type CheckoutModeKind, type CheckoutProcessAvsInput, type CheckoutProcessError, type CheckoutProcessMetadataInput, type CheckoutProcessingPending, type CheckoutProduct, type CheckoutProductType, type CheckoutSession, type CheckoutSessionMode, type CheckoutSessionProduct, type CheckoutSessionResult, type CheckoutSubscription, type ClassifiedTelemetryFailure, type CountryOption, type CreateCardSetupSessionRequest, type CreateCustomerParams, type CreateSessionIntentRequest, type CreateSessionParams, type CurrencyInfo, type Customer, DEFAULT_API_BASE_URL, DEFAULT_API_VERSION, DEFAULT_APPEARANCE, DEFAULT_CURRENCY, type DeclineEvent, type DetachedCheckoutSession, type DirectPayPalConfig, type DirectPayPalGatewaySource, type DisplayLineItem, EXTERNAL_METHOD_CALLBACK_GRACE_MS, type ExternalMethodFailureClassification, type ExternalMethodFailureContext, type ExternalMethodFailureDetails, FLAT_APPEARANCE, FLO_INSTRUMENT_CATALOG, FLO_INSTRUMENT_ONCE_NAMES, FLO_INSTRUMENT_SCHEMA_VERSION, FLO_SDK_CAPABILITIES_HEADER, FLO_SDK_VERSION_HEADER, type FloInstrumentErrorPhase, type FloInstrumentEvent, type FloInstrumentLifecycleName, type FloInstrumentSource, type FloPayAppearance, type FloPayConfig, type FloPayEnvironment, FloPayError, type FloPayErrorType, type FloPayThemeVariables, type FutureUseSessionFields, type FutureUseSurface, type FutureUseUnsupportedMethod, GLASS_DARK_APPEARANCE, GLASS_LIGHT_APPEARANCE, type GatewayEnvironment, IDEMPOTENCY_IN_PROGRESS_CODE, IDEMPOTENCY_KEY_HEADER, type InlineSessionDraft, type InlineSessionParams, type InlineSessionPatch, type LineItem, type ListSavedPaymentMethodsQuery, MAX_IDEMPOTENCY_KEY_LENGTH, MODERN_DARK_APPEARANCE, MODERN_LIGHT_APPEARANCE, NIGHT_APPEARANCE, type NonCardPaymentMethodCategory, type NormalizedCheckoutSession, type NormalizedGatewayEnvironment, PAYPAL_VAULTED_PAYMENT_METHOD_TYPE, type PayPalApprovalPresentation, type PayPalBrowserEnvironment, type PayPalBuyerIdentity, type PayPalPaymentResult, type PayPalProcessPaymentInput, type PayPalProviderObjectType, type PayPalSessionIntent, type PayPalSessionIntentRequest, type PaymentMethodRemovalConflictCode, type PaymentMethodRemovalConflictError, type PaymentMethodRemovalError, type PaymentMethodRemovalFailureReason, type PaymentMethodRemovalNotFoundError, type PaymentMethodRemovalRetryableError, type PaymentMethodSetupAdvertisement, type PaymentProviderAdapter, type PaymentResult, type PriceData, type PrimaryTileStyle, type PrimaryTileStyleSource, type PrimaryTileSubmitStyle, type ProcessPaymentParams, type ProcessingOverlayStatus, type ProcessingOverlayThemeColors, type RecurringInterval, SAVED_PAYMENT_METHOD_FAMILIES, SAVED_PAYMENT_METHOD_LIST_TYPES, SAVED_PAYMENT_METHOD_TYPES, SDK_VERSION, STORED_PAYMENT_METHOD_UNSUPPORTED_CODE, STORED_PAYMENT_METHOD_UNSUPPORTED_MESSAGE, STRIPE_EXPRESS_METHODS, STRIPE_METHOD_AMOUNT_LIMITS, STRIPE_METHOD_COUNTRIES, STRIPE_METHOD_CURRENCIES, STRIPE_METHOD_MATRIX, STRIPE_PAYPAL_RESUME_KEY, STRIPE_REDIRECT_PARAMS, SUPPORTED_CARD_BRANDS, type SavedCardDisplay, type SavedCardPaymentMethodDisplay, type SavedOtherPaymentMethodDisplay, type SavedPaymentMethodDisplay, type SavedPaymentMethodFamily, type SavedPaymentMethodListType, type SavedPaymentMethodStatus, type SavedPaymentMethodType, type SentryEventLike, type SentryStackFrameLike, type SerializeTelemetryBatchOptions, type SessionIntent, type SessionIntentDeclineRequest, type SetupOverlayWording, type StateOption, type StoredPaymentMethodOutcomeCode, type StripeMethodEntry, type StripeMethodThemeVariant, type StripePayPalResumeContinuation, type StripeSafeAppearance, type StripeSessionIntent, type StripeSessionIntentRequest, TELEMETRY_ERROR_CODES, TELEMETRY_FAILURE_CATEGORIES, TELEMETRY_LOG_NAMES, TELEMETRY_MAX_BATCH_BYTES, TELEMETRY_MAX_BATCH_EVENTS, TELEMETRY_SCHEMA_VERSION, TELEMETRY_SDK_PACKAGES, THEMES, THREE_DS_CHALLENGE_WINDOW_MS, type TagsData, type TelemetryAppFamily, type TelemetryBatchEnvelope, type TelemetryCheckoutMode, type TelemetryDurationMode, type TelemetryErrorCode, type TelemetryErrorEvent, type TelemetryErrorReason, type TelemetryEvent, type TelemetryEventClass, type TelemetryExpectedOutcome, type TelemetryExpectedOutcomeEvent, type TelemetryFailureCategory, type TelemetryLayout, type TelemetryLogEvent, type TelemetryLogName, type TelemetryPaymentMethodCategory, type TelemetryPerformanceEvent, type TelemetryPopupCapability, type TelemetryPresentationMode, type TelemetryProvider, type TelemetryProviderInput, type TelemetryRequestCategory, type TelemetrySdkPackage, type TelemetryStage, type TelemetryStatusClass, type TelemetryTerminalReason, type ThemeBundle, type ThemeBundleId, type ThemeId, type TokenizedBody, US_STATES, UUID_V4, type UpdateCustomerParams, VAULT_CAPTURE_FORM_PATH, type VaultCaptureBlock, type VaultCaptureResultMessage, type VaultCardFieldKey, type VaultCardThemeColors, type VaultGradientStop, type VaultLinearGradientBackground, type VaultMountContext, type VaultShadowLayer, type VaultSolidBackground, type VaultSubmitBackground, type VaultSubmitButtonTheme, type VaultSubmitSpacing, type VaultSubmitTypography, type VaultThemeColor, type VaultThemeSource, type WalletPresentation, type WebhookEvent, advertisedMethodKeys, advertisesAnyMethod, apiError, applyFriendlyMessageOverride, assertCaptureMethodEligible, authenticationError, buildCheckoutDisplayData, buildCheckoutProcessMetadata, buildExternalMethodRecoveryMessage, buildItemPayload, buildPayPalProcessPaymentRequest, buildPayPalSessionIntentRequest, buildPayPalTokenizedBody, buildProcessPaymentAvsAccount, buildProcessPaymentAvsExposure, buildProductPayload, buildSubscriptionPayload, buildTelemetryErrorEvent, buildTelemetryLogEvent, buildTelemetryPerformanceEvent, buildTelemetryTerminalEvent, canRecoverHostedCardForm, classifyExternalMethodFailure, classifyPaymentRejection, classifyTelemetryFailure, clearCachedInlineCheckout, clearCachedInlineSession, clearStripePayPalReturn, compactBuyerIdentity, computeCardSetupOverlayTheme, computeVaultCardThemeColors, configureFlopay, darkenHex, derivePrimaryTileStyle, describePayPalProcessFailure, detectPayPalEnvironment, dropThirdPartyOnlyError, filterStripeMethodsByAmount, filterStripeMethodsByCountry, filterStripeMethodsByCountryGate, filterStripeMethodsByCurrency, foldIntoProducts, friendlyPayPalFailureMessage, generateIdempotencyKey, getButtonMethodLabel, getConfiguredBillingApiUrl, getCountryByCode, getCurrencyByCountry, getFloPayEnvironment, getPostalCodeExample, getPostalCodeLabel, getProviderDeclineCode, getProviderErrorCode, getStateFromPostalCode, getStateLabel, getStateOptions, getStripeMethodDisplayName, hasMatchingStripePayPalReturn, hasServerSideCardGateway, hasVendoredStripeMethodLogo, hashCreateParams, invokeMerchantCallback, isAVSEnabled, isAVSFieldVisible, isAuthorizationOnlySession, isCardHolderNamePlaceholder, isCardSetupCheckoutSession, isDetachedSessionEligible, isMoneySettledOutcome, isMountableVaultBlock, isPayPalAcknowledgementDeadWindow, isPayPalTeardownMessage, isPopupBlockedError, isPostalCodeSupported, isProviderDecline, isSetupCheckoutSession, isSetupIntentClientSecret, isUuidV4, isValidEmail, isValidPostalCode, isValidPublishableKey, isValidSecretKey, isVaultVerificationRequired, legacyCachedSessionMatchesDraft, markSessionRecentlyCompleted, mergeButtonsStyles, mergeCardSetupSurface, mergePayPalPayerIdentity, needsPayPalPayerDetails, needsStripeMethodExplicitConfirm, networkError, normalizeBeforeButtonClickError, normalizeCheckoutFailureOutcome, normalizeGatewayEnvironment, partitionStripeMethods, paypalProviderIdentityRequired, persistCachedInlineIdempotencyKey, persistCachedInlineSession, projectFloInstrument, randomUuidV4, rateLimitError, readCachedInlineIdempotencyKey, readCachedInlineSession, readMatchingStripePayPalContinuation, readPayPalPayerIdentity, readSetupAdvertisement, readStripeRedirectParams, resolveAVSConfig, resolveBillingApiUrl, resolveButtonsLayoutTheme, resolveCardSetupTheme, resolveCheckoutLogLayout, resolveDirectPaypalConfig, resolveIdempotencyKey, resolvePayPalApprovalIdentity, resolvePayPalDeclineReason, resolvePayPalPresentationMode, resolveSessionCurrency, resolveSetupFutureUsage, resolveStripeMethodBrandVariant, resolveStripePayPalPresentation, resolveTheme, resolveVaultMountOptions, resolveWalletModeOptions, sanitizeExternalFailureCode, serializeCreateParams, serializeTelemetryBatch, setupOverlayLabels, splitFullName, stripeExpressMethodToOptionKey, stripeMethodCategory, stripeRedirectReturnUrl, telemetryStatusClass, toCssWeight, toStripeAppearance, toStripeAppearanceTheme, usesPayPalVaultedChannel, validationError, wasSessionRecentlyCompleted, writeStripePayPalContinuation };