@adyen/react-native
Version:
Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native
19 lines (15 loc) • 652 B
text/typescript
import { NativeModules } from 'react-native';
import { ModuleMock } from '../base/ModuleMock';
import { AdyenCSEWrapper } from './AdyenCSEModuleWrapper';
import type { Card } from './types';
/** Describes a native module capable of encrypting card data. */
export interface AdyenCSEModule {
/** Method to encrypt card. */
encryptCard(payload: Card, publicKey: string): Promise<Card>;
/** Method to encrypt BIN(first 6-11 digits of the card). */
encryptBin(payload: string, publicKey: string): Promise<string>;
}
/** Encryption helper. */
export const AdyenCSE: AdyenCSEModule = new AdyenCSEWrapper(
NativeModules.AdyenCSE ?? ModuleMock
);