@adyen/kyc-components 3.34.1 → 3.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/adyen-kyc-components.es.js +1293 -1034
- package/dist/es/hide-CWI5yHxd.js +9 -0
- package/dist/es/show-Cm_JGm0K.js +8 -0
- package/dist/style.css +46 -28
- package/dist/types/components/AdditionalInformation/types.d.ts +1 -1
- package/dist/types/components/BankDocument/types.d.ts +1 -1
- package/dist/types/components/BankVerification/types.d.ts +1 -9
- package/dist/types/components/BankVerification/verification/widget/component/BankVerificationWidget.d.ts +7 -19
- package/dist/types/components/BasicInformation/types.d.ts +1 -1
- package/dist/types/components/BusinessDetails/types.d.ts +1 -1
- package/dist/types/components/Company/types.d.ts +1 -1
- package/dist/types/components/CompanyNameAndCountry/types.d.ts +1 -1
- package/dist/types/components/CompanyRegistrationDetails/types.d.ts +1 -1
- package/dist/types/components/CompanyStructure/types.d.ts +1 -1
- package/dist/types/components/CompanyType/types.d.ts +1 -1
- package/dist/types/components/ContactDetails/types.d.ts +1 -1
- package/dist/types/components/DocumentUpload/types.d.ts +1 -1
- package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +1 -1
- package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +1 -1
- package/dist/types/components/Dropins/RoleAndTypeDropin/components/formatRoleAndEntityTypeSummary.d.ts +5 -0
- package/dist/types/components/Dropins/types.d.ts +2 -1
- package/dist/types/components/FinancialInformation/formatFinancialInformationSummary.d.ts +4 -0
- package/dist/types/components/FinancialInformation/types.d.ts +2 -1
- package/dist/types/components/IdDocumentUpload/types.d.ts +3 -3
- package/dist/types/components/IdVerification/types.d.ts +3 -3
- package/dist/types/components/IdVerificationMethod/types.d.ts +3 -3
- package/dist/types/components/IdentityNumber/type.d.ts +1 -1
- package/dist/types/components/Individual/component/IndividualComponent.d.ts +1 -2
- package/dist/types/components/Individual/types.d.ts +1 -1
- package/dist/types/components/PayoutAccount/types.d.ts +4 -3
- package/dist/types/components/PayoutDetails/component/PayoutDetailsComponent.d.ts +1 -4
- package/dist/types/components/PayoutDetails/rules.d.ts +1 -0
- package/dist/types/components/PayoutDetails/types.d.ts +1 -1
- package/dist/types/components/PayoutVerificationMethod/component/PayoutVerificationMethod.d.ts +2 -1
- package/dist/types/components/PayoutVerificationMethod/component/PreferInstantVerificationMethod/PreferInstantVerificationMethod.d.ts +16 -3
- package/dist/types/components/PayoutVerificationMethod/types.d.ts +13 -4
- package/dist/types/components/PersonalDetails/component/IdentityComponent/types.d.ts +1 -1
- package/dist/types/components/PersonalDetails/types.d.ts +3 -4
- package/dist/types/components/RegistrationAddress/types.d.ts +1 -1
- package/dist/types/components/SingpassSelection/types.d.ts +1 -1
- package/dist/types/components/SoleProp/component/SolePropComponent.d.ts +8 -0
- package/dist/types/components/SoleProp/types.d.ts +3 -1
- package/dist/types/components/Trust/types.d.ts +1 -1
- package/dist/types/components/TrustRegistrationDetails/types.d.ts +1 -1
- package/dist/types/components/TrustRoleAndEntityType/types.d.ts +1 -1
- package/dist/types/components/embedded-ui/EmbeddedStatus/EmbeddedStatus.d.ts +4 -4
- package/dist/types/components/internal/Address/types.d.ts +1 -1
- package/dist/types/components/internal/Alert/components/VerificationErrorAlert.d.ts +0 -1
- package/dist/types/components/internal/BankAccountNumber/types.d.ts +1 -1
- package/dist/types/components/internal/BankCity/types.d.ts +1 -1
- package/dist/types/components/internal/BankCode/types.d.ts +1 -1
- package/dist/types/components/internal/BankName/types.d.ts +1 -1
- package/dist/types/components/internal/BranchCode/types.d.ts +1 -1
- package/dist/types/components/internal/BusinessNameField/types.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumber/types.d.ts +1 -1
- package/dist/types/components/internal/CountryField/types.d.ts +1 -5
- package/dist/types/components/internal/CountryOfGoverningLawField/types.d.ts +1 -1
- package/dist/types/components/internal/Currency/types.d.ts +1 -1
- package/dist/types/components/internal/DBANameField/types.d.ts +1 -1
- package/dist/types/components/internal/DecisionMakerRole/types.d.ts +1 -1
- package/dist/types/components/internal/FinancialReportingDate/types.d.ts +1 -1
- package/dist/types/components/internal/FormFields/InputDate/utils.d.ts +4 -5
- package/dist/types/components/internal/FormFields/MaskedInputText/MaskedInputText.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +0 -1
- package/dist/types/components/internal/FormFields/utils.d.ts +1 -2
- package/dist/types/components/internal/Iban/types.d.ts +1 -1
- package/dist/types/components/internal/LegalFormField/LegalFormField.d.ts +1 -2
- package/dist/types/components/internal/LegalFormField/types.d.ts +3 -2
- package/dist/types/components/internal/NaceCodeField/NaceCodeField.d.ts +1 -2
- package/dist/types/components/internal/NaceCodeField/types.d.ts +3 -2
- package/dist/types/components/internal/Name/types.d.ts +1 -1
- package/dist/types/components/internal/NumberOfEmployees/types.d.ts +1 -1
- package/dist/types/components/internal/PhoneInput/types.d.ts +1 -1
- package/dist/types/components/internal/StateField/types.d.ts +1 -1
- package/dist/types/components/internal/StockTickerSymbol/types.d.ts +1 -1
- package/dist/types/components/internal/Summary/Summary.d.ts +1 -2
- package/dist/types/components/internal/Summary/summaryItem.d.ts +11 -0
- package/dist/types/components/internal/Summary/types.d.ts +5 -2
- package/dist/types/components/internal/Svg/svgs.d.ts +2 -0
- package/dist/types/components/internal/SwiftCode/types.d.ts +1 -1
- package/dist/types/components/internal/TaxId/types.d.ts +1 -1
- package/dist/types/core/Context/ExperimentContext/types.d.ts +3 -1
- package/dist/types/core/Services/componentApi/get-bankVerification-vendor.d.ts +2 -1
- package/dist/types/core/hooks/useBusinessData/constants.d.ts +0 -2
- package/dist/types/core/models/api/legal-arrangement.d.ts +2 -1
- package/dist/types/core/models/company.d.ts +0 -3
- package/dist/types/core/models/country-config.d.ts +1 -1
- package/dist/types/core/models/errors/error-message.d.ts +0 -5
- package/dist/types/core/models/errors/maintenance-mode-error.d.ts +0 -6
- package/dist/types/core/models/identity.d.ts +6 -0
- package/dist/types/core/models/province-code.d.ts +2 -1
- package/dist/types/core/process-field-configurations.d.ts +1 -1
- package/dist/types/utils/entity-association-util.d.ts +1 -8
- package/dist/types/utils/formUtils.d.ts +1 -1
- package/dist/types/utils/get-props.d.ts +1 -1
- package/dist/types/utils/logger.d.ts +0 -1
- package/dist/types/utils/perState.d.ts +0 -3
- package/dist/types/utils/validation/ValidationResult.d.ts +0 -2
- package/dist/types/utils/validation/types.d.ts +2 -16
- package/package.json +1 -1
- package/dist/types/components/internal/BankAccountNumber/index.d.ts +0 -1
- package/dist/types/components/internal/BankCity/index.d.ts +0 -1
- package/dist/types/components/internal/BankCode/index.d.ts +0 -1
- package/dist/types/components/internal/BankName/index.d.ts +0 -1
- package/dist/types/components/internal/BranchCode/index.d.ts +0 -1
- package/dist/types/components/internal/BusinessRegistrationNumber/index.d.ts +0 -1
- package/dist/types/components/internal/Iban/index.d.ts +0 -1
- package/dist/types/components/internal/Name/index.d.ts +0 -1
- package/dist/types/components/internal/SwiftCode/index.d.ts +0 -1
- package/dist/types/core/Services/componentApi/index.d.ts +0 -19
- package/dist/types/core/Services/kycExternalApi/index.d.ts +0 -6
- package/dist/types/core/hooks/useForm/index.d.ts +0 -3
- package/dist/types/utils/regex/index.d.ts +0 -7
|
@@ -85,9 +85,6 @@ const defaultTrans = {
|
|
|
85
85
|
accountCantBeSetUp: "Your account can't be set up as your information couldn't be verified. To find out more, reach out to customer support.",
|
|
86
86
|
accountDetailsDescription: "Provide a few details about you to start accepting live payments.",
|
|
87
87
|
accountHolder: "Account holder",
|
|
88
|
-
accountHolderDescriptionCompany: "The bank account holder has to have the same name as your company.",
|
|
89
|
-
accountHolderDescriptionIndividual: "This should be you, since the bank account has to be in your name",
|
|
90
|
-
accountHolderDescriptionSoleProp: " The bank account holder has to have the same name as your sole proprietorship",
|
|
91
88
|
accountHolderTerms: "Account Holder Terms",
|
|
92
89
|
accountName: "Account name",
|
|
93
90
|
accountNumber: "Account number",
|
|
@@ -1749,7 +1746,7 @@ const useCoreContext = () => {
|
|
|
1749
1746
|
if (!context) throw Error("You need a <CoreProvider> to use core context");
|
|
1750
1747
|
return context;
|
|
1751
1748
|
};
|
|
1752
|
-
|
|
1749
|
+
const suppressed = false;
|
|
1753
1750
|
const consoleMethodsPrefixable = Object.freeze([
|
|
1754
1751
|
"debug",
|
|
1755
1752
|
"info",
|
|
@@ -1853,7 +1850,7 @@ const KNOWN_DISALLOWED_INDEX_DATASET_STATES = [
|
|
|
1853
1850
|
StateCodesUS.California,
|
|
1854
1851
|
StateCodesUS.Texas
|
|
1855
1852
|
];
|
|
1856
|
-
const logger$
|
|
1853
|
+
const logger$L = createLogger("useBusinessData");
|
|
1857
1854
|
function useBusinessData({
|
|
1858
1855
|
handleCompanyIndexSearch,
|
|
1859
1856
|
handleCompanyDeepSearch,
|
|
@@ -1891,7 +1888,7 @@ function useBusinessData({
|
|
|
1891
1888
|
try {
|
|
1892
1889
|
setSearching("loading");
|
|
1893
1890
|
if (!handleCompanyDeepSearch || !handleCompanyIndexSearch) {
|
|
1894
|
-
logger$
|
|
1891
|
+
logger$L.error("Missing handlers for searchForBusiness");
|
|
1895
1892
|
setSearchResults([]);
|
|
1896
1893
|
return [];
|
|
1897
1894
|
}
|
|
@@ -1914,7 +1911,7 @@ function useBusinessData({
|
|
|
1914
1911
|
return response == null ? void 0 : response.results;
|
|
1915
1912
|
} catch (e) {
|
|
1916
1913
|
setSearching("error");
|
|
1917
|
-
logger$
|
|
1914
|
+
logger$L.error(e);
|
|
1918
1915
|
} finally {
|
|
1919
1916
|
setCachedSearch(data);
|
|
1920
1917
|
setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
@@ -1925,7 +1922,7 @@ function useBusinessData({
|
|
|
1925
1922
|
const fetchBusinessData = useCallback(
|
|
1926
1923
|
async (company, state) => {
|
|
1927
1924
|
if (!handleGetCompanyDataset || !handleRefreshCompanyDataset) {
|
|
1928
|
-
logger$
|
|
1925
|
+
logger$L.error("Missing handlers for fetchBusinessData");
|
|
1929
1926
|
return;
|
|
1930
1927
|
}
|
|
1931
1928
|
const date = (/* @__PURE__ */ new Date()).toDateString();
|
|
@@ -1935,7 +1932,7 @@ function useBusinessData({
|
|
|
1935
1932
|
setVerifying("idle");
|
|
1936
1933
|
setInvalidTin(false);
|
|
1937
1934
|
if (state) {
|
|
1938
|
-
|
|
1935
|
+
return isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(state) ? await handleGetCompanyDataset({
|
|
1939
1936
|
companyId: company.id,
|
|
1940
1937
|
country: "US",
|
|
1941
1938
|
state
|
|
@@ -1944,19 +1941,17 @@ function useBusinessData({
|
|
|
1944
1941
|
country: "US",
|
|
1945
1942
|
state
|
|
1946
1943
|
});
|
|
1947
|
-
return businessData2;
|
|
1948
1944
|
}
|
|
1949
|
-
|
|
1945
|
+
return isDataCompliant ? await handleGetCompanyDataset({
|
|
1950
1946
|
companyId: company.id,
|
|
1951
1947
|
country: "US"
|
|
1952
1948
|
}) : await handleRefreshCompanyDataset({
|
|
1953
1949
|
companyId: company.id,
|
|
1954
1950
|
country: "US"
|
|
1955
1951
|
});
|
|
1956
|
-
return businessData;
|
|
1957
1952
|
} catch (e) {
|
|
1958
1953
|
setFetching("error");
|
|
1959
|
-
logger$
|
|
1954
|
+
logger$L.error(e);
|
|
1960
1955
|
} finally {
|
|
1961
1956
|
setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
1962
1957
|
}
|
|
@@ -1966,7 +1961,7 @@ function useBusinessData({
|
|
|
1966
1961
|
const verifyBusinessData = useCallback(
|
|
1967
1962
|
async (data, tin) => {
|
|
1968
1963
|
if (!handleVerifyTin) {
|
|
1969
|
-
logger$
|
|
1964
|
+
logger$L.log("Missing handlers for verifyBusinessData");
|
|
1970
1965
|
return;
|
|
1971
1966
|
}
|
|
1972
1967
|
try {
|
|
@@ -1982,7 +1977,7 @@ function useBusinessData({
|
|
|
1982
1977
|
return matched;
|
|
1983
1978
|
} catch (e) {
|
|
1984
1979
|
setVerifying("error");
|
|
1985
|
-
logger$
|
|
1980
|
+
logger$L.error(e);
|
|
1986
1981
|
} finally {
|
|
1987
1982
|
setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
1988
1983
|
}
|
|
@@ -1995,7 +1990,7 @@ function useBusinessData({
|
|
|
1995
1990
|
await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
|
|
1996
1991
|
} catch (e) {
|
|
1997
1992
|
setResettingTrustedData("error");
|
|
1998
|
-
logger$
|
|
1993
|
+
logger$L.error(e);
|
|
1999
1994
|
} finally {
|
|
2000
1995
|
setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
|
|
2001
1996
|
}
|
|
@@ -2265,6 +2260,7 @@ const svgs = {
|
|
|
2265
2260
|
"field-error": lazy(
|
|
2266
2261
|
() => import("./warning-circle-fill-FaaY90uz.js")
|
|
2267
2262
|
),
|
|
2263
|
+
hide: lazy(() => import("./hide-CWI5yHxd.js")),
|
|
2268
2264
|
"info-circle": lazy(() => import("./info-B_8Cr-vS.js")),
|
|
2269
2265
|
image: lazy(() => import("./image-Ol9hzDvF.js")),
|
|
2270
2266
|
"light-bulb": lazy(() => import("./idea-CtaTpGVP.js")),
|
|
@@ -2280,6 +2276,7 @@ const svgs = {
|
|
|
2280
2276
|
remove: lazy(() => import("./cross-circle-fill-small-ChSvrRGZ.js")),
|
|
2281
2277
|
save: lazy(() => import("./save-BueTh8B0.js")),
|
|
2282
2278
|
search: lazy(() => import("./search-BvJVZbOV.js")),
|
|
2279
|
+
show: lazy(() => import("./show-Cm_JGm0K.js")),
|
|
2283
2280
|
store: lazy(() => import("./store-BLl8m644.js")),
|
|
2284
2281
|
trust: lazy(() => import("./partner-B9xMZpSw.js")),
|
|
2285
2282
|
user: lazy(() => import("./person-lPJ07vyF.js")),
|
|
@@ -2398,12 +2395,12 @@ const unscalableIconNames = [
|
|
|
2398
2395
|
"upload",
|
|
2399
2396
|
"warning"
|
|
2400
2397
|
];
|
|
2401
|
-
const logger$
|
|
2398
|
+
const logger$K = createLogger("Icon");
|
|
2402
2399
|
const Svg = ({ className, name, testId, alt, type }) => {
|
|
2403
2400
|
const LazyLoadedSvg = svgs[name];
|
|
2404
2401
|
const viewBox = unscalableIconNames.includes(name) ? "0 0 16 16" : void 0;
|
|
2405
2402
|
if (!LazyLoadedSvg) {
|
|
2406
|
-
logger$
|
|
2403
|
+
logger$K.error(`No such svg: "${name}"`);
|
|
2407
2404
|
return null;
|
|
2408
2405
|
}
|
|
2409
2406
|
return /* @__PURE__ */ jsx("span", { className: cx(`adyen-kyc-${type}`, className), "data-testid": testId, children: /* @__PURE__ */ jsx(Suspense, { fallback: null, children: viewBox ? /* @__PURE__ */ jsx(LazyLoadedSvg, { alt, "aria-hidden": type === "icon", viewBox }) : /* @__PURE__ */ jsx(LazyLoadedSvg, { alt, "aria-hidden": type === "icon" }) }) });
|
|
@@ -2641,10 +2638,10 @@ function useFormRouterContext() {
|
|
|
2641
2638
|
}
|
|
2642
2639
|
return context;
|
|
2643
2640
|
}
|
|
2644
|
-
const logger$
|
|
2641
|
+
const logger$J = createLogger("Link");
|
|
2645
2642
|
const isValidLink = (href) => {
|
|
2646
2643
|
if (href === "#") {
|
|
2647
|
-
logger$
|
|
2644
|
+
logger$J.error(
|
|
2648
2645
|
'Links must include a valid href. If your href is "#", consider using a Button instead'
|
|
2649
2646
|
);
|
|
2650
2647
|
return false;
|
|
@@ -2912,7 +2909,9 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
|
|
|
2912
2909
|
ExperimentNames2["EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation"] = "EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation";
|
|
2913
2910
|
ExperimentNames2["EnableFinancialInformationComponentV4"] = "EnableFinancialInformationComponentV4";
|
|
2914
2911
|
ExperimentNames2["EnablePreferInstantVerificationFlow"] = "EnablePreferInstantVerificationFlow";
|
|
2912
|
+
ExperimentNames2["EnablePhoneFieldScenario"] = "EnablePhoneFieldScenario";
|
|
2915
2913
|
ExperimentNames2["EnableAUIncorporatedPartnershipSkipRegistrationNumber"] = "EnableAUIncorporatedPartnershipSkipRegistrationNumber";
|
|
2914
|
+
ExperimentNames2["EnableCompanyTrusteeSkipABN"] = "EnableCompanyTrusteeSkipABN";
|
|
2916
2915
|
return ExperimentNames2;
|
|
2917
2916
|
})(ExperimentNames || {});
|
|
2918
2917
|
const debounce = (func, delay) => {
|
|
@@ -2980,7 +2979,7 @@ const useSetting = (settingName) => {
|
|
|
2980
2979
|
const { getSetting } = context;
|
|
2981
2980
|
return getSetting(settingName);
|
|
2982
2981
|
};
|
|
2983
|
-
const logger$
|
|
2982
|
+
const logger$I = createLogger("useAllowedCountries");
|
|
2984
2983
|
const useAllowedCountries = () => {
|
|
2985
2984
|
const acceptedCountries = useSetting("acceptedCountries");
|
|
2986
2985
|
const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
|
|
@@ -2989,7 +2988,7 @@ const useAllowedCountries = () => {
|
|
|
2989
2988
|
);
|
|
2990
2989
|
useEffect(() => {
|
|
2991
2990
|
if (acceptedCountries !== void 0) return;
|
|
2992
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$
|
|
2991
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$I.error);
|
|
2993
2992
|
}, [acceptedCountries]);
|
|
2994
2993
|
return allowedCountries;
|
|
2995
2994
|
};
|
|
@@ -3009,11 +3008,72 @@ class ValidationResult {
|
|
|
3009
3008
|
getError() {
|
|
3010
3009
|
return this.validationResults.find((result) => result.hasError);
|
|
3011
3010
|
}
|
|
3012
|
-
/** Returns all validation results that returned an error */
|
|
3013
|
-
getAllErrors() {
|
|
3014
|
-
return this.validationResults.filter((result) => result.hasError);
|
|
3015
|
-
}
|
|
3016
3011
|
}
|
|
3012
|
+
const logger$H = createLogger("useAsyncValidator");
|
|
3013
|
+
const useAsyncValidator = (asyncRules) => {
|
|
3014
|
+
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3015
|
+
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
3016
|
+
const triggerAsyncValidation = useCallback(
|
|
3017
|
+
(field, formState, mode) => {
|
|
3018
|
+
if (!asyncRules) return clearAsyncValidationResults();
|
|
3019
|
+
const rule = asyncRules[field];
|
|
3020
|
+
if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
|
|
3021
|
+
const value = formState.data[field];
|
|
3022
|
+
return rule.asyncValidate(formState.data[field], { state: formState }).then((isValid) => {
|
|
3023
|
+
setAsyncValidationResults({
|
|
3024
|
+
[field]: new ValidationResult([
|
|
3025
|
+
{
|
|
3026
|
+
isValid,
|
|
3027
|
+
errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, { state: formState }) : rule.errorMessage,
|
|
3028
|
+
hasError: !isValid
|
|
3029
|
+
}
|
|
3030
|
+
])
|
|
3031
|
+
});
|
|
3032
|
+
}).catch(logger$H.error);
|
|
3033
|
+
},
|
|
3034
|
+
[asyncRules, clearAsyncValidationResults]
|
|
3035
|
+
);
|
|
3036
|
+
return {
|
|
3037
|
+
asyncValidationResults,
|
|
3038
|
+
triggerAsyncValidation,
|
|
3039
|
+
clearAsyncValidationResults
|
|
3040
|
+
};
|
|
3041
|
+
};
|
|
3042
|
+
const useStaticValidator = (rules2) => {
|
|
3043
|
+
const getRulesForField = useCallback(
|
|
3044
|
+
(field) => {
|
|
3045
|
+
const fallbackRule = {
|
|
3046
|
+
validate: () => true,
|
|
3047
|
+
modes: ["blur", "input"]
|
|
3048
|
+
};
|
|
3049
|
+
const fieldRules = (rules2 == null ? void 0 : rules2[field]) ?? [fallbackRule];
|
|
3050
|
+
return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
|
|
3051
|
+
},
|
|
3052
|
+
[rules2]
|
|
3053
|
+
);
|
|
3054
|
+
const triggerStaticValidation = useCallback(
|
|
3055
|
+
({ key, value, mode = "blur" }, context) => {
|
|
3056
|
+
var _a, _b;
|
|
3057
|
+
const fieldRules = getRulesForField(key);
|
|
3058
|
+
const isFieldOptional = !!((_a = context == null ? void 0 : context.state.optionalFields) == null ? void 0 : _a.includes(key));
|
|
3059
|
+
const isFieldObscured = !!((_b = context == null ? void 0 : context.state.obscuredFields) == null ? void 0 : _b.includes(key));
|
|
3060
|
+
const validationRulesResult = fieldRules.map((rule) => {
|
|
3061
|
+
const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
|
|
3062
|
+
const isValid = isFieldOptional && isEmpty$1(value) ? true : rule.validate(value, context);
|
|
3063
|
+
return {
|
|
3064
|
+
isValid,
|
|
3065
|
+
errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, context) : rule.errorMessage,
|
|
3066
|
+
hasError: shouldValidate && !isValid
|
|
3067
|
+
};
|
|
3068
|
+
});
|
|
3069
|
+
return new ValidationResult(validationRulesResult);
|
|
3070
|
+
},
|
|
3071
|
+
[getRulesForField]
|
|
3072
|
+
);
|
|
3073
|
+
return {
|
|
3074
|
+
triggerStaticValidation
|
|
3075
|
+
};
|
|
3076
|
+
};
|
|
3017
3077
|
const processField = ({
|
|
3018
3078
|
key,
|
|
3019
3079
|
value = null,
|
|
@@ -3329,71 +3389,6 @@ function reducer({
|
|
|
3329
3389
|
}
|
|
3330
3390
|
};
|
|
3331
3391
|
}
|
|
3332
|
-
const logger$G = createLogger("useAsyncValidator");
|
|
3333
|
-
const useAsyncValidator = (asyncRules) => {
|
|
3334
|
-
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3335
|
-
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
3336
|
-
const triggerAsyncValidation = useCallback(
|
|
3337
|
-
(field, formState, mode) => {
|
|
3338
|
-
if (!asyncRules) return clearAsyncValidationResults();
|
|
3339
|
-
const rule = asyncRules[field];
|
|
3340
|
-
if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
|
|
3341
|
-
const value = formState.data[field];
|
|
3342
|
-
return rule.asyncValidate(formState.data[field], { state: formState }).then((isValid) => {
|
|
3343
|
-
setAsyncValidationResults({
|
|
3344
|
-
[field]: new ValidationResult([
|
|
3345
|
-
{
|
|
3346
|
-
isValid,
|
|
3347
|
-
errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, { state: formState }) : rule.errorMessage,
|
|
3348
|
-
hasError: !isValid
|
|
3349
|
-
}
|
|
3350
|
-
])
|
|
3351
|
-
});
|
|
3352
|
-
}).catch(logger$G.error);
|
|
3353
|
-
},
|
|
3354
|
-
[asyncRules, clearAsyncValidationResults]
|
|
3355
|
-
);
|
|
3356
|
-
return {
|
|
3357
|
-
asyncValidationResults,
|
|
3358
|
-
triggerAsyncValidation,
|
|
3359
|
-
clearAsyncValidationResults
|
|
3360
|
-
};
|
|
3361
|
-
};
|
|
3362
|
-
const useStaticValidator = (rules2) => {
|
|
3363
|
-
const getRulesForField = useCallback(
|
|
3364
|
-
(field) => {
|
|
3365
|
-
const fallbackRule = {
|
|
3366
|
-
validate: () => true,
|
|
3367
|
-
modes: ["blur", "input"]
|
|
3368
|
-
};
|
|
3369
|
-
const fieldRules = (rules2 == null ? void 0 : rules2[field]) ?? [fallbackRule];
|
|
3370
|
-
return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
|
|
3371
|
-
},
|
|
3372
|
-
[rules2]
|
|
3373
|
-
);
|
|
3374
|
-
const triggerStaticValidation = useCallback(
|
|
3375
|
-
({ key, value, mode = "blur" }, context) => {
|
|
3376
|
-
var _a, _b;
|
|
3377
|
-
const fieldRules = getRulesForField(key);
|
|
3378
|
-
const isFieldOptional = !!((_a = context == null ? void 0 : context.state.optionalFields) == null ? void 0 : _a.includes(key));
|
|
3379
|
-
const isFieldObscured = !!((_b = context == null ? void 0 : context.state.obscuredFields) == null ? void 0 : _b.includes(key));
|
|
3380
|
-
const validationRulesResult = fieldRules.map((rule) => {
|
|
3381
|
-
const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
|
|
3382
|
-
const isValid = isFieldOptional && isEmpty$1(value) ? true : rule.validate(value, context);
|
|
3383
|
-
return {
|
|
3384
|
-
isValid,
|
|
3385
|
-
errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, context) : rule.errorMessage,
|
|
3386
|
-
hasError: shouldValidate && !isValid
|
|
3387
|
-
};
|
|
3388
|
-
});
|
|
3389
|
-
return new ValidationResult(validationRulesResult);
|
|
3390
|
-
},
|
|
3391
|
-
[getRulesForField]
|
|
3392
|
-
);
|
|
3393
|
-
return {
|
|
3394
|
-
triggerStaticValidation
|
|
3395
|
-
};
|
|
3396
|
-
};
|
|
3397
3392
|
const mergeStaticAndAsyncErrorsState = (staticValidationErrors, asyncValidationErrors, schema, optionalFields) => {
|
|
3398
3393
|
const fields = optionalFields ? [...schema, ...optionalFields] : schema;
|
|
3399
3394
|
if (!fields.length) return staticValidationErrors;
|
|
@@ -6315,8 +6310,6 @@ const stateFormatGuidanceText = {
|
|
|
6315
6310
|
}
|
|
6316
6311
|
}
|
|
6317
6312
|
};
|
|
6318
|
-
const emailPattern = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
6319
|
-
const bankStatementDescriptionPattern = /^[\s+$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6a-zA-Z0-9-."_,:;'*!@#%()+?¿/&「」]*$/;
|
|
6320
6313
|
const businessRegistrationNumberPatterns = {
|
|
6321
6314
|
[CountryCodes.Australia]: { default: /^\d{9}$/, associationIncorporated: /^[a-zA-Z0-9]{3,20}$/ },
|
|
6322
6315
|
[CountryCodes.Austria]: {
|
|
@@ -6430,43 +6423,6 @@ const businessRegistrationNumberPatterns = {
|
|
|
6430
6423
|
default: /^\d{9}$/
|
|
6431
6424
|
}
|
|
6432
6425
|
};
|
|
6433
|
-
const CountryIdNumberPatterns = {
|
|
6434
|
-
[CountryCodes.Brazil]: /^\d{11}$/,
|
|
6435
|
-
[CountryCodes.Canada]: /^\d{9}$/,
|
|
6436
|
-
[CountryCodes.Croatia]: /^\d{11}$/,
|
|
6437
|
-
[CountryCodes.Denmark]: /^\d{10}$/,
|
|
6438
|
-
[CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
|
|
6439
|
-
[CountryCodes.Poland]: /^\d{11}$/,
|
|
6440
|
-
[CountryCodes.Romania]: /^\d{13}$/,
|
|
6441
|
-
[CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
|
|
6442
|
-
[CountryCodes.Spain]: {
|
|
6443
|
-
dni: /(^[KL]?\d{8}[A-Z]$)/,
|
|
6444
|
-
nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
|
|
6445
|
-
},
|
|
6446
|
-
[CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
|
|
6447
|
-
[CountryCodes.UnitedStates]: {
|
|
6448
|
-
// used by CountryCodes.PuertoRico
|
|
6449
|
-
ssn: /^\d{9}$/,
|
|
6450
|
-
ssnLastFour: /^\d{4}$/
|
|
6451
|
-
}
|
|
6452
|
-
};
|
|
6453
|
-
const DriversLicenseCardNumberPatterns = {
|
|
6454
|
-
[CountryCodes.NewZealand]: /^[\d]{3}$/,
|
|
6455
|
-
[CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
|
|
6456
|
-
};
|
|
6457
|
-
const DriversLicenseNumberPatterns = {
|
|
6458
|
-
[CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
|
|
6459
|
-
[CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
|
|
6460
|
-
[CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
|
|
6461
|
-
};
|
|
6462
|
-
const PassportNumberPatterns = {
|
|
6463
|
-
[CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
|
|
6464
|
-
[CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
|
|
6465
|
-
[CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
|
|
6466
|
-
};
|
|
6467
|
-
const ProofOfIdentityCardPatterns = {
|
|
6468
|
-
[CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
|
|
6469
|
-
};
|
|
6470
6426
|
const defaultFieldMetadata$9 = {
|
|
6471
6427
|
label: "registrationNumber"
|
|
6472
6428
|
};
|
|
@@ -7404,7 +7360,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
|
|
|
7404
7360
|
};
|
|
7405
7361
|
};
|
|
7406
7362
|
const MISMATCH_ANIMATION_NAME = "mismatchShake";
|
|
7407
|
-
const logger$
|
|
7363
|
+
const logger$G = createLogger("MaskedInputText");
|
|
7408
7364
|
const MaskedInputText = ({
|
|
7409
7365
|
value,
|
|
7410
7366
|
onInput,
|
|
@@ -7449,7 +7405,7 @@ const MaskedInputText = ({
|
|
|
7449
7405
|
};
|
|
7450
7406
|
useEffect(() => {
|
|
7451
7407
|
if (!mask) {
|
|
7452
|
-
logger$
|
|
7408
|
+
logger$G.warn("`mask` is undefined. No masking of input will take place.");
|
|
7453
7409
|
}
|
|
7454
7410
|
}, [mask]);
|
|
7455
7411
|
const getMaskResult = useCallback(
|
|
@@ -7493,7 +7449,7 @@ const MaskedInputText = ({
|
|
|
7493
7449
|
return;
|
|
7494
7450
|
}
|
|
7495
7451
|
if (preserveMismatchingInitialValue) {
|
|
7496
|
-
logger$
|
|
7452
|
+
logger$G.warn(
|
|
7497
7453
|
`Value received "${value}" does not match mask`,
|
|
7498
7454
|
maskResult,
|
|
7499
7455
|
`
|
|
@@ -7503,7 +7459,7 @@ Preserving mismatched initial value until user input.`
|
|
|
7503
7459
|
return;
|
|
7504
7460
|
}
|
|
7505
7461
|
const fallback = displayValueToPure(maskResult.partialDisplayValue);
|
|
7506
|
-
logger$
|
|
7462
|
+
logger$G.warn(
|
|
7507
7463
|
`Value received "${value}" does not match mask`,
|
|
7508
7464
|
maskResult,
|
|
7509
7465
|
`
|
|
@@ -10343,8 +10299,7 @@ const companyBase = {
|
|
|
10343
10299
|
dateOfIncorporation: { rule: "countryRequiresDateOfIncorporationForCompanies" },
|
|
10344
10300
|
exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
|
|
10345
10301
|
registrationNumber: { rule: "countryRequiresRegistrationNumberForCompanies" },
|
|
10346
|
-
countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" }
|
|
10347
|
-
numberOfEmployees: { rule: "countryRequiringFinancialInformation" }
|
|
10302
|
+
countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" }
|
|
10348
10303
|
};
|
|
10349
10304
|
const businessDetailsBase = {
|
|
10350
10305
|
/* Base required fields */
|
|
@@ -10374,6 +10329,10 @@ const taxInformationBase$1 = {
|
|
|
10374
10329
|
exemptedFromTax: { rule: "countryHasTaxExemptionsForSomeCompanies" },
|
|
10375
10330
|
isUen: { rule: "countryUsesUenOrGst" }
|
|
10376
10331
|
};
|
|
10332
|
+
const financialInformationBase$1 = {
|
|
10333
|
+
numberOfEmployees: { rule: "countryRequiringFinancialInformation" },
|
|
10334
|
+
financialReportingDate: { rule: "countryRequiringFinancialInformation" }
|
|
10335
|
+
};
|
|
10377
10336
|
const companyTypes = [
|
|
10378
10337
|
{
|
|
10379
10338
|
id: CompanyTypesValue.PRIVATE_COMPANY,
|
|
@@ -10410,12 +10369,14 @@ const fieldsPerScenario$3 = {
|
|
|
10410
10369
|
L0: {
|
|
10411
10370
|
country: { rule: "REQUIRED" },
|
|
10412
10371
|
legalCompanyName: { rule: "REQUIRED" },
|
|
10413
|
-
stateOrProvince: { rule: "countryRequiresStateOrProvince" }
|
|
10372
|
+
stateOrProvince: { rule: "countryRequiresStateOrProvince" },
|
|
10373
|
+
...financialInformationBase$1
|
|
10414
10374
|
},
|
|
10415
|
-
L1: { ...companyBase },
|
|
10375
|
+
L1: { ...companyBase, ...financialInformationBase$1 },
|
|
10416
10376
|
L: {
|
|
10417
10377
|
...companyBase,
|
|
10418
|
-
...taxInformationBase$1
|
|
10378
|
+
...taxInformationBase$1,
|
|
10379
|
+
...financialInformationBase$1
|
|
10419
10380
|
},
|
|
10420
10381
|
L_PROOFOFADDRESS: {
|
|
10421
10382
|
proofOfAddressDocument: { rule: "REQUIRED" }
|
|
@@ -11141,7 +11102,7 @@ function Dropzone(props) {
|
|
|
11141
11102
|
isRequired && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: i18n.get("fieldIsRequired") })
|
|
11142
11103
|
] });
|
|
11143
11104
|
}
|
|
11144
|
-
const logger$
|
|
11105
|
+
const logger$F = createLogger("TextArea");
|
|
11145
11106
|
function TextArea(props) {
|
|
11146
11107
|
const { classNameModifiers, uniqueId, ...passedProps } = props;
|
|
11147
11108
|
const {
|
|
@@ -11156,7 +11117,7 @@ function TextArea(props) {
|
|
|
11156
11117
|
const { i18n } = useI18nContext();
|
|
11157
11118
|
const [value, setValue] = useState("");
|
|
11158
11119
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
11159
|
-
logger$
|
|
11120
|
+
logger$F.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
11160
11121
|
}
|
|
11161
11122
|
const handleInput = (e) => {
|
|
11162
11123
|
var _a;
|
|
@@ -11571,11 +11532,11 @@ const financialInfoValidationRules = {
|
|
|
11571
11532
|
}
|
|
11572
11533
|
};
|
|
11573
11534
|
const financialInformationReportedValueOptions = "adyen-kyc-financial-information-reported-value-options";
|
|
11574
|
-
const styles$
|
|
11535
|
+
const styles$8 = {
|
|
11575
11536
|
"financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
|
|
11576
11537
|
financialInformationReportedValueOptions
|
|
11577
11538
|
};
|
|
11578
|
-
const logger$
|
|
11539
|
+
const logger$E = createLogger("InputCurrency");
|
|
11579
11540
|
const determineDecimalSeparator = (formatter) => formatter.formatToParts(0.1).find((part) => part.type === "decimal").value;
|
|
11580
11541
|
const determineCurrencySymbol = (formatter) => formatter.formatToParts(0).find((part) => part.type === "currency").value;
|
|
11581
11542
|
const getNumberFromFormattedCurrency = (formatted, decimalSeparator) => {
|
|
@@ -11606,7 +11567,7 @@ const InputCurrency = ({
|
|
|
11606
11567
|
const rawValue = e.target.value;
|
|
11607
11568
|
const value = getNumberFromFormattedCurrency(rawValue, decimalSeparator);
|
|
11608
11569
|
if (Number.isNaN(value)) {
|
|
11609
|
-
logger$
|
|
11570
|
+
logger$E.warn(`Unable to get number from formatted currency: "${rawValue}"`);
|
|
11610
11571
|
setText(isUndefinedOrNull(amount) ? currencySymbol : formatter.format(amount));
|
|
11611
11572
|
return;
|
|
11612
11573
|
}
|
|
@@ -11619,7 +11580,7 @@ const InputCurrency = ({
|
|
|
11619
11580
|
};
|
|
11620
11581
|
const reportedValue = "adyen-kyc-reported-value";
|
|
11621
11582
|
const reportedValueInput = "adyen-kyc-reported-value-input";
|
|
11622
|
-
const styles$
|
|
11583
|
+
const styles$7 = {
|
|
11623
11584
|
"reported-value": "adyen-kyc-reported-value",
|
|
11624
11585
|
reportedValue,
|
|
11625
11586
|
"reported-value-input": "adyen-kyc-reported-value-input",
|
|
@@ -11635,7 +11596,7 @@ const ReportedValue = ({
|
|
|
11635
11596
|
isValid
|
|
11636
11597
|
}) => {
|
|
11637
11598
|
const { i18n } = useI18nContext();
|
|
11638
|
-
return /* @__PURE__ */ jsx("div", { className: styles$
|
|
11599
|
+
return /* @__PURE__ */ jsx("div", { className: styles$7.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
|
|
11639
11600
|
InputCurrency,
|
|
11640
11601
|
{
|
|
11641
11602
|
...childProps,
|
|
@@ -11643,7 +11604,7 @@ const ReportedValue = ({
|
|
|
11643
11604
|
currency,
|
|
11644
11605
|
amount,
|
|
11645
11606
|
onAmountChanged,
|
|
11646
|
-
className: styles$
|
|
11607
|
+
className: styles$7.reportedValueInput
|
|
11647
11608
|
}
|
|
11648
11609
|
) }) });
|
|
11649
11610
|
};
|
|
@@ -11660,6 +11621,7 @@ const getSchema = (data) => [
|
|
|
11660
11621
|
function FinancialInformation(props) {
|
|
11661
11622
|
var _a;
|
|
11662
11623
|
const { i18n } = useI18nContext();
|
|
11624
|
+
const { id } = props;
|
|
11663
11625
|
const defaultCurrency = ((_a = currencyByCountry[props.country]) == null ? void 0 : _a[0]) ?? "EUR";
|
|
11664
11626
|
const { handleChangeFor, data, valid, errors, fieldProblems, schema } = useForm({
|
|
11665
11627
|
...props,
|
|
@@ -11669,7 +11631,7 @@ function FinancialInformation(props) {
|
|
|
11669
11631
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
11670
11632
|
});
|
|
11671
11633
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
11672
|
-
|
|
11634
|
+
id
|
|
11673
11635
|
);
|
|
11674
11636
|
useEffect(() => {
|
|
11675
11637
|
updateStateSlice({
|
|
@@ -11776,7 +11738,7 @@ function FinancialInformation(props) {
|
|
|
11776
11738
|
],
|
|
11777
11739
|
onChange: updateReportedValueOption,
|
|
11778
11740
|
showContentOnlyOnSelected: true,
|
|
11779
|
-
className: styles$
|
|
11741
|
+
className: styles$8.financialInformationReportedValueOptions
|
|
11780
11742
|
}
|
|
11781
11743
|
)
|
|
11782
11744
|
}
|
|
@@ -12092,7 +12054,7 @@ function useIsElementVisible(ref, fallback = true) {
|
|
|
12092
12054
|
}, [ref]);
|
|
12093
12055
|
return isOnScreen;
|
|
12094
12056
|
}
|
|
12095
|
-
const logger$
|
|
12057
|
+
const logger$D = createLogger("SearchAddress");
|
|
12096
12058
|
const SearchAddress = ({
|
|
12097
12059
|
data,
|
|
12098
12060
|
legalEntityId,
|
|
@@ -12134,7 +12096,7 @@ const SearchAddress = ({
|
|
|
12134
12096
|
const response = await handleFindAddress(selectedAddressId);
|
|
12135
12097
|
autocompleteAddressForm(response);
|
|
12136
12098
|
} catch (e) {
|
|
12137
|
-
logger$
|
|
12099
|
+
logger$D.error(e);
|
|
12138
12100
|
}
|
|
12139
12101
|
};
|
|
12140
12102
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -12145,7 +12107,7 @@ const SearchAddress = ({
|
|
|
12145
12107
|
);
|
|
12146
12108
|
setItems((response == null ? void 0 : response.results) || []);
|
|
12147
12109
|
} catch (e) {
|
|
12148
|
-
logger$
|
|
12110
|
+
logger$D.error(e);
|
|
12149
12111
|
}
|
|
12150
12112
|
};
|
|
12151
12113
|
const onChange = (e) => {
|
|
@@ -12197,7 +12159,7 @@ const SearchAddress = ({
|
|
|
12197
12159
|
setItems([]);
|
|
12198
12160
|
}
|
|
12199
12161
|
} catch (e) {
|
|
12200
|
-
logger$
|
|
12162
|
+
logger$D.error(e);
|
|
12201
12163
|
}
|
|
12202
12164
|
setLoading(false);
|
|
12203
12165
|
}
|
|
@@ -12864,7 +12826,7 @@ Address.defaultProps = {
|
|
|
12864
12826
|
requiredFields: ADDRESS_SCHEMA,
|
|
12865
12827
|
countryCode: null
|
|
12866
12828
|
};
|
|
12867
|
-
const logger$
|
|
12829
|
+
const logger$C = createLogger("AddressFieldContainer");
|
|
12868
12830
|
const formatAddressItem = (item) => {
|
|
12869
12831
|
if (item.description.includes("Addresses")) {
|
|
12870
12832
|
const splittedDescription = item.description.split(" - ");
|
|
@@ -13002,7 +12964,7 @@ function FieldContainerComponent({
|
|
|
13002
12964
|
setItems([]);
|
|
13003
12965
|
}
|
|
13004
12966
|
} catch (e) {
|
|
13005
|
-
logger$
|
|
12967
|
+
logger$C.error(e);
|
|
13006
12968
|
}
|
|
13007
12969
|
setLoading(false);
|
|
13008
12970
|
};
|
|
@@ -13036,7 +12998,7 @@ function FieldContainerComponent({
|
|
|
13036
12998
|
});
|
|
13037
12999
|
}
|
|
13038
13000
|
} catch (e) {
|
|
13039
|
-
logger$
|
|
13001
|
+
logger$C.error(e);
|
|
13040
13002
|
}
|
|
13041
13003
|
};
|
|
13042
13004
|
const onDrilldown = async (address) => {
|
|
@@ -13048,7 +13010,7 @@ function FieldContainerComponent({
|
|
|
13048
13010
|
));
|
|
13049
13011
|
setItems((response == null ? void 0 : response.results) || []);
|
|
13050
13012
|
} catch (e) {
|
|
13051
|
-
logger$
|
|
13013
|
+
logger$C.error(e);
|
|
13052
13014
|
}
|
|
13053
13015
|
};
|
|
13054
13016
|
const handleOnChange = (e) => {
|
|
@@ -14242,12 +14204,36 @@ const COUNTRIES_USING_COMPANY_SEARCH = [
|
|
|
14242
14204
|
const COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
|
|
14243
14205
|
CountryCodes.UnitedKingdom
|
|
14244
14206
|
];
|
|
14207
|
+
const EFP_CAPABILITIES = [
|
|
14208
|
+
// Issuing
|
|
14209
|
+
"useCardInRestrictedCountriesCommercial",
|
|
14210
|
+
"useCardInRestrictedCountriesConsumer",
|
|
14211
|
+
"useCardInRestrictedIndustriesCommercial",
|
|
14212
|
+
"useCardInRestrictedIndustriesConsumer",
|
|
14213
|
+
"withdrawFromAtmCommercial",
|
|
14214
|
+
"withdrawFromAtmConsumer",
|
|
14215
|
+
"withdrawFromAtmInRestrictedCountriesCommercial",
|
|
14216
|
+
"withdrawFromAtmInRestrictedCountriesConsumer",
|
|
14217
|
+
"issueCardCommercial",
|
|
14218
|
+
"issueCardConsumer",
|
|
14219
|
+
"useCardConsumer",
|
|
14220
|
+
"useCardCommercial",
|
|
14221
|
+
"authorisedPaymentInstrumentUser",
|
|
14222
|
+
// Banking
|
|
14223
|
+
"issueBankAccount",
|
|
14224
|
+
"sendToThirdParty",
|
|
14225
|
+
"receiveFromThirdParty",
|
|
14226
|
+
// Capital
|
|
14227
|
+
"getGrantOffers",
|
|
14228
|
+
"receiveGrants"
|
|
14229
|
+
];
|
|
14245
14230
|
const rules$3 = ({
|
|
14246
14231
|
data,
|
|
14247
14232
|
country,
|
|
14248
14233
|
taskType,
|
|
14249
14234
|
isExperimentEnabled = () => false,
|
|
14250
|
-
accountHolder
|
|
14235
|
+
accountHolder,
|
|
14236
|
+
rootLegalEntity
|
|
14251
14237
|
}) => ({
|
|
14252
14238
|
countryRequiresStateOrProvince: () => {
|
|
14253
14239
|
if (COUNTRIES_WITH_STATES_DATASET.includes(country)) {
|
|
@@ -14350,7 +14336,7 @@ const rules$3 = ({
|
|
|
14350
14336
|
}
|
|
14351
14337
|
},
|
|
14352
14338
|
countryHasTaxExemptionsForSomeCompanies: () => {
|
|
14353
|
-
if (taskType === TaskTypes.COMPANY && country === CountryCodes.Australia && accountHolder === "aTrust") {
|
|
14339
|
+
if (taskType === TaskTypes.COMPANY && country === CountryCodes.Australia && accountHolder === "aTrust" && isExperimentEnabled("EnableCompanyTrusteeSkipABN")) {
|
|
14354
14340
|
return "REQUIRED";
|
|
14355
14341
|
}
|
|
14356
14342
|
if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) {
|
|
@@ -14371,9 +14357,16 @@ const rules$3 = ({
|
|
|
14371
14357
|
if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
|
|
14372
14358
|
return "REQUIRED";
|
|
14373
14359
|
}
|
|
14360
|
+
},
|
|
14361
|
+
countryRequiresFinancialInformationForSoleProps: () => {
|
|
14362
|
+
if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country) && country === CountryCodes.UnitedKingdom && keysOf((rootLegalEntity == null ? void 0 : rootLegalEntity.capabilities) ?? {}).some(
|
|
14363
|
+
(capability) => EFP_CAPABILITIES.includes(capability)
|
|
14364
|
+
)) {
|
|
14365
|
+
return "REQUIRED";
|
|
14366
|
+
}
|
|
14374
14367
|
}
|
|
14375
14368
|
});
|
|
14376
|
-
const logger$
|
|
14369
|
+
const logger$B = createLogger("mapPayoutAccountSchemaToApiBankAccount");
|
|
14377
14370
|
const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCountry) => {
|
|
14378
14371
|
var _a;
|
|
14379
14372
|
if ("iban" in payoutAccount && payoutAccount.iban)
|
|
@@ -14453,7 +14446,7 @@ const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCoun
|
|
|
14453
14446
|
routingNumber: payoutAccount.branchCode
|
|
14454
14447
|
};
|
|
14455
14448
|
default:
|
|
14456
|
-
logger$
|
|
14449
|
+
logger$B.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
|
|
14457
14450
|
return {
|
|
14458
14451
|
type: `${bankCountry.toLowerCase()}Local`,
|
|
14459
14452
|
accountNumber: payoutAccount.bankAccountNumber
|
|
@@ -15102,7 +15095,7 @@ const mapHighExposureToLegalEntity = (data) => ({
|
|
|
15102
15095
|
...formatObject(data, highExposureApiKeyMapping)
|
|
15103
15096
|
});
|
|
15104
15097
|
const mapLegalEntityToSoleProp = (legalEntity) => {
|
|
15105
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
15098
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
15106
15099
|
let solePropCompData;
|
|
15107
15100
|
if (legalEntity == null ? void 0 : legalEntity.soleProprietorship) {
|
|
15108
15101
|
solePropCompData = formatObject(legalEntity, solePropComponentsKeyMapping);
|
|
@@ -15135,6 +15128,11 @@ const mapLegalEntityToSoleProp = (legalEntity) => {
|
|
|
15135
15128
|
...mapApiDocumentToSolePropDocuments(legalEntity == null ? void 0 : legalEntity.id)
|
|
15136
15129
|
};
|
|
15137
15130
|
}
|
|
15131
|
+
if ((_k = legalEntity == null ? void 0 : legalEntity.soleProprietorship) == null ? void 0 : _k.financialReports) {
|
|
15132
|
+
solePropCompData.solePropFinancialInformation = mapFinancialReportsToFinancialInformation(
|
|
15133
|
+
legalEntity.soleProprietorship.financialReports
|
|
15134
|
+
);
|
|
15135
|
+
}
|
|
15138
15136
|
}
|
|
15139
15137
|
return solePropCompData;
|
|
15140
15138
|
};
|
|
@@ -15160,6 +15158,14 @@ const mapSolePropToLegalEntity = (data) => {
|
|
|
15160
15158
|
delete requestObj.soleProprietorship.vatNumber;
|
|
15161
15159
|
delete requestObj.soleProprietorship.registrationNumber;
|
|
15162
15160
|
}
|
|
15161
|
+
if (data.solePropFinancialInformation) {
|
|
15162
|
+
requestObj.soleProprietorship.financialReports = [
|
|
15163
|
+
formatObject(
|
|
15164
|
+
data.solePropFinancialInformation,
|
|
15165
|
+
financialInformationApiKeyMapping
|
|
15166
|
+
)
|
|
15167
|
+
];
|
|
15168
|
+
}
|
|
15163
15169
|
requestObj.type = LegalEntityType.SOLE_PROPRIETORSHIP;
|
|
15164
15170
|
return requestObj;
|
|
15165
15171
|
};
|
|
@@ -15318,7 +15324,7 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
|
|
|
15318
15324
|
const { bankStatementDocument, description } = payoutAccountDocuments;
|
|
15319
15325
|
const entityType = TransferInstrumentType.BANK_ACCOUNT;
|
|
15320
15326
|
const existingDocument = getDocument$1(entityId, DocumentType.BANK_STATEMENT);
|
|
15321
|
-
|
|
15327
|
+
return createDocumentRequest({
|
|
15322
15328
|
entityId,
|
|
15323
15329
|
entityType,
|
|
15324
15330
|
documentType: DocumentType.BANK_STATEMENT,
|
|
@@ -15326,7 +15332,6 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
|
|
|
15326
15332
|
description,
|
|
15327
15333
|
existingDocument
|
|
15328
15334
|
});
|
|
15329
|
-
return document2;
|
|
15330
15335
|
};
|
|
15331
15336
|
const mapApiDocumentToPayoutDocuments = (entityId) => {
|
|
15332
15337
|
const bankStatement = getDocument$1(entityId, DocumentType.BANK_STATEMENT) || null;
|
|
@@ -15535,10 +15540,9 @@ const useIdVerificationToken = ({
|
|
|
15535
15540
|
const [sdkToken2, setSdkToken2] = useState();
|
|
15536
15541
|
const [providerId, setProviderId] = useState();
|
|
15537
15542
|
const [loadingStatus, setLoadingStatus] = useState();
|
|
15538
|
-
const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
|
|
15539
15543
|
useEffect(() => {
|
|
15540
15544
|
(async () => {
|
|
15541
|
-
if (!
|
|
15545
|
+
if (!firstName || !lastName || !residencyCountry) return;
|
|
15542
15546
|
try {
|
|
15543
15547
|
setLoadingStatus("loading");
|
|
15544
15548
|
const data = {
|
|
@@ -15563,7 +15567,7 @@ const useIdVerificationToken = ({
|
|
|
15563
15567
|
setLoadingStatus("success");
|
|
15564
15568
|
}
|
|
15565
15569
|
})().catch(console.error);
|
|
15566
|
-
}, [firstName, lastName, residencyCountry
|
|
15570
|
+
}, [firstName, lastName, residencyCountry]);
|
|
15567
15571
|
return {
|
|
15568
15572
|
providerId,
|
|
15569
15573
|
sdkToken: sdkToken2,
|
|
@@ -15572,7 +15576,7 @@ const useIdVerificationToken = ({
|
|
|
15572
15576
|
};
|
|
15573
15577
|
const loaderWrapperLoader = "adyen-kyc-loader-wrapper-loader";
|
|
15574
15578
|
const loaderWrapperLoaderActive = "adyen-kyc-loader-wrapper-loader-active";
|
|
15575
|
-
const styles$
|
|
15579
|
+
const styles$6 = {
|
|
15576
15580
|
"loader-wrapper-loader": "adyen-kyc-loader-wrapper-loader",
|
|
15577
15581
|
loaderWrapperLoader,
|
|
15578
15582
|
"loader-wrapper-loader-active": "adyen-kyc-loader-wrapper-loader-active",
|
|
@@ -15589,13 +15593,13 @@ const LoaderWrapper = ({
|
|
|
15589
15593
|
const opacitySyle = status === "loading" ? {
|
|
15590
15594
|
opacity: formOpacityWhenLoading
|
|
15591
15595
|
} : { opacity: 1 };
|
|
15592
|
-
const loaderWrapperClass = cx(styles$
|
|
15593
|
-
[styles$
|
|
15596
|
+
const loaderWrapperClass = cx(styles$6.loaderWrapperLoader, {
|
|
15597
|
+
[styles$6.loaderWrapperLoaderActive]: status === "loading" && showSpinner
|
|
15594
15598
|
});
|
|
15595
|
-
const overlayClass = cx(styles$
|
|
15599
|
+
const overlayClass = cx(styles$6.loaderWrapper, className);
|
|
15596
15600
|
return /* @__PURE__ */ jsxs("div", { className: overlayClass, style: { position: "relative" }, children: [
|
|
15597
15601
|
/* @__PURE__ */ jsx("div", { className: loaderWrapperClass, children: /* @__PURE__ */ jsx(Loader, { size: loaderSize }) }),
|
|
15598
|
-
/* @__PURE__ */ jsx("div", { className: styles$
|
|
15602
|
+
/* @__PURE__ */ jsx("div", { className: styles$6.loaderWrapperForm, style: opacitySyle, children })
|
|
15599
15603
|
] });
|
|
15600
15604
|
};
|
|
15601
15605
|
const containerId = "adyen-kyc-id-verification";
|
|
@@ -15648,7 +15652,7 @@ const initOnfido = async ({
|
|
|
15648
15652
|
language: getOnfidoLocaleConfig(i18n)
|
|
15649
15653
|
});
|
|
15650
15654
|
};
|
|
15651
|
-
const logger$
|
|
15655
|
+
const logger$A = createLogger("IdVerificationComponent");
|
|
15652
15656
|
function IdVerificationComponent({
|
|
15653
15657
|
userDetails,
|
|
15654
15658
|
legalEntityId,
|
|
@@ -15677,7 +15681,7 @@ function IdVerificationComponent({
|
|
|
15677
15681
|
onIdVerificationError,
|
|
15678
15682
|
onIdVerificationComplete
|
|
15679
15683
|
});
|
|
15680
|
-
})().catch(logger$
|
|
15684
|
+
})().catch(logger$A.error);
|
|
15681
15685
|
return () => {
|
|
15682
15686
|
if (onfidoSdk.current) onfidoSdk.current.tearDown();
|
|
15683
15687
|
};
|
|
@@ -15721,7 +15725,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
15721
15725
|
] })
|
|
15722
15726
|
] });
|
|
15723
15727
|
}
|
|
15724
|
-
const logger$
|
|
15728
|
+
const logger$z = createLogger("IdDocumentInstantVerificationComponent");
|
|
15725
15729
|
const idVerificationSchema = [
|
|
15726
15730
|
"instantIdVerificationData",
|
|
15727
15731
|
"idDocumentType"
|
|
@@ -15793,7 +15797,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
15793
15797
|
userDetails: props.userDetails,
|
|
15794
15798
|
legalEntityId: props.legalEntityId,
|
|
15795
15799
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
15796
|
-
onIdVerificationError: logger$
|
|
15800
|
+
onIdVerificationError: logger$z.error
|
|
15797
15801
|
}
|
|
15798
15802
|
),
|
|
15799
15803
|
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
|
|
@@ -16141,8 +16145,7 @@ function useVerification(fieldsToVerify, country) {
|
|
|
16141
16145
|
if (!isDirty) return false;
|
|
16142
16146
|
if (typeof field !== "string") return false;
|
|
16143
16147
|
const hasVerification = FIELDS_WITH_EXTERNAL_VERIFICATION.includes(field);
|
|
16144
|
-
|
|
16145
|
-
return false;
|
|
16148
|
+
return hasVerification;
|
|
16146
16149
|
}).map(async (field) => {
|
|
16147
16150
|
switch (field) {
|
|
16148
16151
|
case "idNumber":
|
|
@@ -16214,7 +16217,7 @@ const phoneFormatters = {
|
|
|
16214
16217
|
};
|
|
16215
16218
|
const phoneFields = ["phoneNumber"];
|
|
16216
16219
|
const DEFAULT_PHONE_PREFIX = "+1";
|
|
16217
|
-
const logger$
|
|
16220
|
+
const logger$y = createLogger("PhoneInput");
|
|
16218
16221
|
const usePhonePrefixes = () => {
|
|
16219
16222
|
const [phonePrefixes, setPhonePrefixes] = useState();
|
|
16220
16223
|
useEffect(() => {
|
|
@@ -16222,7 +16225,7 @@ const usePhonePrefixes = () => {
|
|
|
16222
16225
|
const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
|
|
16223
16226
|
setPhonePrefixes(loaded);
|
|
16224
16227
|
};
|
|
16225
|
-
loadPhonePrefixes().catch(logger$
|
|
16228
|
+
loadPhonePrefixes().catch(logger$y.error);
|
|
16226
16229
|
}, []);
|
|
16227
16230
|
return phonePrefixes;
|
|
16228
16231
|
};
|
|
@@ -16306,6 +16309,8 @@ const PhoneInput = memo(
|
|
|
16306
16309
|
PhoneInputComponent,
|
|
16307
16310
|
(prevProps, nextProps) => prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate
|
|
16308
16311
|
);
|
|
16312
|
+
const emailPattern = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
16313
|
+
const bankStatementDescriptionPattern = /^[\s+$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6a-zA-Z0-9-."_,:;'*!@#%()+?¿/&「」]*$/;
|
|
16309
16314
|
const contactDetailsValidationRules = {
|
|
16310
16315
|
email: {
|
|
16311
16316
|
modes: ["blur"],
|
|
@@ -16373,6 +16378,43 @@ const ContactDetailsComp = memo(
|
|
|
16373
16378
|
ContactDetailsComponent.defaultProps = {
|
|
16374
16379
|
data: {}
|
|
16375
16380
|
};
|
|
16381
|
+
const CountryIdNumberPatterns = {
|
|
16382
|
+
[CountryCodes.Brazil]: /^\d{11}$/,
|
|
16383
|
+
[CountryCodes.Canada]: /^\d{9}$/,
|
|
16384
|
+
[CountryCodes.Croatia]: /^\d{11}$/,
|
|
16385
|
+
[CountryCodes.Denmark]: /^\d{10}$/,
|
|
16386
|
+
[CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
|
|
16387
|
+
[CountryCodes.Poland]: /^\d{11}$/,
|
|
16388
|
+
[CountryCodes.Romania]: /^\d{13}$/,
|
|
16389
|
+
[CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
|
|
16390
|
+
[CountryCodes.Spain]: {
|
|
16391
|
+
dni: /(^[KL]?\d{8}[A-Z]$)/,
|
|
16392
|
+
nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
|
|
16393
|
+
},
|
|
16394
|
+
[CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
|
|
16395
|
+
[CountryCodes.UnitedStates]: {
|
|
16396
|
+
// used by CountryCodes.PuertoRico
|
|
16397
|
+
ssn: /^\d{9}$/,
|
|
16398
|
+
ssnLastFour: /^\d{4}$/
|
|
16399
|
+
}
|
|
16400
|
+
};
|
|
16401
|
+
const DriversLicenseCardNumberPatterns = {
|
|
16402
|
+
[CountryCodes.NewZealand]: /^[\d]{3}$/,
|
|
16403
|
+
[CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
|
|
16404
|
+
};
|
|
16405
|
+
const DriversLicenseNumberPatterns = {
|
|
16406
|
+
[CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
|
|
16407
|
+
[CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
|
|
16408
|
+
[CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
|
|
16409
|
+
};
|
|
16410
|
+
const PassportNumberPatterns = {
|
|
16411
|
+
[CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
|
|
16412
|
+
[CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
|
|
16413
|
+
[CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
|
|
16414
|
+
};
|
|
16415
|
+
const ProofOfIdentityCardPatterns = {
|
|
16416
|
+
[CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
|
|
16417
|
+
};
|
|
16376
16418
|
const defaultFieldMetadata$5 = {
|
|
16377
16419
|
label: "idNumber"
|
|
16378
16420
|
};
|
|
@@ -17159,7 +17201,7 @@ const roleMetadata = {
|
|
|
17159
17201
|
name: TrustMemberGuidanceLabel.TRUSTEE
|
|
17160
17202
|
}
|
|
17161
17203
|
};
|
|
17162
|
-
const getRoleTagVariant = (role) => {
|
|
17204
|
+
const getRoleTagVariant$1 = (role) => {
|
|
17163
17205
|
var _a;
|
|
17164
17206
|
return ((_a = roleMetadata[role]) == null ? void 0 : _a.variant) ?? "blue";
|
|
17165
17207
|
};
|
|
@@ -18741,21 +18783,47 @@ const individualDocumentForms = [
|
|
|
18741
18783
|
proofOfRelationshipFormID
|
|
18742
18784
|
];
|
|
18743
18785
|
function IndividualComponent(props) {
|
|
18744
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
18786
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18745
18787
|
const { i18n } = useI18nContext();
|
|
18746
|
-
const
|
|
18788
|
+
const {
|
|
18789
|
+
activeForm: propActiveForm,
|
|
18790
|
+
allowedRoles,
|
|
18791
|
+
capabilities,
|
|
18792
|
+
country,
|
|
18793
|
+
data: propData,
|
|
18794
|
+
forms,
|
|
18795
|
+
handleGetIdVerificationToken,
|
|
18796
|
+
onCountryChange,
|
|
18797
|
+
onBack,
|
|
18798
|
+
onNext,
|
|
18799
|
+
parentLegalEntity,
|
|
18800
|
+
setHideFooter,
|
|
18801
|
+
taskType,
|
|
18802
|
+
trustedFields,
|
|
18803
|
+
trustedFieldsProvider,
|
|
18804
|
+
trustedRoles,
|
|
18805
|
+
legalEntityId,
|
|
18806
|
+
handleAddressSearch,
|
|
18807
|
+
handleFindAddress
|
|
18808
|
+
} = props;
|
|
18809
|
+
const [data, setData] = useState(propData);
|
|
18747
18810
|
const [idVerificationMethodSelected, setIdVerificationMethodSelected] = useState("instantVerification");
|
|
18748
18811
|
const stateRef = useRef({ setState: null });
|
|
18749
18812
|
useEffect(() => {
|
|
18750
|
-
|
|
18813
|
+
var _a2, _b2;
|
|
18814
|
+
if (!forms) {
|
|
18815
|
+
return;
|
|
18816
|
+
}
|
|
18817
|
+
const activeFormsWithoutSummary = Object.values(forms).reduce(
|
|
18751
18818
|
(acc, item) => [...acc, ...item.formId !== "summary" ? [item.formId] : []],
|
|
18752
18819
|
[]
|
|
18753
18820
|
);
|
|
18754
|
-
stateRef.current.setActiveForms(
|
|
18755
|
-
}, [
|
|
18821
|
+
(_b2 = (_a2 = stateRef.current).setActiveForms) == null ? void 0 : _b2.call(_a2, activeFormsWithoutSummary);
|
|
18822
|
+
}, [forms == null ? void 0 : forms.toString()]);
|
|
18756
18823
|
useEffect(
|
|
18757
18824
|
() => () => {
|
|
18758
|
-
|
|
18825
|
+
var _a2, _b2;
|
|
18826
|
+
(_b2 = (_a2 = stateRef.current).setState) == null ? void 0 : _b2.call(_a2, { type: "resetState" });
|
|
18759
18827
|
},
|
|
18760
18828
|
[]
|
|
18761
18829
|
);
|
|
@@ -18779,18 +18847,18 @@ function IndividualComponent(props) {
|
|
|
18779
18847
|
lastName: (_d = data == null ? void 0 : data.personalDetails) == null ? void 0 : _d.lastName,
|
|
18780
18848
|
residencyCountry: (_e = data == null ? void 0 : data.personalDetails) == null ? void 0 : _e.residencyCountry
|
|
18781
18849
|
};
|
|
18782
|
-
const isLegalRepresentativeDetailsTask =
|
|
18850
|
+
const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
|
|
18783
18851
|
const handleStateChange = ({
|
|
18784
18852
|
currentState,
|
|
18785
18853
|
prevState
|
|
18786
18854
|
}) => {
|
|
18787
18855
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
18788
|
-
const residencyCountryPrev = (_b2 = (_a2 = prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
|
|
18856
|
+
const residencyCountryPrev = (_b2 = (_a2 = prevState == null ? void 0 : prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
|
|
18789
18857
|
const residencyCountry = (_d2 = (_c2 = currentState.data) == null ? void 0 : _c2.personalDetails) == null ? void 0 : _d2.residencyCountry;
|
|
18790
18858
|
if (residencyCountry != null && residencyCountry !== residencyCountryPrev) {
|
|
18791
|
-
|
|
18859
|
+
onCountryChange == null ? void 0 : onCountryChange(residencyCountry);
|
|
18792
18860
|
}
|
|
18793
|
-
const idVerificationMethodPrev = (_f2 = (_e2 = prevState.data) == null ? void 0 : _e2.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod;
|
|
18861
|
+
const idVerificationMethodPrev = (_f2 = (_e2 = prevState == null ? void 0 : prevState.data) == null ? void 0 : _e2.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod;
|
|
18794
18862
|
const idVerificationMethod = (_h2 = (_g2 = currentState.data) == null ? void 0 : _g2.idVerificationMethod) == null ? void 0 : _h2.idVerificationMethod;
|
|
18795
18863
|
if (idVerificationMethod != null && idVerificationMethod !== idVerificationMethodPrev) {
|
|
18796
18864
|
setIdVerificationMethodSelected(idVerificationMethod);
|
|
@@ -18803,31 +18871,31 @@ function IndividualComponent(props) {
|
|
|
18803
18871
|
});
|
|
18804
18872
|
};
|
|
18805
18873
|
useEffect(() => {
|
|
18806
|
-
var _a2, _b2
|
|
18807
|
-
const isIdDocumentFormActive =
|
|
18808
|
-
const isInstantIdVerificationEnabled = idVerificationMethodSelected === "instantVerification" && !!
|
|
18809
|
-
const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((
|
|
18810
|
-
|
|
18874
|
+
var _a2, _b2;
|
|
18875
|
+
const isIdDocumentFormActive = (propActiveForm == null ? void 0 : propActiveForm.formId) === idDocumentFormID;
|
|
18876
|
+
const isInstantIdVerificationEnabled = idVerificationMethodSelected === "instantVerification" && !!handleGetIdVerificationToken;
|
|
18877
|
+
const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((_b2 = propData == null ? void 0 : propData.idDocument) == null ? void 0 : _b2.idDocumentType);
|
|
18878
|
+
setHideFooter == null ? void 0 : setHideFooter(
|
|
18811
18879
|
isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled
|
|
18812
18880
|
);
|
|
18813
18881
|
}, [
|
|
18814
|
-
|
|
18882
|
+
propActiveForm,
|
|
18815
18883
|
idVerificationMethodSelected,
|
|
18816
|
-
|
|
18884
|
+
handleGetIdVerificationToken,
|
|
18817
18885
|
(_f = data == null ? void 0 : data.idDocument) == null ? void 0 : _f.instantIdVerificationData,
|
|
18818
|
-
(
|
|
18886
|
+
(_g = propData == null ? void 0 : propData.idDocument) == null ? void 0 : _g.idDocumentType
|
|
18819
18887
|
]);
|
|
18820
|
-
const addressSchema = getAddressSchemaForCountry((
|
|
18888
|
+
const addressSchema = getAddressSchemaForCountry((_h = data == null ? void 0 : data.personalDetails) == null ? void 0 : _h.residencyCountry).filter(
|
|
18821
18889
|
(field) => {
|
|
18822
18890
|
var _a2;
|
|
18823
|
-
return
|
|
18891
|
+
return !!((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) && !COUNTRIES_WITH_STATES_DATASET.includes(data.personalDetails.residencyCountry) ? field !== "stateOrProvince" : true;
|
|
18824
18892
|
}
|
|
18825
18893
|
);
|
|
18826
18894
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
18827
18895
|
"address"
|
|
18828
18896
|
);
|
|
18829
18897
|
const renderActiveForm = (activeForm) => {
|
|
18830
|
-
var _a2, _b2
|
|
18898
|
+
var _a2, _b2;
|
|
18831
18899
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18832
18900
|
/* @__PURE__ */ jsx(StateContextWatcher, { owner: "IndividualComponent", onChange: handleStateChange }),
|
|
18833
18901
|
/* @__PURE__ */ jsx(StateContextSetter, { owner: "IndividualComponent", stateRef }),
|
|
@@ -18841,17 +18909,17 @@ function IndividualComponent(props) {
|
|
|
18841
18909
|
...personalFormProps,
|
|
18842
18910
|
data: {
|
|
18843
18911
|
...personalFormProps == null ? void 0 : personalFormProps.data,
|
|
18844
|
-
residencyCountry:
|
|
18912
|
+
residencyCountry: country
|
|
18845
18913
|
},
|
|
18846
18914
|
ref: formsRef[personalDetailsFormID],
|
|
18847
18915
|
heading: isLegalRepresentativeDetailsTask ? i18n.get("legalRepresentativeDetails") : i18n.get("personalDetails"),
|
|
18848
|
-
taskType
|
|
18916
|
+
taskType,
|
|
18849
18917
|
id: personalDetailsFormID,
|
|
18850
|
-
allowedRoles
|
|
18851
|
-
capabilities
|
|
18852
|
-
parentLegalEntity
|
|
18853
|
-
trustedFieldsProvider
|
|
18854
|
-
trustedRoles
|
|
18918
|
+
allowedRoles,
|
|
18919
|
+
capabilities,
|
|
18920
|
+
parentLegalEntity,
|
|
18921
|
+
trustedFieldsProvider,
|
|
18922
|
+
trustedRoles
|
|
18855
18923
|
}
|
|
18856
18924
|
)
|
|
18857
18925
|
}
|
|
@@ -18877,13 +18945,13 @@ function IndividualComponent(props) {
|
|
|
18877
18945
|
{
|
|
18878
18946
|
...addressFormProps,
|
|
18879
18947
|
id: addressFormID,
|
|
18880
|
-
data: { ...data
|
|
18948
|
+
data: { ...addressFormProps == null ? void 0 : addressFormProps.data, country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry },
|
|
18881
18949
|
requiredFields: addressSchema,
|
|
18882
18950
|
optionalFields: ["otherAddressInformation"],
|
|
18883
|
-
trustedFields:
|
|
18884
|
-
legalEntityId
|
|
18885
|
-
handleAddressSearch
|
|
18886
|
-
handleFindAddress
|
|
18951
|
+
trustedFields: trustedFields == null ? void 0 : trustedFields.address,
|
|
18952
|
+
legalEntityId,
|
|
18953
|
+
handleAddressSearch,
|
|
18954
|
+
handleFindAddress,
|
|
18887
18955
|
onChange: handleAddressChange,
|
|
18888
18956
|
hideCountry: true
|
|
18889
18957
|
}
|
|
@@ -18891,7 +18959,7 @@ function IndividualComponent(props) {
|
|
|
18891
18959
|
] })
|
|
18892
18960
|
}
|
|
18893
18961
|
),
|
|
18894
|
-
!!
|
|
18962
|
+
!!handleGetIdVerificationToken && /* @__PURE__ */ jsx(
|
|
18895
18963
|
"div",
|
|
18896
18964
|
{
|
|
18897
18965
|
className: activeForm.formId !== idVerificationMethodFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -18901,7 +18969,7 @@ function IndividualComponent(props) {
|
|
|
18901
18969
|
...idVerificationMethodFormProps,
|
|
18902
18970
|
name: fullName,
|
|
18903
18971
|
id: idVerificationMethodFormID,
|
|
18904
|
-
countryOfResidence: (
|
|
18972
|
+
countryOfResidence: (_b2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b2.residencyCountry
|
|
18905
18973
|
}
|
|
18906
18974
|
)
|
|
18907
18975
|
}
|
|
@@ -18917,10 +18985,10 @@ function IndividualComponent(props) {
|
|
|
18917
18985
|
name: fullName,
|
|
18918
18986
|
userDetails: activeForm.formId === idDocumentFormID ? userDetails : void 0,
|
|
18919
18987
|
id: idDocumentFormID,
|
|
18920
|
-
legalEntityId
|
|
18921
|
-
handleGetIdVerificationToken
|
|
18922
|
-
handleOnBack:
|
|
18923
|
-
handleOnNext:
|
|
18988
|
+
legalEntityId,
|
|
18989
|
+
handleGetIdVerificationToken,
|
|
18990
|
+
handleOnBack: onBack,
|
|
18991
|
+
handleOnNext: onNext,
|
|
18924
18992
|
idVerificationMethodSelected
|
|
18925
18993
|
}
|
|
18926
18994
|
)
|
|
@@ -18972,7 +19040,7 @@ function IndividualComponent(props) {
|
|
|
18972
19040
|
)
|
|
18973
19041
|
] });
|
|
18974
19042
|
};
|
|
18975
|
-
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(
|
|
19043
|
+
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(propActiveForm) });
|
|
18976
19044
|
}
|
|
18977
19045
|
const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccountNumberMasked) => {
|
|
18978
19046
|
const [timeoutId, setTimeoutId] = useState(null);
|
|
@@ -19656,7 +19724,7 @@ class AdyenKycSdkError extends Error {
|
|
|
19656
19724
|
}
|
|
19657
19725
|
let sdkToken;
|
|
19658
19726
|
let fetchSdkToken;
|
|
19659
|
-
const logger$
|
|
19727
|
+
const logger$x = createLogger("Session");
|
|
19660
19728
|
const setSdkToken = (token) => {
|
|
19661
19729
|
sdkToken = token;
|
|
19662
19730
|
};
|
|
@@ -19681,7 +19749,7 @@ const refreshSession = async () => {
|
|
|
19681
19749
|
setSdkToken(token);
|
|
19682
19750
|
isSessionRefreshed = true;
|
|
19683
19751
|
} catch (e) {
|
|
19684
|
-
logger$
|
|
19752
|
+
logger$x.error("Failed to fetch sdk token", e);
|
|
19685
19753
|
}
|
|
19686
19754
|
return isSessionRefreshed;
|
|
19687
19755
|
};
|
|
@@ -19691,7 +19759,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
19691
19759
|
const removeAnimationStartListener = (element, listener) => {
|
|
19692
19760
|
element.removeEventListener("animationstart", listener, false);
|
|
19693
19761
|
};
|
|
19694
|
-
const logger$
|
|
19762
|
+
const logger$w = createLogger("Fetch");
|
|
19695
19763
|
const getRequestObject = (options, data) => {
|
|
19696
19764
|
const { headers = [], method = "GET", authentication } = options;
|
|
19697
19765
|
let authHeaders;
|
|
@@ -19732,10 +19800,10 @@ const logFetchError = (message, level) => {
|
|
|
19732
19800
|
case "info":
|
|
19733
19801
|
case "warn":
|
|
19734
19802
|
case "error":
|
|
19735
|
-
logger$
|
|
19803
|
+
logger$w[level](message);
|
|
19736
19804
|
break;
|
|
19737
19805
|
default:
|
|
19738
|
-
logger$
|
|
19806
|
+
logger$w.error(message);
|
|
19739
19807
|
}
|
|
19740
19808
|
};
|
|
19741
19809
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -19819,7 +19887,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
19819
19887
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
19820
19888
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
19821
19889
|
const TINK_VENDOR = "Tink";
|
|
19822
|
-
const logger$
|
|
19890
|
+
const logger$v = createLogger("iframeWidget");
|
|
19823
19891
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
19824
19892
|
const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
19825
19893
|
const parseMessageJson = (message) => {
|
|
@@ -19837,7 +19905,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
19837
19905
|
try {
|
|
19838
19906
|
await response;
|
|
19839
19907
|
} catch (ex) {
|
|
19840
|
-
logger$
|
|
19908
|
+
logger$v.error(ex);
|
|
19841
19909
|
}
|
|
19842
19910
|
return {
|
|
19843
19911
|
error: "UNKNOWN_ERROR",
|
|
@@ -19933,7 +20001,7 @@ class IFrameWidget {
|
|
|
19933
20001
|
message = responseData.errorMessage;
|
|
19934
20002
|
}
|
|
19935
20003
|
} catch (ex) {
|
|
19936
|
-
logger$
|
|
20004
|
+
logger$v.error(ex);
|
|
19937
20005
|
}
|
|
19938
20006
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
19939
20007
|
}
|
|
@@ -20012,14 +20080,67 @@ const DEFAULT_ERROR = {
|
|
|
20012
20080
|
function BankVerificationWidget({
|
|
20013
20081
|
url,
|
|
20014
20082
|
vendor,
|
|
20015
|
-
|
|
20083
|
+
setBankVerificationError,
|
|
20084
|
+
setVerificationComplete,
|
|
20085
|
+
onBack,
|
|
20086
|
+
retrieveBankAccountInfo,
|
|
20016
20087
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
20017
20088
|
handleBankVerificationError: handleBankVerificationError2
|
|
20018
20089
|
}) {
|
|
20090
|
+
const { i18n } = useI18nContext();
|
|
20019
20091
|
const widgetContainerRef = useRef(null);
|
|
20020
20092
|
const context = useAuthContext();
|
|
20021
20093
|
const { isEmbeddedDropin } = context;
|
|
20022
20094
|
const sdkToken2 = isEmbeddedDropin ? getSdkToken() : void 0;
|
|
20095
|
+
setBankVerificationError(null);
|
|
20096
|
+
const widgetCallback = useCallback(
|
|
20097
|
+
(payload) => {
|
|
20098
|
+
setVerificationComplete(true);
|
|
20099
|
+
const errorContent = i18n.get("tryAgainOrManualAccountDetails");
|
|
20100
|
+
switch (payload.action) {
|
|
20101
|
+
case "handle_exception": {
|
|
20102
|
+
let errorTitle = i18n.get("sorryAnErrorOccurred");
|
|
20103
|
+
const { err } = payload;
|
|
20104
|
+
switch (!(err instanceof Error) && (err == null ? void 0 : err.error)) {
|
|
20105
|
+
case "USER_CANCELLED":
|
|
20106
|
+
errorTitle = "";
|
|
20107
|
+
break;
|
|
20108
|
+
case "CONNECTION_ERROR":
|
|
20109
|
+
errorTitle = i18n.get("couldNotEstablishBankConnection");
|
|
20110
|
+
break;
|
|
20111
|
+
case "GENERIC_ERROR":
|
|
20112
|
+
errorTitle = i18n.get("ranIntoTechnicalError");
|
|
20113
|
+
break;
|
|
20114
|
+
case "UNKNOWN_ERROR":
|
|
20115
|
+
default: {
|
|
20116
|
+
errorTitle = i18n.get("couldNotCompleteAccountCheck");
|
|
20117
|
+
break;
|
|
20118
|
+
}
|
|
20119
|
+
}
|
|
20120
|
+
if (errorTitle) {
|
|
20121
|
+
setBankVerificationError({
|
|
20122
|
+
title: errorTitle,
|
|
20123
|
+
content: errorContent
|
|
20124
|
+
});
|
|
20125
|
+
}
|
|
20126
|
+
onBack == null ? void 0 : onBack();
|
|
20127
|
+
break;
|
|
20128
|
+
}
|
|
20129
|
+
case "retry_verification":
|
|
20130
|
+
setBankVerificationError({
|
|
20131
|
+
title: i18n.get("failedInitializeInstantVerification"),
|
|
20132
|
+
content: errorContent
|
|
20133
|
+
});
|
|
20134
|
+
onBack == null ? void 0 : onBack();
|
|
20135
|
+
break;
|
|
20136
|
+
default: {
|
|
20137
|
+
const { accounts } = payload.result;
|
|
20138
|
+
retrieveBankAccountInfo(accounts[0]);
|
|
20139
|
+
}
|
|
20140
|
+
}
|
|
20141
|
+
},
|
|
20142
|
+
[i18n, retrieveBankAccountInfo, onBack, setBankVerificationError, setVerificationComplete]
|
|
20143
|
+
);
|
|
20023
20144
|
useEffect(
|
|
20024
20145
|
() => {
|
|
20025
20146
|
const container = widgetContainerRef.current;
|
|
@@ -20037,16 +20158,16 @@ function BankVerificationWidget({
|
|
|
20037
20158
|
divElement: container,
|
|
20038
20159
|
link: url,
|
|
20039
20160
|
successHandler: (code, state) => {
|
|
20040
|
-
createTrustedTransferInstrument2(code, state).then((
|
|
20041
|
-
if (
|
|
20161
|
+
createTrustedTransferInstrument2(code, state).then((res) => {
|
|
20162
|
+
if (res) {
|
|
20042
20163
|
widgetCallback({
|
|
20043
20164
|
action: "verification_success",
|
|
20044
|
-
result:
|
|
20165
|
+
result: res
|
|
20045
20166
|
});
|
|
20046
20167
|
}
|
|
20047
20168
|
}).catch(
|
|
20048
20169
|
() => widgetCallback({
|
|
20049
|
-
action: "
|
|
20170
|
+
action: "handle_exception",
|
|
20050
20171
|
err: DEFAULT_ERROR
|
|
20051
20172
|
})
|
|
20052
20173
|
);
|
|
@@ -20054,12 +20175,12 @@ function BankVerificationWidget({
|
|
|
20054
20175
|
errorHandler: (errorCode, errorMessage, state, metadata) => {
|
|
20055
20176
|
handleBankVerificationError2 == null ? void 0 : handleBankVerificationError2(errorCode, errorMessage, state, metadata).then(
|
|
20056
20177
|
(error) => widgetCallback({
|
|
20057
|
-
action: "
|
|
20178
|
+
action: "handle_exception",
|
|
20058
20179
|
err: error
|
|
20059
20180
|
})
|
|
20060
20181
|
).catch(
|
|
20061
20182
|
() => widgetCallback({
|
|
20062
|
-
action: "
|
|
20183
|
+
action: "handle_exception",
|
|
20063
20184
|
err: DEFAULT_ERROR
|
|
20064
20185
|
})
|
|
20065
20186
|
);
|
|
@@ -20077,30 +20198,40 @@ function BankVerificationWidget({
|
|
|
20077
20198
|
try {
|
|
20078
20199
|
iFrameWidget = new IFrameWidget(iFrame, url, vendor, sdkToken2);
|
|
20079
20200
|
const result = await iFrameWidget.mountAndWaitForResponse();
|
|
20080
|
-
widgetCallback({
|
|
20201
|
+
widgetCallback({
|
|
20202
|
+
action: "verification_success",
|
|
20203
|
+
result
|
|
20204
|
+
});
|
|
20081
20205
|
} catch (err) {
|
|
20082
20206
|
if (err instanceof AdyenKycSdkError) {
|
|
20083
20207
|
switch (err.message) {
|
|
20084
20208
|
case "WIDGET_ACCOUNT_COMMIT_FAILURE":
|
|
20085
20209
|
return widgetCallback({
|
|
20086
|
-
action: "
|
|
20210
|
+
action: "handle_exception",
|
|
20087
20211
|
err: err.sourceError
|
|
20088
20212
|
});
|
|
20089
20213
|
case "WIDGET_LAUNCH_FAILED":
|
|
20090
20214
|
case "WIDGET_URL_MALFORMED":
|
|
20091
20215
|
case "WIDGET_TIMEOUT":
|
|
20092
|
-
return widgetCallback({
|
|
20216
|
+
return widgetCallback({
|
|
20217
|
+
action: "retry_verification"
|
|
20218
|
+
/* RETRY_VERIFICATION */
|
|
20219
|
+
});
|
|
20093
20220
|
default:
|
|
20094
20221
|
return widgetCallback({
|
|
20095
|
-
action: "
|
|
20222
|
+
action: "handle_exception",
|
|
20096
20223
|
err: {
|
|
20097
|
-
error: (err == null ? void 0 : err.name) ?? "
|
|
20098
|
-
message: ((_a = err.sourceError) == null ? void 0 : _a.message) ?? "
|
|
20224
|
+
error: (err == null ? void 0 : err.name) ?? "handle_exception",
|
|
20225
|
+
message: ((_a = err.sourceError) == null ? void 0 : _a.message) ?? "handle_exception"
|
|
20226
|
+
/* HANDLE_EXCEPTION */
|
|
20099
20227
|
}
|
|
20100
20228
|
});
|
|
20101
20229
|
}
|
|
20102
20230
|
}
|
|
20103
|
-
return widgetCallback({
|
|
20231
|
+
return widgetCallback({
|
|
20232
|
+
action: "handle_exception",
|
|
20233
|
+
err
|
|
20234
|
+
});
|
|
20104
20235
|
}
|
|
20105
20236
|
});
|
|
20106
20237
|
}
|
|
@@ -20151,79 +20282,6 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
|
|
|
20151
20282
|
}, [errorNotification, clearNotificationTimeout, notificationVisibilityDuration]);
|
|
20152
20283
|
return [errorNotification, setErrorNotification];
|
|
20153
20284
|
};
|
|
20154
|
-
function InstantBankVerification({
|
|
20155
|
-
provider,
|
|
20156
|
-
retrieveBankAccountInfo,
|
|
20157
|
-
setBankVerificationError,
|
|
20158
|
-
onBack,
|
|
20159
|
-
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
20160
|
-
handleBankVerificationError: handleBankVerificationError2
|
|
20161
|
-
}) {
|
|
20162
|
-
const { i18n } = useI18nContext();
|
|
20163
|
-
const [verificationComplete, setVerificationComplete] = useState(false);
|
|
20164
|
-
const widgetCallback = useCallback(
|
|
20165
|
-
(payload) => {
|
|
20166
|
-
setVerificationComplete(true);
|
|
20167
|
-
const errorContent = i18n.get("tryAgainOrManualAccountDetails");
|
|
20168
|
-
switch (payload.action) {
|
|
20169
|
-
case "handle_verification_exception": {
|
|
20170
|
-
let errorTitle = i18n.get("sorryAnErrorOccurred");
|
|
20171
|
-
const { err } = payload;
|
|
20172
|
-
switch (!(err instanceof Error) && (err == null ? void 0 : err.error)) {
|
|
20173
|
-
case "USER_CANCELLED":
|
|
20174
|
-
errorTitle = "";
|
|
20175
|
-
break;
|
|
20176
|
-
case "CONNECTION_ERROR":
|
|
20177
|
-
errorTitle = i18n.get("couldNotEstablishBankConnection");
|
|
20178
|
-
break;
|
|
20179
|
-
case "GENERIC_ERROR":
|
|
20180
|
-
errorTitle = i18n.get("ranIntoTechnicalError");
|
|
20181
|
-
break;
|
|
20182
|
-
case "UNKNOWN_ERROR":
|
|
20183
|
-
default: {
|
|
20184
|
-
errorTitle = i18n.get("couldNotCompleteAccountCheck");
|
|
20185
|
-
break;
|
|
20186
|
-
}
|
|
20187
|
-
}
|
|
20188
|
-
if (errorTitle) {
|
|
20189
|
-
setBankVerificationError({
|
|
20190
|
-
title: errorTitle,
|
|
20191
|
-
content: errorContent
|
|
20192
|
-
});
|
|
20193
|
-
}
|
|
20194
|
-
if (onBack) onBack();
|
|
20195
|
-
break;
|
|
20196
|
-
}
|
|
20197
|
-
case "retry_verification":
|
|
20198
|
-
setBankVerificationError({
|
|
20199
|
-
title: i18n.get("failedInitializeInstantVerification"),
|
|
20200
|
-
content: errorContent
|
|
20201
|
-
});
|
|
20202
|
-
if (onBack) onBack();
|
|
20203
|
-
break;
|
|
20204
|
-
default: {
|
|
20205
|
-
const { accounts } = payload.result;
|
|
20206
|
-
retrieveBankAccountInfo(accounts[0]);
|
|
20207
|
-
}
|
|
20208
|
-
}
|
|
20209
|
-
},
|
|
20210
|
-
[i18n, retrieveBankAccountInfo, onBack, setBankVerificationError]
|
|
20211
|
-
);
|
|
20212
|
-
setBankVerificationError(null);
|
|
20213
|
-
return /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !verificationComplete ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20214
|
-
/* @__PURE__ */ jsx(
|
|
20215
|
-
BankVerificationWidget,
|
|
20216
|
-
{
|
|
20217
|
-
widgetCallback,
|
|
20218
|
-
url: provider.redirectUrl,
|
|
20219
|
-
vendor: provider.name,
|
|
20220
|
-
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
20221
|
-
handleBankVerificationError: handleBankVerificationError2
|
|
20222
|
-
}
|
|
20223
|
-
),
|
|
20224
|
-
/* @__PURE__ */ jsx(ActionBar, { onBack: () => onBack == null ? void 0 : onBack(), backButtonLabel: i18n.get("goBack") })
|
|
20225
|
-
] }) : void 0 });
|
|
20226
|
-
}
|
|
20227
20285
|
function BankVerification(props) {
|
|
20228
20286
|
const {
|
|
20229
20287
|
heading,
|
|
@@ -20246,7 +20304,7 @@ function BankVerification(props) {
|
|
|
20246
20304
|
const ACCOUNT_VERIFICATION = props.id;
|
|
20247
20305
|
const schema = accountVerificationFields;
|
|
20248
20306
|
const stateRef = useRef({ setState: null });
|
|
20249
|
-
const
|
|
20307
|
+
const [verificationComplete, setVerificationComplete] = useState(false);
|
|
20250
20308
|
const { handleChangeFor, data, valid, errors, isValid, triggerValidation, fieldProblems } = useForm({
|
|
20251
20309
|
...props,
|
|
20252
20310
|
schema,
|
|
@@ -20284,7 +20342,7 @@ function BankVerification(props) {
|
|
|
20284
20342
|
fieldProblems,
|
|
20285
20343
|
caller: ACCOUNT_VERIFICATION,
|
|
20286
20344
|
dataStoreId: ACCOUNT_VERIFICATION,
|
|
20287
|
-
schema
|
|
20345
|
+
schema
|
|
20288
20346
|
}
|
|
20289
20347
|
});
|
|
20290
20348
|
}, [data, valid, errors, isValid]);
|
|
@@ -20296,13 +20354,7 @@ function BankVerification(props) {
|
|
|
20296
20354
|
/* @__PURE__ */ jsx(StateContextSetter, { owner: ACCOUNT_VERIFICATION, stateRef }),
|
|
20297
20355
|
bankInfoValidated && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20298
20356
|
/* @__PURE__ */ jsx(FormHeader, { heading }),
|
|
20299
|
-
/* @__PURE__ */
|
|
20300
|
-
/* @__PURE__ */ jsx(Icon, { name: "check", className: "adyen-kyc-u-margin-x-24" }),
|
|
20301
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
20302
|
-
" ",
|
|
20303
|
-
i18n.get("youSuccessfullyVerifiedAccount")
|
|
20304
|
-
] })
|
|
20305
|
-
] })
|
|
20357
|
+
/* @__PURE__ */ jsx(Alert, { title: i18n.get("youSuccessfullyVerifiedAccount"), variant: "success" })
|
|
20306
20358
|
] }),
|
|
20307
20359
|
(provider == null ? void 0 : provider.redirectUrl) && (provider == null ? void 0 : provider.name) && formIsActive && !bankInfoValidated && /* @__PURE__ */ jsx(
|
|
20308
20360
|
"div",
|
|
@@ -20310,17 +20362,22 @@ function BankVerification(props) {
|
|
|
20310
20362
|
className: cx("adyen-kyc-bank-verification-container", {
|
|
20311
20363
|
"adyen-kyc-bank-verification-container__fixed": !isEmbeddedDropin
|
|
20312
20364
|
}),
|
|
20313
|
-
children: /* @__PURE__ */ jsx(
|
|
20314
|
-
|
|
20315
|
-
|
|
20316
|
-
|
|
20317
|
-
|
|
20318
|
-
|
|
20319
|
-
|
|
20320
|
-
|
|
20321
|
-
|
|
20322
|
-
|
|
20323
|
-
|
|
20365
|
+
children: /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !verificationComplete ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20366
|
+
/* @__PURE__ */ jsx(
|
|
20367
|
+
BankVerificationWidget,
|
|
20368
|
+
{
|
|
20369
|
+
url: provider.redirectUrl,
|
|
20370
|
+
vendor: provider.name,
|
|
20371
|
+
setBankVerificationError,
|
|
20372
|
+
setVerificationComplete,
|
|
20373
|
+
onBack,
|
|
20374
|
+
retrieveBankAccountInfo,
|
|
20375
|
+
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
20376
|
+
handleBankVerificationError: handleBankVerificationError2
|
|
20377
|
+
}
|
|
20378
|
+
),
|
|
20379
|
+
/* @__PURE__ */ jsx(ActionBar, { onBack: () => onBack == null ? void 0 : onBack(), backButtonLabel: i18n.get("goBack") })
|
|
20380
|
+
] }) : void 0 })
|
|
20324
20381
|
}
|
|
20325
20382
|
)
|
|
20326
20383
|
] });
|
|
@@ -21232,6 +21289,77 @@ function SwiftCode(props) {
|
|
|
21232
21289
|
}
|
|
21233
21290
|
);
|
|
21234
21291
|
}
|
|
21292
|
+
const AccountHolderDescriptionFragment = ({
|
|
21293
|
+
legalEntityResponse
|
|
21294
|
+
}) => {
|
|
21295
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
21296
|
+
const { i18n } = useI18nContext();
|
|
21297
|
+
const hasSolePropEntityAssociations = hasOwnEntityAssociationOfType(
|
|
21298
|
+
LegalEntityType.SOLE_PROPRIETORSHIP,
|
|
21299
|
+
legalEntityResponse.entityAssociations,
|
|
21300
|
+
legalEntityResponse.id
|
|
21301
|
+
);
|
|
21302
|
+
const { accountHolder } = useCoreContext();
|
|
21303
|
+
if (accountHolder === "mySoleProprietorName" || hasSolePropEntityAssociations) {
|
|
21304
|
+
const soleProp = (_a = legalEntityResponse.entityAssociations) == null ? void 0 : _a.find(
|
|
21305
|
+
(ea) => ea.entityType === "soleProprietorship"
|
|
21306
|
+
);
|
|
21307
|
+
const { individual: individual2 } = legalEntityResponse;
|
|
21308
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21309
|
+
`${i18n.get("bankAccountHasToBeInYourName")} `,
|
|
21310
|
+
/* @__PURE__ */ jsx("b", { children: `${individual2 == null ? void 0 : individual2.name.firstName} ${individual2 == null ? void 0 : individual2.name.lastName}` }),
|
|
21311
|
+
` ${i18n.get("orSoleProprietorshipName")} `,
|
|
21312
|
+
" ",
|
|
21313
|
+
/* @__PURE__ */ jsx("b", { children: `${(soleProp == null ? void 0 : soleProp.name) ?? ""}` })
|
|
21314
|
+
] });
|
|
21315
|
+
}
|
|
21316
|
+
const hasTrustsEntityAssociations = hasOwnEntityAssociationOfType(
|
|
21317
|
+
LegalEntityType.TRUST,
|
|
21318
|
+
legalEntityResponse.entityAssociations,
|
|
21319
|
+
legalEntityResponse.id
|
|
21320
|
+
);
|
|
21321
|
+
if (accountHolder === "aTrust" || hasTrustsEntityAssociations) {
|
|
21322
|
+
const trust = (_b = legalEntityResponse.entityAssociations) == null ? void 0 : _b.find((ea) => ea.entityType === "trust");
|
|
21323
|
+
if (legalEntityResponse.type === LegalEntityType.INDIVIDUAL) {
|
|
21324
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21325
|
+
`${i18n.get("bankAccountToHaveSameNameAsTrust")} `,
|
|
21326
|
+
/* @__PURE__ */ jsx("b", { children: i18n.get("trusteeAsTrusteeForTrust", {
|
|
21327
|
+
values: {
|
|
21328
|
+
trusteeName: `${(_c = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _c.name.firstName} ${(_d = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _d.name.lastName}`,
|
|
21329
|
+
trustName: (trust == null ? void 0 : trust.name) ?? ""
|
|
21330
|
+
}
|
|
21331
|
+
}) })
|
|
21332
|
+
] });
|
|
21333
|
+
}
|
|
21334
|
+
const companyTrusteeBankAccountName = ((_e = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _e.legalName) !== ((_f = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _f.doingBusinessAs) ? i18n.get("trusteeAsTrusteeForTrustDoingBusinessAs", {
|
|
21335
|
+
values: {
|
|
21336
|
+
trusteeName: ((_g = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _g.legalName) ?? "",
|
|
21337
|
+
trustName: (trust == null ? void 0 : trust.name) ?? "",
|
|
21338
|
+
tradingName: (_h = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _h.doingBusinessAs
|
|
21339
|
+
}
|
|
21340
|
+
}) : i18n.get("trusteeAsTrusteeForTrust", {
|
|
21341
|
+
values: {
|
|
21342
|
+
trusteeName: ((_i = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _i.legalName) ?? "",
|
|
21343
|
+
trustName: (trust == null ? void 0 : trust.name) ?? ""
|
|
21344
|
+
}
|
|
21345
|
+
});
|
|
21346
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21347
|
+
/* @__PURE__ */ jsx("div", { children: `${i18n.get("bankAccountToHaveSameNameAsTrust")} ` }),
|
|
21348
|
+
/* @__PURE__ */ jsx("b", { children: companyTrusteeBankAccountName })
|
|
21349
|
+
] });
|
|
21350
|
+
}
|
|
21351
|
+
if (legalEntityResponse.type === LegalEntityType.ORGANIZATION) {
|
|
21352
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21353
|
+
`${i18n.get("bankAccountHasToBeInYourCompanyName")} `,
|
|
21354
|
+
/* @__PURE__ */ jsx("b", { children: (_j = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _j.legalName })
|
|
21355
|
+
] });
|
|
21356
|
+
}
|
|
21357
|
+
const { individual } = legalEntityResponse;
|
|
21358
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21359
|
+
`${i18n.get("bankAccountHasToBeInYourName")} `,
|
|
21360
|
+
/* @__PURE__ */ jsx("b", { children: `${individual == null ? void 0 : individual.name.firstName} ${individual == null ? void 0 : individual.name.lastName}` })
|
|
21361
|
+
] });
|
|
21362
|
+
};
|
|
21235
21363
|
const CheckGuidance = ({ annotated }) => /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-check-guidance", children: [
|
|
21236
21364
|
/* @__PURE__ */ jsx(
|
|
21237
21365
|
Svg,
|
|
@@ -21273,7 +21401,7 @@ const payoutAccountFields = [
|
|
|
21273
21401
|
...bankCodeFields
|
|
21274
21402
|
];
|
|
21275
21403
|
function PayoutAccountComponent(props) {
|
|
21276
|
-
const {
|
|
21404
|
+
const { accountFormat, setAccountFormat } = useCoreContext();
|
|
21277
21405
|
const { i18n } = useI18nContext();
|
|
21278
21406
|
const [checkAnnotation, setCheckAnnotation] = useState();
|
|
21279
21407
|
const { isSettingEnabled } = useSettingsContext();
|
|
@@ -21290,7 +21418,7 @@ function PayoutAccountComponent(props) {
|
|
|
21290
21418
|
invalidFieldNames
|
|
21291
21419
|
} = props;
|
|
21292
21420
|
const showCheckGuidance = shouldShowCheckGuidance(country);
|
|
21293
|
-
const { data, valid, errors,
|
|
21421
|
+
const { data, valid, errors, schema } = useForm({
|
|
21294
21422
|
...props,
|
|
21295
21423
|
defaultData: props.data,
|
|
21296
21424
|
schema: requiredFields,
|
|
@@ -21314,19 +21442,14 @@ function PayoutAccountComponent(props) {
|
|
|
21314
21442
|
const bankNameProps = getFieldProps(props, bankNameFields);
|
|
21315
21443
|
const bankCodeProps = getFieldProps(props, bankCodeFields);
|
|
21316
21444
|
const bankCityProps = getFieldProps(props, bankCityFields);
|
|
21317
|
-
const hasSoleProprietorship = accountHolder === "mySoleProprietorName" || hasOwnEntityAssociationOfType(
|
|
21318
|
-
LegalEntityType.SOLE_PROPRIETORSHIP,
|
|
21319
|
-
legalEntityResponse.entityAssociations,
|
|
21320
|
-
legalEntityResponse.id
|
|
21321
|
-
);
|
|
21322
|
-
const hasTrusts = accountHolder === "aTrust" || hasOwnEntityAssociationOfType(
|
|
21323
|
-
LegalEntityType.TRUST,
|
|
21324
|
-
legalEntityResponse.entityAssociations,
|
|
21325
|
-
legalEntityResponse.id
|
|
21326
|
-
);
|
|
21327
|
-
const accountHolderDescriptionKey = hasSoleProprietorship ? "accountHolderDescriptionSoleProp" : hasTrusts ? "bankAccountToHaveSameNameAsTrust" : legalEntityResponse.type === LegalEntityType.ORGANIZATION ? "accountHolderDescriptionCompany" : "accountHolderDescriptionIndividual";
|
|
21328
21445
|
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__payout-account", "aria-describedby": "ariaErrorField", children: [
|
|
21329
|
-
/* @__PURE__ */ jsx(
|
|
21446
|
+
/* @__PURE__ */ jsx(
|
|
21447
|
+
FormHeader,
|
|
21448
|
+
{
|
|
21449
|
+
heading,
|
|
21450
|
+
descriptionComponent: /* @__PURE__ */ jsx(AccountHolderDescriptionFragment, { legalEntityResponse })
|
|
21451
|
+
}
|
|
21452
|
+
),
|
|
21330
21453
|
/* @__PURE__ */ jsx(
|
|
21331
21454
|
ErrorPanel,
|
|
21332
21455
|
{
|
|
@@ -21337,31 +21460,6 @@ function PayoutAccountComponent(props) {
|
|
|
21337
21460
|
}
|
|
21338
21461
|
),
|
|
21339
21462
|
showCheckGuidance ? /* @__PURE__ */ jsx(CheckGuidance, { annotated: checkAnnotation }) : void 0,
|
|
21340
|
-
formUtils.isRequiredField("accountHolder") && /* @__PURE__ */ jsx(
|
|
21341
|
-
Field,
|
|
21342
|
-
{
|
|
21343
|
-
name: "accountHolder",
|
|
21344
|
-
label: formUtils.getLabel("accountHolder"),
|
|
21345
|
-
helper: i18n.get(accountHolderDescriptionKey),
|
|
21346
|
-
classNameModifiers: ["accountHolder"],
|
|
21347
|
-
isValid: valid.accountHolder,
|
|
21348
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
21349
|
-
InputText,
|
|
21350
|
-
{
|
|
21351
|
-
...childProps,
|
|
21352
|
-
name: "accountHolder",
|
|
21353
|
-
value: data.accountHolder,
|
|
21354
|
-
placeholder: formUtils.getPlaceholder("accountHolder"),
|
|
21355
|
-
readonly: true,
|
|
21356
|
-
onInput: handleChangeFor("accountHolder", "input"),
|
|
21357
|
-
onBlur: handleChangeFor("accountHolder", "blur"),
|
|
21358
|
-
"aria-required": true,
|
|
21359
|
-
"aria-label": formUtils.getLabel("accountHolder"),
|
|
21360
|
-
"aria-invalid": !valid.accountHolder
|
|
21361
|
-
}
|
|
21362
|
-
)
|
|
21363
|
-
}
|
|
21364
|
-
),
|
|
21365
21463
|
bankAccountFormatSelectionAllowed && shouldShowPayoutAccountFormatSelector(country) && accountFormat && /* @__PURE__ */ jsx(
|
|
21366
21464
|
BankAccountFormat,
|
|
21367
21465
|
{
|
|
@@ -21369,6 +21467,16 @@ function PayoutAccountComponent(props) {
|
|
|
21369
21467
|
handleAccountFormatChange: setAccountFormat
|
|
21370
21468
|
}
|
|
21371
21469
|
),
|
|
21470
|
+
formUtils.isRequiredField("branchCode") && /* @__PURE__ */ jsx(
|
|
21471
|
+
BranchCode,
|
|
21472
|
+
{
|
|
21473
|
+
...branchCodeProps,
|
|
21474
|
+
country,
|
|
21475
|
+
dataStoreId: id,
|
|
21476
|
+
onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
|
|
21477
|
+
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
|
|
21478
|
+
}
|
|
21479
|
+
),
|
|
21372
21480
|
formUtils.isRequiredField("bankAccountNumber") && /* @__PURE__ */ jsx(
|
|
21373
21481
|
BankAccountNumber,
|
|
21374
21482
|
{
|
|
@@ -21383,16 +21491,6 @@ function PayoutAccountComponent(props) {
|
|
|
21383
21491
|
formUtils.isRequiredField("swiftCode") && /* @__PURE__ */ jsx(SwiftCode, { ...swiftCodeProps, dataStoreId: id }),
|
|
21384
21492
|
formUtils.isRequiredField("bankName") && /* @__PURE__ */ jsx(BankName, { ...bankNameProps, dataStoreId: id }),
|
|
21385
21493
|
formUtils.isRequiredField("bankCode") && /* @__PURE__ */ jsx(BankCode, { ...bankCodeProps, country, dataStoreId: id }),
|
|
21386
|
-
formUtils.isRequiredField("branchCode") && /* @__PURE__ */ jsx(
|
|
21387
|
-
BranchCode,
|
|
21388
|
-
{
|
|
21389
|
-
...branchCodeProps,
|
|
21390
|
-
country,
|
|
21391
|
-
dataStoreId: id,
|
|
21392
|
-
onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
|
|
21393
|
-
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
|
|
21394
|
-
}
|
|
21395
|
-
),
|
|
21396
21494
|
formUtils.isRequiredField("bankCity") && /* @__PURE__ */ jsx(BankCity, { ...bankCityProps, dataStoreId: id }),
|
|
21397
21495
|
shouldShowPayoutAlert(country) && /* @__PURE__ */ jsx(
|
|
21398
21496
|
Alert,
|
|
@@ -21484,77 +21582,6 @@ const makePayoutVerificationMethodsMetadata = (instantVerificationProvider) => {
|
|
|
21484
21582
|
};
|
|
21485
21583
|
};
|
|
21486
21584
|
const payoutVerificationMethods = ["instantVerification", "manualVerification"];
|
|
21487
|
-
const AccountHolderDescriptionFragment = ({
|
|
21488
|
-
legalEntityResponse
|
|
21489
|
-
}) => {
|
|
21490
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
21491
|
-
const { i18n } = useI18nContext();
|
|
21492
|
-
const hasSolePropEntityAssociations = hasOwnEntityAssociationOfType(
|
|
21493
|
-
LegalEntityType.SOLE_PROPRIETORSHIP,
|
|
21494
|
-
legalEntityResponse.entityAssociations,
|
|
21495
|
-
legalEntityResponse.id
|
|
21496
|
-
);
|
|
21497
|
-
const { accountHolder } = useCoreContext();
|
|
21498
|
-
if (accountHolder === "mySoleProprietorName" || hasSolePropEntityAssociations) {
|
|
21499
|
-
const soleProp = (_a = legalEntityResponse.entityAssociations) == null ? void 0 : _a.find(
|
|
21500
|
-
(ea) => ea.entityType === "soleProprietorship"
|
|
21501
|
-
);
|
|
21502
|
-
const { individual: individual2 } = legalEntityResponse;
|
|
21503
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21504
|
-
`${i18n.get("bankAccountHasToBeInYourName")} `,
|
|
21505
|
-
/* @__PURE__ */ jsx("b", { children: `${individual2 == null ? void 0 : individual2.name.firstName} ${individual2 == null ? void 0 : individual2.name.lastName}` }),
|
|
21506
|
-
` ${i18n.get("orSoleProprietorshipName")} `,
|
|
21507
|
-
" ",
|
|
21508
|
-
/* @__PURE__ */ jsx("b", { children: `${(soleProp == null ? void 0 : soleProp.name) ?? ""}` })
|
|
21509
|
-
] });
|
|
21510
|
-
}
|
|
21511
|
-
const hasTrustsEntityAssociations = hasOwnEntityAssociationOfType(
|
|
21512
|
-
LegalEntityType.TRUST,
|
|
21513
|
-
legalEntityResponse.entityAssociations,
|
|
21514
|
-
legalEntityResponse.id
|
|
21515
|
-
);
|
|
21516
|
-
if (accountHolder === "aTrust" || hasTrustsEntityAssociations) {
|
|
21517
|
-
const trust = (_b = legalEntityResponse.entityAssociations) == null ? void 0 : _b.find((ea) => ea.entityType === "trust");
|
|
21518
|
-
if (legalEntityResponse.type === LegalEntityType.INDIVIDUAL) {
|
|
21519
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21520
|
-
`${i18n.get("bankAccountToHaveSameNameAsTrust")} `,
|
|
21521
|
-
/* @__PURE__ */ jsx("b", { children: i18n.get("trusteeAsTrusteeForTrust", {
|
|
21522
|
-
values: {
|
|
21523
|
-
trusteeName: `${(_c = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _c.name.firstName} ${(_d = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _d.name.lastName}`,
|
|
21524
|
-
trustName: (trust == null ? void 0 : trust.name) ?? ""
|
|
21525
|
-
}
|
|
21526
|
-
}) })
|
|
21527
|
-
] });
|
|
21528
|
-
}
|
|
21529
|
-
const companyTrusteeBankAccountName = ((_e = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _e.legalName) !== ((_f = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _f.doingBusinessAs) ? i18n.get("trusteeAsTrusteeForTrustDoingBusinessAs", {
|
|
21530
|
-
values: {
|
|
21531
|
-
trusteeName: ((_g = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _g.legalName) ?? "",
|
|
21532
|
-
trustName: (trust == null ? void 0 : trust.name) ?? "",
|
|
21533
|
-
tradingName: (_h = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _h.doingBusinessAs
|
|
21534
|
-
}
|
|
21535
|
-
}) : i18n.get("trusteeAsTrusteeForTrust", {
|
|
21536
|
-
values: {
|
|
21537
|
-
trusteeName: ((_i = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _i.legalName) ?? "",
|
|
21538
|
-
trustName: (trust == null ? void 0 : trust.name) ?? ""
|
|
21539
|
-
}
|
|
21540
|
-
});
|
|
21541
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21542
|
-
/* @__PURE__ */ jsx("div", { children: `${i18n.get("bankAccountToHaveSameNameAsTrust")} ` }),
|
|
21543
|
-
/* @__PURE__ */ jsx("b", { children: companyTrusteeBankAccountName })
|
|
21544
|
-
] });
|
|
21545
|
-
}
|
|
21546
|
-
if (legalEntityResponse.type === LegalEntityType.ORGANIZATION) {
|
|
21547
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21548
|
-
`${i18n.get("bankAccountHasToBeInYourCompanyName")} `,
|
|
21549
|
-
/* @__PURE__ */ jsx("b", { children: (_j = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _j.legalName })
|
|
21550
|
-
] });
|
|
21551
|
-
}
|
|
21552
|
-
const { individual } = legalEntityResponse;
|
|
21553
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21554
|
-
`${i18n.get("bankAccountHasToBeInYourName")} `,
|
|
21555
|
-
/* @__PURE__ */ jsx("b", { children: `${individual == null ? void 0 : individual.name.firstName} ${individual == null ? void 0 : individual.name.lastName}` })
|
|
21556
|
-
] });
|
|
21557
|
-
};
|
|
21558
21585
|
function Card({
|
|
21559
21586
|
className,
|
|
21560
21587
|
children,
|
|
@@ -21619,7 +21646,7 @@ function Card({
|
|
|
21619
21646
|
const skeleton = "adyen-kyc-skeleton";
|
|
21620
21647
|
const skeletonCircle = "adyen-kyc-skeleton-circle";
|
|
21621
21648
|
const skeletonText = "adyen-kyc-skeleton-text";
|
|
21622
|
-
const styles$
|
|
21649
|
+
const styles$5 = {
|
|
21623
21650
|
skeleton,
|
|
21624
21651
|
"skeleton-circle": "adyen-kyc-skeleton-circle",
|
|
21625
21652
|
skeletonCircle,
|
|
@@ -21632,19 +21659,61 @@ const Skeleton = ({
|
|
|
21632
21659
|
height = "1em",
|
|
21633
21660
|
width
|
|
21634
21661
|
}) => {
|
|
21635
|
-
const classNames = cx(styles$
|
|
21636
|
-
[styles$
|
|
21637
|
-
[styles$
|
|
21662
|
+
const classNames = cx(styles$5.skeleton, {
|
|
21663
|
+
[styles$5.skeletonCircle]: circle,
|
|
21664
|
+
[styles$5.skeletonText]: text
|
|
21638
21665
|
});
|
|
21639
21666
|
return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
|
|
21640
21667
|
};
|
|
21668
|
+
const isInstantVerificationAvailable = ({
|
|
21669
|
+
verificationVendorsCallback,
|
|
21670
|
+
provider
|
|
21671
|
+
}) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
|
|
21672
|
+
const isProviderPlaidEmbedded = (redirectUrl) => !!(redirectUrl == null ? void 0 : redirectUrl.includes("/plaid/embedded-search/sdk?"));
|
|
21673
|
+
const rules$2 = ({ data, requiredFields }) => ({
|
|
21674
|
+
whenUsingManualVerification: () => {
|
|
21675
|
+
var _a;
|
|
21676
|
+
if (!data.payoutVerificationMethod) return;
|
|
21677
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21678
|
+
return "REQUIRED";
|
|
21679
|
+
}
|
|
21680
|
+
},
|
|
21681
|
+
whenUsingInstantVerification: () => {
|
|
21682
|
+
var _a;
|
|
21683
|
+
if (!data.payoutVerificationMethod) {
|
|
21684
|
+
return "REQUIRED";
|
|
21685
|
+
}
|
|
21686
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21687
|
+
return "REQUIRED";
|
|
21688
|
+
}
|
|
21689
|
+
},
|
|
21690
|
+
verifiedBankAccountNumber: () => {
|
|
21691
|
+
var _a;
|
|
21692
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
21693
|
+
return "REQUIRED";
|
|
21694
|
+
}
|
|
21695
|
+
},
|
|
21696
|
+
bankStatementRequirement: () => {
|
|
21697
|
+
var _a;
|
|
21698
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
21699
|
+
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
21700
|
+
}
|
|
21701
|
+
},
|
|
21702
|
+
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
21703
|
+
bankStatementDescription: () => {
|
|
21704
|
+
var _a;
|
|
21705
|
+
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
21706
|
+
return "OPTIONAL";
|
|
21707
|
+
}
|
|
21708
|
+
}
|
|
21709
|
+
});
|
|
21641
21710
|
const preferInstantVerificationMethod = "adyen-kyc-prefer-instant-verification-method";
|
|
21642
21711
|
const preferInstantVerificationMethodCard = "adyen-kyc-prefer-instant-verification-method-card";
|
|
21643
21712
|
const preferInstantVerificationMethodImage = "adyen-kyc-prefer-instant-verification-method-image";
|
|
21644
21713
|
const preferInstantVerificationMethodInstantButton = "adyen-kyc-prefer-instant-verification-method-instant-button";
|
|
21645
|
-
const
|
|
21646
|
-
const
|
|
21647
|
-
const styles$
|
|
21714
|
+
const preferInstantVerificationMethodActions = "adyen-kyc-prefer-instant-verification-method-actions";
|
|
21715
|
+
const preferInstantVerificationMethodManualButtonDarker = "adyen-kyc-prefer-instant-verification-method-manual-button-darker";
|
|
21716
|
+
const styles$4 = {
|
|
21648
21717
|
"prefer-instant-verification-method": "adyen-kyc-prefer-instant-verification-method",
|
|
21649
21718
|
preferInstantVerificationMethod,
|
|
21650
21719
|
"prefer-instant-verification-method-card": "adyen-kyc-prefer-instant-verification-method-card",
|
|
@@ -21653,10 +21722,10 @@ const styles$3 = {
|
|
|
21653
21722
|
preferInstantVerificationMethodImage,
|
|
21654
21723
|
"prefer-instant-verification-method-instant-button": "adyen-kyc-prefer-instant-verification-method-instant-button",
|
|
21655
21724
|
preferInstantVerificationMethodInstantButton,
|
|
21656
|
-
"prefer-instant-verification-method-
|
|
21657
|
-
|
|
21658
|
-
"prefer-instant-verification-method-manual-button-
|
|
21659
|
-
|
|
21725
|
+
"prefer-instant-verification-method-actions": "adyen-kyc-prefer-instant-verification-method-actions",
|
|
21726
|
+
preferInstantVerificationMethodActions,
|
|
21727
|
+
"prefer-instant-verification-method-manual-button-darker": "adyen-kyc-prefer-instant-verification-method-manual-button-darker",
|
|
21728
|
+
preferInstantVerificationMethodManualButtonDarker
|
|
21660
21729
|
};
|
|
21661
21730
|
const getProviderIconName = (providerName) => {
|
|
21662
21731
|
switch (providerName) {
|
|
@@ -21672,52 +21741,87 @@ const getProviderIconName = (providerName) => {
|
|
|
21672
21741
|
};
|
|
21673
21742
|
const PreferInstantVerificationMethod = ({
|
|
21674
21743
|
loadingStatus,
|
|
21675
|
-
|
|
21744
|
+
provider,
|
|
21676
21745
|
bankInfoValidated,
|
|
21677
21746
|
instantVerificationAvailable,
|
|
21678
|
-
selectVerificationMethod
|
|
21747
|
+
selectVerificationMethod,
|
|
21748
|
+
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
21749
|
+
setBankInfoValidated,
|
|
21750
|
+
handleBankVerificationError: handleBankVerificationError2,
|
|
21751
|
+
setBankVerificationError,
|
|
21752
|
+
refreshLegalEntity,
|
|
21753
|
+
handleChangeFor,
|
|
21754
|
+
triggerValidation
|
|
21679
21755
|
}) => {
|
|
21756
|
+
var _a;
|
|
21680
21757
|
const { i18n } = useI18nContext();
|
|
21681
|
-
const iconName = getProviderIconName(
|
|
21682
|
-
|
|
21683
|
-
|
|
21684
|
-
|
|
21685
|
-
|
|
21686
|
-
|
|
21687
|
-
|
|
21688
|
-
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
|
|
21700
|
-
|
|
21701
|
-
|
|
21702
|
-
|
|
21703
|
-
|
|
21704
|
-
|
|
21705
|
-
|
|
21706
|
-
|
|
21707
|
-
|
|
21758
|
+
const iconName = getProviderIconName((_a = provider == null ? void 0 : provider.name) == null ? void 0 : _a.toLocaleLowerCase());
|
|
21759
|
+
const showVerificationWidget = isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl);
|
|
21760
|
+
const [verificationComplete, setVerificationComplete] = useState(false);
|
|
21761
|
+
const retrieveBankAccountInfo = async ({
|
|
21762
|
+
realLastFour,
|
|
21763
|
+
number,
|
|
21764
|
+
bankName
|
|
21765
|
+
}) => {
|
|
21766
|
+
handleChangeFor("payoutVerificationMethod")("instantVerification");
|
|
21767
|
+
handleChangeFor("verifiedBankAccountNumber")(realLastFour ? `*******${realLastFour}` : number);
|
|
21768
|
+
handleChangeFor("verifiedBankName")(bankName);
|
|
21769
|
+
setBankInfoValidated == null ? void 0 : setBankInfoValidated(true);
|
|
21770
|
+
triggerValidation();
|
|
21771
|
+
await (refreshLegalEntity == null ? void 0 : refreshLegalEntity());
|
|
21772
|
+
};
|
|
21773
|
+
const bankVerificationWidget = verificationComplete ? bankInfoValidated && /* @__PURE__ */ jsx(Alert, { title: i18n.get("youSuccessfullyVerifiedAccount"), variant: "success" }) : provider && /* @__PURE__ */ jsx(
|
|
21774
|
+
BankVerificationWidget,
|
|
21775
|
+
{
|
|
21776
|
+
url: provider.redirectUrl,
|
|
21777
|
+
vendor: provider.name,
|
|
21778
|
+
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
21779
|
+
handleBankVerificationError: handleBankVerificationError2,
|
|
21780
|
+
setBankVerificationError,
|
|
21781
|
+
setVerificationComplete,
|
|
21782
|
+
retrieveBankAccountInfo
|
|
21783
|
+
}
|
|
21784
|
+
);
|
|
21785
|
+
const providerBanner = provider && /* @__PURE__ */ jsx(Card, { background: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethodCard, children: [
|
|
21786
|
+
/* @__PURE__ */ jsx(
|
|
21787
|
+
Svg,
|
|
21788
|
+
{
|
|
21789
|
+
type: "image",
|
|
21790
|
+
name: "instant-verification-method",
|
|
21791
|
+
className: styles$4.preferInstantVerificationMethodImage
|
|
21792
|
+
}
|
|
21793
|
+
),
|
|
21794
|
+
/* @__PURE__ */ jsx(Typography, { el: "p", variant: "body-stronger", children: i18n.get("instantlyConnectAndVerifyYourBankAccount") }),
|
|
21708
21795
|
/* @__PURE__ */ jsx(
|
|
21796
|
+
Button,
|
|
21797
|
+
{
|
|
21798
|
+
type: "button",
|
|
21799
|
+
label: i18n.get("connectWith", {
|
|
21800
|
+
values: { providerName: iconName ? "" : provider.name }
|
|
21801
|
+
}),
|
|
21802
|
+
className: styles$4.preferInstantVerificationMethodInstantButton,
|
|
21803
|
+
onClick: () => selectVerificationMethod("instantVerification"),
|
|
21804
|
+
disabled: bankInfoValidated,
|
|
21805
|
+
icon: iconName,
|
|
21806
|
+
iconPosition: "right"
|
|
21807
|
+
}
|
|
21808
|
+
)
|
|
21809
|
+
] }) });
|
|
21810
|
+
return /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethod, children: [
|
|
21811
|
+
loadingStatus === "loading" ? /* @__PURE__ */ jsx(Skeleton, { height: "21rem" }) : instantVerificationAvailable && (showVerificationWidget ? bankVerificationWidget : providerBanner),
|
|
21812
|
+
/* @__PURE__ */ jsx("div", { className: styles$4.preferInstantVerificationMethodActions, children: /* @__PURE__ */ jsx(
|
|
21709
21813
|
Button,
|
|
21710
21814
|
{
|
|
21711
21815
|
type: "button",
|
|
21712
21816
|
label: i18n.get("addAccountManually"),
|
|
21713
21817
|
tertiary: instantVerificationAvailable,
|
|
21714
|
-
className: cx(
|
|
21715
|
-
[styles$
|
|
21818
|
+
className: cx({
|
|
21819
|
+
[styles$4.preferInstantVerificationMethodManualButtonDarker]: instantVerificationAvailable
|
|
21716
21820
|
}),
|
|
21717
21821
|
onClick: () => selectVerificationMethod("manualVerification"),
|
|
21718
21822
|
disabled: bankInfoValidated
|
|
21719
21823
|
}
|
|
21720
|
-
)
|
|
21824
|
+
) })
|
|
21721
21825
|
] });
|
|
21722
21826
|
};
|
|
21723
21827
|
const PayoutVerificationMethodOptionIcon = ({
|
|
@@ -21746,10 +21850,7 @@ const PayoutVerificationMethodOptionFooter = ({
|
|
|
21746
21850
|
)
|
|
21747
21851
|
] }) : null;
|
|
21748
21852
|
};
|
|
21749
|
-
const payoutVerificationMethodFields = [
|
|
21750
|
-
"payoutVerificationMethod",
|
|
21751
|
-
"bankCountry"
|
|
21752
|
-
];
|
|
21853
|
+
const payoutVerificationMethodFields = ["payoutVerificationMethod", "bankCountry", ...accountVerificationFields];
|
|
21753
21854
|
const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName, i18n) => {
|
|
21754
21855
|
switch (legalEntityType) {
|
|
21755
21856
|
case LegalEntityType.INDIVIDUAL:
|
|
@@ -21765,20 +21866,26 @@ const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName
|
|
|
21765
21866
|
}
|
|
21766
21867
|
};
|
|
21767
21868
|
function PayoutVerificationMethod(props) {
|
|
21768
|
-
var _a;
|
|
21869
|
+
var _a, _b;
|
|
21769
21870
|
const {
|
|
21871
|
+
heading,
|
|
21872
|
+
country,
|
|
21770
21873
|
accountHolder,
|
|
21771
|
-
legalEntityResponse,
|
|
21772
21874
|
provider,
|
|
21773
|
-
|
|
21875
|
+
bankVendorsLoadingStatus,
|
|
21876
|
+
instantVerificationAllowed,
|
|
21877
|
+
legalEntityResponse,
|
|
21774
21878
|
forms,
|
|
21775
|
-
country,
|
|
21776
21879
|
validators: validators2,
|
|
21880
|
+
isActiveForm,
|
|
21777
21881
|
bankInfoValidated,
|
|
21778
|
-
|
|
21779
|
-
bankVendorsLoadingStatus,
|
|
21882
|
+
setBankInfoValidated,
|
|
21780
21883
|
handleNextClick,
|
|
21781
|
-
|
|
21884
|
+
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
21885
|
+
refreshLegalEntity,
|
|
21886
|
+
handleBankVerificationError: handleBankVerificationError2,
|
|
21887
|
+
setBankVerificationError,
|
|
21888
|
+
setHideFooter
|
|
21782
21889
|
} = props;
|
|
21783
21890
|
const { type: legalEntityType } = legalEntityResponse;
|
|
21784
21891
|
const { i18n } = useI18nContext();
|
|
@@ -21793,10 +21900,15 @@ function PayoutVerificationMethod(props) {
|
|
|
21793
21900
|
SettingNames.AllowIntraRegionCrossBorderPayout
|
|
21794
21901
|
);
|
|
21795
21902
|
const [hasSelectedMethod, setHasSelectedMethod] = useState(false);
|
|
21796
|
-
const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
|
|
21903
|
+
const { handleChangeFor, data, valid, errors, fieldProblems, triggerValidation } = useForm({
|
|
21797
21904
|
...props,
|
|
21798
21905
|
schema: payoutVerificationMethodFields,
|
|
21799
|
-
defaultData: {
|
|
21906
|
+
defaultData: {
|
|
21907
|
+
verifiedAccountHolder: accountHolder,
|
|
21908
|
+
verifiedCurrencyCode: (_a = currencyByCountry[country]) == null ? void 0 : _a[0],
|
|
21909
|
+
bankCountry: country,
|
|
21910
|
+
...props.data
|
|
21911
|
+
},
|
|
21800
21912
|
rules: validators2,
|
|
21801
21913
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
21802
21914
|
});
|
|
@@ -21806,6 +21918,12 @@ function PayoutVerificationMethod(props) {
|
|
|
21806
21918
|
() => updateStateSlice({ data: { ...sliceData, ...data }, errors, valid, fieldProblems }),
|
|
21807
21919
|
[data, errors, fieldProblems, valid]
|
|
21808
21920
|
);
|
|
21921
|
+
useEffect(() => {
|
|
21922
|
+
if (!enablePreferInstantVerificationMethodFlow) return;
|
|
21923
|
+
setHideFooter == null ? void 0 : setHideFooter(
|
|
21924
|
+
enablePreferInstantVerificationMethodFlow && isActiveForm && !bankInfoValidated
|
|
21925
|
+
);
|
|
21926
|
+
}, [enablePreferInstantVerificationMethodFlow, isActiveForm, bankInfoValidated, setHideFooter]);
|
|
21809
21927
|
const instantVerificationAvailable = useMemo(
|
|
21810
21928
|
() => Boolean(instantVerificationAllowed && (provider == null ? void 0 : provider.redirectUrl)),
|
|
21811
21929
|
[instantVerificationAllowed, provider]
|
|
@@ -21855,7 +21973,7 @@ function PayoutVerificationMethod(props) {
|
|
|
21855
21973
|
}
|
|
21856
21974
|
}, [provider, bankVendorsLoadingStatus, enablePreferInstantVerificationMethodFlow]);
|
|
21857
21975
|
const { dataset: countries } = useDataset(datasetIdentifier.country);
|
|
21858
|
-
const bankCountryName = ((
|
|
21976
|
+
const bankCountryName = ((_b = countries.find((country2) => country2.id === data.bankCountry)) == null ? void 0 : _b.name) ?? data.bankCountry;
|
|
21859
21977
|
const allowedBankCountries = getAllowedBankCountries(country);
|
|
21860
21978
|
const countryField = /* @__PURE__ */ jsx(
|
|
21861
21979
|
CountryField,
|
|
@@ -21903,10 +22021,17 @@ function PayoutVerificationMethod(props) {
|
|
|
21903
22021
|
PreferInstantVerificationMethod,
|
|
21904
22022
|
{
|
|
21905
22023
|
loadingStatus: bankVendorsLoadingStatus,
|
|
21906
|
-
|
|
22024
|
+
provider,
|
|
21907
22025
|
instantVerificationAvailable,
|
|
21908
22026
|
bankInfoValidated,
|
|
21909
|
-
selectVerificationMethod
|
|
22027
|
+
selectVerificationMethod,
|
|
22028
|
+
handleChangeFor,
|
|
22029
|
+
setBankInfoValidated,
|
|
22030
|
+
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
22031
|
+
handleBankVerificationError: handleBankVerificationError2,
|
|
22032
|
+
setBankVerificationError,
|
|
22033
|
+
triggerValidation,
|
|
22034
|
+
refreshLegalEntity
|
|
21910
22035
|
}
|
|
21911
22036
|
) : /* @__PURE__ */ jsx(
|
|
21912
22037
|
Field,
|
|
@@ -22020,17 +22145,6 @@ const payoutSteps = {
|
|
|
22020
22145
|
const PayoutVerificationMethodFormID = payoutSteps.payoutVerificationMethod.formId;
|
|
22021
22146
|
const PayoutAccountDocumentsFormID = payoutSteps.payoutAccountDocuments.formId;
|
|
22022
22147
|
const PayoutAccountVerificationFormID = payoutSteps.payoutAccountVerification.formId;
|
|
22023
|
-
const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailable, canChangeCountry) => {
|
|
22024
|
-
const dependentSteps = {
|
|
22025
|
-
payoutAccountDetails: payoutSteps.payoutAccountDetails,
|
|
22026
|
-
payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
|
|
22027
|
-
payoutAccountVerification: payoutSteps.payoutAccountVerification
|
|
22028
|
-
};
|
|
22029
|
-
return !isEditing && (instantVerificationAvailable || canChangeCountry) ? {
|
|
22030
|
-
payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
|
|
22031
|
-
...dependentSteps
|
|
22032
|
-
} : dependentSteps;
|
|
22033
|
-
};
|
|
22034
22148
|
function PayoutDetailsComponent(props) {
|
|
22035
22149
|
var _a, _b;
|
|
22036
22150
|
const { i18n } = useI18nContext();
|
|
@@ -22045,6 +22159,7 @@ function PayoutDetailsComponent(props) {
|
|
|
22045
22159
|
setHideDropinLayout,
|
|
22046
22160
|
setHideOnHomeButton,
|
|
22047
22161
|
setSkipSubmit,
|
|
22162
|
+
setHideFooter,
|
|
22048
22163
|
setSubmitButtonLabel,
|
|
22049
22164
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
22050
22165
|
handleBankVerificationError: handleBankVerificationError2,
|
|
@@ -22070,7 +22185,9 @@ function PayoutDetailsComponent(props) {
|
|
|
22070
22185
|
const globalData = useGlobalData();
|
|
22071
22186
|
const data = isEmpty$1(globalData) ? propData : globalData;
|
|
22072
22187
|
const resetData = useResetGlobalData();
|
|
22188
|
+
const { isExperimentEnabled } = useExperimentsContext();
|
|
22073
22189
|
const verifyInstantly = ((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification";
|
|
22190
|
+
const showBankVerification = !(isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl) && isExperimentEnabled("EnablePreferInstantVerificationFlow"));
|
|
22074
22191
|
const bankCountry = ((_b = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _b.bankCountry) ?? country;
|
|
22075
22192
|
useEffect(() => resetData(), [resetData]);
|
|
22076
22193
|
useEffect(() => {
|
|
@@ -22115,8 +22232,8 @@ function PayoutDetailsComponent(props) {
|
|
|
22115
22232
|
PayoutVerificationMethod,
|
|
22116
22233
|
{
|
|
22117
22234
|
...verificationMethodFormProps,
|
|
22118
|
-
heading: taskHeading,
|
|
22119
22235
|
id: PayoutVerificationMethodFormID,
|
|
22236
|
+
heading: taskHeading,
|
|
22120
22237
|
country,
|
|
22121
22238
|
forms,
|
|
22122
22239
|
isActiveForm: (activeForm == null ? void 0 : activeForm.formId) === PayoutVerificationMethodFormID,
|
|
@@ -22125,15 +22242,21 @@ function PayoutDetailsComponent(props) {
|
|
|
22125
22242
|
provider,
|
|
22126
22243
|
bankVendorsLoadingStatus,
|
|
22127
22244
|
bankInfoValidated,
|
|
22245
|
+
setBankInfoValidated,
|
|
22128
22246
|
handleNextClick,
|
|
22129
22247
|
instantVerificationAllowed: Boolean(
|
|
22130
22248
|
instantVerificationEnabled && handleGetBankVerificationVendors
|
|
22131
|
-
)
|
|
22249
|
+
),
|
|
22250
|
+
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
22251
|
+
handleBankVerificationError: handleBankVerificationError2,
|
|
22252
|
+
setBankVerificationError: setInstantVerificationError,
|
|
22253
|
+
refreshLegalEntity: props.refreshLegalEntity,
|
|
22254
|
+
setHideFooter
|
|
22132
22255
|
}
|
|
22133
22256
|
) })
|
|
22134
22257
|
}
|
|
22135
22258
|
),
|
|
22136
|
-
verifyInstantly ? /* @__PURE__ */ jsx(
|
|
22259
|
+
verifyInstantly ? showBankVerification && /* @__PURE__ */ jsx(
|
|
22137
22260
|
"div",
|
|
22138
22261
|
{
|
|
22139
22262
|
className: (activeForm == null ? void 0 : activeForm.formId) !== PayoutAccountVerificationFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -22307,12 +22430,20 @@ const solePropForms = {
|
|
|
22307
22430
|
formId: "solePropConstitutionalDocument",
|
|
22308
22431
|
formName: "constitutionalDocument",
|
|
22309
22432
|
fields: ["constitutionalDocument"]
|
|
22433
|
+
},
|
|
22434
|
+
solePropFinancialInformation: {
|
|
22435
|
+
formId: "solePropFinancialInformation",
|
|
22436
|
+
formName: "financialInformation",
|
|
22437
|
+
formHeading: "companyFinancialInformationFormHeading",
|
|
22438
|
+
formDescription: "companyFinancialInformationFormDescription",
|
|
22439
|
+
fields: financialInformationFields
|
|
22310
22440
|
}
|
|
22311
22441
|
};
|
|
22312
22442
|
const solePropNameAndCountryFormId = solePropForms.solePropNameAndCountry.formId;
|
|
22313
22443
|
const solePropRegistrationAddressFormId = solePropForms.solePropRegistrationAddress.formId;
|
|
22314
22444
|
const solePropRegistrationDetailsFormId = solePropForms.solePropRegistrationDetails.formId;
|
|
22315
22445
|
const solePropDocumentFormId = solePropForms.solePropConstitutionalDocument.formId;
|
|
22446
|
+
const solePropFinancialInformationFormId = solePropForms.solePropFinancialInformation.formId;
|
|
22316
22447
|
function SolePropComponent(props) {
|
|
22317
22448
|
const { i18n } = useI18nContext();
|
|
22318
22449
|
const [currentCountry, setCurrentCountry] = useState(props.country);
|
|
@@ -22321,6 +22452,7 @@ function SolePropComponent(props) {
|
|
|
22321
22452
|
const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
|
|
22322
22453
|
const solePropRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, solePropRegistrationAddressFormId);
|
|
22323
22454
|
const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
|
|
22455
|
+
const solePropFinancialInformationFormProps = getFormProps(props, solePropFinancialInformationFormId);
|
|
22324
22456
|
const handleStateChange = ({
|
|
22325
22457
|
currentState,
|
|
22326
22458
|
prevState
|
|
@@ -22413,6 +22545,21 @@ function SolePropComponent(props) {
|
|
|
22413
22545
|
}
|
|
22414
22546
|
)
|
|
22415
22547
|
}
|
|
22548
|
+
),
|
|
22549
|
+
/* @__PURE__ */ jsx(
|
|
22550
|
+
"div",
|
|
22551
|
+
{
|
|
22552
|
+
className: activeForm.formId !== solePropFinancialInformationFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
22553
|
+
children: /* @__PURE__ */ jsx(
|
|
22554
|
+
FinancialInformation,
|
|
22555
|
+
{
|
|
22556
|
+
...solePropFinancialInformationFormProps,
|
|
22557
|
+
heading: i18n.get("financialInformation"),
|
|
22558
|
+
id: solePropFinancialInformationFormId,
|
|
22559
|
+
country: props.country
|
|
22560
|
+
}
|
|
22561
|
+
)
|
|
22562
|
+
}
|
|
22416
22563
|
)
|
|
22417
22564
|
] });
|
|
22418
22565
|
};
|
|
@@ -22671,8 +22818,7 @@ const getAllowedDecisionMakerRoles = (rootLegalEntity, taskType) => {
|
|
|
22671
22818
|
}
|
|
22672
22819
|
return acc;
|
|
22673
22820
|
}, []);
|
|
22674
|
-
|
|
22675
|
-
return uniqueAllowedRoles;
|
|
22821
|
+
return [...new Set(allowedRoles)];
|
|
22676
22822
|
};
|
|
22677
22823
|
const hasMinRequiredDecisionMakerCount = (rootLegalEntity) => {
|
|
22678
22824
|
var _a, _b;
|
|
@@ -23962,6 +24108,11 @@ function ErrorPanel({
|
|
|
23962
24108
|
isValidationError2 && /* @__PURE__ */ jsx(ServerValidationErrors, { formUtils, validationErrors })
|
|
23963
24109
|
] });
|
|
23964
24110
|
}
|
|
24111
|
+
const isSummaryItem = (val) => typeof val === "object" && val !== null && "summaryLabel" in val && "summaryValue" in val;
|
|
24112
|
+
const summaryItem = (summaryLabel, summaryValue) => ({
|
|
24113
|
+
summaryLabel,
|
|
24114
|
+
summaryValue
|
|
24115
|
+
});
|
|
23965
24116
|
const summaryStep = {
|
|
23966
24117
|
formId: "summary",
|
|
23967
24118
|
formName: "summary"
|
|
@@ -24057,7 +24208,14 @@ function Summary({
|
|
|
24057
24208
|
Object.entries(formData).forEach(([field, fieldData]) => {
|
|
24058
24209
|
if ((omittedKeys == null ? void 0 : omittedKeys.includes(field)) || !fieldData) return;
|
|
24059
24210
|
const fieldName = i18n.get(labelData[field]) || i18n.get(field);
|
|
24060
|
-
if (
|
|
24211
|
+
if (isSummaryItem(fieldData)) {
|
|
24212
|
+
dataList.push(
|
|
24213
|
+
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-summary-section__field", children: [
|
|
24214
|
+
/* @__PURE__ */ jsx("dt", { className: "adyen-kyc-summary-section__label", children: i18n.get(fieldData.summaryLabel) }),
|
|
24215
|
+
/* @__PURE__ */ jsx("dd", { className: "adyen-kyc-summary-section__data", children: fieldData.summaryValue })
|
|
24216
|
+
] })
|
|
24217
|
+
);
|
|
24218
|
+
} else if (typeof fieldData === "object") {
|
|
24061
24219
|
dataList.push(renderSummaryItems(fieldData, labelData));
|
|
24062
24220
|
} else if (["string", "number"].includes(typeof fieldData)) {
|
|
24063
24221
|
dataList.push(
|
|
@@ -24303,7 +24461,7 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
|
|
|
24303
24461
|
setParentLoadingStatus(loadingStatus);
|
|
24304
24462
|
}, [...childLoadingStatuses]);
|
|
24305
24463
|
};
|
|
24306
|
-
const logger$
|
|
24464
|
+
const logger$u = createLogger("useScenarioConfiguration");
|
|
24307
24465
|
const useScenarioConfiguration = ({
|
|
24308
24466
|
getConfigurationData,
|
|
24309
24467
|
getPayoutAccountFormatData,
|
|
@@ -24326,12 +24484,12 @@ const useScenarioConfiguration = ({
|
|
|
24326
24484
|
const response = await getConfigurationData();
|
|
24327
24485
|
setConfigurationResponse(response);
|
|
24328
24486
|
} catch (err) {
|
|
24329
|
-
logger$
|
|
24487
|
+
logger$u.warn("WARNING: Configuration request failed - error:", err);
|
|
24330
24488
|
} finally {
|
|
24331
24489
|
setConfigurationLoadingStatus("success");
|
|
24332
24490
|
}
|
|
24333
24491
|
};
|
|
24334
|
-
makeConfigCallAndSave().catch(logger$
|
|
24492
|
+
makeConfigCallAndSave().catch(logger$u.error);
|
|
24335
24493
|
}, [getConfigurationData, setConfigurationLoadingStatus]);
|
|
24336
24494
|
useEffect(() => {
|
|
24337
24495
|
if (!getPayoutAccountFormatData) return;
|
|
@@ -24350,12 +24508,12 @@ const useScenarioConfiguration = ({
|
|
|
24350
24508
|
const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
|
|
24351
24509
|
setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
|
|
24352
24510
|
} catch (err) {
|
|
24353
|
-
logger$
|
|
24511
|
+
logger$u.warn("WARNING: Payout format request failed - error:", err);
|
|
24354
24512
|
} finally {
|
|
24355
24513
|
setpayoutFormatLoadingStatus("success");
|
|
24356
24514
|
}
|
|
24357
24515
|
};
|
|
24358
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
24516
|
+
makePayoutFormatCallAndSave().catch(logger$u.error);
|
|
24359
24517
|
}, [
|
|
24360
24518
|
country,
|
|
24361
24519
|
setAccountFormat,
|
|
@@ -24445,7 +24603,7 @@ const identityBase = {
|
|
|
24445
24603
|
rule: "REQUIRED"
|
|
24446
24604
|
},
|
|
24447
24605
|
phoneNumber: {
|
|
24448
|
-
|
|
24606
|
+
rules: ["requiredIfPhoneScenarioDisabled", "contactsIfRequiredForRole"]
|
|
24449
24607
|
},
|
|
24450
24608
|
email: {
|
|
24451
24609
|
rule: "contactsIfRequiredForRole"
|
|
@@ -24518,6 +24676,11 @@ const nationality = {
|
|
|
24518
24676
|
rule: "REQUIRED"
|
|
24519
24677
|
}
|
|
24520
24678
|
};
|
|
24679
|
+
const phoneNumberBase = {
|
|
24680
|
+
phoneNumber: {
|
|
24681
|
+
rule: "contactsIfRequiredForRole"
|
|
24682
|
+
}
|
|
24683
|
+
};
|
|
24521
24684
|
const fieldsPerScenario$1 = {
|
|
24522
24685
|
L0: drop("address", "birthDate").from(identityBase),
|
|
24523
24686
|
L1: identityBase,
|
|
@@ -24538,7 +24701,8 @@ const fieldsPerScenario$1 = {
|
|
|
24538
24701
|
...additionalIdentityInfo,
|
|
24539
24702
|
...nationality
|
|
24540
24703
|
},
|
|
24541
|
-
L1_IDDOC: idDocument
|
|
24704
|
+
L1_IDDOC: idDocument,
|
|
24705
|
+
L_PH: phoneNumberBase
|
|
24542
24706
|
};
|
|
24543
24707
|
const solePropBase = {
|
|
24544
24708
|
companyCountry: { rule: "REQUIRED" },
|
|
@@ -24560,16 +24724,22 @@ const taxInformationBase = {
|
|
|
24560
24724
|
taxInformation: { rule: "countryUsesTaxId" },
|
|
24561
24725
|
exemptedFromTax: { rule: "countryHasTaxExemptionsForSomeSoleProps" }
|
|
24562
24726
|
};
|
|
24727
|
+
const financialInformationBase = {
|
|
24728
|
+
numberOfEmployees: { rule: "countryRequiresFinancialInformationForSoleProps" },
|
|
24729
|
+
financialReportingDate: { rule: "countryRequiresFinancialInformationForSoleProps" }
|
|
24730
|
+
};
|
|
24563
24731
|
const fieldsPerScenario = {
|
|
24564
24732
|
L0: {
|
|
24565
24733
|
legalCompanyName: { rule: "REQUIRED" },
|
|
24566
|
-
companyCountry: { rule: "REQUIRED" }
|
|
24734
|
+
companyCountry: { rule: "REQUIRED" },
|
|
24735
|
+
...financialInformationBase
|
|
24567
24736
|
},
|
|
24568
|
-
L1: { ...solePropBase },
|
|
24569
|
-
L2: { ...solePropBase },
|
|
24737
|
+
L1: { ...solePropBase, ...financialInformationBase },
|
|
24738
|
+
L2: { ...solePropBase, ...financialInformationBase },
|
|
24570
24739
|
L: {
|
|
24571
24740
|
...solePropBase,
|
|
24572
|
-
...taxInformationBase
|
|
24741
|
+
...taxInformationBase,
|
|
24742
|
+
...financialInformationBase
|
|
24573
24743
|
},
|
|
24574
24744
|
L_ConstDoc: {
|
|
24575
24745
|
constitutionalDocument: { rule: "REQUIRED" }
|
|
@@ -25103,7 +25273,7 @@ const structuredListListItem = "adyen-kyc-structured-list-list-item";
|
|
|
25103
25273
|
const adyenLayoutMd = "adyen-layout-md";
|
|
25104
25274
|
const structuredListLabel = "adyen-kyc-structured-list-label";
|
|
25105
25275
|
const structuredListValue = "adyen-kyc-structured-list-value";
|
|
25106
|
-
const styles$
|
|
25276
|
+
const styles$3 = {
|
|
25107
25277
|
"structured-list": "adyen-kyc-structured-list",
|
|
25108
25278
|
structuredList,
|
|
25109
25279
|
"structured-list-list-item": "adyen-kyc-structured-list-list-item",
|
|
@@ -25117,9 +25287,9 @@ const styles$2 = {
|
|
|
25117
25287
|
};
|
|
25118
25288
|
const StructuredList = ({ items }) => {
|
|
25119
25289
|
const { i18n } = useI18nContext();
|
|
25120
|
-
return /* @__PURE__ */ jsx("dl", { className: styles$
|
|
25121
|
-
/* @__PURE__ */ jsx("dt", { className: styles$
|
|
25122
|
-
/* @__PURE__ */ jsx("dd", { className: styles$
|
|
25290
|
+
return /* @__PURE__ */ jsx("dl", { className: styles$3.structuredList, children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: styles$3.structuredListListItem, children: [
|
|
25291
|
+
/* @__PURE__ */ jsx("dt", { className: styles$3.structuredListLabel, children: i18n.get(item.labelKey) }),
|
|
25292
|
+
/* @__PURE__ */ jsx("dd", { className: styles$3.structuredListValue, children: item.value })
|
|
25123
25293
|
] }, item.labelKey)) });
|
|
25124
25294
|
};
|
|
25125
25295
|
function VerifiedBusinessCard({
|
|
@@ -25951,7 +26121,7 @@ function BusinessInformationCard({
|
|
|
25951
26121
|
}
|
|
25952
26122
|
);
|
|
25953
26123
|
}
|
|
25954
|
-
const logger$
|
|
26124
|
+
const logger$t = createLogger("BusinessSelection");
|
|
25955
26125
|
function BusinessSelectionComponent({
|
|
25956
26126
|
showCompanyStructure,
|
|
25957
26127
|
searching,
|
|
@@ -26003,7 +26173,7 @@ function BusinessSelectionComponent({
|
|
|
26003
26173
|
setCurrentBusinessSelection(businessData);
|
|
26004
26174
|
}
|
|
26005
26175
|
} catch (e) {
|
|
26006
|
-
logger$
|
|
26176
|
+
logger$t.error(e);
|
|
26007
26177
|
}
|
|
26008
26178
|
},
|
|
26009
26179
|
[basicInformation == null ? void 0 : basicInformation.stateOrProvince, fetchBusinessData, fetching, selectedBusinessId]
|
|
@@ -26017,7 +26187,7 @@ function BusinessSelectionComponent({
|
|
|
26017
26187
|
handleNextClick == null ? void 0 : handleNextClick();
|
|
26018
26188
|
}
|
|
26019
26189
|
} catch (e) {
|
|
26020
|
-
logger$
|
|
26190
|
+
logger$t.error(e);
|
|
26021
26191
|
}
|
|
26022
26192
|
},
|
|
26023
26193
|
[currentTin, handleNextClick, handleBusinessVerification]
|
|
@@ -27127,7 +27297,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
|
|
|
27127
27297
|
DecisionMakerType.SIGNATORY,
|
|
27128
27298
|
DecisionMakerType.CONTROLLING_PERSON
|
|
27129
27299
|
];
|
|
27130
|
-
const rules$
|
|
27300
|
+
const rules$1 = ({
|
|
27131
27301
|
data,
|
|
27132
27302
|
country,
|
|
27133
27303
|
taskType,
|
|
@@ -27186,6 +27356,7 @@ const rules$2 = ({
|
|
|
27186
27356
|
return REQUIRED;
|
|
27187
27357
|
}
|
|
27188
27358
|
},
|
|
27359
|
+
requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
|
|
27189
27360
|
jobTitleIfRequiredForRole: () => {
|
|
27190
27361
|
var _a, _b;
|
|
27191
27362
|
if (taskType === TaskTypes.DECISION_MAKER) {
|
|
@@ -27601,7 +27772,7 @@ const useExpiryThreshold = (expiry) => {
|
|
|
27601
27772
|
return { expiryStatus: "notYetCloseToExpiry", secondsUntilExpiry: void 0 };
|
|
27602
27773
|
};
|
|
27603
27774
|
const ExpiryContext = createContext(false);
|
|
27604
|
-
const logger$
|
|
27775
|
+
const logger$s = createLogger("ExpiryProvider");
|
|
27605
27776
|
const ExpiryProvider = ({
|
|
27606
27777
|
expiry: initialExpiry,
|
|
27607
27778
|
eventEmitter,
|
|
@@ -27630,7 +27801,7 @@ const ExpiryProvider = ({
|
|
|
27630
27801
|
refreshExpiry().then((newExpiry) => {
|
|
27631
27802
|
setExpiry(newExpiry);
|
|
27632
27803
|
setModalDismissed(false);
|
|
27633
|
-
}).catch(logger$
|
|
27804
|
+
}).catch(logger$s.error);
|
|
27634
27805
|
}
|
|
27635
27806
|
}
|
|
27636
27807
|
),
|
|
@@ -27652,7 +27823,7 @@ const ExpiryProvider = ({
|
|
|
27652
27823
|
return /* @__PURE__ */ jsx(ExpiryContext.Provider, { value: expiryStatus === "expired", children });
|
|
27653
27824
|
};
|
|
27654
27825
|
const useHasExpired = () => useContext(ExpiryContext);
|
|
27655
|
-
const logger$
|
|
27826
|
+
const logger$r = createLogger("FormRouterContextProvider");
|
|
27656
27827
|
function FormRouterContextProvider({
|
|
27657
27828
|
children,
|
|
27658
27829
|
forms,
|
|
@@ -27675,7 +27846,7 @@ function FormRouterContextProvider({
|
|
|
27675
27846
|
if (formIndex > -1) {
|
|
27676
27847
|
setFormIndex(formIndex);
|
|
27677
27848
|
} else {
|
|
27678
|
-
logger$
|
|
27849
|
+
logger$r.error("No form was found to have that field so form navigation failed.");
|
|
27679
27850
|
}
|
|
27680
27851
|
}
|
|
27681
27852
|
}),
|
|
@@ -28925,6 +29096,24 @@ const formatCurrency = (amount, currency, locale) => {
|
|
|
28925
29096
|
);
|
|
28926
29097
|
return format(amount);
|
|
28927
29098
|
};
|
|
29099
|
+
const formatFinancialInformationSummary = (data, i18n) => {
|
|
29100
|
+
if (!data) return {};
|
|
29101
|
+
const summary2 = {
|
|
29102
|
+
numberOfEmployees: `${data.numberOfEmployees}`,
|
|
29103
|
+
currency: data.currency,
|
|
29104
|
+
financialReportingDate: data.financialReportingDate
|
|
29105
|
+
};
|
|
29106
|
+
if (data.netAssets) {
|
|
29107
|
+
summary2.netAssets = summaryItem(
|
|
29108
|
+
"totalAssets",
|
|
29109
|
+
formatCurrency(data.netAssets, data.currency, i18n.locale)
|
|
29110
|
+
);
|
|
29111
|
+
}
|
|
29112
|
+
if (data.annualTurnover) {
|
|
29113
|
+
summary2.annualTurnover = formatCurrency(data.annualTurnover, data.currency, i18n.locale);
|
|
29114
|
+
}
|
|
29115
|
+
return summary2;
|
|
29116
|
+
};
|
|
28928
29117
|
const parseConfiguration$5 = ({ country, matchingScenario }) => parseCompanyScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country);
|
|
28929
29118
|
const canSubmit$1 = (data) => mandatoryApiFields.ORGANIZATION.every((detail) => {
|
|
28930
29119
|
const value = getProp(data, detail);
|
|
@@ -29273,25 +29462,10 @@ function CompanyDropinComponent({
|
|
|
29273
29462
|
}
|
|
29274
29463
|
delete summaryData.companyRegistrationDetails.taxInformation;
|
|
29275
29464
|
}
|
|
29276
|
-
|
|
29277
|
-
|
|
29278
|
-
|
|
29279
|
-
|
|
29280
|
-
financialInfoSummary.totalAssets = formatCurrency(
|
|
29281
|
-
financialInfoSummary.netAssets,
|
|
29282
|
-
financialInfoSummary.currency,
|
|
29283
|
-
i18n.locale
|
|
29284
|
-
);
|
|
29285
|
-
delete financialInfoSummary.netAssets;
|
|
29286
|
-
}
|
|
29287
|
-
if (financialInfoSummary.annualTurnover) {
|
|
29288
|
-
financialInfoSummary.annualTurnover = formatCurrency(
|
|
29289
|
-
financialInfoSummary.annualTurnover,
|
|
29290
|
-
financialInfoSummary.currency,
|
|
29291
|
-
i18n.locale
|
|
29292
|
-
);
|
|
29293
|
-
}
|
|
29294
|
-
}
|
|
29465
|
+
summaryData.companyFinancialInformation = formatFinancialInformationSummary(
|
|
29466
|
+
summaryData.companyFinancialInformation,
|
|
29467
|
+
i18n
|
|
29468
|
+
);
|
|
29295
29469
|
if (isDocumentsRequired$1(forms2)) {
|
|
29296
29470
|
companyDocumentForms.forEach((formId) => delete summaryData[formId]);
|
|
29297
29471
|
summaryData = {
|
|
@@ -29367,7 +29541,7 @@ function CompanyDropinComponent({
|
|
|
29367
29541
|
}
|
|
29368
29542
|
const IgnoreLocalStorageContext = createContext(false);
|
|
29369
29543
|
const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
|
|
29370
|
-
const logger$
|
|
29544
|
+
const logger$q = createLogger("useLocalStorage");
|
|
29371
29545
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
29372
29546
|
const { serializer, parser, syncData } = useMemo(
|
|
29373
29547
|
() => ({
|
|
@@ -29387,7 +29561,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29387
29561
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
29388
29562
|
return res;
|
|
29389
29563
|
} catch (err) {
|
|
29390
|
-
logger$
|
|
29564
|
+
logger$q.error(err);
|
|
29391
29565
|
return defaultValue;
|
|
29392
29566
|
}
|
|
29393
29567
|
});
|
|
@@ -29422,7 +29596,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29422
29596
|
try {
|
|
29423
29597
|
updateLocalStorage();
|
|
29424
29598
|
} catch (err) {
|
|
29425
|
-
logger$
|
|
29599
|
+
logger$q.error(err);
|
|
29426
29600
|
}
|
|
29427
29601
|
}, [value, ignoreLocalStorage]);
|
|
29428
29602
|
useEffect(() => {
|
|
@@ -29435,7 +29609,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
29435
29609
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
29436
29610
|
}
|
|
29437
29611
|
} catch (err) {
|
|
29438
|
-
logger$
|
|
29612
|
+
logger$q.error(err);
|
|
29439
29613
|
}
|
|
29440
29614
|
};
|
|
29441
29615
|
if (ignoreLocalStorage) return;
|
|
@@ -29619,7 +29793,7 @@ const useSingpassMyInfoLogin = ({
|
|
|
29619
29793
|
trustedEntityAssociations
|
|
29620
29794
|
};
|
|
29621
29795
|
};
|
|
29622
|
-
const logger$
|
|
29796
|
+
const logger$p = createLogger("useAssociatedLegalArrangement");
|
|
29623
29797
|
function useAssociatedLegalArrangement({
|
|
29624
29798
|
rootLegalEntity,
|
|
29625
29799
|
getLegalEntity: getLegalEntity2
|
|
@@ -29635,7 +29809,7 @@ function useAssociatedLegalArrangement({
|
|
|
29635
29809
|
(entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST
|
|
29636
29810
|
);
|
|
29637
29811
|
if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
|
|
29638
|
-
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$
|
|
29812
|
+
getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$p.error);
|
|
29639
29813
|
}
|
|
29640
29814
|
}, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
|
|
29641
29815
|
useEffect(() => {
|
|
@@ -29685,7 +29859,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
|
|
|
29685
29859
|
setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
|
|
29686
29860
|
};
|
|
29687
29861
|
};
|
|
29688
|
-
const logger$
|
|
29862
|
+
const logger$o = createLogger("useExemptSettlor");
|
|
29689
29863
|
const useExemptSettlor = ({
|
|
29690
29864
|
trust,
|
|
29691
29865
|
handleGetLegalEntity
|
|
@@ -29703,7 +29877,7 @@ const useExemptSettlor = ({
|
|
|
29703
29877
|
);
|
|
29704
29878
|
useEffect(() => {
|
|
29705
29879
|
if (!(trust == null ? void 0 : trust.trust)) return;
|
|
29706
|
-
updateExemptSettlor(trust).catch(logger$
|
|
29880
|
+
updateExemptSettlor(trust).catch(logger$o.error);
|
|
29707
29881
|
}, [trust, updateExemptSettlor]);
|
|
29708
29882
|
return exemptSettlor;
|
|
29709
29883
|
};
|
|
@@ -30857,7 +31031,7 @@ const EntityAssociation = ({
|
|
|
30857
31031
|
Tag,
|
|
30858
31032
|
{
|
|
30859
31033
|
className: "adyen-kyc-entity-association__tag",
|
|
30860
|
-
variant: getRoleTagVariant(type),
|
|
31034
|
+
variant: getRoleTagVariant$1(type),
|
|
30861
31035
|
children: i18n.get(getRoleName(type))
|
|
30862
31036
|
},
|
|
30863
31037
|
type
|
|
@@ -30918,7 +31092,7 @@ const EntityGuidanceStatus = ({
|
|
|
30918
31092
|
Tag,
|
|
30919
31093
|
{
|
|
30920
31094
|
className: "adyen-kyc-entity-status__tag",
|
|
30921
|
-
variant: getRoleTagVariant(entityLabel),
|
|
31095
|
+
variant: getRoleTagVariant$1(entityLabel),
|
|
30922
31096
|
children: i18n.get(getRoleName(entityLabel))
|
|
30923
31097
|
},
|
|
30924
31098
|
entityLabel
|
|
@@ -32801,7 +32975,7 @@ function IndividualDropinComponent({
|
|
|
32801
32975
|
country
|
|
32802
32976
|
});
|
|
32803
32977
|
const fieldsFromCustomRules = useMemo(
|
|
32804
|
-
() => rules$
|
|
32978
|
+
() => rules$1({
|
|
32805
32979
|
data,
|
|
32806
32980
|
country,
|
|
32807
32981
|
taskType,
|
|
@@ -33046,12 +33220,11 @@ function IndividualDropinComponent({
|
|
|
33046
33220
|
idDocumentType: idDocumentType || null
|
|
33047
33221
|
}
|
|
33048
33222
|
});
|
|
33049
|
-
|
|
33223
|
+
legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
|
|
33050
33224
|
taskType,
|
|
33051
33225
|
legalEntityResponse,
|
|
33052
33226
|
accountHolder || void 0
|
|
33053
33227
|
);
|
|
33054
|
-
legalEntity.entityAssociations = filteredEntityAssociation;
|
|
33055
33228
|
const createdLegalEntity = await submitLegalEntity({
|
|
33056
33229
|
dataSubmitted,
|
|
33057
33230
|
legalEntity,
|
|
@@ -33267,7 +33440,7 @@ function IndividualDropinComponent({
|
|
|
33267
33440
|
}
|
|
33268
33441
|
);
|
|
33269
33442
|
}
|
|
33270
|
-
const logger$
|
|
33443
|
+
const logger$n = createLogger("useBankConfigurationHandler");
|
|
33271
33444
|
const useBankConfigurationHandlers = ({
|
|
33272
33445
|
handleGetBankVerificationVendors,
|
|
33273
33446
|
bankAccountCountry,
|
|
@@ -33285,7 +33458,7 @@ const useBankConfigurationHandlers = ({
|
|
|
33285
33458
|
const bankVerificationVendorsResponse = handleGetBankVerificationVendors ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
|
|
33286
33459
|
setProvider(bankVerificationVendorsResponse == null ? void 0 : bankVerificationVendorsResponse[0]);
|
|
33287
33460
|
})().catch(() => {
|
|
33288
|
-
logger$
|
|
33461
|
+
logger$n.error();
|
|
33289
33462
|
setProvider(void 0);
|
|
33290
33463
|
}).finally(() => {
|
|
33291
33464
|
setLoadingStatus("success");
|
|
@@ -33322,47 +33495,6 @@ const getAccountFormatsForCountry = async (country) => {
|
|
|
33322
33495
|
}
|
|
33323
33496
|
return (await importForCountry()).default;
|
|
33324
33497
|
};
|
|
33325
|
-
const isInstantVerificationAvailable = ({
|
|
33326
|
-
verificationVendorsCallback,
|
|
33327
|
-
provider
|
|
33328
|
-
}) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
|
|
33329
|
-
const rules$1 = ({ data, requiredFields }) => ({
|
|
33330
|
-
whenUsingManualVerification: () => {
|
|
33331
|
-
var _a;
|
|
33332
|
-
if (!data.payoutVerificationMethod) return;
|
|
33333
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
33334
|
-
return "REQUIRED";
|
|
33335
|
-
}
|
|
33336
|
-
},
|
|
33337
|
-
whenUsingInstantVerification: () => {
|
|
33338
|
-
var _a;
|
|
33339
|
-
if (!data.payoutVerificationMethod) {
|
|
33340
|
-
return "REQUIRED";
|
|
33341
|
-
}
|
|
33342
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
33343
|
-
return "REQUIRED";
|
|
33344
|
-
}
|
|
33345
|
-
},
|
|
33346
|
-
verifiedBankAccountNumber: () => {
|
|
33347
|
-
var _a;
|
|
33348
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
|
|
33349
|
-
return "REQUIRED";
|
|
33350
|
-
}
|
|
33351
|
-
},
|
|
33352
|
-
bankStatementRequirement: () => {
|
|
33353
|
-
var _a;
|
|
33354
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
|
|
33355
|
-
return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
|
|
33356
|
-
}
|
|
33357
|
-
},
|
|
33358
|
-
// "bankStatement description" field is always "optional" and it's coupled with bank statement document.
|
|
33359
|
-
bankStatementDescription: () => {
|
|
33360
|
-
var _a;
|
|
33361
|
-
if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
|
|
33362
|
-
return "OPTIONAL";
|
|
33363
|
-
}
|
|
33364
|
-
}
|
|
33365
|
-
});
|
|
33366
33498
|
const labels = () => ({
|
|
33367
33499
|
verifiedAccountHolder: () => "accountHolder",
|
|
33368
33500
|
verifiedBankCountry: () => "bankCountry",
|
|
@@ -33379,6 +33511,27 @@ const parseConfiguration$3 = ({
|
|
|
33379
33511
|
country,
|
|
33380
33512
|
bankVerificationAvailable
|
|
33381
33513
|
});
|
|
33514
|
+
const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailable, canChangeCountry, showWidgetInVerificationMethodStep) => {
|
|
33515
|
+
const dependentSteps = {
|
|
33516
|
+
payoutAccountDetails: payoutSteps.payoutAccountDetails,
|
|
33517
|
+
payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
|
|
33518
|
+
payoutAccountVerification: payoutSteps.payoutAccountVerification
|
|
33519
|
+
};
|
|
33520
|
+
if (!isEditing) {
|
|
33521
|
+
if (showWidgetInVerificationMethodStep)
|
|
33522
|
+
return {
|
|
33523
|
+
payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
|
|
33524
|
+
payoutAccountDetails: payoutSteps.payoutAccountDetails,
|
|
33525
|
+
payoutAccountDocuments: payoutSteps.payoutAccountDocuments
|
|
33526
|
+
};
|
|
33527
|
+
if (instantVerificationAvailable || canChangeCountry)
|
|
33528
|
+
return {
|
|
33529
|
+
payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
|
|
33530
|
+
...dependentSteps
|
|
33531
|
+
};
|
|
33532
|
+
}
|
|
33533
|
+
return dependentSteps;
|
|
33534
|
+
};
|
|
33382
33535
|
function PayoutDetailsDropinComponent({
|
|
33383
33536
|
transferInstrument,
|
|
33384
33537
|
setTransferInstrument,
|
|
@@ -33407,7 +33560,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33407
33560
|
handleBankVerificationError: handleBankVerificationError2,
|
|
33408
33561
|
handleBackClick: externalBackClick
|
|
33409
33562
|
}) {
|
|
33410
|
-
var _a, _b, _c, _d, _e, _f;
|
|
33563
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
33411
33564
|
const { isEmbeddedDropin } = useAuthContext();
|
|
33412
33565
|
const { i18n } = useI18nContext();
|
|
33413
33566
|
const { showToast, clearToasts } = useToastContext();
|
|
@@ -33453,12 +33606,13 @@ function PayoutDetailsDropinComponent({
|
|
|
33453
33606
|
const formValidity = currentState.validityByForm;
|
|
33454
33607
|
const bankAccountCountry = ((_c = (_b = currentState == null ? void 0 : currentState.data) == null ? void 0 : _b.payoutVerificationMethod) == null ? void 0 : _c.bankCountry) ?? defaultPayoutCountry;
|
|
33455
33608
|
const [hideDropinLayout, setHideDropinLayout] = useState(false);
|
|
33609
|
+
const [hideFooter, setHideFooter] = useState(false);
|
|
33456
33610
|
const [submitButtonLabel, setSubmitButtonLabel] = useState("submit");
|
|
33457
33611
|
const [skipSubmit, setSkipSubmit] = useState(false);
|
|
33458
33612
|
const [hideOnHomeButton, setHideHomeButton] = useState(false);
|
|
33459
|
-
const [loadingStatus, setLoadingStatus] = useState("
|
|
33460
|
-
const [
|
|
33461
|
-
const [
|
|
33613
|
+
const [loadingStatus, setLoadingStatus] = useState("loading");
|
|
33614
|
+
const [bankVendorsLoadingStatus, setBankVendorsLoadingStatus] = useState("loading");
|
|
33615
|
+
const [configurationLoadingStatus, setConfigurationLoadingStatus] = useState("loading");
|
|
33462
33616
|
const [data, setData] = useState(prefilledData);
|
|
33463
33617
|
const [problems, setProblems] = useState(
|
|
33464
33618
|
propProblems || ((transferInstrument == null ? void 0 : transferInstrument.id) ? (_e = (_d = getCapabilityProblems(legalEntityResponse, bankAccountCountry)) == null ? void 0 : _d.BankAccount) == null ? void 0 : _e[transferInstrument.id] : void 0)
|
|
@@ -33506,7 +33660,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33506
33660
|
getConfiguration: getConfiguration2,
|
|
33507
33661
|
legalEntityType: legalEntityResponse.type,
|
|
33508
33662
|
capabilities,
|
|
33509
|
-
setLoadingStatus:
|
|
33663
|
+
setLoadingStatus: setBankVendorsLoadingStatus,
|
|
33510
33664
|
useFreshProviderRedirectUrl,
|
|
33511
33665
|
setUseFreshProviderRedirectUrl
|
|
33512
33666
|
});
|
|
@@ -33519,12 +33673,12 @@ function PayoutDetailsDropinComponent({
|
|
|
33519
33673
|
getConfigurationData,
|
|
33520
33674
|
getPayoutAccountFormatData,
|
|
33521
33675
|
instantVerificationEnabled,
|
|
33522
|
-
setLoadingStatus:
|
|
33676
|
+
setLoadingStatus: setConfigurationLoadingStatus,
|
|
33523
33677
|
country: bankAccountCountry,
|
|
33524
33678
|
existingBankAccountFormat
|
|
33525
33679
|
});
|
|
33526
33680
|
const fieldsFromCustomRules = useMemo(
|
|
33527
|
-
() => rules$
|
|
33681
|
+
() => rules$2({
|
|
33528
33682
|
data,
|
|
33529
33683
|
country: bankAccountCountry,
|
|
33530
33684
|
taskType,
|
|
@@ -33532,10 +33686,11 @@ function PayoutDetailsDropinComponent({
|
|
|
33532
33686
|
}),
|
|
33533
33687
|
[bankAccountCountry, data, taskType]
|
|
33534
33688
|
);
|
|
33535
|
-
const
|
|
33689
|
+
const fieldsFromCustomLabels = useMemo(
|
|
33536
33690
|
() => labels ? labels() : {},
|
|
33537
33691
|
[data, bankAccountCountry]
|
|
33538
33692
|
);
|
|
33693
|
+
const showWidgetInVerificationMethodStep = isExperimentEnabled("EnablePreferInstantVerificationFlow") && isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl);
|
|
33539
33694
|
const payoutDetailsSteps = useMemo(
|
|
33540
33695
|
() => {
|
|
33541
33696
|
var _a2;
|
|
@@ -33545,7 +33700,8 @@ function PayoutDetailsDropinComponent({
|
|
|
33545
33700
|
provider,
|
|
33546
33701
|
verificationVendorsCallback: handleGetBankVerificationVendors
|
|
33547
33702
|
}),
|
|
33548
|
-
isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout)
|
|
33703
|
+
isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
|
|
33704
|
+
showWidgetInVerificationMethodStep
|
|
33549
33705
|
);
|
|
33550
33706
|
},
|
|
33551
33707
|
[provider]
|
|
@@ -33558,7 +33714,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33558
33714
|
(problems == null ? void 0 : problems.missingData) ?? [],
|
|
33559
33715
|
[],
|
|
33560
33716
|
fieldsFromCustomRules,
|
|
33561
|
-
|
|
33717
|
+
fieldsFromCustomLabels,
|
|
33562
33718
|
{},
|
|
33563
33719
|
legalEntityResponse.type
|
|
33564
33720
|
),
|
|
@@ -33766,12 +33922,12 @@ function PayoutDetailsDropinComponent({
|
|
|
33766
33922
|
navigateBackToTaskList == null ? void 0 : navigateBackToTaskList();
|
|
33767
33923
|
} : onSubmit
|
|
33768
33924
|
});
|
|
33769
|
-
const hideFooter = isExperimentEnabled("EnablePreferInstantVerificationFlow") && activeForm.formId === payoutSteps.payoutVerificationMethod.formId;
|
|
33770
33925
|
const currentStep = useMemo(
|
|
33771
33926
|
() => Object.values(forms).findIndex((step) => step.formId === activeForm.formId),
|
|
33772
33927
|
[forms, activeForm.formId]
|
|
33773
33928
|
);
|
|
33774
33929
|
const totalSteps = useMemo(() => Object.keys(forms).length, [forms]);
|
|
33930
|
+
const omittedForms = showWidgetInVerificationMethodStep && ((_g = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _g.payoutVerificationMethod) === "instantVerification" ? [] : [payoutSteps.payoutVerificationMethod.formId];
|
|
33775
33931
|
return /* @__PURE__ */ jsx(
|
|
33776
33932
|
FormWrapper,
|
|
33777
33933
|
{
|
|
@@ -33779,8 +33935,8 @@ function PayoutDetailsDropinComponent({
|
|
|
33779
33935
|
activeForm,
|
|
33780
33936
|
summary: {
|
|
33781
33937
|
data: formatDataForSummary2(),
|
|
33782
|
-
omittedKeys: ["transferInstrumentId"],
|
|
33783
|
-
omittedForms
|
|
33938
|
+
omittedKeys: ["transferInstrumentId", "payoutVerificationMethod"],
|
|
33939
|
+
omittedForms,
|
|
33784
33940
|
labels: derivedProps == null ? void 0 : derivedProps.labels
|
|
33785
33941
|
},
|
|
33786
33942
|
handleBackClick,
|
|
@@ -33819,6 +33975,7 @@ function PayoutDetailsDropinComponent({
|
|
|
33819
33975
|
setSubmitButtonLabel,
|
|
33820
33976
|
setHideOnHomeButton: setHideHomeButton,
|
|
33821
33977
|
setSkipSubmit,
|
|
33978
|
+
setHideFooter,
|
|
33822
33979
|
onChange,
|
|
33823
33980
|
legalEntityResponse,
|
|
33824
33981
|
associatedLegalArrangement,
|
|
@@ -33838,11 +33995,11 @@ function PayoutDetailsDropinComponent({
|
|
|
33838
33995
|
);
|
|
33839
33996
|
}
|
|
33840
33997
|
const outlinedIcon = "adyen-kyc-outlined-icon";
|
|
33841
|
-
const styles$
|
|
33998
|
+
const styles$2 = {
|
|
33842
33999
|
"outlined-icon": "adyen-kyc-outlined-icon",
|
|
33843
34000
|
outlinedIcon
|
|
33844
34001
|
};
|
|
33845
|
-
const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$
|
|
34002
|
+
const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$2.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
|
|
33846
34003
|
const Splashscreen = ({ title, subtitle, icon, buttonText, onClick }) => {
|
|
33847
34004
|
const { i18n } = useI18nContext();
|
|
33848
34005
|
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-splashscreen", children: [
|
|
@@ -34538,6 +34695,42 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
34538
34695
|
] }) : void 0
|
|
34539
34696
|
] });
|
|
34540
34697
|
};
|
|
34698
|
+
const settlorExemptionReasonsList = "adyen-kyc-settlor-exemption-reasons-list";
|
|
34699
|
+
const styles$1 = {
|
|
34700
|
+
"settlor-exemption-reasons-list": "adyen-kyc-settlor-exemption-reasons-list",
|
|
34701
|
+
settlorExemptionReasonsList
|
|
34702
|
+
};
|
|
34703
|
+
const formatRolesForSummary = (roles, i18n) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
|
|
34704
|
+
const formatSettlorExemptionReasonsForSummary = (reasons, i18n) => /* @__PURE__ */ jsx("ul", { className: styles$1.settlorExemptionReasonsList, children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: i18n.get(reason) }, reason)) });
|
|
34705
|
+
const formatRoleAndEntityTypeSummary = (data, i18n, isOrganizationSettlorWithExemptionEnabled) => {
|
|
34706
|
+
var _a, _b;
|
|
34707
|
+
const { trustMemberType, roles } = data;
|
|
34708
|
+
const role = formatRolesForSummary(roles, i18n);
|
|
34709
|
+
switch (trustMemberType) {
|
|
34710
|
+
case "undefinedBeneficiary":
|
|
34711
|
+
return {
|
|
34712
|
+
role,
|
|
34713
|
+
descriptionUndefinedBeneficiary: data.description
|
|
34714
|
+
};
|
|
34715
|
+
case "exemptSettlor":
|
|
34716
|
+
return {
|
|
34717
|
+
role,
|
|
34718
|
+
entityType: i18n.get(data.legalEntityType),
|
|
34719
|
+
firstName: (_a = data.exemptSettlorName) == null ? void 0 : _a.firstName,
|
|
34720
|
+
lastName: (_b = data.exemptSettlorName) == null ? void 0 : _b.lastName,
|
|
34721
|
+
country: isOrganizationSettlorWithExemptionEnabled ? data.country : void 0,
|
|
34722
|
+
legalCompanyName: isOrganizationSettlorWithExemptionEnabled ? data.name : void 0,
|
|
34723
|
+
settlorExemptionReason: summaryItem(
|
|
34724
|
+
"otherInformation",
|
|
34725
|
+
formatSettlorExemptionReasonsForSummary(data.settlorExemptionReason ?? [], i18n)
|
|
34726
|
+
)
|
|
34727
|
+
};
|
|
34728
|
+
case "company":
|
|
34729
|
+
case "rootTrustee":
|
|
34730
|
+
case "regular":
|
|
34731
|
+
return {};
|
|
34732
|
+
}
|
|
34733
|
+
};
|
|
34541
34734
|
const summary = {
|
|
34542
34735
|
formId: "summary",
|
|
34543
34736
|
formName: "summary"
|
|
@@ -34660,7 +34853,6 @@ function RoleAndTypeDropinComponent({
|
|
|
34660
34853
|
isOrganizationSettlorWithExemptionEnabled,
|
|
34661
34854
|
country
|
|
34662
34855
|
}) {
|
|
34663
|
-
var _a, _b;
|
|
34664
34856
|
const { i18n } = useI18nContext();
|
|
34665
34857
|
const [trustMember, setTrustMember] = useState(
|
|
34666
34858
|
existingTrustMember ?? "incomplete"
|
|
@@ -34673,19 +34865,12 @@ function RoleAndTypeDropinComponent({
|
|
|
34673
34865
|
});
|
|
34674
34866
|
const [activeForm, setActiveForm] = useState(regularForms.roleAndEntityType);
|
|
34675
34867
|
const isSummaryStep = activeForm.formId === summaryStep.formId;
|
|
34676
|
-
const formatRolesForSummary = (roles) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
|
|
34677
|
-
const formatSettlorExemptionReasonsForSummary = (reasons) => reasons.map((reason) => i18n.get(reason)).join(", ");
|
|
34678
34868
|
const summaryData = trustMember === "incomplete" ? {} : {
|
|
34679
|
-
roleAndEntityType:
|
|
34680
|
-
|
|
34681
|
-
|
|
34682
|
-
|
|
34683
|
-
|
|
34684
|
-
firstName: trustMember.trustMemberType === "exemptSettlor" ? (_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName : void 0,
|
|
34685
|
-
lastName: trustMember.trustMemberType === "exemptSettlor" ? (_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName : void 0,
|
|
34686
|
-
country: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.country : void 0,
|
|
34687
|
-
legalCompanyName: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.name : void 0
|
|
34688
|
-
}
|
|
34869
|
+
roleAndEntityType: formatRoleAndEntityTypeSummary(
|
|
34870
|
+
trustMember,
|
|
34871
|
+
i18n,
|
|
34872
|
+
isOrganizationSettlorWithExemptionEnabled
|
|
34873
|
+
)
|
|
34689
34874
|
};
|
|
34690
34875
|
const onNavigateToNextStep = () => {
|
|
34691
34876
|
if (isSummaryStep && trustMember !== "incomplete") {
|
|
@@ -34796,7 +34981,7 @@ const serviceAgreementValidationRules = {
|
|
|
34796
34981
|
errorMessage: "fieldIsRequired"
|
|
34797
34982
|
}
|
|
34798
34983
|
};
|
|
34799
|
-
const logger$
|
|
34984
|
+
const logger$m = createLogger("useServiceAgreement");
|
|
34800
34985
|
const FALLBACK_LANGUAGE_CODE$1 = "en";
|
|
34801
34986
|
const useServiceAgreement = ({
|
|
34802
34987
|
handleGetServiceAgreement,
|
|
@@ -34826,7 +35011,7 @@ const useServiceAgreement = ({
|
|
|
34826
35011
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
34827
35012
|
setServiceAgreement({ id, contract });
|
|
34828
35013
|
};
|
|
34829
|
-
requestAcceptedServiceAgreement().catch(logger$
|
|
35014
|
+
requestAcceptedServiceAgreement().catch(logger$m.error).finally(() => setLoading("success"));
|
|
34830
35015
|
}, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
|
|
34831
35016
|
useEffect(() => {
|
|
34832
35017
|
const requestServiceAgreement = async () => {
|
|
@@ -34841,7 +35026,7 @@ const useServiceAgreement = ({
|
|
|
34841
35026
|
}
|
|
34842
35027
|
);
|
|
34843
35028
|
if (!document2) {
|
|
34844
|
-
logger$
|
|
35029
|
+
logger$m.log('"document" field was missing in response');
|
|
34845
35030
|
return;
|
|
34846
35031
|
}
|
|
34847
35032
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
@@ -34856,7 +35041,7 @@ const useServiceAgreement = ({
|
|
|
34856
35041
|
throw err;
|
|
34857
35042
|
}
|
|
34858
35043
|
};
|
|
34859
|
-
requestServiceAgreement().catch(logger$
|
|
35044
|
+
requestServiceAgreement().catch(logger$m.error);
|
|
34860
35045
|
}, [
|
|
34861
35046
|
handleGetServiceAgreement,
|
|
34862
35047
|
handleServiceAgreementIsNotAvailableInThatLanguage,
|
|
@@ -34880,7 +35065,7 @@ const serviceAgreementTypesTranslationMapping = {
|
|
|
34880
35065
|
adyenPccr: "pccr",
|
|
34881
35066
|
adyenChargeCard: "chargeCardUserAgreement"
|
|
34882
35067
|
};
|
|
34883
|
-
const logger$
|
|
35068
|
+
const logger$l = createLogger("ServiceAgreementDropinComponent");
|
|
34884
35069
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
34885
35070
|
function ServiceAgreementDropinComponent({
|
|
34886
35071
|
legalEntityResponse,
|
|
@@ -35064,7 +35249,7 @@ function ServiceAgreementDropinComponent({
|
|
|
35064
35249
|
await requestAndDownload(i18n.languageCode);
|
|
35065
35250
|
} catch (e) {
|
|
35066
35251
|
if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
|
|
35067
|
-
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$
|
|
35252
|
+
await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$l.error);
|
|
35068
35253
|
return;
|
|
35069
35254
|
}
|
|
35070
35255
|
showToast({
|
|
@@ -35396,9 +35581,11 @@ function SolePropDropinComponent({
|
|
|
35396
35581
|
country,
|
|
35397
35582
|
taskType,
|
|
35398
35583
|
requiredFields,
|
|
35399
|
-
isSettingEnabled
|
|
35584
|
+
isSettingEnabled,
|
|
35585
|
+
isExperimentEnabled,
|
|
35586
|
+
rootLegalEntity: parentLegalEntity ?? legalEntityResponse
|
|
35400
35587
|
}),
|
|
35401
|
-
[country, data, taskType, requiredFields, isSettingEnabled]
|
|
35588
|
+
[country, data, taskType, requiredFields, isSettingEnabled, isExperimentEnabled]
|
|
35402
35589
|
);
|
|
35403
35590
|
const derivedProps = useMemo(
|
|
35404
35591
|
() => getPropsFromConfigurations(
|
|
@@ -35476,11 +35663,10 @@ function SolePropDropinComponent({
|
|
|
35476
35663
|
setNewSoleProp(createdLegalEntity);
|
|
35477
35664
|
return createdLegalEntity;
|
|
35478
35665
|
}
|
|
35479
|
-
|
|
35666
|
+
return handleUpdateLegalEntity(
|
|
35480
35667
|
drop("type").from(mappedLegalEntity),
|
|
35481
35668
|
(legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newSoleProp == null ? void 0 : newSoleProp.id)
|
|
35482
35669
|
);
|
|
35483
|
-
return updatedLegalEntity;
|
|
35484
35670
|
};
|
|
35485
35671
|
const handleOnSubmit = async () => {
|
|
35486
35672
|
const dataSubmitted = data;
|
|
@@ -35550,6 +35736,10 @@ function SolePropDropinComponent({
|
|
|
35550
35736
|
datasetUtils
|
|
35551
35737
|
);
|
|
35552
35738
|
}
|
|
35739
|
+
summaryData.solePropFinancialInformation = formatFinancialInformationSummary(
|
|
35740
|
+
summaryData.solePropFinancialInformation,
|
|
35741
|
+
i18n
|
|
35742
|
+
);
|
|
35553
35743
|
if (isDocumentsRequired(forms2)) {
|
|
35554
35744
|
delete summaryData[solePropDocumentFormId];
|
|
35555
35745
|
summaryData = {
|
|
@@ -36058,7 +36248,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
|
|
|
36058
36248
|
return hasOwnEntityAssocation || !!hasOrganizationType;
|
|
36059
36249
|
};
|
|
36060
36250
|
const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
36061
|
-
const logger$
|
|
36251
|
+
const logger$k = createLogger("DropinComposerComponent");
|
|
36062
36252
|
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
|
|
36063
36253
|
function DropinComposerComponent({
|
|
36064
36254
|
capabilities,
|
|
@@ -36165,7 +36355,7 @@ function DropinComposerComponent({
|
|
|
36165
36355
|
setPciStatus(response);
|
|
36166
36356
|
return response;
|
|
36167
36357
|
} catch (e) {
|
|
36168
|
-
logger$
|
|
36358
|
+
logger$k.warn(i18n.get("failedToGetPciStatus"));
|
|
36169
36359
|
}
|
|
36170
36360
|
}
|
|
36171
36361
|
return void 0;
|
|
@@ -36193,7 +36383,7 @@ function DropinComposerComponent({
|
|
|
36193
36383
|
}, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
|
|
36194
36384
|
useEffect(() => {
|
|
36195
36385
|
if (!tasks.includes(TaskTypes.PCI_DSS)) return;
|
|
36196
|
-
getPciTemplate2().catch(logger$
|
|
36386
|
+
getPciTemplate2().catch(logger$k.error);
|
|
36197
36387
|
}, [getPciTemplate2, tasks]);
|
|
36198
36388
|
const addFetchedAcceptedByName = async (acceptanceInfo) => {
|
|
36199
36389
|
try {
|
|
@@ -36203,7 +36393,7 @@ function DropinComposerComponent({
|
|
|
36203
36393
|
acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
|
|
36204
36394
|
};
|
|
36205
36395
|
} catch (e) {
|
|
36206
|
-
logger$
|
|
36396
|
+
logger$k.warn(i18n.get("failedToFetchAcceptedByName"));
|
|
36207
36397
|
return {
|
|
36208
36398
|
...acceptanceInfo,
|
|
36209
36399
|
acceptedByName: null
|
|
@@ -36217,7 +36407,7 @@ function DropinComposerComponent({
|
|
|
36217
36407
|
const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
|
|
36218
36408
|
setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
|
|
36219
36409
|
} catch (e) {
|
|
36220
|
-
logger$
|
|
36410
|
+
logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
36221
36411
|
}
|
|
36222
36412
|
}
|
|
36223
36413
|
};
|
|
@@ -36227,7 +36417,7 @@ function DropinComposerComponent({
|
|
|
36227
36417
|
const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
|
|
36228
36418
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
36229
36419
|
} catch (e) {
|
|
36230
|
-
logger$
|
|
36420
|
+
logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
36231
36421
|
}
|
|
36232
36422
|
}
|
|
36233
36423
|
};
|
|
@@ -36257,7 +36447,7 @@ function DropinComposerComponent({
|
|
|
36257
36447
|
try {
|
|
36258
36448
|
return await args.handleGetLegalEntity(rootLegalEntity.id);
|
|
36259
36449
|
} catch (e) {
|
|
36260
|
-
logger$
|
|
36450
|
+
logger$k.warn("Failed to fetch legal entity details", e);
|
|
36261
36451
|
}
|
|
36262
36452
|
}
|
|
36263
36453
|
return void 0;
|
|
@@ -36313,7 +36503,7 @@ function DropinComposerComponent({
|
|
|
36313
36503
|
await refreshAssociatedLegalArrangement();
|
|
36314
36504
|
showToast({ type: "success", label: i18n.get("successFullyRemovedTrustMember") });
|
|
36315
36505
|
} catch (err) {
|
|
36316
|
-
logger$
|
|
36506
|
+
logger$k.error(`Failed to delete trust member`, err);
|
|
36317
36507
|
showToast({ type: "error", label: i18n.get("failedToRemoveTrustMember") });
|
|
36318
36508
|
}
|
|
36319
36509
|
};
|
|
@@ -36380,14 +36570,14 @@ function DropinComposerComponent({
|
|
|
36380
36570
|
}
|
|
36381
36571
|
break;
|
|
36382
36572
|
default:
|
|
36383
|
-
logger$
|
|
36573
|
+
logger$k.warn(
|
|
36384
36574
|
`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`
|
|
36385
36575
|
);
|
|
36386
36576
|
}
|
|
36387
36577
|
showToast({ label: i18n.get("successfullyUpdatedDetails"), type: "success" });
|
|
36388
36578
|
await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
|
|
36389
36579
|
} catch (err) {
|
|
36390
|
-
logger$
|
|
36580
|
+
logger$k.error(err);
|
|
36391
36581
|
showToast({ label: i18n.get("failedToUpdateDetails"), type: "error" });
|
|
36392
36582
|
}
|
|
36393
36583
|
};
|
|
@@ -36399,7 +36589,7 @@ function DropinComposerComponent({
|
|
|
36399
36589
|
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
36400
36590
|
singpassTabRef.current.focus();
|
|
36401
36591
|
} catch (e) {
|
|
36402
|
-
logger$
|
|
36592
|
+
logger$k.error(e);
|
|
36403
36593
|
handleSingpassMyInfoLoginFailure(e);
|
|
36404
36594
|
}
|
|
36405
36595
|
}
|
|
@@ -36590,7 +36780,7 @@ function DropinComposerComponent({
|
|
|
36590
36780
|
}
|
|
36591
36781
|
};
|
|
36592
36782
|
setIsLoadingConfiguration(true);
|
|
36593
|
-
fetchConfiguration().catch(logger$
|
|
36783
|
+
fetchConfiguration().catch(logger$k.error).finally(() => {
|
|
36594
36784
|
setIsLoadingConfiguration(false);
|
|
36595
36785
|
onLoad();
|
|
36596
36786
|
});
|
|
@@ -36627,7 +36817,7 @@ function DropinComposerComponent({
|
|
|
36627
36817
|
singpassTabRef.current = window.open(authUrl);
|
|
36628
36818
|
singpassTabRef.current.focus();
|
|
36629
36819
|
} catch (e) {
|
|
36630
|
-
logger$
|
|
36820
|
+
logger$k.error(e);
|
|
36631
36821
|
handleSingpassMyInfoLoginFailure(e);
|
|
36632
36822
|
}
|
|
36633
36823
|
},
|
|
@@ -37155,6 +37345,26 @@ function DropinComposerComponent({
|
|
|
37155
37345
|
return null;
|
|
37156
37346
|
}
|
|
37157
37347
|
}
|
|
37348
|
+
const acceptServiceAgreement = async (context, termsOfServiceDocumentId, data) => {
|
|
37349
|
+
const { loadingContext, legalEntityId } = context;
|
|
37350
|
+
return httpPost(
|
|
37351
|
+
{
|
|
37352
|
+
loadingContext,
|
|
37353
|
+
errorLevel: "warn",
|
|
37354
|
+
errorMessage: `Failed to get service agreement status`,
|
|
37355
|
+
path: `${legalEntityId}/termsOfService/accept`,
|
|
37356
|
+
authentication: "jwt",
|
|
37357
|
+
headers: {
|
|
37358
|
+
"Content-Type": "application/json"
|
|
37359
|
+
}
|
|
37360
|
+
},
|
|
37361
|
+
{
|
|
37362
|
+
...data,
|
|
37363
|
+
legalEntityReference: legalEntityId,
|
|
37364
|
+
termsOfServiceDocumentId
|
|
37365
|
+
}
|
|
37366
|
+
);
|
|
37367
|
+
};
|
|
37158
37368
|
const clearCompanyData = async (context) => {
|
|
37159
37369
|
const { loadingContext, legalEntityId } = context;
|
|
37160
37370
|
return httpPost({
|
|
@@ -37200,6 +37410,19 @@ const companyIndexSearch = async (context, data) => {
|
|
|
37200
37410
|
data
|
|
37201
37411
|
);
|
|
37202
37412
|
};
|
|
37413
|
+
const confirmDataReview = async (context) => {
|
|
37414
|
+
const { loadingContext, legalEntityId } = context;
|
|
37415
|
+
return httpPost({
|
|
37416
|
+
loadingContext,
|
|
37417
|
+
errorLevel: "warn",
|
|
37418
|
+
errorMessage: `Failed to confirm data review`,
|
|
37419
|
+
path: `${legalEntityId}/confirmDataReview`,
|
|
37420
|
+
authentication: "jwt",
|
|
37421
|
+
headers: {
|
|
37422
|
+
"Content-Type": "application/json"
|
|
37423
|
+
}
|
|
37424
|
+
});
|
|
37425
|
+
};
|
|
37203
37426
|
const createDocument = async (context, document2, ownerId) => {
|
|
37204
37427
|
const { loadingContext, legalEntityId } = context;
|
|
37205
37428
|
return httpPost(
|
|
@@ -37248,240 +37471,6 @@ const createTransferInstrument = async (context, transferInstrument) => {
|
|
|
37248
37471
|
transferInstrument
|
|
37249
37472
|
);
|
|
37250
37473
|
};
|
|
37251
|
-
const getBankVerificationVendor = async (context, country, openBankingPartnerConfigId) => {
|
|
37252
|
-
const { loadingContext, legalEntityId } = context;
|
|
37253
|
-
const providerParams = new URLSearchParams({
|
|
37254
|
-
country,
|
|
37255
|
-
...openBankingPartnerConfigId && { configId: openBankingPartnerConfigId }
|
|
37256
|
-
});
|
|
37257
|
-
return httpGet({
|
|
37258
|
-
loadingContext,
|
|
37259
|
-
errorLevel: "warn",
|
|
37260
|
-
errorMessage: `Bank verification vendor not available`,
|
|
37261
|
-
path: `${legalEntityId}/transferInstruments/trusted/providers?${providerParams}`,
|
|
37262
|
-
authentication: "jwt",
|
|
37263
|
-
headers: {
|
|
37264
|
-
"Content-Type": "application/json"
|
|
37265
|
-
}
|
|
37266
|
-
});
|
|
37267
|
-
};
|
|
37268
|
-
const getCompanyDataset = async (context, data) => {
|
|
37269
|
-
const { loadingContext, legalEntityId } = context;
|
|
37270
|
-
return httpPost(
|
|
37271
|
-
{
|
|
37272
|
-
loadingContext,
|
|
37273
|
-
errorLevel: "warn",
|
|
37274
|
-
errorMessage: `Failed to get company dataset`,
|
|
37275
|
-
path: `${legalEntityId}/companyDataset`,
|
|
37276
|
-
authentication: "jwt",
|
|
37277
|
-
headers: {
|
|
37278
|
-
"Content-Type": "application/json"
|
|
37279
|
-
}
|
|
37280
|
-
},
|
|
37281
|
-
data
|
|
37282
|
-
);
|
|
37283
|
-
};
|
|
37284
|
-
const getDocument = async (context, documentId) => {
|
|
37285
|
-
const { loadingContext, legalEntityId } = context;
|
|
37286
|
-
return httpGet({
|
|
37287
|
-
loadingContext,
|
|
37288
|
-
errorLevel: "warn",
|
|
37289
|
-
errorMessage: `Failed to fetch document`,
|
|
37290
|
-
path: `${legalEntityId}/documents/${documentId}`,
|
|
37291
|
-
authentication: "jwt",
|
|
37292
|
-
headers: {
|
|
37293
|
-
"Content-Type": "application/json"
|
|
37294
|
-
}
|
|
37295
|
-
});
|
|
37296
|
-
};
|
|
37297
|
-
const getLegalEntity = async (context, legalEntityId) => {
|
|
37298
|
-
const { loadingContext, legalEntityId: rootLegalEntityId } = context;
|
|
37299
|
-
const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/child/${legalEntityId}` : `${rootLegalEntityId}`;
|
|
37300
|
-
return httpGet({
|
|
37301
|
-
loadingContext,
|
|
37302
|
-
errorLevel: "warn",
|
|
37303
|
-
errorMessage: `LegalEntity not available`,
|
|
37304
|
-
path,
|
|
37305
|
-
authentication: "jwt",
|
|
37306
|
-
headers: {
|
|
37307
|
-
"Content-Type": "application/json"
|
|
37308
|
-
}
|
|
37309
|
-
});
|
|
37310
|
-
};
|
|
37311
|
-
const getScenarios = async (request, context) => {
|
|
37312
|
-
const { loadingContext, legalEntityId } = context;
|
|
37313
|
-
const { country: countryCode, legalEntityType } = request;
|
|
37314
|
-
const scenarioParams = new URLSearchParams({
|
|
37315
|
-
...countryCode && { countryCode },
|
|
37316
|
-
...legalEntityType && { legalEntityType }
|
|
37317
|
-
});
|
|
37318
|
-
return httpGet({
|
|
37319
|
-
loadingContext,
|
|
37320
|
-
errorLevel: "warn",
|
|
37321
|
-
errorMessage: `Scenarios not available`,
|
|
37322
|
-
path: `${legalEntityId}/configurations/scenarios?${scenarioParams}`,
|
|
37323
|
-
authentication: "jwt",
|
|
37324
|
-
headers: {
|
|
37325
|
-
"Content-Type": "application/json"
|
|
37326
|
-
}
|
|
37327
|
-
});
|
|
37328
|
-
};
|
|
37329
|
-
const getTasks = async (context) => {
|
|
37330
|
-
const { loadingContext, legalEntityId } = context;
|
|
37331
|
-
return httpGet({
|
|
37332
|
-
loadingContext,
|
|
37333
|
-
errorLevel: "warn",
|
|
37334
|
-
errorMessage: `Tasks not available`,
|
|
37335
|
-
path: `${legalEntityId}/configurations/tasks`,
|
|
37336
|
-
authentication: "jwt",
|
|
37337
|
-
headers: {
|
|
37338
|
-
"Content-Type": "application/json"
|
|
37339
|
-
}
|
|
37340
|
-
});
|
|
37341
|
-
};
|
|
37342
|
-
const getTransferInstrument = async (context, transferInstrumentId) => {
|
|
37343
|
-
const { loadingContext, legalEntityId } = context;
|
|
37344
|
-
return httpGet({
|
|
37345
|
-
loadingContext,
|
|
37346
|
-
errorLevel: "warn",
|
|
37347
|
-
errorMessage: `TransferInstrument not available`,
|
|
37348
|
-
path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
|
|
37349
|
-
authentication: "jwt",
|
|
37350
|
-
headers: {
|
|
37351
|
-
"Content-Type": "application/json"
|
|
37352
|
-
}
|
|
37353
|
-
});
|
|
37354
|
-
};
|
|
37355
|
-
const getTransferInstruments = async (context) => {
|
|
37356
|
-
const { loadingContext, legalEntityId } = context;
|
|
37357
|
-
return httpGet({
|
|
37358
|
-
loadingContext,
|
|
37359
|
-
errorLevel: "warn",
|
|
37360
|
-
errorMessage: `TransferInstrument not available`,
|
|
37361
|
-
path: `${legalEntityId}/transferInstruments`,
|
|
37362
|
-
authentication: "jwt",
|
|
37363
|
-
headers: {
|
|
37364
|
-
"Content-Type": "application/json"
|
|
37365
|
-
}
|
|
37366
|
-
});
|
|
37367
|
-
};
|
|
37368
|
-
const refreshCompanyDataset = async (context, data) => {
|
|
37369
|
-
const { loadingContext, legalEntityId } = context;
|
|
37370
|
-
return httpPost(
|
|
37371
|
-
{
|
|
37372
|
-
loadingContext,
|
|
37373
|
-
errorLevel: "warn",
|
|
37374
|
-
errorMessage: `Failed to refresh company dataset`,
|
|
37375
|
-
path: `${legalEntityId}/companyDataset/refreshed`,
|
|
37376
|
-
authentication: "jwt",
|
|
37377
|
-
headers: {
|
|
37378
|
-
"Content-Type": "application/json"
|
|
37379
|
-
}
|
|
37380
|
-
},
|
|
37381
|
-
data
|
|
37382
|
-
);
|
|
37383
|
-
};
|
|
37384
|
-
const updateDocument = async (context, document2, documentId, ownerId) => {
|
|
37385
|
-
const { loadingContext, legalEntityId } = context;
|
|
37386
|
-
return httpPost(
|
|
37387
|
-
{
|
|
37388
|
-
loadingContext,
|
|
37389
|
-
errorLevel: "warn",
|
|
37390
|
-
errorMessage: `Failed to update document`,
|
|
37391
|
-
path: `${legalEntityId}/documents/${documentId}/${ownerId}`,
|
|
37392
|
-
authentication: "jwt",
|
|
37393
|
-
headers: {
|
|
37394
|
-
"Content-Type": "application/json"
|
|
37395
|
-
}
|
|
37396
|
-
},
|
|
37397
|
-
document2
|
|
37398
|
-
);
|
|
37399
|
-
};
|
|
37400
|
-
const updateLegalEntity = async (context, legalEntity, legalEntityId) => {
|
|
37401
|
-
const { loadingContext, legalEntityId: rootLegalEntityId } = context;
|
|
37402
|
-
const patchLegalEntity = {
|
|
37403
|
-
...legalEntity,
|
|
37404
|
-
id: legalEntityId
|
|
37405
|
-
};
|
|
37406
|
-
return httpPost(
|
|
37407
|
-
{
|
|
37408
|
-
loadingContext,
|
|
37409
|
-
errorLevel: "warn",
|
|
37410
|
-
errorMessage: `LegalEntity update failed`,
|
|
37411
|
-
path: `${rootLegalEntityId}`,
|
|
37412
|
-
authentication: "jwt",
|
|
37413
|
-
headers: {
|
|
37414
|
-
"Content-Type": "application/json"
|
|
37415
|
-
}
|
|
37416
|
-
},
|
|
37417
|
-
patchLegalEntity
|
|
37418
|
-
);
|
|
37419
|
-
};
|
|
37420
|
-
const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
|
|
37421
|
-
const { loadingContext, legalEntityId } = context;
|
|
37422
|
-
return httpPost(
|
|
37423
|
-
{
|
|
37424
|
-
loadingContext,
|
|
37425
|
-
errorLevel: "warn",
|
|
37426
|
-
errorMessage: `Failed to update transferInstrument`,
|
|
37427
|
-
path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
|
|
37428
|
-
authentication: "jwt",
|
|
37429
|
-
headers: {
|
|
37430
|
-
"Content-Type": "application/json"
|
|
37431
|
-
}
|
|
37432
|
-
},
|
|
37433
|
-
transferInstrument
|
|
37434
|
-
);
|
|
37435
|
-
};
|
|
37436
|
-
const verifyTin = async (context, data) => {
|
|
37437
|
-
const { loadingContext, legalEntityId } = context;
|
|
37438
|
-
return httpPost(
|
|
37439
|
-
{
|
|
37440
|
-
loadingContext,
|
|
37441
|
-
errorLevel: "warn",
|
|
37442
|
-
errorMessage: `Failed to verify tin`,
|
|
37443
|
-
path: `${legalEntityId}/verifyTin`,
|
|
37444
|
-
authentication: "jwt",
|
|
37445
|
-
headers: {
|
|
37446
|
-
"Content-Type": "application/json"
|
|
37447
|
-
}
|
|
37448
|
-
},
|
|
37449
|
-
data
|
|
37450
|
-
);
|
|
37451
|
-
};
|
|
37452
|
-
const acceptServiceAgreement = async (context, termsOfServiceDocumentId, data) => {
|
|
37453
|
-
const { loadingContext, legalEntityId } = context;
|
|
37454
|
-
return httpPost(
|
|
37455
|
-
{
|
|
37456
|
-
loadingContext,
|
|
37457
|
-
errorLevel: "warn",
|
|
37458
|
-
errorMessage: `Failed to get service agreement status`,
|
|
37459
|
-
path: `${legalEntityId}/termsOfService/accept`,
|
|
37460
|
-
authentication: "jwt",
|
|
37461
|
-
headers: {
|
|
37462
|
-
"Content-Type": "application/json"
|
|
37463
|
-
}
|
|
37464
|
-
},
|
|
37465
|
-
{
|
|
37466
|
-
...data,
|
|
37467
|
-
legalEntityReference: legalEntityId,
|
|
37468
|
-
termsOfServiceDocumentId
|
|
37469
|
-
}
|
|
37470
|
-
);
|
|
37471
|
-
};
|
|
37472
|
-
const confirmDataReview = async (context) => {
|
|
37473
|
-
const { loadingContext, legalEntityId } = context;
|
|
37474
|
-
return httpPost({
|
|
37475
|
-
loadingContext,
|
|
37476
|
-
errorLevel: "warn",
|
|
37477
|
-
errorMessage: `Failed to confirm data review`,
|
|
37478
|
-
path: `${legalEntityId}/confirmDataReview`,
|
|
37479
|
-
authentication: "jwt",
|
|
37480
|
-
headers: {
|
|
37481
|
-
"Content-Type": "application/json"
|
|
37482
|
-
}
|
|
37483
|
-
});
|
|
37484
|
-
};
|
|
37485
37474
|
const createTrustedTransferInstrument = async (context, code, state) => {
|
|
37486
37475
|
const { loadingContext, legalEntityId } = context;
|
|
37487
37476
|
const path = `${legalEntityId}/transferInstruments/trusted`;
|
|
@@ -37567,6 +37556,53 @@ const getAddress = async (context, addressId) => {
|
|
|
37567
37556
|
}
|
|
37568
37557
|
});
|
|
37569
37558
|
};
|
|
37559
|
+
const getBankVerificationVendor = async (context, country, openBankingPartnerConfigId, locale) => {
|
|
37560
|
+
const { loadingContext, legalEntityId } = context;
|
|
37561
|
+
const providerParams = new URLSearchParams({
|
|
37562
|
+
country,
|
|
37563
|
+
...openBankingPartnerConfigId && { configId: openBankingPartnerConfigId },
|
|
37564
|
+
locale
|
|
37565
|
+
});
|
|
37566
|
+
return httpGet({
|
|
37567
|
+
loadingContext,
|
|
37568
|
+
errorLevel: "warn",
|
|
37569
|
+
errorMessage: `Bank verification vendor not available`,
|
|
37570
|
+
path: `${legalEntityId}/transferInstruments/trusted/providers?${providerParams}`,
|
|
37571
|
+
authentication: "jwt",
|
|
37572
|
+
headers: {
|
|
37573
|
+
"Content-Type": "application/json"
|
|
37574
|
+
}
|
|
37575
|
+
});
|
|
37576
|
+
};
|
|
37577
|
+
const getCompanyDataset = async (context, data) => {
|
|
37578
|
+
const { loadingContext, legalEntityId } = context;
|
|
37579
|
+
return httpPost(
|
|
37580
|
+
{
|
|
37581
|
+
loadingContext,
|
|
37582
|
+
errorLevel: "warn",
|
|
37583
|
+
errorMessage: `Failed to get company dataset`,
|
|
37584
|
+
path: `${legalEntityId}/companyDataset`,
|
|
37585
|
+
authentication: "jwt",
|
|
37586
|
+
headers: {
|
|
37587
|
+
"Content-Type": "application/json"
|
|
37588
|
+
}
|
|
37589
|
+
},
|
|
37590
|
+
data
|
|
37591
|
+
);
|
|
37592
|
+
};
|
|
37593
|
+
const getDocument = async (context, documentId) => {
|
|
37594
|
+
const { loadingContext, legalEntityId } = context;
|
|
37595
|
+
return httpGet({
|
|
37596
|
+
loadingContext,
|
|
37597
|
+
errorLevel: "warn",
|
|
37598
|
+
errorMessage: `Failed to fetch document`,
|
|
37599
|
+
path: `${legalEntityId}/documents/${documentId}`,
|
|
37600
|
+
authentication: "jwt",
|
|
37601
|
+
headers: {
|
|
37602
|
+
"Content-Type": "application/json"
|
|
37603
|
+
}
|
|
37604
|
+
});
|
|
37605
|
+
};
|
|
37570
37606
|
const getIdverificationToken = async (context, request) => {
|
|
37571
37607
|
const { loadingContext, legalEntityId } = context;
|
|
37572
37608
|
return httpPost(
|
|
@@ -37583,6 +37619,20 @@ const getIdverificationToken = async (context, request) => {
|
|
|
37583
37619
|
request
|
|
37584
37620
|
);
|
|
37585
37621
|
};
|
|
37622
|
+
const getLegalEntity = async (context, legalEntityId) => {
|
|
37623
|
+
const { loadingContext, legalEntityId: rootLegalEntityId } = context;
|
|
37624
|
+
const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/child/${legalEntityId}` : `${rootLegalEntityId}`;
|
|
37625
|
+
return httpGet({
|
|
37626
|
+
loadingContext,
|
|
37627
|
+
errorLevel: "warn",
|
|
37628
|
+
errorMessage: `LegalEntity not available`,
|
|
37629
|
+
path,
|
|
37630
|
+
authentication: "jwt",
|
|
37631
|
+
headers: {
|
|
37632
|
+
"Content-Type": "application/json"
|
|
37633
|
+
}
|
|
37634
|
+
});
|
|
37635
|
+
};
|
|
37586
37636
|
const getOnboardingStatus = async (context) => {
|
|
37587
37637
|
const { loadingContext, legalEntityId } = context;
|
|
37588
37638
|
return httpGet({
|
|
@@ -37699,6 +37749,32 @@ const getServiceAgreementStatus = async (context) => {
|
|
|
37699
37749
|
}
|
|
37700
37750
|
});
|
|
37701
37751
|
};
|
|
37752
|
+
const getTransferInstrument = async (context, transferInstrumentId) => {
|
|
37753
|
+
const { loadingContext, legalEntityId } = context;
|
|
37754
|
+
return httpGet({
|
|
37755
|
+
loadingContext,
|
|
37756
|
+
errorLevel: "warn",
|
|
37757
|
+
errorMessage: `TransferInstrument not available`,
|
|
37758
|
+
path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
|
|
37759
|
+
authentication: "jwt",
|
|
37760
|
+
headers: {
|
|
37761
|
+
"Content-Type": "application/json"
|
|
37762
|
+
}
|
|
37763
|
+
});
|
|
37764
|
+
};
|
|
37765
|
+
const getTransferInstruments = async (context) => {
|
|
37766
|
+
const { loadingContext, legalEntityId } = context;
|
|
37767
|
+
return httpGet({
|
|
37768
|
+
loadingContext,
|
|
37769
|
+
errorLevel: "warn",
|
|
37770
|
+
errorMessage: `TransferInstrument not available`,
|
|
37771
|
+
path: `${legalEntityId}/transferInstruments`,
|
|
37772
|
+
authentication: "jwt",
|
|
37773
|
+
headers: {
|
|
37774
|
+
"Content-Type": "application/json"
|
|
37775
|
+
}
|
|
37776
|
+
});
|
|
37777
|
+
};
|
|
37702
37778
|
const handleBankVerificationError = async (context, errorCode, errorMessage, state, metadata) => {
|
|
37703
37779
|
const { loadingContext, legalEntityId } = context;
|
|
37704
37780
|
const path = `${legalEntityId}/transferInstruments/trusted/error`;
|
|
@@ -37737,6 +37813,22 @@ const idVerificationStartcheck = async (context, request) => {
|
|
|
37737
37813
|
request
|
|
37738
37814
|
);
|
|
37739
37815
|
};
|
|
37816
|
+
const refreshCompanyDataset = async (context, data) => {
|
|
37817
|
+
const { loadingContext, legalEntityId } = context;
|
|
37818
|
+
return httpPost(
|
|
37819
|
+
{
|
|
37820
|
+
loadingContext,
|
|
37821
|
+
errorLevel: "warn",
|
|
37822
|
+
errorMessage: `Failed to refresh company dataset`,
|
|
37823
|
+
path: `${legalEntityId}/companyDataset/refreshed`,
|
|
37824
|
+
authentication: "jwt",
|
|
37825
|
+
headers: {
|
|
37826
|
+
"Content-Type": "application/json"
|
|
37827
|
+
}
|
|
37828
|
+
},
|
|
37829
|
+
data
|
|
37830
|
+
);
|
|
37831
|
+
};
|
|
37740
37832
|
const searchAddress = async (context, address) => {
|
|
37741
37833
|
const { loadingContext, legalEntityId } = context;
|
|
37742
37834
|
return httpPost(
|
|
@@ -37769,6 +37861,74 @@ const signPci = async (context, data) => {
|
|
|
37769
37861
|
data
|
|
37770
37862
|
);
|
|
37771
37863
|
};
|
|
37864
|
+
const updateDocument = async (context, document2, documentId, ownerId) => {
|
|
37865
|
+
const { loadingContext, legalEntityId } = context;
|
|
37866
|
+
return httpPost(
|
|
37867
|
+
{
|
|
37868
|
+
loadingContext,
|
|
37869
|
+
errorLevel: "warn",
|
|
37870
|
+
errorMessage: `Failed to update document`,
|
|
37871
|
+
path: `${legalEntityId}/documents/${documentId}/${ownerId}`,
|
|
37872
|
+
authentication: "jwt",
|
|
37873
|
+
headers: {
|
|
37874
|
+
"Content-Type": "application/json"
|
|
37875
|
+
}
|
|
37876
|
+
},
|
|
37877
|
+
document2
|
|
37878
|
+
);
|
|
37879
|
+
};
|
|
37880
|
+
const updateLegalEntity = async (context, legalEntity, legalEntityId) => {
|
|
37881
|
+
const { loadingContext, legalEntityId: rootLegalEntityId } = context;
|
|
37882
|
+
const patchLegalEntity = {
|
|
37883
|
+
...legalEntity,
|
|
37884
|
+
id: legalEntityId
|
|
37885
|
+
};
|
|
37886
|
+
return httpPost(
|
|
37887
|
+
{
|
|
37888
|
+
loadingContext,
|
|
37889
|
+
errorLevel: "warn",
|
|
37890
|
+
errorMessage: `LegalEntity update failed`,
|
|
37891
|
+
path: `${rootLegalEntityId}`,
|
|
37892
|
+
authentication: "jwt",
|
|
37893
|
+
headers: {
|
|
37894
|
+
"Content-Type": "application/json"
|
|
37895
|
+
}
|
|
37896
|
+
},
|
|
37897
|
+
patchLegalEntity
|
|
37898
|
+
);
|
|
37899
|
+
};
|
|
37900
|
+
const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
|
|
37901
|
+
const { loadingContext, legalEntityId } = context;
|
|
37902
|
+
return httpPost(
|
|
37903
|
+
{
|
|
37904
|
+
loadingContext,
|
|
37905
|
+
errorLevel: "warn",
|
|
37906
|
+
errorMessage: `Failed to update transferInstrument`,
|
|
37907
|
+
path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
|
|
37908
|
+
authentication: "jwt",
|
|
37909
|
+
headers: {
|
|
37910
|
+
"Content-Type": "application/json"
|
|
37911
|
+
}
|
|
37912
|
+
},
|
|
37913
|
+
transferInstrument
|
|
37914
|
+
);
|
|
37915
|
+
};
|
|
37916
|
+
const verifyTin = async (context, data) => {
|
|
37917
|
+
const { loadingContext, legalEntityId } = context;
|
|
37918
|
+
return httpPost(
|
|
37919
|
+
{
|
|
37920
|
+
loadingContext,
|
|
37921
|
+
errorLevel: "warn",
|
|
37922
|
+
errorMessage: `Failed to verify tin`,
|
|
37923
|
+
path: `${legalEntityId}/verifyTin`,
|
|
37924
|
+
authentication: "jwt",
|
|
37925
|
+
headers: {
|
|
37926
|
+
"Content-Type": "application/json"
|
|
37927
|
+
}
|
|
37928
|
+
},
|
|
37929
|
+
data
|
|
37930
|
+
);
|
|
37931
|
+
};
|
|
37772
37932
|
const COMPONENTS_API_VERSION = "v1";
|
|
37773
37933
|
const useComponentApi = (rootLegalEntityId) => {
|
|
37774
37934
|
const authContext = useAuthContext();
|
|
@@ -37788,7 +37948,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
37788
37948
|
updateLegalEntity: async (legalEntity, legalEntityId) => updateLegalEntity(baseRequestContext, legalEntity, legalEntityId),
|
|
37789
37949
|
createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
|
|
37790
37950
|
getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
|
|
37791
|
-
getBankVerificationVendor: async (country, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country, openBankingPartnerConfigId),
|
|
37951
|
+
getBankVerificationVendor: async (country, openBankingPartnerConfigId, locale) => getBankVerificationVendor(baseRequestContext, country, openBankingPartnerConfigId, locale),
|
|
37792
37952
|
getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
|
|
37793
37953
|
createDocument: async (document2, ownerId) => createDocument(baseRequestContext, document2, ownerId),
|
|
37794
37954
|
updateDocument: async (document2, documentId, ownerId) => updateDocument(baseRequestContext, document2, documentId, ownerId),
|
|
@@ -37839,7 +37999,7 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
37839
37999
|
};
|
|
37840
38000
|
}, [base, rootLegalEntityId]);
|
|
37841
38001
|
};
|
|
37842
|
-
const logger$
|
|
38002
|
+
const logger$j = createLogger("AcceptTermsOfService");
|
|
37843
38003
|
function AcceptTermsOfServiceComponent({
|
|
37844
38004
|
legalEntityId,
|
|
37845
38005
|
modalView,
|
|
@@ -37881,13 +38041,13 @@ function AcceptTermsOfServiceComponent({
|
|
|
37881
38041
|
onClose == null ? void 0 : onClose();
|
|
37882
38042
|
};
|
|
37883
38043
|
const fetchLegalEntity = useCallback(async () => {
|
|
37884
|
-
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$
|
|
38044
|
+
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$j.error);
|
|
37885
38045
|
}, [getLegalEntity2, legalEntityId]);
|
|
37886
38046
|
const fetchUnsigned = useCallback(async () => {
|
|
37887
|
-
await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$
|
|
38047
|
+
await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$j.error);
|
|
37888
38048
|
}, [getServiceAgreementStatus2, legalEntityId]);
|
|
37889
38049
|
const fetchSigned = useCallback(async () => {
|
|
37890
|
-
await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$
|
|
38050
|
+
await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$j.error);
|
|
37891
38051
|
}, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
|
|
37892
38052
|
const handleSign = useCallback(
|
|
37893
38053
|
// @ts-ignore-error:next-line ts does not infer type correctly
|
|
@@ -37921,7 +38081,7 @@ function AcceptTermsOfServiceComponent({
|
|
|
37921
38081
|
(async () => {
|
|
37922
38082
|
setIsLoading(true);
|
|
37923
38083
|
await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
|
|
37924
|
-
})().catch(logger$
|
|
38084
|
+
})().catch(logger$j.error).finally(() => {
|
|
37925
38085
|
setIsLoading(false);
|
|
37926
38086
|
});
|
|
37927
38087
|
}, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
|
|
@@ -37948,7 +38108,7 @@ function AcceptTermsOfServiceComponent({
|
|
|
37948
38108
|
}
|
|
37949
38109
|
);
|
|
37950
38110
|
}
|
|
37951
|
-
const logger$
|
|
38111
|
+
const logger$i = createLogger("CreateIndividualComponent");
|
|
37952
38112
|
function CreateIndividualComponent({
|
|
37953
38113
|
parentLegalEntityId,
|
|
37954
38114
|
legalEntityId,
|
|
@@ -37998,11 +38158,11 @@ function CreateIndividualComponent({
|
|
|
37998
38158
|
setParentLegalEntity(parentEntity);
|
|
37999
38159
|
setLegalEntity(entity);
|
|
38000
38160
|
} catch (error) {
|
|
38001
|
-
logger$
|
|
38161
|
+
logger$i.error(error);
|
|
38002
38162
|
}
|
|
38003
38163
|
}, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
|
|
38004
38164
|
useEffect(() => {
|
|
38005
|
-
fetchLegalEntity().catch(logger$
|
|
38165
|
+
fetchLegalEntity().catch(logger$i.error);
|
|
38006
38166
|
}, [fetchLegalEntity]);
|
|
38007
38167
|
const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
|
|
38008
38168
|
const onSubmit = (d) => {
|
|
@@ -38020,7 +38180,7 @@ function CreateIndividualComponent({
|
|
|
38020
38180
|
setIsAddressEnabled(res.statuses.address.enabled);
|
|
38021
38181
|
}, [country, getProviderStatus2]);
|
|
38022
38182
|
useEffect(() => {
|
|
38023
|
-
fetchProviderStatus().catch(logger$
|
|
38183
|
+
fetchProviderStatus().catch(logger$i.error);
|
|
38024
38184
|
}, [fetchProviderStatus]);
|
|
38025
38185
|
return /* @__PURE__ */ jsx(
|
|
38026
38186
|
IndividualDropinComponent,
|
|
@@ -38045,7 +38205,7 @@ function CreateIndividualComponent({
|
|
|
38045
38205
|
}
|
|
38046
38206
|
);
|
|
38047
38207
|
}
|
|
38048
|
-
const logger$
|
|
38208
|
+
const logger$h = createLogger("CreateTransferInstrumentComponent");
|
|
38049
38209
|
function CreateTransferInstrumentComponent({
|
|
38050
38210
|
legalEntityId,
|
|
38051
38211
|
transferInstrumentId,
|
|
@@ -38072,6 +38232,7 @@ function CreateTransferInstrumentComponent({
|
|
|
38072
38232
|
rootLegalEntity: legalEntity,
|
|
38073
38233
|
getLegalEntity: getLegalEntity2
|
|
38074
38234
|
});
|
|
38235
|
+
const { i18n } = useI18nContext();
|
|
38075
38236
|
const fetchLegalEntity = useCallback(async () => {
|
|
38076
38237
|
const le = await getLegalEntity2(legalEntityId);
|
|
38077
38238
|
setLegalEntity(le);
|
|
@@ -38085,7 +38246,7 @@ function CreateTransferInstrumentComponent({
|
|
|
38085
38246
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
38086
38247
|
setTransferInstrument(ti);
|
|
38087
38248
|
}
|
|
38088
|
-
})().catch(logger$
|
|
38249
|
+
})().catch(logger$h.error).finally(() => {
|
|
38089
38250
|
setLoadingStatus("success");
|
|
38090
38251
|
});
|
|
38091
38252
|
}, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
|
|
@@ -38096,7 +38257,7 @@ function CreateTransferInstrumentComponent({
|
|
|
38096
38257
|
setTransferInstrument,
|
|
38097
38258
|
legalEntityResponse: legalEntity,
|
|
38098
38259
|
associatedLegalArrangement,
|
|
38099
|
-
handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId),
|
|
38260
|
+
handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId, i18n.locale),
|
|
38100
38261
|
handleGetDocument: getDocument2,
|
|
38101
38262
|
handleCreateDocument: createDocument2,
|
|
38102
38263
|
handleUpdateDocument: updateDocument2,
|
|
@@ -38124,6 +38285,7 @@ const embeddedStatus = "adyen-kyc-embedded-status";
|
|
|
38124
38285
|
const embeddedStatusLoading = "adyen-kyc-embedded-status-loading";
|
|
38125
38286
|
const embeddedStatusAvatar = "adyen-kyc-embedded-status-avatar";
|
|
38126
38287
|
const embeddedStatusLight = "adyen-kyc-embedded-status-light";
|
|
38288
|
+
const embeddedStatusActionIndicator = "adyen-kyc-embedded-status-action-indicator";
|
|
38127
38289
|
const embeddedStatusInfo = "adyen-kyc-embedded-status-info";
|
|
38128
38290
|
const styles = {
|
|
38129
38291
|
"embedded-status": "adyen-kyc-embedded-status",
|
|
@@ -38134,6 +38296,8 @@ const styles = {
|
|
|
38134
38296
|
embeddedStatusAvatar,
|
|
38135
38297
|
"embedded-status-light": "adyen-kyc-embedded-status-light",
|
|
38136
38298
|
embeddedStatusLight,
|
|
38299
|
+
"embedded-status-action-indicator": "adyen-kyc-embedded-status-action-indicator",
|
|
38300
|
+
embeddedStatusActionIndicator,
|
|
38137
38301
|
"embedded-status-info": "adyen-kyc-embedded-status-info",
|
|
38138
38302
|
embeddedStatusInfo
|
|
38139
38303
|
};
|
|
@@ -38170,7 +38334,7 @@ const EmbeddedStatus = ({
|
|
|
38170
38334
|
onClick,
|
|
38171
38335
|
light,
|
|
38172
38336
|
className,
|
|
38173
|
-
|
|
38337
|
+
actionIndicator,
|
|
38174
38338
|
...props
|
|
38175
38339
|
}) => {
|
|
38176
38340
|
const { i18n } = useI18nContext();
|
|
@@ -38194,18 +38358,7 @@ const EmbeddedStatus = ({
|
|
|
38194
38358
|
/* @__PURE__ */ jsx(Typography, { variant: "body-stronger", children: title }),
|
|
38195
38359
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: subtitle })
|
|
38196
38360
|
] }) }),
|
|
38197
|
-
|
|
38198
|
-
Button,
|
|
38199
|
-
{
|
|
38200
|
-
label: i18n.get(actionButton.labelKey),
|
|
38201
|
-
onClick: (e) => {
|
|
38202
|
-
e.stopPropagation();
|
|
38203
|
-
actionButton.onClick();
|
|
38204
|
-
},
|
|
38205
|
-
secondary: true,
|
|
38206
|
-
small: true
|
|
38207
|
-
}
|
|
38208
|
-
) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
|
|
38361
|
+
actionIndicator ? /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusButton, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "5em", height: "2em" }) : /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", className: styles.embeddedStatusActionIndicator, children: i18n.get(actionIndicator.labelKey) }) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
|
|
38209
38362
|
]
|
|
38210
38363
|
}
|
|
38211
38364
|
);
|
|
@@ -38278,9 +38431,6 @@ function PCIStatus({ legalEntityId, onClick, title, subtitle = "" }) {
|
|
|
38278
38431
|
}).catch(() => {
|
|
38279
38432
|
});
|
|
38280
38433
|
}, [fetchStatus]);
|
|
38281
|
-
const handleClick = () => {
|
|
38282
|
-
onClick == null ? void 0 : onClick();
|
|
38283
|
-
};
|
|
38284
38434
|
return hasSigned ? /* @__PURE__ */ jsx(
|
|
38285
38435
|
EmbeddedStatus,
|
|
38286
38436
|
{
|
|
@@ -38294,7 +38444,7 @@ function PCIStatus({ legalEntityId, onClick, title, subtitle = "" }) {
|
|
|
38294
38444
|
EmbeddedStatus,
|
|
38295
38445
|
{
|
|
38296
38446
|
onClick,
|
|
38297
|
-
|
|
38447
|
+
actionIndicator: { labelKey: "sign" },
|
|
38298
38448
|
title,
|
|
38299
38449
|
subtitle,
|
|
38300
38450
|
loading: isLoading
|
|
@@ -38329,22 +38479,19 @@ function TermsOfServiceStatus({
|
|
|
38329
38479
|
async () => getServiceAgreementAcceptanceInfos2(legalEntityId),
|
|
38330
38480
|
[getServiceAgreementAcceptanceInfos2, legalEntityId]
|
|
38331
38481
|
);
|
|
38332
|
-
const
|
|
38482
|
+
const getStatus2 = useCallback(async () => {
|
|
38333
38483
|
const [signedRes, unsignedRes] = await Promise.all([getSigned(), getUnsigned()]);
|
|
38334
38484
|
const signed = signedRes.data.map((d) => d.type);
|
|
38335
38485
|
const unsigned = unsignedRes.termsOfServiceTypes;
|
|
38336
38486
|
return signed.length !== 0 && unsigned.length === 0;
|
|
38337
38487
|
}, [getUnsigned, getSigned]);
|
|
38338
38488
|
useEffect(() => {
|
|
38339
|
-
|
|
38489
|
+
getStatus2().then((allSigned) => {
|
|
38340
38490
|
setIsLoading(false);
|
|
38341
38491
|
setHasSignedAll(allSigned);
|
|
38342
38492
|
}).catch(() => {
|
|
38343
38493
|
});
|
|
38344
38494
|
});
|
|
38345
|
-
const handleClick = () => {
|
|
38346
|
-
onClick == null ? void 0 : onClick();
|
|
38347
|
-
};
|
|
38348
38495
|
return hasSignedAll ? /* @__PURE__ */ jsx(
|
|
38349
38496
|
EmbeddedStatus,
|
|
38350
38497
|
{
|
|
@@ -38358,7 +38505,7 @@ function TermsOfServiceStatus({
|
|
|
38358
38505
|
EmbeddedStatus,
|
|
38359
38506
|
{
|
|
38360
38507
|
onClick,
|
|
38361
|
-
|
|
38508
|
+
actionIndicator: { labelKey: "accept" },
|
|
38362
38509
|
title,
|
|
38363
38510
|
subtitle,
|
|
38364
38511
|
loading: isLoading
|
|
@@ -38607,14 +38754,13 @@ function ManageTransferInstrumentOverviewItem({
|
|
|
38607
38754
|
const [modalOpen, setModalOpen] = useState(false);
|
|
38608
38755
|
const isDetailsRequired = transferInstrumentReference.status === "DETAILS_REQUIRED";
|
|
38609
38756
|
const onClick = (transferInstrumentId) => {
|
|
38610
|
-
if (isDetailsRequired)
|
|
38757
|
+
if (isDetailsRequired) {
|
|
38758
|
+
onEdit(transferInstrumentReference.transferInstrument.id);
|
|
38759
|
+
return;
|
|
38760
|
+
}
|
|
38611
38761
|
onOpen(transferInstrumentId);
|
|
38612
38762
|
setModalOpen(true);
|
|
38613
38763
|
};
|
|
38614
|
-
const actionButton = {
|
|
38615
|
-
labelKey: "continue",
|
|
38616
|
-
onClick: () => onEdit(transferInstrumentReference.transferInstrument.id)
|
|
38617
|
-
};
|
|
38618
38764
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38619
38765
|
/* @__PURE__ */ jsx(
|
|
38620
38766
|
EmbeddedStatus,
|
|
@@ -38628,7 +38774,7 @@ function ManageTransferInstrumentOverviewItem({
|
|
|
38628
38774
|
),
|
|
38629
38775
|
subtitle: i18n.get("bankAccount"),
|
|
38630
38776
|
onClick: () => onClick(transferInstrumentReference.transferInstrument.id),
|
|
38631
|
-
|
|
38777
|
+
actionIndicator: isDetailsRequired ? { labelKey: "continue" } : void 0,
|
|
38632
38778
|
"aria-label": i18n.get("bankAccount")
|
|
38633
38779
|
},
|
|
38634
38780
|
transferInstrumentReference.transferInstrument.id
|
|
@@ -38646,7 +38792,7 @@ function ManageTransferInstrumentOverviewItem({
|
|
|
38646
38792
|
)
|
|
38647
38793
|
] });
|
|
38648
38794
|
}
|
|
38649
|
-
const logger$
|
|
38795
|
+
const logger$g = createLogger("ManageTransferInstrumentOverview");
|
|
38650
38796
|
function ManageTransferInstrumentOverview({
|
|
38651
38797
|
transferInstrumentReferences,
|
|
38652
38798
|
legalEntityId,
|
|
@@ -38665,7 +38811,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38665
38811
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
38666
38812
|
setTransferInstrumentsMap({ [transferInstrumentId]: ti, ...transferInstrumentsMap });
|
|
38667
38813
|
} catch (e) {
|
|
38668
|
-
logger$
|
|
38814
|
+
logger$g.error(e);
|
|
38669
38815
|
}
|
|
38670
38816
|
};
|
|
38671
38817
|
const onRemoveTransferInstrument = async (transferInstrumentId) => {
|
|
@@ -38674,7 +38820,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38674
38820
|
onRemove(transferInstrumentId);
|
|
38675
38821
|
} catch (e) {
|
|
38676
38822
|
showToast({ label: i18n.get("thereWasAnErrorTryAgain"), type: "error" });
|
|
38677
|
-
logger$
|
|
38823
|
+
logger$g.error(e);
|
|
38678
38824
|
}
|
|
38679
38825
|
};
|
|
38680
38826
|
const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => /* @__PURE__ */ jsx(
|
|
@@ -38703,7 +38849,7 @@ function ManageTransferInstrumentOverview({
|
|
|
38703
38849
|
)
|
|
38704
38850
|
] });
|
|
38705
38851
|
}
|
|
38706
|
-
const logger$
|
|
38852
|
+
const logger$f = createLogger("ManageTransferInstrumentComponent");
|
|
38707
38853
|
function ManageTransferInstrumentComponent({
|
|
38708
38854
|
legalEntityId,
|
|
38709
38855
|
onAdd,
|
|
@@ -38731,7 +38877,7 @@ function ManageTransferInstrumentComponent({
|
|
|
38731
38877
|
}, [getTransferInstruments2]);
|
|
38732
38878
|
useEffect(() => {
|
|
38733
38879
|
eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
38734
|
-
init2().catch(logger$
|
|
38880
|
+
init2().catch(logger$f.error).finally(() => {
|
|
38735
38881
|
setLoadingStatus("success");
|
|
38736
38882
|
});
|
|
38737
38883
|
}, [init2, setLocale, eventEmitter]);
|
|
@@ -38741,7 +38887,7 @@ function ManageTransferInstrumentComponent({
|
|
|
38741
38887
|
}
|
|
38742
38888
|
}, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
|
|
38743
38889
|
const onRemove = (transferInstrumentId) => {
|
|
38744
|
-
refreshTransferInstruments().catch(logger$
|
|
38890
|
+
refreshTransferInstruments().catch(logger$f.error);
|
|
38745
38891
|
onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
|
|
38746
38892
|
};
|
|
38747
38893
|
const render2 = () => {
|
|
@@ -38768,7 +38914,7 @@ function ManageTransferInstrumentComponent({
|
|
|
38768
38914
|
};
|
|
38769
38915
|
return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-manage-transfer-instrument", children: render2() });
|
|
38770
38916
|
}
|
|
38771
|
-
const logger$
|
|
38917
|
+
const logger$e = createLogger("OnboardingDropinComponent");
|
|
38772
38918
|
function OnboardingDropinComponent({
|
|
38773
38919
|
legalEntityId,
|
|
38774
38920
|
openBankingPartnerConfigId
|
|
@@ -38828,13 +38974,13 @@ function OnboardingDropinComponent({
|
|
|
38828
38974
|
setLegalEntity(le);
|
|
38829
38975
|
setProviderStatus(providerStatuses);
|
|
38830
38976
|
} catch (error) {
|
|
38831
|
-
logger$
|
|
38977
|
+
logger$e.error(error);
|
|
38832
38978
|
} finally {
|
|
38833
38979
|
setLoadingStatus("success");
|
|
38834
38980
|
}
|
|
38835
38981
|
}, [legalEntityId, getLegalEntity2, getProviderStatus2]);
|
|
38836
38982
|
useEffect(() => {
|
|
38837
|
-
init2().catch(logger$
|
|
38983
|
+
init2().catch(logger$e.error);
|
|
38838
38984
|
}, [init2]);
|
|
38839
38985
|
return loadingStatus === "loading" || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
|
|
38840
38986
|
DropinComposerComponent,
|
|
@@ -38878,7 +39024,7 @@ function OnboardingDropinComponent({
|
|
|
38878
39024
|
}
|
|
38879
39025
|
);
|
|
38880
39026
|
}
|
|
38881
|
-
const logger$
|
|
39027
|
+
const logger$d = createLogger("SignPCIComponent");
|
|
38882
39028
|
function SignPCIComponent({
|
|
38883
39029
|
legalEntityId,
|
|
38884
39030
|
modalView,
|
|
@@ -38908,7 +39054,7 @@ function SignPCIComponent({
|
|
|
38908
39054
|
onClose == null ? void 0 : onClose();
|
|
38909
39055
|
};
|
|
38910
39056
|
const fetchLegalEntity = useCallback(async () => {
|
|
38911
|
-
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$
|
|
39057
|
+
await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$d.error);
|
|
38912
39058
|
}, [getLegalEntity2, legalEntityId]);
|
|
38913
39059
|
const fetchStatus = useCallback(async () => {
|
|
38914
39060
|
await getPciStatus2(legalEntityId, { additionalSalesChannels }).then(({ signingRequired }) => {
|
|
@@ -38919,7 +39065,7 @@ function SignPCIComponent({
|
|
|
38919
39065
|
await getPciTemplate2(legalEntityId, {
|
|
38920
39066
|
additionalSalesChannels,
|
|
38921
39067
|
language: i18n.locale.substring(0, 2) ?? "en"
|
|
38922
|
-
}).then((res) => setPciTemplate(res)).catch(logger$
|
|
39068
|
+
}).then((res) => setPciTemplate(res)).catch(logger$d.error);
|
|
38923
39069
|
}, [additionalSalesChannels, getPciTemplate2, i18n.locale, legalEntityId]);
|
|
38924
39070
|
useEffect(() => {
|
|
38925
39071
|
(async () => {
|
|
@@ -39438,7 +39584,7 @@ const highExposureParentCompaniesDetailsValidations = {
|
|
|
39438
39584
|
}
|
|
39439
39585
|
]
|
|
39440
39586
|
};
|
|
39441
|
-
const logger$
|
|
39587
|
+
const logger$c = createLogger("LegalFormField");
|
|
39442
39588
|
function LegalFormField({
|
|
39443
39589
|
name = "legalForm",
|
|
39444
39590
|
data,
|
|
@@ -39476,7 +39622,7 @@ function LegalFormField({
|
|
|
39476
39622
|
}));
|
|
39477
39623
|
setLegalForms(legalFormsResponse);
|
|
39478
39624
|
}
|
|
39479
|
-
}).catch(() => logger$
|
|
39625
|
+
}).catch(() => logger$c.error);
|
|
39480
39626
|
}, [countryCode]);
|
|
39481
39627
|
return /* @__PURE__ */ jsx(
|
|
39482
39628
|
Field,
|
|
@@ -39502,7 +39648,7 @@ function LegalFormField({
|
|
|
39502
39648
|
}
|
|
39503
39649
|
);
|
|
39504
39650
|
}
|
|
39505
|
-
const logger$
|
|
39651
|
+
const logger$b = createLogger("NaceCodeField");
|
|
39506
39652
|
function NaceCodeField({
|
|
39507
39653
|
name = "naceCode",
|
|
39508
39654
|
data,
|
|
@@ -39522,7 +39668,7 @@ function NaceCodeField({
|
|
|
39522
39668
|
if (response) {
|
|
39523
39669
|
setNaceCodes(response);
|
|
39524
39670
|
}
|
|
39525
|
-
}).catch(() => logger$
|
|
39671
|
+
}).catch(() => logger$b.error);
|
|
39526
39672
|
}, []);
|
|
39527
39673
|
const handleChangeForNaceCode = (e) => {
|
|
39528
39674
|
var _a;
|
|
@@ -40525,7 +40671,7 @@ const FormEndState = ({
|
|
|
40525
40671
|
);
|
|
40526
40672
|
};
|
|
40527
40673
|
const parseConfiguration = ({ matchingScenario }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
|
|
40528
|
-
const logger$
|
|
40674
|
+
const logger$a = createLogger("UpdateLegalEntityForHighExposure");
|
|
40529
40675
|
const customLabels = {
|
|
40530
40676
|
company: {
|
|
40531
40677
|
legalForm: "businessStructure",
|
|
@@ -40646,7 +40792,7 @@ function UpdateLegalEntityForHighExposure({
|
|
|
40646
40792
|
useEffect(() => {
|
|
40647
40793
|
(async () => {
|
|
40648
40794
|
await fetchLegalEntities();
|
|
40649
|
-
})().catch(logger$
|
|
40795
|
+
})().catch(logger$a.error);
|
|
40650
40796
|
}, [fetchLegalEntities]);
|
|
40651
40797
|
const [data, setData] = useState(dataFromResponse);
|
|
40652
40798
|
const [problems, setProblems] = useState(problemsProp ?? {});
|
|
@@ -41046,7 +41192,7 @@ function getContentByStatus(status) {
|
|
|
41046
41192
|
return contentMap[status];
|
|
41047
41193
|
}
|
|
41048
41194
|
const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
|
|
41049
|
-
const logger$
|
|
41195
|
+
const logger$9 = createLogger("ViewVerificationStatusComponent");
|
|
41050
41196
|
function ViewVerificationStatusComponent({
|
|
41051
41197
|
legalEntityId,
|
|
41052
41198
|
hideExplanation = false,
|
|
@@ -41065,12 +41211,12 @@ function ViewVerificationStatusComponent({
|
|
|
41065
41211
|
if (!onboardingStatus) return;
|
|
41066
41212
|
const statusContent = getContentByStatus(onboardingStatus);
|
|
41067
41213
|
if (statusContent) return statusContent;
|
|
41068
|
-
logger$
|
|
41214
|
+
logger$9.error(`there is no content for status "${onboardingStatus}"`);
|
|
41069
41215
|
}, [onboardingStatus]);
|
|
41070
41216
|
const handleError = useCallback(
|
|
41071
41217
|
(rawError, userMessage) => {
|
|
41072
41218
|
const error = coerceError(rawError);
|
|
41073
|
-
logger$
|
|
41219
|
+
logger$9.error(error);
|
|
41074
41220
|
setAlertContent(userMessage);
|
|
41075
41221
|
onError == null ? void 0 : onError({
|
|
41076
41222
|
error,
|
|
@@ -41104,7 +41250,7 @@ function ViewVerificationStatusComponent({
|
|
|
41104
41250
|
});
|
|
41105
41251
|
useEffect(() => {
|
|
41106
41252
|
setAlertContent(void 0);
|
|
41107
|
-
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$
|
|
41253
|
+
fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$9.error);
|
|
41108
41254
|
}, [fetchOnboardingStatus, updateOnboardingStatus]);
|
|
41109
41255
|
const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
|
|
41110
41256
|
const redirectToAdyen = async () => {
|
|
@@ -41299,7 +41445,7 @@ const getVersionConfiguration = async (context) => {
|
|
|
41299
41445
|
}
|
|
41300
41446
|
});
|
|
41301
41447
|
};
|
|
41302
|
-
const logger$
|
|
41448
|
+
const logger$8 = createLogger("UseVersionConfiguration");
|
|
41303
41449
|
const useVersionConfiguration = async (legalEntityId) => {
|
|
41304
41450
|
var _a, _b;
|
|
41305
41451
|
const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
|
|
@@ -41314,25 +41460,25 @@ const useVersionConfiguration = async (legalEntityId) => {
|
|
|
41314
41460
|
enableVersionExperiment(feature);
|
|
41315
41461
|
});
|
|
41316
41462
|
} catch (e) {
|
|
41317
|
-
logger$
|
|
41463
|
+
logger$8.error("Failed to set version configuration", e);
|
|
41318
41464
|
}
|
|
41319
41465
|
};
|
|
41320
|
-
const logger$
|
|
41466
|
+
const logger$7 = createLogger("loadCountries");
|
|
41321
41467
|
const countriesImports = /* @__PURE__ */ Object.assign({ "./de-DE.json": () => import("./de-DE-Cx8Uim1K.js"), "./el-GR.json": () => import("./el-GR-B7_JR3z5.js"), "./en-US.json": () => import("./en-US-CkdCbOCX.js"), "./es-ES.json": () => import("./es-ES-NBv3HHhn.js"), "./fr-FR.json": () => import("./fr-FR-DdSVMVsp.js"), "./it-IT.json": () => import("./it-IT-Bwdk3zuj.js"), "./ja-JP.json": () => import("./ja-JP-Bsvzm8zu.js"), "./nl-NL.json": () => import("./nl-NL-DofKaNkk.js"), "./pt-PT.json": () => import("./pt-PT-DFEvMD1M.js"), "./ru-RU.json": () => import("./ru-RU-PiM0ZI5h.js"), "./sv-SE.json": () => import("./sv-SE-C0GoLwTg.js"), "./zh-CN.json": () => import("./zh-CN-DJs6Hct-.js"), "./zh-TW.json": () => import("./zh-TW-BWhLbns8.js") });
|
|
41322
41468
|
const loadCountriesDataset = async (locale) => {
|
|
41323
41469
|
const importForLocale = countriesImports[`./${locale}.json`];
|
|
41324
41470
|
if (!importForLocale) {
|
|
41325
|
-
logger$
|
|
41471
|
+
logger$7.warn(`No countries dataset for ${locale}, falling back to en-US`);
|
|
41326
41472
|
return (await import("./en-US-CkdCbOCX.js")).default;
|
|
41327
41473
|
}
|
|
41328
41474
|
return (await importForLocale()).default;
|
|
41329
41475
|
};
|
|
41330
|
-
const logger$
|
|
41476
|
+
const logger$6 = createLogger("loadStates");
|
|
41331
41477
|
const statesImports = /* @__PURE__ */ Object.assign({ "./AU/en-US.json": () => import("./en-US-CQv3D6--.js"), "./BR/en-US.json": () => import("./en-US-eaysbh-g.js"), "./BR/pt-BR.json": () => import("./pt-BR-CNtbeGFJ.js"), "./CA/en-US.json": () => import("./en-US-gM26UC0X.js"), "./NZ/en-US.json": () => import("./en-US-CLmaFLwu.js"), "./US/en-US.json": () => import("./en-US-7uBFgKyC.js") });
|
|
41332
41478
|
const loadStatesDataset = async (country, locale) => {
|
|
41333
41479
|
const importForLocale = statesImports[`./${country}/${locale}.json`];
|
|
41334
41480
|
if (!importForLocale) {
|
|
41335
|
-
logger$
|
|
41481
|
+
logger$6.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
|
|
41336
41482
|
const fallbackImport = statesImports[`./${country}/en-US.json`];
|
|
41337
41483
|
return (await fallbackImport()).default;
|
|
41338
41484
|
}
|
|
@@ -41394,6 +41540,24 @@ const getNaceCodes = async (base) => httpGet({
|
|
|
41394
41540
|
"Content-Type": "application/json"
|
|
41395
41541
|
}
|
|
41396
41542
|
});
|
|
41543
|
+
const getScenarios = async (request, context) => {
|
|
41544
|
+
const { loadingContext, legalEntityId } = context;
|
|
41545
|
+
const { country: countryCode, legalEntityType } = request;
|
|
41546
|
+
const scenarioParams = new URLSearchParams({
|
|
41547
|
+
...countryCode && { countryCode },
|
|
41548
|
+
...legalEntityType && { legalEntityType }
|
|
41549
|
+
});
|
|
41550
|
+
return httpGet({
|
|
41551
|
+
loadingContext,
|
|
41552
|
+
errorLevel: "warn",
|
|
41553
|
+
errorMessage: `Scenarios not available`,
|
|
41554
|
+
path: `${legalEntityId}/configurations/scenarios?${scenarioParams}`,
|
|
41555
|
+
authentication: "jwt",
|
|
41556
|
+
headers: {
|
|
41557
|
+
"Content-Type": "application/json"
|
|
41558
|
+
}
|
|
41559
|
+
});
|
|
41560
|
+
};
|
|
41397
41561
|
const getSupportedCountries = async (context) => {
|
|
41398
41562
|
const { loadingContext, legalEntityId } = context;
|
|
41399
41563
|
return httpGet({
|
|
@@ -41407,6 +41571,19 @@ const getSupportedCountries = async (context) => {
|
|
|
41407
41571
|
}
|
|
41408
41572
|
});
|
|
41409
41573
|
};
|
|
41574
|
+
const getTasks = async (context) => {
|
|
41575
|
+
const { loadingContext, legalEntityId } = context;
|
|
41576
|
+
return httpGet({
|
|
41577
|
+
loadingContext,
|
|
41578
|
+
errorLevel: "warn",
|
|
41579
|
+
errorMessage: `Tasks not available`,
|
|
41580
|
+
path: `${legalEntityId}/configurations/tasks`,
|
|
41581
|
+
authentication: "jwt",
|
|
41582
|
+
headers: {
|
|
41583
|
+
"Content-Type": "application/json"
|
|
41584
|
+
}
|
|
41585
|
+
});
|
|
41586
|
+
};
|
|
41410
41587
|
const validateAccountIdentification$1 = async (context, payoutAccountDetails) => {
|
|
41411
41588
|
const { loadingContext } = context;
|
|
41412
41589
|
return httpPost(
|
|
@@ -41437,7 +41614,7 @@ const validatePhoneNumber$1 = async (context, phoneNumber) => {
|
|
|
41437
41614
|
{ number: phoneNumber }
|
|
41438
41615
|
);
|
|
41439
41616
|
};
|
|
41440
|
-
const logger$
|
|
41617
|
+
const logger$5 = createLogger("verify-id-number");
|
|
41441
41618
|
const verifyIdNumber$1 = async (context, request) => {
|
|
41442
41619
|
const { loadingContext, legalEntityId } = context;
|
|
41443
41620
|
try {
|
|
@@ -41460,13 +41637,13 @@ const verifyIdNumber$1 = async (context, request) => {
|
|
|
41460
41637
|
if (responseData.status === 500) {
|
|
41461
41638
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
41462
41639
|
}
|
|
41463
|
-
return logger$
|
|
41640
|
+
return logger$5.warn(`Unexpected response status ${responseData.status}`);
|
|
41464
41641
|
}
|
|
41465
41642
|
},
|
|
41466
41643
|
request
|
|
41467
41644
|
);
|
|
41468
41645
|
} catch (e) {
|
|
41469
|
-
logger$
|
|
41646
|
+
logger$5.warn("WARNING: idNumber verification failed - error:", e);
|
|
41470
41647
|
}
|
|
41471
41648
|
};
|
|
41472
41649
|
const getEmbeddedApi = ({
|
|
@@ -41565,7 +41742,7 @@ const validatePhoneNumber = async (context, phoneNumber) => {
|
|
|
41565
41742
|
{ number: phoneNumber }
|
|
41566
41743
|
);
|
|
41567
41744
|
};
|
|
41568
|
-
const logger$
|
|
41745
|
+
const logger$4 = createLogger("verify-id-number");
|
|
41569
41746
|
const verifyIdNumber = async (context, request) => {
|
|
41570
41747
|
const { loadingContext, clientKey } = context;
|
|
41571
41748
|
try {
|
|
@@ -41583,7 +41760,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
41583
41760
|
if (responseData.status === 500) {
|
|
41584
41761
|
return { status: 500, message: "Service did not respond, do not block verification" };
|
|
41585
41762
|
}
|
|
41586
|
-
return logger$
|
|
41763
|
+
return logger$4.warn(`Unexpected response status ${responseData.status}`);
|
|
41587
41764
|
},
|
|
41588
41765
|
path: "v1/verification/idNumber",
|
|
41589
41766
|
clientKey
|
|
@@ -41591,7 +41768,7 @@ const verifyIdNumber = async (context, request) => {
|
|
|
41591
41768
|
request
|
|
41592
41769
|
);
|
|
41593
41770
|
} catch (e) {
|
|
41594
|
-
logger$
|
|
41771
|
+
logger$4.warn("WARNING: idNumber verification failed - error:", e);
|
|
41595
41772
|
}
|
|
41596
41773
|
};
|
|
41597
41774
|
const getKycExternalApi = ({
|
|
@@ -41620,7 +41797,7 @@ const ConfigurationApiProvider = ({
|
|
|
41620
41797
|
}) => {
|
|
41621
41798
|
const authContext = useAuthContext();
|
|
41622
41799
|
const { isEmbeddedDropin, loadingContext } = authContext;
|
|
41623
|
-
const sdkVersion = "3.
|
|
41800
|
+
const sdkVersion = "3.35.0";
|
|
41624
41801
|
useAnalytics({
|
|
41625
41802
|
onUserEvent,
|
|
41626
41803
|
legalEntityId: rootLegalEntityId,
|
|
@@ -41651,7 +41828,7 @@ const useAccountHolder = (legalEntityId) => {
|
|
|
41651
41828
|
setAccountHolder: setAccountHolderIntoLocalStorage
|
|
41652
41829
|
};
|
|
41653
41830
|
};
|
|
41654
|
-
const logger$
|
|
41831
|
+
const logger$3 = createLogger("CoreProvider");
|
|
41655
41832
|
const CoreProvider = ({
|
|
41656
41833
|
contextCountry: initialContextCountry,
|
|
41657
41834
|
rootLegalEntityId,
|
|
@@ -41666,7 +41843,7 @@ const CoreProvider = ({
|
|
|
41666
41843
|
const isCountryAllowed = (allowedCountries == null ? void 0 : allowedCountries.includes(contextCountry)) ?? true;
|
|
41667
41844
|
useEffect(() => {
|
|
41668
41845
|
if (allowedCountries && !isCountryAllowed) {
|
|
41669
|
-
logger$
|
|
41846
|
+
logger$3.warn(`
|
|
41670
41847
|
|
|
41671
41848
|
"${contextCountry}" isn't a supported country. Please use one of the following:
|
|
41672
41849
|
- ${listify(
|
|
@@ -41708,12 +41885,12 @@ function ExperimentsContextProvider({
|
|
|
41708
41885
|
);
|
|
41709
41886
|
return /* @__PURE__ */ jsx(ExperimentsContext.Provider, { value: contextValue, children });
|
|
41710
41887
|
}
|
|
41711
|
-
const logger$
|
|
41888
|
+
const logger$2 = createLogger("useAllowedLocales");
|
|
41712
41889
|
const useAllowedLocales = () => {
|
|
41713
41890
|
const { getAllowedLocales: getAllowedLocales2 } = useConfigurationApi();
|
|
41714
41891
|
const [allowedLocales, setAllowedLocales] = useState();
|
|
41715
41892
|
useEffect(() => {
|
|
41716
|
-
getAllowedLocales2().then((response) => setAllowedLocales(response.locales)).catch(logger$
|
|
41893
|
+
getAllowedLocales2().then((response) => setAllowedLocales(response.locales)).catch(logger$2.error);
|
|
41717
41894
|
}, []);
|
|
41718
41895
|
return allowedLocales;
|
|
41719
41896
|
};
|
|
@@ -41725,7 +41902,7 @@ const loadLocale = async (locale) => {
|
|
|
41725
41902
|
}
|
|
41726
41903
|
return (await importForLocale()).default;
|
|
41727
41904
|
};
|
|
41728
|
-
const logger = createLogger("useTranslations");
|
|
41905
|
+
const logger$1 = createLogger("useTranslations");
|
|
41729
41906
|
const useTranslations = ({
|
|
41730
41907
|
locale,
|
|
41731
41908
|
allowedLocales
|
|
@@ -41740,7 +41917,7 @@ const useTranslations = ({
|
|
|
41740
41917
|
const localeToUse = isLocaleAllowed ? locale : FALLBACK_LOCALE;
|
|
41741
41918
|
if (loaded.locale === localeToUse) return;
|
|
41742
41919
|
if (!isLocaleAllowed) {
|
|
41743
|
-
logger.error(
|
|
41920
|
+
logger$1.error(
|
|
41744
41921
|
`
|
|
41745
41922
|
"${locale}" isn't a supported locale. Please use one of the following:
|
|
41746
41923
|
- ${listify(
|
|
@@ -41760,7 +41937,7 @@ const useTranslations = ({
|
|
|
41760
41937
|
translations: dataset,
|
|
41761
41938
|
locale: localeToUse
|
|
41762
41939
|
});
|
|
41763
|
-
}).catch((err) => logger.error("Error while loading translations", err));
|
|
41940
|
+
}).catch((err) => logger$1.error("Error while loading translations", err));
|
|
41764
41941
|
}, [locale, allowedLocales, loaded.locale]);
|
|
41765
41942
|
return loaded;
|
|
41766
41943
|
};
|
|
@@ -42220,25 +42397,57 @@ class BaseElement {
|
|
|
42220
42397
|
}
|
|
42221
42398
|
}
|
|
42222
42399
|
}
|
|
42400
|
+
const logger = createLogger("DebugModal");
|
|
42401
|
+
const getRoleTagVariant = (value) => {
|
|
42402
|
+
switch (value) {
|
|
42403
|
+
case void 0:
|
|
42404
|
+
return "orange";
|
|
42405
|
+
case true:
|
|
42406
|
+
return "green";
|
|
42407
|
+
case false:
|
|
42408
|
+
return "red";
|
|
42409
|
+
default:
|
|
42410
|
+
return "blue";
|
|
42411
|
+
}
|
|
42412
|
+
};
|
|
42413
|
+
const getStatus = (value) => {
|
|
42414
|
+
switch (value) {
|
|
42415
|
+
case void 0:
|
|
42416
|
+
return "undefined";
|
|
42417
|
+
case true:
|
|
42418
|
+
return "Enabled";
|
|
42419
|
+
case false:
|
|
42420
|
+
return "Disabled";
|
|
42421
|
+
default:
|
|
42422
|
+
return String(value);
|
|
42423
|
+
}
|
|
42424
|
+
};
|
|
42223
42425
|
const DebugTable = ({
|
|
42224
42426
|
data,
|
|
42225
42427
|
keyHeading,
|
|
42226
|
-
|
|
42227
|
-
}) =>
|
|
42228
|
-
|
|
42229
|
-
|
|
42230
|
-
|
|
42231
|
-
|
|
42232
|
-
|
|
42233
|
-
|
|
42234
|
-
|
|
42235
|
-
|
|
42236
|
-
]
|
|
42428
|
+
searchTerm
|
|
42429
|
+
}) => {
|
|
42430
|
+
const filteredData = data.filter(([key]) => key.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
42431
|
+
const sortedData = [...filteredData].sort(([keyA], [keyB]) => keyA.localeCompare(keyB));
|
|
42432
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
42433
|
+
/* @__PURE__ */ jsx("h2", { children: keyHeading }),
|
|
42434
|
+
sortedData.length === 0 ? /* @__PURE__ */ jsxs("p", { children: [
|
|
42435
|
+
"No results found for ",
|
|
42436
|
+
/* @__PURE__ */ jsx("strong", { children: searchTerm })
|
|
42437
|
+
] }) : null,
|
|
42438
|
+
/* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children: sortedData.map(([experimentName, value]) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
42439
|
+
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: experimentName }),
|
|
42440
|
+
/* @__PURE__ */ jsx(Tag, { variant: getRoleTagVariant(value), className: "adyen-kyc-tag--large", children: getStatus(value) })
|
|
42441
|
+
] }) }, experimentName)) }) })
|
|
42442
|
+
] });
|
|
42443
|
+
};
|
|
42237
42444
|
const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
42238
42445
|
const { isExperimentEnabled } = useExperimentsContext();
|
|
42239
42446
|
const { getSetting } = useSettingsContext();
|
|
42240
42447
|
const [rootLeData, setRootLeData] = useState();
|
|
42241
42448
|
const [debugInfoCopied, setDebugInfoCopied] = useState(false);
|
|
42449
|
+
const [isRootLeDataEnabled, setIsRootLeDataEnabled] = useState(false);
|
|
42450
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
42242
42451
|
const allExperimentsWithValues = valuesOf(ExperimentNames).map(
|
|
42243
42452
|
(experimentName) => [experimentName, isExperimentEnabled(experimentName)]
|
|
42244
42453
|
);
|
|
@@ -42247,11 +42456,19 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
42247
42456
|
);
|
|
42248
42457
|
const fetchRootLeData = () => {
|
|
42249
42458
|
if (!getRootLegalEntity) return;
|
|
42250
|
-
getRootLegalEntity().then(setRootLeData).catch(
|
|
42459
|
+
getRootLegalEntity().then(setRootLeData).catch(logger.error);
|
|
42460
|
+
};
|
|
42461
|
+
const handleToggleRootLeData = () => {
|
|
42462
|
+
if (!isRootLeDataEnabled) {
|
|
42463
|
+
fetchRootLeData();
|
|
42464
|
+
} else {
|
|
42465
|
+
setRootLeData(void 0);
|
|
42466
|
+
}
|
|
42467
|
+
setIsRootLeDataEnabled(!isRootLeDataEnabled);
|
|
42251
42468
|
};
|
|
42252
42469
|
const copyToClipboard = async () => {
|
|
42253
42470
|
const toCopy = {
|
|
42254
|
-
sdkVersion: "3.
|
|
42471
|
+
sdkVersion: "3.35.0",
|
|
42255
42472
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
42256
42473
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
42257
42474
|
};
|
|
@@ -42265,37 +42482,79 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
|
|
|
42265
42482
|
}, 5e3);
|
|
42266
42483
|
};
|
|
42267
42484
|
const header = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__header", children: [
|
|
42268
|
-
"Debug
|
|
42269
|
-
/* @__PURE__ */ jsx(
|
|
42270
|
-
|
|
42271
|
-
|
|
42272
|
-
|
|
42273
|
-
|
|
42485
|
+
/* @__PURE__ */ jsx("h1", { children: "Debug" }),
|
|
42486
|
+
/* @__PURE__ */ jsx(
|
|
42487
|
+
InputText,
|
|
42488
|
+
{
|
|
42489
|
+
name: "search",
|
|
42490
|
+
value: searchTerm,
|
|
42491
|
+
classNameModifiers: ["search"],
|
|
42492
|
+
onInput: (e) => setSearchTerm(e.target.value),
|
|
42493
|
+
placeholder: "Search for Experiments/Settings 🔎",
|
|
42494
|
+
trimOnBlur: true,
|
|
42495
|
+
spellCheck: false,
|
|
42496
|
+
"aria-label": "Search experiments or settings",
|
|
42497
|
+
"aria-invalid": false
|
|
42498
|
+
}
|
|
42499
|
+
)
|
|
42274
42500
|
] });
|
|
42275
|
-
const footer = /* @__PURE__ */
|
|
42276
|
-
|
|
42277
|
-
|
|
42278
|
-
|
|
42279
|
-
|
|
42280
|
-
|
|
42281
|
-
|
|
42282
|
-
|
|
42283
|
-
|
|
42284
|
-
|
|
42285
|
-
|
|
42501
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__footer", children: [
|
|
42502
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
42503
|
+
/* @__PURE__ */ jsx(
|
|
42504
|
+
Button,
|
|
42505
|
+
{
|
|
42506
|
+
label: "Copy debug info",
|
|
42507
|
+
"aria-label": "Copy debug info",
|
|
42508
|
+
icon: "document",
|
|
42509
|
+
onClick: () => {
|
|
42510
|
+
copyToClipboard().catch((error) => {
|
|
42511
|
+
logger.error("Error copying to clipboard:", error);
|
|
42512
|
+
});
|
|
42513
|
+
}
|
|
42514
|
+
}
|
|
42515
|
+
),
|
|
42516
|
+
debugInfoCopied ? /* @__PURE__ */ jsxs("span", { className: "adyen-kyc-debug-modal__footer--copy-status", children: [
|
|
42517
|
+
/* @__PURE__ */ jsx(Icon, { name: "check" }),
|
|
42518
|
+
" Copied!"
|
|
42519
|
+
] }) : void 0
|
|
42286
42520
|
] }),
|
|
42521
|
+
/* @__PURE__ */ jsx(
|
|
42522
|
+
Button,
|
|
42523
|
+
{
|
|
42524
|
+
icon: isRootLeDataEnabled ? "show" : "hide",
|
|
42525
|
+
iconPosition: "left",
|
|
42526
|
+
"aria-label": isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
|
|
42527
|
+
label: isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
|
|
42528
|
+
onClick: handleToggleRootLeData
|
|
42529
|
+
}
|
|
42530
|
+
)
|
|
42531
|
+
] });
|
|
42532
|
+
return /* @__PURE__ */ jsx(Modal, { size: "fullscreen", header, footer, onClose: onExit, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42533
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
|
|
42534
|
+
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
42535
|
+
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
|
|
42536
|
+
/* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.35.0" })
|
|
42537
|
+
] }) }),
|
|
42538
|
+
/* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
|
|
42539
|
+
/* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
|
|
42540
|
+
/* @__PURE__ */ jsx(Tag, { variant: "blue", className: "adyen-kyc-tag--large", children: rootLegalEntityId })
|
|
42541
|
+
] }) })
|
|
42542
|
+
] }) }) }),
|
|
42287
42543
|
/* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__content", children: [
|
|
42544
|
+
rootLeData ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42545
|
+
/* @__PURE__ */ jsx("h2", { children: "Legal Entity Data" }),
|
|
42546
|
+
/* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLeData, null, 2) })
|
|
42547
|
+
] }) : void 0,
|
|
42288
42548
|
/* @__PURE__ */ jsx(
|
|
42289
42549
|
DebugTable,
|
|
42290
42550
|
{
|
|
42291
42551
|
data: allExperimentsWithValues,
|
|
42292
|
-
keyHeading: "
|
|
42293
|
-
|
|
42552
|
+
keyHeading: "Experiments",
|
|
42553
|
+
searchTerm
|
|
42294
42554
|
}
|
|
42295
42555
|
),
|
|
42296
|
-
/* @__PURE__ */ jsx(DebugTable, { data: allSettingsWithValues, keyHeading: "
|
|
42297
|
-
] })
|
|
42298
|
-
rootLeData ? /* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLeData, null, 2) }) : void 0
|
|
42556
|
+
/* @__PURE__ */ jsx(DebugTable, { data: allSettingsWithValues, keyHeading: "Settings", searchTerm })
|
|
42557
|
+
] })
|
|
42299
42558
|
] }) });
|
|
42300
42559
|
};
|
|
42301
42560
|
const DebugWrapper = ({
|