@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.
24 lines (23 loc) • 969 B
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] = "3d65a91c-0b78-4a11-8d82-7c2e53092dc2", e._sentryDebugIdIdentifier = "sentry-dbid-3d65a91c-0b78-4a11-8d82-7c2e53092dc2");
} catch (e) {}
var formatCurrency = (amount, currency, locale) => {
const { format } = new Intl.NumberFormat(locale, currency ? {
style: "currency",
currency
} : void 0);
return format(amount);
};
var formatAmountWithCurrency = (amount, currency) => {
const formattedAmount = formatCurrency(amount, currency, [
"EUR",
"BRL",
"ARS",
"CHF"
].includes(currency.toUpperCase()) ? "de-DE" : "en-US");
if (!formattedAmount) return;
return `${formattedAmount} ${currency}`;
};
//#endregion
export { formatCurrency as n, formatAmountWithCurrency as t };