@adyen/kyc-components
Version:
`adyen-kyc-components` provides the required pieces to build an onboarding flow based on a legal entity. To onboard and verify users, you need to create a user interface (UI) to collect user data. To speed up building your integration, Adyen offers onboar
39 lines (38 loc) • 1.58 kB
JavaScript
;
{
try {
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0db42c42-2982-48d8-911b-f16f32877eb3", e._sentryDebugIdIdentifier = "sentry-dbid-0db42c42-2982-48d8-911b-f16f32877eb3");
} catch (e) {
}
}
;
import { getCoreFromSdkOptionsProp } from "./adyenConfig.js";
class AdyenTransferInstrument extends HTMLElement {
// Setters are needed for the Preact renderer to detect these are properties and not
set options(opt) {
this.sdkOptions = opt;
}
constructor() {
super();
this.root = this.attachShadow({ mode: "open" });
this.root.innerHTML = `
<link href="https://unpkg.com/@adyen/kyc-components@3.43.6/dist/style.css" rel="stylesheet" />
<div id="mount"></div>`;
}
async connectedCallback() {
const legalEntityId = this.getAttribute("legalEntityId");
if (!legalEntityId) {
throw Error("Adyen Transfer Instrument must have a `legalEntityId` prop");
}
const modalView = this.getAttribute("view") === "modal";
const { onSubmitSuccess } = this;
const core = await getCoreFromSdkOptionsProp(this.sdkOptions);
core == null ? void 0 : core.create("createTransferInstrumentComponent", {
legalEntityId,
onSubmitSuccess,
modalView
}).mount(this.root.querySelector("#mount"));
}
}
customElements.define("adyen-transfer-instrument", AdyenTransferInstrument);