UNPKG

@adyen/react-native

Version:

Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native

39 lines (31 loc) 1.11 kB
import type { AddressLookupItem, PaymentAction } from '../../core'; import { EventListenerWrapper } from '../base/EventListenerWrapper'; import type { EmbeddedNativeModule } from './EmbeddedComponentBus'; /** * Communication bus for all embedded Native Modules. * */ export class EmbeddedComponentBusWrapper extends EventListenerWrapper<EmbeddedNativeModule> { name: string = 'AdyenComponentBus'; subscribe(viewId: string): void { this.nativeModule.subscribe(viewId); } unsubscribe(viewId: string): void { this.nativeModule.unsubscribe(viewId); } handle(viewId: string, action: PaymentAction): void { this.nativeModule.handle(viewId, action); } hide(viewId: string, success: boolean, option?: { message?: string }): void { this.nativeModule.hide(viewId, success, option); } update(viewId: string, results: AddressLookupItem[]): void { this.nativeModule.update(viewId, results); } confirm( viewId: string, success: boolean, body?: AddressLookupItem | { message?: string } ): void { this.nativeModule.confirm(viewId, success, body); } }