@flopay/shared 1.11.5 → 1.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +602 -2
- package/dist/index.d.ts +602 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
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,103 @@ 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 card-setup processing / success / error modal for a named preset: the
|
|
2079
|
+
* panel reuses the credit-card pane surface and typography; processing wears
|
|
2080
|
+
* the preset primary on the spinner; success and error keep semantic accents.
|
|
2081
|
+
*/
|
|
2082
|
+
declare function computeCardSetupOverlayTheme(bundle: ThemeBundle): ProcessingOverlayThemeColors;
|
|
2083
|
+
|
|
2084
|
+
/**
|
|
2085
|
+
* Surface treatment for the card-setup container — the same complete
|
|
2086
|
+
* `cardFormContainer` look the checkout's credit-card pane wears for a preset —
|
|
2087
|
+
* merged beneath the merchant's `containerStyle` with deterministic precedence:
|
|
2088
|
+
*
|
|
2089
|
+
* 1. Every `containerStyle` property wins over the preset value for the same
|
|
2090
|
+
* property.
|
|
2091
|
+
* 2. Declarations are applied preset-first, then `containerStyle` in the
|
|
2092
|
+
* merchant's own order, so a `containerStyle` longhand refines a preset
|
|
2093
|
+
* shorthand of the same family (`borderColor` recolors the preset `border`;
|
|
2094
|
+
* `paddingTop` adjusts one side) exactly as CSS cascades a later declaration.
|
|
2095
|
+
* 3. Background is the one family a longhand cannot refine: a color cannot
|
|
2096
|
+
* displace a preset gradient's image layer. Any `background*` member in
|
|
2097
|
+
* `containerStyle` therefore replaces the preset's background family
|
|
2098
|
+
* entirely, so a merchant color never shows a glass gradient through it.
|
|
2099
|
+
*
|
|
2100
|
+
* `classic` and raw `VaultCardThemeColors` supply no surface, so `containerStyle`
|
|
2101
|
+
* applies alone — byte-for-byte the released behavior.
|
|
2102
|
+
*
|
|
2103
|
+
* Framework-free (any style-object type), so every UI binding merges the same
|
|
2104
|
+
* way (TeamFloPay/sdk#410, CTO decision 1).
|
|
2105
|
+
*/
|
|
2106
|
+
declare function mergeCardSetupSurface<Style extends object>(surface: Style | undefined, containerStyle: Style | undefined): Style | undefined;
|
|
2107
|
+
|
|
2108
|
+
/**
|
|
2109
|
+
* The PayPal gateway fields the direct PayPal button needs: the session's
|
|
2110
|
+
* `gateways.paypal`, or the normalized `data.paypal` copy of it.
|
|
2111
|
+
*/
|
|
2112
|
+
interface DirectPayPalGatewaySource {
|
|
2113
|
+
/** The PayPal client id. */
|
|
2114
|
+
publishableKey?: string | null;
|
|
2115
|
+
environment?: GatewayEnvironment;
|
|
2116
|
+
providerObjectType?: PayPalProviderObjectType;
|
|
2117
|
+
approvalPresentation?: PayPalApprovalPresentation;
|
|
2118
|
+
}
|
|
2119
|
+
/** What the checkout hands its card form as `directPaypal`. */
|
|
2120
|
+
interface DirectPayPalConfig {
|
|
2121
|
+
clientId: string;
|
|
2122
|
+
environment?: GatewayEnvironment;
|
|
2123
|
+
providerObjectType?: PayPalProviderObjectType;
|
|
2124
|
+
approvalPresentation?: PayPalApprovalPresentation;
|
|
2125
|
+
existingOrderId?: string;
|
|
2126
|
+
}
|
|
2127
|
+
/**
|
|
2128
|
+
* The direct PayPal config for a session's PayPal gateway: its
|
|
2129
|
+
* `publishableKey` is the PayPal client id, and `existingOrderId` is an order
|
|
2130
|
+
* to resume instead of creating one. `undefined` when the gateway has no
|
|
2131
|
+
* client id.
|
|
2132
|
+
*/
|
|
2133
|
+
declare function resolveDirectPaypalConfig(paypal: DirectPayPalGatewaySource | null | undefined, existingOrderId?: string): DirectPayPalConfig | undefined;
|
|
2134
|
+
/**
|
|
2135
|
+
* The buyer-country gate on the Stripe methods outside the wallet row (iDEAL,
|
|
2136
|
+
* Bancontact, …). The buyer's live country (the AVS select, else the static
|
|
2137
|
+
* `country`) is matched against `enabledPaymentMethodCountries`: a method
|
|
2138
|
+
* without an entry, or with an empty list, has no gate. Without the map, the
|
|
2139
|
+
* built-in country table ({@link filterStripeMethodsByCountry}) decides. With
|
|
2140
|
+
* no country, nothing is filtered and `methods` is returned as it is.
|
|
2141
|
+
*/
|
|
2142
|
+
declare function filterStripeMethodsByCountryGate(methods: string[], country: string | null | undefined, enabledPaymentMethodCountries: Record<string, string[]> | undefined): string[];
|
|
2143
|
+
/**
|
|
2144
|
+
* Whether the session can route cards to a gateway the billing API processes
|
|
2145
|
+
* entirely server-side behind the hosted vault form — today the Worldpay
|
|
2146
|
+
* Corporate Gateway (TeamFloPay/backend#1563). Such a gateway has no browser
|
|
2147
|
+
* runtime or credentials, and its payment references are not Stripe objects.
|
|
2148
|
+
*/
|
|
2149
|
+
declare function hasServerSideCardGateway(session: CheckoutSession | null | undefined): boolean;
|
|
2150
|
+
/**
|
|
2151
|
+
* Whether an open session can recover its hosted card form from
|
|
2152
|
+
* `/vault/capture` when the read omitted the embedded block. A server-side
|
|
2153
|
+
* card gateway is the explicit card capability; a terminal session has no
|
|
2154
|
+
* form left to recover.
|
|
2155
|
+
*/
|
|
2156
|
+
declare function canRecoverHostedCardForm(session: CheckoutSession | null | undefined): boolean;
|
|
2157
|
+
|
|
2051
2158
|
/** Returns whether a checkout deliberately stops after placing an authorization hold. */
|
|
2052
2159
|
declare function isAuthorizationOnlySession(session?: {
|
|
2053
2160
|
captureMethod?: CaptureMethod;
|
|
@@ -2147,6 +2254,62 @@ declare function buildItemPayload(item: CheckoutItem, sessionCurrency: string):
|
|
|
2147
2254
|
*/
|
|
2148
2255
|
declare function buildSubscriptionPayload(subscription: CheckoutSubscription, sessionCurrency: string): Record<string, unknown>;
|
|
2149
2256
|
|
|
2257
|
+
/**
|
|
2258
|
+
* The `/process` request a checkout form sends when it continues a tokenized
|
|
2259
|
+
* payment itself (React's `SplitCardForm` `processPaymentInternal`, moved here
|
|
2260
|
+
* so every UI binding sends the same billing fields and analytics metadata).
|
|
2261
|
+
*/
|
|
2262
|
+
/** The billing inputs a checkout form holds when it posts `/process`. */
|
|
2263
|
+
interface CheckoutProcessAvsInput {
|
|
2264
|
+
/** The resolved AVS config (`resolveAVSConfig(enableAVS)`), or none when AVS is off. */
|
|
2265
|
+
avsConfig: AVSFieldConfig | null | undefined;
|
|
2266
|
+
/** The buyer's selected billing country (ISO 3166-1 alpha-2). */
|
|
2267
|
+
country: string;
|
|
2268
|
+
zip?: string | null;
|
|
2269
|
+
city?: string | null;
|
|
2270
|
+
state?: string | null;
|
|
2271
|
+
addressLine1?: string | null;
|
|
2272
|
+
addressLine2?: string | null;
|
|
2273
|
+
}
|
|
2274
|
+
/** The analytics metadata a checkout form adds to its `/process` request. */
|
|
2275
|
+
interface CheckoutProcessMetadataInput extends CheckoutProcessAvsInput {
|
|
2276
|
+
/** The form's `chv` prop, forwarded as is. */
|
|
2277
|
+
chv?: string;
|
|
2278
|
+
/** Whether AVS was enabled (the form's `avsCheck` prop). Sent as `false` when not set. */
|
|
2279
|
+
avsCheck?: boolean;
|
|
2280
|
+
/** `standard_checkout` or `embedded_checkout`. */
|
|
2281
|
+
checkoutType?: string;
|
|
2282
|
+
/** `default_layout`, `buttons_layout` or `custom_layout`. */
|
|
2283
|
+
checkoutLayout?: string;
|
|
2284
|
+
}
|
|
2285
|
+
type ProcessAccountAddress = Pick<ProcessPaymentParams['accountData'], 'country' | 'zip' | 'city' | 'state' | 'addressLine1' | 'addressLine2'>;
|
|
2286
|
+
/**
|
|
2287
|
+
* The address part of `/process`'s `accountData`: nothing without AVS.
|
|
2288
|
+
* With AVS, the country and each field that is visible for that country and
|
|
2289
|
+
* filled. When line 1 is collected but the state is hidden, the state is
|
|
2290
|
+
* derived from the postcode (US/CA) so the provider's AVS still gets one.
|
|
2291
|
+
*/
|
|
2292
|
+
declare function buildProcessPaymentAvsAccount(input: CheckoutProcessAvsInput): ProcessAccountAddress;
|
|
2293
|
+
/**
|
|
2294
|
+
* Which AVS fields were actually shown for the buyer's country, for
|
|
2295
|
+
* analytics. Country-scoped rules (e.g. `['US', 'CA']`) are flattened to
|
|
2296
|
+
* booleans. `undefined` without AVS.
|
|
2297
|
+
*/
|
|
2298
|
+
declare function buildProcessPaymentAvsExposure(avsConfig: AVSFieldConfig | null | undefined, country: string): AVSFieldConfig | undefined;
|
|
2299
|
+
/**
|
|
2300
|
+
* The checkout analytics metadata on `/process`, in the order the released
|
|
2301
|
+
* form sends it: `chv`, `avsCheck` (`false` when not set), `checkoutType`,
|
|
2302
|
+
* `checkoutLayout` and the AVS exposure.
|
|
2303
|
+
*/
|
|
2304
|
+
declare function buildCheckoutProcessMetadata(input: CheckoutProcessMetadataInput): Pick<ProcessPaymentParams, 'chv' | 'avsCheck' | 'checkoutType' | 'checkoutLayout' | 'avsConfig'>;
|
|
2305
|
+
/** How the checkout is logged: React's `resolveCheckoutLogLayout`. */
|
|
2306
|
+
type CheckoutLogLayout = 'default_layout' | 'buttons_layout' | 'custom_layout';
|
|
2307
|
+
/**
|
|
2308
|
+
* The checkout layout a `FloPayCheckout` reports: `custom_layout` when the
|
|
2309
|
+
* merchant renders its own layout, else the built-in form's layout.
|
|
2310
|
+
*/
|
|
2311
|
+
declare function resolveCheckoutLogLayout(hasCustomLayout: boolean, layout: 'default' | 'buttons' | undefined): CheckoutLogLayout;
|
|
2312
|
+
|
|
2150
2313
|
/** FloPay environment — determines which billing API URL is used. */
|
|
2151
2314
|
type FloPayEnvironment = 'staging' | 'production' | 'local';
|
|
2152
2315
|
/**
|
|
@@ -2178,7 +2341,7 @@ declare function getConfiguredBillingApiUrl(): string;
|
|
|
2178
2341
|
declare function getFloPayEnvironment(): FloPayEnvironment;
|
|
2179
2342
|
|
|
2180
2343
|
/** Current SDK version. */
|
|
2181
|
-
declare const SDK_VERSION = "1.11.
|
|
2344
|
+
declare const SDK_VERSION = "1.11.6";
|
|
2182
2345
|
/**
|
|
2183
2346
|
* HTTP header the SDK sends on checkout-session create/read requests so the
|
|
2184
2347
|
* backend can observe compatibility. Version 1.4.9 is the first release that
|
|
@@ -2696,6 +2859,36 @@ declare function buildCheckoutDisplayData(session: CheckoutSession, options?: Bu
|
|
|
2696
2859
|
/** Return true only for a non-blank email accepted by the backend validator. */
|
|
2697
2860
|
declare function isValidEmail(email: string | null | undefined): email is string;
|
|
2698
2861
|
|
|
2862
|
+
declare const EXTERNAL_METHOD_CALLBACK_GRACE_MS = 600;
|
|
2863
|
+
interface ExternalMethodFailureContext {
|
|
2864
|
+
inAppBrowser: boolean;
|
|
2865
|
+
handoffObserved: boolean;
|
|
2866
|
+
/** May corroborate a recognized signal, but never determines classification. */
|
|
2867
|
+
elapsedMs?: number;
|
|
2868
|
+
}
|
|
2869
|
+
interface ExternalMethodFailureClassification {
|
|
2870
|
+
errorCode: 'POPUP_BLOCKED' | 'PROVIDER_RUNTIME_FAILED';
|
|
2871
|
+
popupBlocked: boolean;
|
|
2872
|
+
providerDeclined: boolean;
|
|
2873
|
+
terminalReason: TelemetryTerminalReason;
|
|
2874
|
+
}
|
|
2875
|
+
/** One buyer-copy contract shared by wallets and both PayPal integrations. */
|
|
2876
|
+
declare function buildExternalMethodRecoveryMessage(displayName: string, popupBlocked: boolean, inAppBrowser: boolean): string;
|
|
2877
|
+
declare function sanitizeExternalFailureCode(value: unknown): string | undefined;
|
|
2878
|
+
declare function getProviderErrorCode(err: unknown): string | undefined;
|
|
2879
|
+
declare function getProviderDeclineCode(err: unknown): string | undefined;
|
|
2880
|
+
declare function isProviderDecline(err: unknown): boolean;
|
|
2881
|
+
declare function isPayPalAcknowledgementDeadWindow(err: unknown): boolean;
|
|
2882
|
+
/** Classifies only bounded, positive evidence; time by itself is never evidence. */
|
|
2883
|
+
declare function classifyExternalMethodFailure(err: unknown, context: ExternalMethodFailureContext): ExternalMethodFailureClassification;
|
|
2884
|
+
declare function isPopupBlockedError(err: unknown): boolean;
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
2887
|
+
* The buyer-facing copy for a raw failure message: a known backend message is
|
|
2888
|
+
* replaced, anything else is returned unchanged (`undefined` for a non-string).
|
|
2889
|
+
*/
|
|
2890
|
+
declare function applyFriendlyMessageOverride(message: string | undefined | null): string | undefined;
|
|
2891
|
+
|
|
2699
2892
|
/**
|
|
2700
2893
|
* The Stripe Elements group asking for a usage. It only selects which of
|
|
2701
2894
|
* today's values a legacy read (one without `futureUse`) keeps.
|
|
@@ -2776,6 +2969,25 @@ declare function generateIdempotencyKey(): string | undefined;
|
|
|
2776
2969
|
*/
|
|
2777
2970
|
declare function resolveIdempotencyKey(supplied?: string): string | undefined;
|
|
2778
2971
|
|
|
2972
|
+
interface CachedInlineSession {
|
|
2973
|
+
canonicalIdentity?: string;
|
|
2974
|
+
sid: string;
|
|
2975
|
+
nonce?: string;
|
|
2976
|
+
}
|
|
2977
|
+
interface CachedInlineIdempotencyKey {
|
|
2978
|
+
canonicalIdentity?: string;
|
|
2979
|
+
idempotencyKey: string;
|
|
2980
|
+
}
|
|
2981
|
+
declare function readCachedInlineSession(cacheKey: string, canonicalIdentity: string): CachedInlineSession | null;
|
|
2982
|
+
declare function readCachedInlineIdempotencyKey(cacheKey: string, canonicalIdentity: string): CachedInlineIdempotencyKey | null;
|
|
2983
|
+
declare function clearCachedInlineSession(cacheKey: string, canonicalIdentity: string): void;
|
|
2984
|
+
declare function clearCachedInlineCheckout(cacheKey: string, canonicalIdentity: string): void;
|
|
2985
|
+
declare function persistCachedInlineSession(cacheKey: string, canonicalIdentity: string, sid: string, nonce?: string): void;
|
|
2986
|
+
declare function persistCachedInlineIdempotencyKey(cacheKey: string, canonicalIdentity: string, idempotencyKey: string): void;
|
|
2987
|
+
declare function serializeCreateParams(params: InlineSessionDraft | undefined, includeRequestContext?: boolean): string;
|
|
2988
|
+
declare function hashCreateParams(params: InlineSessionDraft | undefined, includeRequestContext?: boolean): string;
|
|
2989
|
+
declare function legacyCachedSessionMatchesDraft(session: CheckoutSession | undefined, params: InlineSessionDraft): boolean;
|
|
2990
|
+
|
|
2779
2991
|
/** Schema version for the privacy-safe instrument callback contract. */
|
|
2780
2992
|
declare const FLO_INSTRUMENT_SCHEMA_VERSION: 1;
|
|
2781
2993
|
/**
|
|
@@ -2826,6 +3038,229 @@ type FloInstrumentEvent = (FloInstrumentCommonFields & {
|
|
|
2826
3038
|
phase: FloInstrumentErrorPhase;
|
|
2827
3039
|
});
|
|
2828
3040
|
|
|
3041
|
+
/**
|
|
3042
|
+
* Invoke merchant-owned code without allowing its failure to alter checkout.
|
|
3043
|
+
* Failures stay local to the merchant console and are never sent as Flo
|
|
3044
|
+
* telemetry because the SDK cannot act on merchant implementation errors.
|
|
3045
|
+
* Every UI binding (`@flopay/react`, `@flopay/vue`) calls merchant callbacks
|
|
3046
|
+
* through this one invoker.
|
|
3047
|
+
*/
|
|
3048
|
+
declare function invokeMerchantCallback(callback: (() => unknown) | undefined): void;
|
|
3049
|
+
/** An internal observation a UI binding may project onto the merchant instrument feed. */
|
|
3050
|
+
type FloInstrumentSource = {
|
|
3051
|
+
class: 'lifecycle';
|
|
3052
|
+
name: TelemetryLogName;
|
|
3053
|
+
provider?: TelemetryProviderInput;
|
|
3054
|
+
} | {
|
|
3055
|
+
class: 'technical_error';
|
|
3056
|
+
errorCode: TelemetryErrorCode;
|
|
3057
|
+
requestCategory?: TelemetryRequestCategory;
|
|
3058
|
+
provider?: TelemetryProviderInput;
|
|
3059
|
+
} | {
|
|
3060
|
+
class: 'card_surface';
|
|
3061
|
+
provider?: TelemetryProviderInput;
|
|
3062
|
+
};
|
|
3063
|
+
/** Project the closed internal taxonomy onto the smaller merchant-safe v1 contract. */
|
|
3064
|
+
declare function projectFloInstrument(source: FloInstrumentSource): FloInstrumentEvent | null;
|
|
3065
|
+
/** Instruments a checkout emits at most once per checkout identity. */
|
|
3066
|
+
declare const FLO_INSTRUMENT_ONCE_NAMES: ReadonlySet<FloInstrumentEvent['name']>;
|
|
3067
|
+
|
|
3068
|
+
/** One advertised Stripe wallet/APM, with the account the backend chose for it. */
|
|
3069
|
+
interface StripeSetupAdvertisement {
|
|
3070
|
+
/** The Stripe payment method type (`apple_pay`, `sepa_debit`, ...). */
|
|
3071
|
+
method: string;
|
|
3072
|
+
/** This entry's own publishable key: the backend can pick an account per method. */
|
|
3073
|
+
publishableKey: string;
|
|
3074
|
+
/** The setup session's own currency, from the read. Never guessed. */
|
|
3075
|
+
currency: string;
|
|
3076
|
+
}
|
|
3077
|
+
/** Direct PayPal vault flow a setup session advertises. */
|
|
3078
|
+
interface PayPalSetupAdvertisement {
|
|
3079
|
+
clientId: string;
|
|
3080
|
+
environment?: string;
|
|
3081
|
+
}
|
|
3082
|
+
/**
|
|
3083
|
+
* The methods a setup session advertises. The SDK renders exactly these: no
|
|
3084
|
+
* gateway selection, filtering or inference happens on the client.
|
|
3085
|
+
*/
|
|
3086
|
+
interface PaymentMethodSetupAdvertisement {
|
|
3087
|
+
/** The hosted vault card widget (a `card` entry, or no advertisement at all). */
|
|
3088
|
+
card: boolean;
|
|
3089
|
+
/** Stripe wallets/APMs in advertised order. */
|
|
3090
|
+
stripe: StripeSetupAdvertisement[];
|
|
3091
|
+
paypal: PayPalSetupAdvertisement | null;
|
|
3092
|
+
/** The setup session's own currency from the read, or `null` when it carries none. */
|
|
3093
|
+
currency: string | null;
|
|
3094
|
+
/**
|
|
3095
|
+
* Stripe wallets/APMs the session advertises that are not rendered only
|
|
3096
|
+
* because the read carries no currency, so a session that offers nothing
|
|
3097
|
+
* else can say why instead of claiming it advertises nothing.
|
|
3098
|
+
*/
|
|
3099
|
+
skippedForMissingCurrency: string[];
|
|
3100
|
+
}
|
|
3101
|
+
/**
|
|
3102
|
+
* Read the advertisement from a normalized setup session. Only the session's
|
|
3103
|
+
* `advertisedPaymentMethods` decides it (backend docs/card-setup.md,
|
|
3104
|
+
* "Advertised payment methods"); the purchase-checkout gateway block is never
|
|
3105
|
+
* read, since it lists nothing on a setup session.
|
|
3106
|
+
*
|
|
3107
|
+
* - Field absent (an older backend): the card only, exactly as `FloPayCardSetup`.
|
|
3108
|
+
* - `family: "card"`: the hosted vault card widget.
|
|
3109
|
+
* - `family: "wallet"` / `"apm"` with `providerType: "stripe"`: that Stripe
|
|
3110
|
+
* method, with the entry's own publishable key. Skipped when the read carries
|
|
3111
|
+
* no currency, and listed in `skippedForMissingCurrency`.
|
|
3112
|
+
* - `family: "paypal"` (`paypal_vaulted`): the PayPal vault flow, with the
|
|
3113
|
+
* entry's key as the client id and its environment. It owns `paypal`, so a
|
|
3114
|
+
* Stripe-rendered `paypal` entry is not drawn a second time.
|
|
3115
|
+
* - Anything else is skipped, never thrown on. The first entry for a
|
|
3116
|
+
* `paymentMethodType` wins.
|
|
3117
|
+
*/
|
|
3118
|
+
declare function readSetupAdvertisement(normalized: NormalizedCheckoutSession): PaymentMethodSetupAdvertisement;
|
|
3119
|
+
/** The marker of every method the advertisement renders, card first. */
|
|
3120
|
+
declare function advertisedMethodKeys(advertisement: PaymentMethodSetupAdvertisement): string[];
|
|
3121
|
+
/** Whether the advertisement offers anything to render. */
|
|
3122
|
+
declare function advertisesAnyMethod(advertisement: PaymentMethodSetupAdvertisement): boolean;
|
|
3123
|
+
/** The session-intent category for an advertised Stripe method. */
|
|
3124
|
+
declare function stripeMethodCategory(method: string): 'wallet' | 'apm';
|
|
3125
|
+
/** Which wording the outcome overlay uses: card wording only for the card widget. */
|
|
3126
|
+
type SetupOverlayWording = 'card' | 'payment_method';
|
|
3127
|
+
/** Processing / success / failure overlay labels for a setup outcome. */
|
|
3128
|
+
declare function setupOverlayLabels(wording: SetupOverlayWording): {
|
|
3129
|
+
processingLabel: string;
|
|
3130
|
+
successLabel: string;
|
|
3131
|
+
errorLabel: string;
|
|
3132
|
+
};
|
|
3133
|
+
|
|
3134
|
+
/**
|
|
3135
|
+
* The buyer identity an express surface attaches to the checkout: the
|
|
3136
|
+
* session-patch `account` shape (email and names, plus any other account
|
|
3137
|
+
* fields the click-time patch carried).
|
|
3138
|
+
*/
|
|
3139
|
+
type PayPalBuyerIdentity = NonNullable<InlineSessionPatch['account']>;
|
|
3140
|
+
/**
|
|
3141
|
+
* Trims the names and drops empty ones. Express continuations use empty name
|
|
3142
|
+
* markers to clear hydrated fallbacks through JSON checkpoints
|
|
3143
|
+
* (`preserveMissingNames`); the final process payload strips them again.
|
|
3144
|
+
*/
|
|
3145
|
+
declare function compactBuyerIdentity(identity: PayPalBuyerIdentity, preserveMissingNames?: boolean): PayPalBuyerIdentity;
|
|
3146
|
+
/** Splits a full name at the first whitespace run; a card-holder placeholder is no name. */
|
|
3147
|
+
declare function splitFullName(name: string | null | undefined): {
|
|
3148
|
+
firstName?: string;
|
|
3149
|
+
lastName?: string;
|
|
3150
|
+
};
|
|
3151
|
+
/** The payer PayPal reports for an approved order (`actions.order.get()`). */
|
|
3152
|
+
declare function readPayPalPayerIdentity(details: unknown): PayPalBuyerIdentity;
|
|
3153
|
+
/**
|
|
3154
|
+
* The buyer identity a PayPal approval starts from: the click-time account
|
|
3155
|
+
* patch wins, then the host's `email` and `billingName`, then the session's
|
|
3156
|
+
* customer.
|
|
3157
|
+
*/
|
|
3158
|
+
declare function resolvePayPalApprovalIdentity(input: {
|
|
3159
|
+
accountPatch?: InlineSessionPatch['account'] | null;
|
|
3160
|
+
email?: string | null;
|
|
3161
|
+
billingName?: string | null;
|
|
3162
|
+
session?: CheckoutSession | null;
|
|
3163
|
+
}): PayPalBuyerIdentity;
|
|
3164
|
+
/** Whether the approval still lacks a valid email or any name, so PayPal's payer is read. */
|
|
3165
|
+
declare function needsPayPalPayerDetails(identity: PayPalBuyerIdentity): boolean;
|
|
3166
|
+
/** Fills the approval identity's gaps from PayPal's order details; PayPal's payer wins per field. */
|
|
3167
|
+
declare function mergePayPalPayerIdentity(identity: PayPalBuyerIdentity, details: unknown): PayPalBuyerIdentity;
|
|
3168
|
+
/**
|
|
3169
|
+
* Whether a PayPal approval must collect the buyer's email itself: no valid
|
|
3170
|
+
* email is known from the host or the session.
|
|
3171
|
+
*/
|
|
3172
|
+
declare function paypalProviderIdentityRequired(email: string | null | undefined, session: CheckoutSession | null | undefined): boolean;
|
|
3173
|
+
/**
|
|
3174
|
+
* Chooses a PayPal presentation without ever hiding PayPal. Deterministic
|
|
3175
|
+
* non-popup modes are limited to one-time Orders in an in-app browser and
|
|
3176
|
+
* require the backend's advertisement.
|
|
3177
|
+
*/
|
|
3178
|
+
declare function resolvePayPalPresentationMode(environment: PayPalBrowserEnvironment, advertisedCapability: TelemetryPresentationMode | undefined, providerObjectType: PayPalProviderObjectType): TelemetryPresentationMode;
|
|
3179
|
+
|
|
3180
|
+
/**
|
|
3181
|
+
* Whether the configured PayPal object rides the Flo-owned `paypal_vaulted`
|
|
3182
|
+
* channel. An explicitly configured `order` or `setup_token` (the session's
|
|
3183
|
+
* advertisement, or the deprecated prop as a fallback) does. A legacy session
|
|
3184
|
+
* with neither, and an advertised provider-managed `subscription`, keep the
|
|
3185
|
+
* released `paypal` requests byte-identical.
|
|
3186
|
+
*/
|
|
3187
|
+
declare function usesPayPalVaultedChannel(configuredObjectType: PayPalProviderObjectType | undefined): boolean;
|
|
3188
|
+
/**
|
|
3189
|
+
* The `/intents` request body for a direct PayPal button. The payment-method
|
|
3190
|
+
* type is the in-band channel selector: the Flo-owned channel asks for
|
|
3191
|
+
* `paypal_vaulted` (with `intentKind: 'setup'` for a vault setup token); the
|
|
3192
|
+
* legacy channel asks for `paypal` with `intentKind: 'payment'`.
|
|
3193
|
+
*/
|
|
3194
|
+
declare function buildPayPalSessionIntentRequest(configuredObjectType: PayPalProviderObjectType | undefined): PayPalSessionIntentRequest;
|
|
3195
|
+
/**
|
|
3196
|
+
* The tokenized body for PayPal's approval token. A vault setup token and an
|
|
3197
|
+
* advertised order carry the Flo-owned channel so the backend can continue on
|
|
3198
|
+
* it; the legacy fallback keeps the released body byte-identical.
|
|
3199
|
+
*/
|
|
3200
|
+
declare function buildPayPalTokenizedBody(token: string, configuredObjectType: PayPalProviderObjectType | undefined): TokenizedBody;
|
|
3201
|
+
/** What a direct PayPal button knows when it completes an approval itself. */
|
|
3202
|
+
interface PayPalProcessPaymentInput {
|
|
3203
|
+
/** The approval's tokenized body ({@link buildPayPalTokenizedBody}). */
|
|
3204
|
+
body: TokenizedBody;
|
|
3205
|
+
/** The session the attempt runs on (the click-time patch's, else the button's). */
|
|
3206
|
+
sessionId: string;
|
|
3207
|
+
/** The checkout session token for the attempt. */
|
|
3208
|
+
nonce: string | undefined;
|
|
3209
|
+
/** The click-time account patch from `runBeforeButtonClick`. */
|
|
3210
|
+
accountPatch?: InlineSessionPatch['account'];
|
|
3211
|
+
/** The checkout session, for the buyer's identity and address. */
|
|
3212
|
+
session?: CheckoutSession | null;
|
|
3213
|
+
/** The button's `email` prop. */
|
|
3214
|
+
email?: string;
|
|
3215
|
+
}
|
|
3216
|
+
/**
|
|
3217
|
+
* The `/process` call a direct PayPal button makes when no host takes the
|
|
3218
|
+
* tokenized body: the click-time account patch wins, then the session's
|
|
3219
|
+
* customer, then its account data. Returns the (vestigial) user id argument
|
|
3220
|
+
* and the request, in the field order the released button sends.
|
|
3221
|
+
*/
|
|
3222
|
+
declare function buildPayPalProcessPaymentRequest(input: PayPalProcessPaymentInput): {
|
|
3223
|
+
userId: string;
|
|
3224
|
+
params: ProcessPaymentParams;
|
|
3225
|
+
};
|
|
3226
|
+
/**
|
|
3227
|
+
* The buyer-facing message for a failed PayPal payment: the raw message (or
|
|
3228
|
+
* the generic fallback) through the shared friendly-message override.
|
|
3229
|
+
*/
|
|
3230
|
+
declare function friendlyPayPalFailureMessage(rawMessage: string | undefined): string;
|
|
3231
|
+
/** A rejected PayPal `/process` response body, read for the buyer message and the decline codes. */
|
|
3232
|
+
declare function describePayPalProcessFailure(json: Record<string, unknown> | null): {
|
|
3233
|
+
message: string;
|
|
3234
|
+
code: string | undefined;
|
|
3235
|
+
declineCode: string | undefined;
|
|
3236
|
+
};
|
|
3237
|
+
/**
|
|
3238
|
+
* The `providerDeclineReason` a PayPal decline reports to `/intents/decline`:
|
|
3239
|
+
* the provider's decline code, then its error code, then the generic reason.
|
|
3240
|
+
*/
|
|
3241
|
+
declare function resolvePayPalDeclineReason(error: unknown): string;
|
|
3242
|
+
/**
|
|
3243
|
+
* Zoid (PayPal's iframe framework) reports its own teardown through `onError`:
|
|
3244
|
+
* "zoid destroyed all components", a closed window, a removed container. Those
|
|
3245
|
+
* are page navigation or unmounting, not payment errors, so no binding shows
|
|
3246
|
+
* them to the buyer.
|
|
3247
|
+
*/
|
|
3248
|
+
declare function isPayPalTeardownMessage(message: string | undefined): boolean;
|
|
3249
|
+
|
|
3250
|
+
/** Privacy-bounded browser context shared by PayPal presentation and telemetry. */
|
|
3251
|
+
interface PayPalBrowserEnvironment {
|
|
3252
|
+
inAppBrowser: boolean;
|
|
3253
|
+
appFamily: TelemetryAppFamily;
|
|
3254
|
+
popupCapability: TelemetryPopupCapability;
|
|
3255
|
+
}
|
|
3256
|
+
/**
|
|
3257
|
+
* Classifies an in-app browser without retaining or returning its user agent.
|
|
3258
|
+
*
|
|
3259
|
+
* Static UA evidence cannot prove that a popup will open, so capability stays
|
|
3260
|
+
* `unknown`; runtime lifecycle evidence is reported separately.
|
|
3261
|
+
*/
|
|
3262
|
+
declare function detectPayPalEnvironment(userAgent?: string): PayPalBrowserEnvironment;
|
|
3263
|
+
|
|
2829
3264
|
/**
|
|
2830
3265
|
* Postal-code → state derivation for AVS.
|
|
2831
3266
|
*
|
|
@@ -2878,6 +3313,55 @@ declare function isValidPostalCode(country: string, postalCode: string): boolean
|
|
|
2878
3313
|
*/
|
|
2879
3314
|
declare function getPostalCodeExample(country: string): string | undefined;
|
|
2880
3315
|
|
|
3316
|
+
/** The submit-button style fields a themed tile copies (any CSS-like record). */
|
|
3317
|
+
interface PrimaryTileSubmitStyle {
|
|
3318
|
+
color?: unknown;
|
|
3319
|
+
border?: unknown;
|
|
3320
|
+
borderRadius?: unknown;
|
|
3321
|
+
boxShadow?: unknown;
|
|
3322
|
+
}
|
|
3323
|
+
/** Inputs for {@link derivePrimaryTileStyle}. */
|
|
3324
|
+
interface PrimaryTileStyleSource {
|
|
3325
|
+
themeBundle: ThemeBundle | null | undefined;
|
|
3326
|
+
resolvedPrimaryColor: string;
|
|
3327
|
+
resolvedBorderRadius: string;
|
|
3328
|
+
submitButtonStyle?: PrimaryTileSubmitStyle | undefined;
|
|
3329
|
+
/**
|
|
3330
|
+
* Raw `appearance.colorPrimary` (undefined when the merchant didn't set one).
|
|
3331
|
+
* When present it forces a primary-filled tile even with no theme bundle
|
|
3332
|
+
* (the `classic` preset), so an explicit `colorPrimary` override always wins
|
|
3333
|
+
* over the historic white tile.
|
|
3334
|
+
*/
|
|
3335
|
+
explicitPrimaryColor?: string | undefined;
|
|
3336
|
+
}
|
|
3337
|
+
/** The colour and shape of a primary tile. */
|
|
3338
|
+
interface PrimaryTileStyle {
|
|
3339
|
+
backgroundColor: string;
|
|
3340
|
+
color: string;
|
|
3341
|
+
border: string;
|
|
3342
|
+
borderRadius: string | number;
|
|
3343
|
+
boxShadow?: string | undefined;
|
|
3344
|
+
}
|
|
3345
|
+
/**
|
|
3346
|
+
* Base colours for a primary tile (the buttons-layout card tile and the
|
|
3347
|
+
* one-click button):
|
|
3348
|
+
*
|
|
3349
|
+
* - `'classic'` / no theme: white background, grey border — historic look
|
|
3350
|
+
* that lines up with the wallet ECE row's flat tiles.
|
|
3351
|
+
* - Any theme bundle (`modern-*`, `bold-*`, `glass-*`): `colorPrimary`
|
|
3352
|
+
* (`resolvedPrimaryColor` — already merged with any `appearance` override)
|
|
3353
|
+
* drives the `backgroundColor`, exactly like the "Confirm Payment" submit
|
|
3354
|
+
* CTA, so all three flo buttons (submit, card, auto-pay) share one fill and
|
|
3355
|
+
* a per-checkout `colorPrimary` override re-skins every one of them. The
|
|
3356
|
+
* bundle's `submitButton` still supplies `color` / `border` / `borderRadius`
|
|
3357
|
+
* / `boxShadow` so typography + shape stay on-theme. Hover (`colorPrimaryHover`)
|
|
3358
|
+
* is applied by each button's mouse-enter / mouse-leave at the call site.
|
|
3359
|
+
*/
|
|
3360
|
+
declare function derivePrimaryTileStyle(opts: PrimaryTileStyleSource): PrimaryTileStyle;
|
|
3361
|
+
|
|
3362
|
+
declare function markSessionRecentlyCompleted(sessionId: string | null | undefined): void;
|
|
3363
|
+
declare function wasSessionRecentlyCompleted(sessionId: string | null | undefined): boolean;
|
|
3364
|
+
|
|
2881
3365
|
interface SentryStackFrameLike {
|
|
2882
3366
|
in_app?: boolean;
|
|
2883
3367
|
filename?: string;
|
|
@@ -2900,6 +3384,67 @@ interface SentryEventLike {
|
|
|
2900
3384
|
*/
|
|
2901
3385
|
declare function dropThirdPartyOnlyError<T extends SentryEventLike>(event: T): T | null;
|
|
2902
3386
|
|
|
3387
|
+
/**
|
|
3388
|
+
* A `FloPayAppearance` whose `theme` has been normalized to the set Stripe's
|
|
3389
|
+
* Appearance API accepts, so it can be handed straight to Stripe Elements
|
|
3390
|
+
* without tripping Stripe.js's `Invalid value … provided to "theme"` warning.
|
|
3391
|
+
*/
|
|
3392
|
+
interface StripeSafeAppearance {
|
|
3393
|
+
theme: 'stripe' | 'night' | 'flat';
|
|
3394
|
+
variables?: FloPayThemeVariables;
|
|
3395
|
+
rules?: Record<string, Record<string, string>>;
|
|
3396
|
+
}
|
|
3397
|
+
/** Maps FloPay's public appearance token to Stripe's accepted theme set. */
|
|
3398
|
+
declare function toStripeAppearanceTheme(theme: 'default' | 'flat' | 'night' | 'none' | undefined): 'stripe' | 'night' | 'flat';
|
|
3399
|
+
/**
|
|
3400
|
+
* Normalizes a FloPay appearance before a UI binding passes it to Stripe
|
|
3401
|
+
* Elements. Lives here, free of Stripe.js, so the Stripe-free entries and
|
|
3402
|
+
* every UI binding share one mapping (TeamFloPay/sdk#410, CTO decision 1).
|
|
3403
|
+
*/
|
|
3404
|
+
declare function toStripeAppearance(appearance: FloPayAppearance): StripeSafeAppearance;
|
|
3405
|
+
|
|
3406
|
+
/**
|
|
3407
|
+
* Selects the safe Stripe-routed PayPal surface for the active checkout mount
|
|
3408
|
+
* from the merchant's `walletPresentation` preference. An in-app browser, a
|
|
3409
|
+
* pop-up the browser blocked, or `prefer_redirect` gives the full-page
|
|
3410
|
+
* redirect; anything else keeps the pop-up. Moved from @flopay/react's
|
|
3411
|
+
* `in-app-browser.ts` so @flopay/vue resolves `walletPresentation` the same way.
|
|
3412
|
+
*/
|
|
3413
|
+
declare function resolveStripePayPalPresentation(environment: PayPalBrowserEnvironment, preference: WalletPresentation, popupCapability?: TelemetryPopupCapability): 'popup' | 'redirect';
|
|
3414
|
+
/**
|
|
3415
|
+
* Storage key carrying the effective session / nonce / account patch across a
|
|
3416
|
+
* Stripe-routed PayPal redirect, so the return can `/process` against the same
|
|
3417
|
+
* session PayPal authorized (an inline-session bootstrap inside the click gate
|
|
3418
|
+
* would otherwise be lost when the page reloads after the PayPal round-trip).
|
|
3419
|
+
*/
|
|
3420
|
+
declare const STRIPE_PAYPAL_RESUME_KEY = "flopay_paypal_resume";
|
|
3421
|
+
/** The query parameters Stripe appends to the return URL after a redirect. */
|
|
3422
|
+
declare const STRIPE_REDIRECT_PARAMS: readonly ["payment_intent", "payment_intent_client_secret", "redirect_status"];
|
|
3423
|
+
interface StripePayPalResumeContinuation<TAccount = unknown> {
|
|
3424
|
+
clientSecret?: string;
|
|
3425
|
+
sessionId?: string;
|
|
3426
|
+
nonce?: string;
|
|
3427
|
+
accountPatch?: TAccount;
|
|
3428
|
+
}
|
|
3429
|
+
/** `[payment_intent, payment_intent_client_secret, redirect_status]` from the current URL. */
|
|
3430
|
+
declare function readStripeRedirectParams(): [string | null, string | null, string | null];
|
|
3431
|
+
/** The current URL without Stripe's redirect parameters (the PayPal `return_url`). */
|
|
3432
|
+
declare function stripeRedirectReturnUrl(): string;
|
|
3433
|
+
/**
|
|
3434
|
+
* The saved continuation, only when it belongs to `clientSecret`, so a stale
|
|
3435
|
+
* payload from a prior attempt can't replay against a different PaymentIntent.
|
|
3436
|
+
*/
|
|
3437
|
+
declare function readMatchingStripePayPalContinuation<TAccount = unknown>(clientSecret: string | null): StripePayPalResumeContinuation<TAccount> | null;
|
|
3438
|
+
/** Whether this page load is the return of a Stripe-routed PayPal redirect this browser started. */
|
|
3439
|
+
declare function hasMatchingStripePayPalReturn(): boolean;
|
|
3440
|
+
/**
|
|
3441
|
+
* Saves the continuation, or removes it when called without one. Returns
|
|
3442
|
+
* whether storage accepted the change (a redirect must not start without it).
|
|
3443
|
+
*/
|
|
3444
|
+
declare function writeStripePayPalContinuation(continuation?: StripePayPalResumeContinuation): boolean;
|
|
3445
|
+
/** Consumes the continuation and strips Stripe's redirect parameters from the URL. */
|
|
3446
|
+
declare function clearStripePayPalReturn(): void;
|
|
3447
|
+
|
|
2903
3448
|
interface ClassifiedTelemetryFailure {
|
|
2904
3449
|
errorCode: TelemetryErrorCode;
|
|
2905
3450
|
statusClass: TelemetryStatusClass;
|
|
@@ -2953,6 +3498,34 @@ declare function isSetupIntentClientSecret(clientSecret: string | null | undefin
|
|
|
2953
3498
|
/** Treat the checkout's normalized fallback cardholder sentinel as absent. */
|
|
2954
3499
|
declare function isCardHolderNamePlaceholder(...nameParts: Array<string | null | undefined>): boolean;
|
|
2955
3500
|
|
|
3501
|
+
/**
|
|
3502
|
+
* Darken a `#rrggbb` color by `amount` (0–1) — used to derive a flo-button hover
|
|
3503
|
+
* shade from the primary when the theme doesn't supply an explicit
|
|
3504
|
+
* `colorPrimaryHover`. Returns the input unchanged for non-hex values.
|
|
3505
|
+
*/
|
|
3506
|
+
declare function darkenHex(hex: string, amount?: number): string;
|
|
3507
|
+
/** Pass through CSS font-weight values; anything else resolves to undefined. */
|
|
3508
|
+
declare function toCssWeight(value: string | number | undefined): string | number | undefined;
|
|
3509
|
+
/** Inputs for {@link computeVaultCardThemeColors}. */
|
|
3510
|
+
interface VaultThemeSource {
|
|
3511
|
+
/** Stripe-side appearance (a theme bundle's, or the merchant's override). */
|
|
3512
|
+
appearance?: FloPayAppearance | undefined;
|
|
3513
|
+
/** Resolved buttons-layout styles (bundle + merchant overrides merged). */
|
|
3514
|
+
buttonsStyles: ButtonsLayoutStyles;
|
|
3515
|
+
/** Surrounding layout — affects the neutral border fallback. */
|
|
3516
|
+
layout?: 'default' | 'buttons';
|
|
3517
|
+
}
|
|
3518
|
+
/**
|
|
3519
|
+
* Colors pushed into the hosted vault widget so the backend-rendered card form
|
|
3520
|
+
* matches the merchant's theme. The SDK owns *all* theming here — every value
|
|
3521
|
+
* resolves from the theme bundle / appearance overrides (same precedence the
|
|
3522
|
+
* SDK uses for its merchant-hosted AVS inputs); the backend ships only neutral
|
|
3523
|
+
* fallbacks for when a var is absent. Shared by `SplitCardForm` (checkout) and
|
|
3524
|
+
* `FloPayCardSetup` (no-charge card setup) so one `theme` value renders the
|
|
3525
|
+
* same hosted card form everywhere.
|
|
3526
|
+
*/
|
|
3527
|
+
declare function computeVaultCardThemeColors({ appearance, buttonsStyles, layout, }: VaultThemeSource): VaultCardThemeColors;
|
|
3528
|
+
|
|
2956
3529
|
/**
|
|
2957
3530
|
* Production card-capture verification (TeamFloPay/backend#1920, sdk#414).
|
|
2958
3531
|
*
|
|
@@ -2998,4 +3571,31 @@ interface VaultMountContext {
|
|
|
2998
3571
|
*/
|
|
2999
3572
|
declare function resolveVaultMountOptions(block: VaultCaptureBlock | null | undefined, context: VaultMountContext): CardCaptureMountOptions | null;
|
|
3000
3573
|
|
|
3001
|
-
|
|
3574
|
+
/**
|
|
3575
|
+
* Deferred Stripe Elements mode for the wallet / Express Checkout row
|
|
3576
|
+
* (Apple Pay, Google Pay), from the cart total due today.
|
|
3577
|
+
*
|
|
3578
|
+
* A $0-today cart (free trial) cannot run in `payment` mode: Stripe rejects a
|
|
3579
|
+
* `$0` amount with "amount must be greater than 0", and the historic
|
|
3580
|
+
* `amount: totalAmount || 100` floor surfaced a misleading **$1.00** charge on
|
|
3581
|
+
* the wallet sheet. Those carts run in `setup` mode instead — the wallet
|
|
3582
|
+
* collects the card for the trial with no amount shown, matching the backend's
|
|
3583
|
+
* SetupIntent. Any positive amount keeps `payment` mode with the real total.
|
|
3584
|
+
*
|
|
3585
|
+
* Moved from `@flopay/react`'s `resolveWalletElementsMode` so `@flopay/react`
|
|
3586
|
+
* and `@flopay/vue` decide the wallet row's mode, amount and capture method
|
|
3587
|
+
* with one implementation. Each caller adds its method list and the usage
|
|
3588
|
+
* from `resolveSetupFutureUsage`.
|
|
3589
|
+
*
|
|
3590
|
+
* @param amountInMinorUnits cart total due today, in the smallest currency unit.
|
|
3591
|
+
* @param captureMethod capture contract used by the subsequently created intent.
|
|
3592
|
+
*/
|
|
3593
|
+
declare function resolveWalletModeOptions(amountInMinorUnits: number | undefined, captureMethod?: CaptureMethod): {
|
|
3594
|
+
mode: 'setup';
|
|
3595
|
+
} | {
|
|
3596
|
+
mode: 'payment';
|
|
3597
|
+
amount: number;
|
|
3598
|
+
captureMethod: 'automatic_async' | 'manual';
|
|
3599
|
+
};
|
|
3600
|
+
|
|
3601
|
+
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 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, mergeCardSetupSurface, mergePayPalPayerIdentity, needsPayPalPayerDetails, needsStripeMethodExplicitConfirm, networkError, normalizeBeforeButtonClickError, normalizeCheckoutFailureOutcome, normalizeGatewayEnvironment, partitionStripeMethods, paypalProviderIdentityRequired, persistCachedInlineIdempotencyKey, persistCachedInlineSession, projectFloInstrument, randomUuidV4, rateLimitError, readCachedInlineIdempotencyKey, readCachedInlineSession, readMatchingStripePayPalContinuation, readPayPalPayerIdentity, readSetupAdvertisement, readStripeRedirectParams, resolveAVSConfig, resolveBillingApiUrl, resolveButtonsLayoutTheme, 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 };
|