@adyen/react-native
Version:
Wraps Adyen Checkout Drop-In and Components for iOS and Android for convenient use with React Native
37 lines (36 loc) • 968 B
JavaScript
;
/**
* 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.
*/
export 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);
}
}
//# sourceMappingURL=EmbeddedComponentProxy.js.map