@flopay/react 1.20.0 → 1.20.2

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.
@@ -0,0 +1,31 @@
1
+ import type { CheckoutRuntimeEvent } from '@flopay/js';
2
+ import { FloPayError } from '@flopay/shared';
3
+ import type { ReactElement } from 'react';
4
+ export interface FloPayRuntimeCheckoutProps {
5
+ publishableKey: string;
6
+ /** A session the merchant's server created. */
7
+ sessionId?: string;
8
+ nonce?: string;
9
+ /**
10
+ * An inline-created session, used when there is no `sessionId`: the billing API's create
11
+ * body, passed to the runtime as given (see `CheckoutRuntimeMountOptions.createSession`).
12
+ */
13
+ createSession?: Record<string, unknown>;
14
+ appearance?: Record<string, unknown>;
15
+ /** Merchant wording overrides, applied by the runtime over the strings the API returns. */
16
+ strings?: Record<string, string>;
17
+ /** The Flo-origin runtime script. */
18
+ runtimeUrl: string;
19
+ /** How long the runtime has to load before `onError` fires. Defaults to 10 seconds. */
20
+ runtimeTimeoutMs?: number;
21
+ onEvent?: (event: CheckoutRuntimeEvent) => void;
22
+ onError?: (error: FloPayError) => void;
23
+ }
24
+ /**
25
+ * A card checkout that runs from the Flo-hosted runtime. The component holds no checkout
26
+ * logic: it loads the runtime, mounts it in a container, passes its props through, relays the
27
+ * runtime's events to `onEvent`, and reports a runtime that cannot load to `onError`.
28
+ * A change to the session (`sessionId`, `nonce`, `createSession`), the key or the runtime
29
+ * mounts the checkout again; `appearance` and `strings` update the mounted checkout.
30
+ */
31
+ export declare function FloPayRuntimeCheckout(props: FloPayRuntimeCheckoutProps): ReactElement;