UNPKG

@adyen/react-native

Version:

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

42 lines (41 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EmbeddedComponentProxy = void 0; /** * Proxy that binds a viewId to all outbound native module calls. * Passed to merchant callbacks as the `component` argument so that * `component.handle(action)` routes to the correct embedded view. */ class EmbeddedComponentProxy { constructor(wrapper, viewId) { this.wrapper = wrapper; this.viewId = viewId; } isSupported(event) { return this.wrapper.isSupported(event); } get eventEmitterTarget() { return this.wrapper.eventEmitterTarget; } handle(action) { this.wrapper.handle(this.viewId, action); } hide(success, option) { this.wrapper.hide(this.viewId, success, { message: option?.message ?? '' }); } update(results) { this.wrapper.update(this.viewId, results); } confirm(address) { this.wrapper.confirm(this.viewId, true, address); } reject(error) { this.wrapper.confirm(this.viewId, false, error); } } exports.EmbeddedComponentProxy = EmbeddedComponentProxy; //# sourceMappingURL=EmbeddedComponentProxy.js.map