@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
61 lines (60 loc) • 2.29 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] = "f9eb7e13-92f5-4a56-8a69-bb35761e3293", e._sentryDebugIdIdentifier = "sentry-dbid-f9eb7e13-92f5-4a56-8a69-bb35761e3293");
} catch (e) {}
import { a as stylesheets, n as EmbedShell, t as resolveEnvironment } from "./resolveEnvironment-CguBRdxx.js";
import { t as emitAdyenSdkEvent } from "./emitEvent-Cdd95HOT.js";
import { t as AcceptTermsOfServiceComponent } from "./AcceptTermsOfServiceComponent-D9-mwS-T.js";
import register from "preact-custom-element";
import { useRef } from "preact/hooks";
import { jsx } from "preact/jsx-runtime";
//#region src/embeds/terms-of-service-management/adyen-terms-of-service-management.tsx
/**
* Enables users to view and accept the Terms of Service documents.
*/
var AdyenTermsOfService = ({ rootlegalentityid, fetchToken, environment, locale, settings = {}, experiments = {}, view }) => {
const eventEmitterRef = useRef(null);
const handleOnComplete = (data) => {
emitAdyenSdkEvent(eventEmitterRef, "complete", data);
};
const handleOnAccept = (data) => {
emitAdyenSdkEvent(eventEmitterRef, "accept", data);
};
const handleOnClose = () => {
emitAdyenSdkEvent(eventEmitterRef, "close");
};
return /* @__PURE__ */ jsx("div", {
ref: eventEmitterRef,
style: "width:100%;",
children: /* @__PURE__ */ jsx(EmbedShell, {
componentName: "adyen-terms-of-service-management",
rootLegalEntityId: rootlegalentityid,
settings,
features: experiments,
getSdkToken: fetchToken,
locale,
baseUrl: resolveEnvironment(environment),
children: /* @__PURE__ */ jsx(AcceptTermsOfServiceComponent, {
legalEntityId: rootlegalentityid,
onAccept: handleOnAccept,
onComplete: handleOnComplete,
modalView: view === "modal",
onClose: handleOnClose
})
})
});
};
register(AdyenTermsOfService, "adyen-terms-of-service-management", [
"rootlegalentityid",
"fetchToken",
"environment",
"locale",
"settings",
"experiments",
"view"
], {
shadow: true,
adoptedStyleSheets: stylesheets
});
//#endregion
export { AdyenTermsOfService };