UNPKG

@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
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] = "bc94e206-c755-45e0-920c-bbd256526e3b", e._sentryDebugIdIdentifier = "sentry-dbid-bc94e206-c755-45e0-920c-bbd256526e3b"); } catch (e) {} import { mt as stylesheets, n as EmbedShell, t as resolveEnvironment } from "./resolveEnvironment-DNmu53Rr.js"; import { t as emitAdyenSdkEvent } from "./emitEvent-CcGIaOut.js"; import { t as AcceptTermsOfServiceComponent } from "./AcceptTermsOfServiceComponent-BAP8iSCH.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 };