react-native-klarna-inapp-sdk
Version:
This library wraps Klarna Mobile SDK and exposes its functionality as React Native components.
51 lines • 2.36 kB
TypeScript
import React, { Component, type RefObject } from 'react';
import type { NativeMethods, ViewStyle } from 'react-native';
import { type RNKlarnaPaymentViewProps } from './specs/KlarnaPaymentViewNativeComponent';
export interface KlarnaPaymentViewProps {
style: ViewStyle;
readonly category: string;
readonly returnUrl: string;
readonly onInitialized: () => void;
readonly onLoaded: () => void;
readonly onLoadedPaymentReview: () => void;
readonly onAuthorized: (approved: boolean, authToken: string | null, finalizeRequired: boolean | null) => void;
readonly onReauthorized: (approved: boolean, authToken: string | null) => void;
readonly onFinalized: (approved: boolean, authToken: string | null) => void;
readonly onError: (error: KlarnaPaymentsSDKError) => void;
}
interface KlarnaReactPaymentViewOldProps {
style: ViewStyle;
readonly category: string;
readonly returnUrl?: string;
readonly onInitialized?: (event: any) => void;
readonly onLoaded?: (event: any) => void;
readonly onLoadedPaymentReview?: (event: any) => void;
readonly onAuthorized?: (event: any) => void;
readonly onReauthorized?: (event: any) => void;
readonly onFinalized?: (event: any) => void;
readonly onError?: (event: any) => void;
}
type KlarnaPaymentViewPropsAny = KlarnaPaymentViewProps | KlarnaReactPaymentViewOldProps;
interface KlarnaPaymentViewState {
nativeViewHeight: number;
}
export declare class KlarnaPaymentView extends Component<KlarnaPaymentViewPropsAny, KlarnaPaymentViewState> {
paymentViewRef: RefObject<Component<RNKlarnaPaymentViewProps> & Readonly<NativeMethods>>;
constructor(props: KlarnaPaymentViewPropsAny);
render(): React.JSX.Element;
initialize: (clientToken: string, returnUrl?: string | null) => void;
load: (sessionData?: string | null) => void;
loadPaymentReview: () => void;
authorize: (autoFinalize?: boolean | null, sessionData?: string | null) => void;
reauthorize: (sessionData?: string | null) => void;
finalize: (sessionData?: string | null) => void;
}
export interface KlarnaPaymentsSDKError {
readonly action: string;
readonly isFatal: boolean;
readonly message: string;
readonly name: string;
readonly sessionId: string;
}
export default KlarnaPaymentView;
//# sourceMappingURL=KlarnaPaymentView.d.ts.map