import React from 'react'; import { MFCurrencyISO, MFV3PaymentMode } from './MFEnums'; import { MFV3GetSessionData, MFV3PaymentResult, MFV3SessionData, MFV3VerifyResult, MFV3WidgetEvent, MFCardViewStyle, MFError } from './MFModels'; export interface IMFCardViewV3Props { /** Width/positioning styles for the card view container. Height is driven automatically. */ style?: any; /** Reused MFCardViewStyle object. `ShowCardholderName` is V3-only. */ paymentStyle?: MFCardViewStyle; /** Fired whenever the widget's content height changes (the view resizes itself too). */ onHeightChanged?: (height: number) => void; /** Fired for subscribed widget lifecycle events (VIEW_READY, CARD_IDENTIFIED, ...). */ onWidgetEvent?: (event: MFV3WidgetEvent) => void; /** Fired if the widget fails to load (e.g. a session id missing its country prefix). */ onError?: (error: MFError) => void; } interface IMFCardViewV3State { height: number; } /** * The V3 embedded card view. Renders a native, per-instance card widget (no singleton). * Usage: * const ref = useRef(null); * const session = await MFV3Session.create({ amount: 1, currency: MFCurrencyISO.KUWAIT_KWD }); * await ref.current.load(session); * const result = await ref.current.submit(MFCurrencyISO.KUWAIT_KWD); */ export declare class MFCardViewV3 extends React.Component { private cardId; private subscriptions; constructor(props: IMFCardViewV3Props); componentDidMount(): void; componentWillUnmount(): void; private isForThisView; /** Renders the card widget for the given session. Call before submit/verify. */ load(session: MFV3SessionData): Promise; /** Submits the entered card (pay / collect, per the session mode). */ submit(currency?: MFCurrencyISO): Promise; /** Verifies the entered card (VERIFY session — no charge). */ verify(): Promise; render(): React.JSX.Element; } export interface IMFV3CreateSessionRequest { amount: number; currency?: MFCurrencyISO; mode?: MFV3PaymentMode; require3DS?: boolean; saveCard?: boolean; customerReference?: string; } export interface IMFV3CreateVerifySessionRequest { customerReference: string; currency?: MFCurrencyISO; require3DS?: boolean; } /** * Session helpers. Two integration paths: * - SDK path: create / createVerify use the API key set via MFSDK.init. * - Backend path: your server creates the session; pass the id to fromBackend. */ export declare const MFV3Session: { create(request: IMFV3CreateSessionRequest): Promise; createVerify(request: IMFV3CreateVerifySessionRequest): Promise; /** * Backend path: build a session from an id your server created via POST /v3/sessions. * SessionId must be the full country-prefixed id (e.g. "KWT-abc123"). Pass * encryptionKey too if you want the SDK to decrypt the inline (non-3DS) result. */ fromBackend(sessionId: string, encryptionKey?: string): MFV3SessionData; }; export type { MFV3PaymentResult, MFV3VerifyResult, MFV3SessionData, MFV3GetSessionData, MFV3WidgetEvent }; //# sourceMappingURL=MFCardV3.d.ts.map