@adyen/kyc-components 3.6.2 → 3.8.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 +359 -157
- package/dist/style.css +9 -0
- package/dist/types/components/BankVerification/BankVerification.d.ts +1 -1
- package/dist/types/components/BankVerification/types.d.ts +5 -5
- package/dist/types/components/BusinessTypeSelection/utils.d.ts +2 -1
- package/dist/types/components/CompanyBasics/component/CompanyBasicsComponent.d.ts +1 -1
- package/dist/types/components/CompanyBasics/types.d.ts +5 -3
- package/dist/types/components/CompanyLookup/types.d.ts +4 -4
- package/dist/types/components/Individual/types.d.ts +2 -2
- package/dist/types/components/Introduction/constants.d.ts +14 -0
- package/dist/types/components/PayoutDetails/types.d.ts +2 -2
- package/dist/types/components/TaskList/types.d.ts +2 -2
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
- package/dist/types/components/internal/BusinessRegistrationNumberField/types.d.ts +9 -0
- package/dist/types/components/internal/EntityAssociation/types.d.ts +2 -2
- package/dist/types/components/internal/Remove/types.d.ts +3 -3
- package/dist/types/components/internal/TaxInformationField/TaxInformationField.d.ts +1 -1
- package/dist/types/components/internal/TaxInformationField/types.d.ts +7 -0
- package/dist/types/components/internal/VatNumberField/VatNumberField.d.ts +1 -1
- package/dist/types/components/internal/VatNumberField/types.d.ts +4 -0
- package/dist/types/core/Context/ConfigurationApiContext/ConfigurationApiContext.d.ts +1 -1
- package/dist/types/core/Context/ExperimentContext/types.d.ts +2 -1
- package/dist/types/core/Context/ReactQueryContext/ReactQueryClient.d.ts +2 -0
- package/dist/types/core/Context/ReactQueryContext/ReactQueryProvider.d.ts +4 -0
- package/dist/types/core/Context/SettingsContext/types.d.ts +2 -0
- package/dist/types/core/Context/SettingsContext/useSetting.d.ts +1 -1
- package/dist/types/core/Services/componentApi/validate-account-identification.d.ts +4 -0
- package/dist/types/core/Services/kycExternalApi/index.d.ts +1 -1
- package/dist/types/core/Services/kycExternalApi/{account-identification.d.ts → validate-account-identification.d.ts} +1 -1
- package/dist/types/core/hooks/introduction/useHasSeenIntroduction.d.ts +1 -1
- package/dist/types/core/hooks/useCompanySearch/types.d.ts +2 -2
- package/dist/types/core/hooks/useCompanySearchTaskSubmit.d.ts +3 -3
- package/dist/types/core/hooks/useForm/types.d.ts +8 -8
- package/dist/types/core/hooks/useFormComposer.d.ts +2 -2
- package/dist/types/core/hooks/useLeId.d.ts +1 -0
- package/dist/types/core/hooks/useLocalStorage.d.ts +2 -2
- package/dist/types/language/config.d.ts +2 -1254
- package/dist/types/language/types.d.ts +1 -1
- package/dist/types/utils/entity-status-util.d.ts +1 -1
- package/dist/types/utils/useStateFromProp.d.ts +2 -2
- package/package.json +9 -5
- package/dist/types/core/hooks/useBusinessTypeSelection.d.ts +0 -2
|
@@ -2,12 +2,13 @@ import { useContext, useState, useCallback, useEffect, useMemo, useReducer, useR
|
|
|
2
2
|
import { createContext, createElement, render } from "preact";
|
|
3
3
|
import { sanitize } from "isomorphic-dompurify";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1
|
|
5
|
+
import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1 } from "preact/compat";
|
|
6
6
|
import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
|
|
7
7
|
import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
|
|
8
8
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
9
9
|
import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
|
|
10
10
|
import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
|
|
11
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
11
12
|
const ConfigurationApiContext = createContext(void 0);
|
|
12
13
|
const useConfigurationApi = () => {
|
|
13
14
|
const configurationApi = useContext(ConfigurationApiContext);
|
|
@@ -16,6 +17,15 @@ const useConfigurationApi = () => {
|
|
|
16
17
|
}
|
|
17
18
|
return configurationApi;
|
|
18
19
|
};
|
|
20
|
+
const smartling = {
|
|
21
|
+
placeholder_format: "YAML",
|
|
22
|
+
translate_paths: [
|
|
23
|
+
{
|
|
24
|
+
path: "*",
|
|
25
|
+
key: "{*}"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
19
29
|
const close = "Close";
|
|
20
30
|
const individual = "Individual";
|
|
21
31
|
const payoutAccount = "Payout account";
|
|
@@ -621,7 +631,7 @@ const noGlare = "No glare";
|
|
|
621
631
|
const selectDocumentType = "Select document type";
|
|
622
632
|
const registrationDocumentSubTitle = "Upload your company’s business registration document. We need to see this document so we can verify your company.";
|
|
623
633
|
const documentIssuedByGovernmentAuthority = "The document has to be issued by a government authority. It’s usually given when a business is created at the local commercial register";
|
|
624
|
-
const uploadTaxationDocument = "Upload a
|
|
634
|
+
const uploadTaxationDocument = "Upload a tax return or taxation registration document. We need to see this document so we can verify that your tax ID number belongs to your company.";
|
|
625
635
|
const containsNameOfCompany = "Contains the name of your company or organization";
|
|
626
636
|
const documentShowsTaxIdOfCompany = "The document shows the tax ID number of the company";
|
|
627
637
|
const issuedByTheTaxAuthority = "Issued by the tax authority or government of the country where the company is registered";
|
|
@@ -871,14 +881,14 @@ const marketIdentifierCodeMIC = "Market Identifier Code (MIC)";
|
|
|
871
881
|
const isin = "ISIN";
|
|
872
882
|
const companyLookupResultsHeader = "Let's find your company";
|
|
873
883
|
const companyLookupResultsHeader__searching = "Searching for companies...";
|
|
874
|
-
const companyLookupResultsHeader__verifying = "Verifying
|
|
884
|
+
const companyLookupResultsHeader__verifying = "Verifying company selection...";
|
|
875
885
|
const companyLookupResultsHeader__noResults = "We couldn't find your company";
|
|
876
886
|
const companyLookupResultsHeader__results = "Select your company";
|
|
877
887
|
const companyLookupResultsHeader__searchFailure = "Sorry, something went wrong";
|
|
878
888
|
const companyLookupResultsHeaderDescription__noResults = "No problem, let's enter your company details in the next steps.";
|
|
879
|
-
const companyLookupResultsHeaderDescription__results = "
|
|
889
|
+
const companyLookupResultsHeaderDescription__results = "We'll find your official company details to help you get verified faster. If your company isn't in this list, you can always continue by pressing Next.";
|
|
880
890
|
const companyLookupResultsHeaderDescription__searchFailure = "If that doesn't work, press Next to continue.";
|
|
881
|
-
const companyLookupResultsListAlert__title__verified = "Your
|
|
891
|
+
const companyLookupResultsListAlert__title__verified = "Your company details will be pre-filled in the relevant sections.";
|
|
882
892
|
const companyLookupResultsListAlert__title__warning = "This company's TIN doesn't match yours";
|
|
883
893
|
const companyLookupResultsListAlert__title__error = "Sorry, something went wrong. Try again or continue by pressing Next";
|
|
884
894
|
const companyLookupResultsListAlert__description__warning = "Check the TIN you've entered, or select a different company.";
|
|
@@ -889,9 +899,9 @@ const companyStructureFormName = "Company structure";
|
|
|
889
899
|
const companyStructureFormDescription = "What type of company do you have?";
|
|
890
900
|
const companyOtherDetailsFormName = "Other details";
|
|
891
901
|
const companyRegistrationDocumentFormName = "Registration document";
|
|
892
|
-
const companyRegistrationDocumentFormDescription = "Please upload
|
|
902
|
+
const companyRegistrationDocumentFormDescription = "Please upload your companies registration document so we can verify your information.";
|
|
893
903
|
const companyTaxDocumentFormName = "Tax document";
|
|
894
|
-
const companyTaxDocumentFormDescription = "Please upload
|
|
904
|
+
const companyTaxDocumentFormDescription = "Please upload your companies tax documents so we can verify your information.";
|
|
895
905
|
const errorMessage_1_10 = "Information couldn’t be verified";
|
|
896
906
|
const errorMessage_1_11 = "Document didn’t meet requirements";
|
|
897
907
|
const errorMessage_1_12 = "Legal entity declined";
|
|
@@ -1114,6 +1124,7 @@ const errorMessage_2_8064 = "UBO through ownership was missing.";
|
|
|
1114
1124
|
const errorMessage_2_8067 = "Signatory was missing.";
|
|
1115
1125
|
const errorMessage_2_8141 = "Registration document was missing.";
|
|
1116
1126
|
const errorMessage_2_8162 = "proofOfOrganizationTaxInfo was missing.";
|
|
1127
|
+
const errorMessage_2_8183 = "'webAddress' was missing.";
|
|
1117
1128
|
const errorMessage_2_8189 = "UBO through control was missing.";
|
|
1118
1129
|
const errorMessage_2_8193 = "Director was missing.";
|
|
1119
1130
|
const errorMessage_3_10 = "Review of data is required";
|
|
@@ -1159,6 +1170,7 @@ const remediationMessage_1_705 = "Upload an official bank statement";
|
|
|
1159
1170
|
const remediationMessage_2_123 = "You haven't added an owner";
|
|
1160
1171
|
const remediationMessage_2_124 = "You haven't added a signatory";
|
|
1161
1172
|
const remediationMessage_2_151 = "You haven't added a controlling person";
|
|
1173
|
+
const remediationMessage_2_178 = "Add 'webAddress' to business line.";
|
|
1162
1174
|
const remediationMessage_2_185 = "You haven't added your directors";
|
|
1163
1175
|
const remediationMessage_3_100 = "Check the above information, then click here to confirm.";
|
|
1164
1176
|
const sameNameAsLegalName = "Same as legal name of the company";
|
|
@@ -1259,6 +1271,7 @@ const completeAddingAccount = "Complete adding account";
|
|
|
1259
1271
|
const removeThisBankAccount = "Remove this bank account";
|
|
1260
1272
|
const editDetails = "Edit details";
|
|
1261
1273
|
const defaultTrans = {
|
|
1274
|
+
smartling,
|
|
1262
1275
|
close,
|
|
1263
1276
|
individual,
|
|
1264
1277
|
payoutAccount,
|
|
@@ -2365,6 +2378,7 @@ const defaultTrans = {
|
|
|
2365
2378
|
errorMessage_2_8067,
|
|
2366
2379
|
errorMessage_2_8141,
|
|
2367
2380
|
errorMessage_2_8162,
|
|
2381
|
+
errorMessage_2_8183,
|
|
2368
2382
|
errorMessage_2_8189,
|
|
2369
2383
|
errorMessage_2_8193,
|
|
2370
2384
|
errorMessage_3_10,
|
|
@@ -2410,6 +2424,7 @@ const defaultTrans = {
|
|
|
2410
2424
|
remediationMessage_2_123,
|
|
2411
2425
|
remediationMessage_2_124,
|
|
2412
2426
|
remediationMessage_2_151,
|
|
2427
|
+
remediationMessage_2_178,
|
|
2413
2428
|
remediationMessage_2_185,
|
|
2414
2429
|
remediationMessage_3_100,
|
|
2415
2430
|
sameNameAsLegalName,
|
|
@@ -2511,7 +2526,10 @@ const defaultTrans = {
|
|
|
2511
2526
|
editDetails
|
|
2512
2527
|
};
|
|
2513
2528
|
const FALLBACK_LOCALE = "en-US";
|
|
2514
|
-
const defaultTranslation = defaultTrans
|
|
2529
|
+
const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
|
|
2530
|
+
...acc,
|
|
2531
|
+
[translationKey]: translationValue
|
|
2532
|
+
} : acc, {});
|
|
2515
2533
|
const determineAllowedAttributes = (allowedTags) => {
|
|
2516
2534
|
const allowedAttributes = [];
|
|
2517
2535
|
if (allowedTags.includes("a")) {
|
|
@@ -2733,6 +2751,7 @@ var SettingNames = /* @__PURE__ */ ((SettingNames2) => {
|
|
|
2733
2751
|
SettingNames2["AllowIntraRegionCrossBorderPayout"] = "allowIntraRegionCrossBorderPayout";
|
|
2734
2752
|
SettingNames2["AllowLegalEntityTypeChange"] = "changeLegalEntityType";
|
|
2735
2753
|
SettingNames2["AllowPrefilledCountryEdit"] = "editPrefilledCountry";
|
|
2754
|
+
SettingNames2["LimitToOneTransferInstrument"] = "limitToOneTransferInstrument";
|
|
2736
2755
|
SettingNames2["RequirePciSignEcommerce"] = "requirePciSignEcommerce";
|
|
2737
2756
|
SettingNames2["RequirePciSignPos"] = "requirePciSignPos";
|
|
2738
2757
|
SettingNames2["RequirePciSignEcomMoto"] = "requirePciSignEcomMoto";
|
|
@@ -8080,7 +8099,7 @@ function BusinessRegistrationNumber(props) {
|
|
|
8080
8099
|
...formUtils.getMask("registrationNumber")
|
|
8081
8100
|
}), formUtils.isRequiredField("exemptedFromRegistrationNumber") && !showExemptedOption && jsx(Checkbox, {
|
|
8082
8101
|
name: "exemptedFromRegistrationNumber",
|
|
8083
|
-
label: formUtils.getLabel("
|
|
8102
|
+
label: formUtils.getLabel("iDontHaveARegistrationNumber"),
|
|
8084
8103
|
value: "exemptedFromRegistrationNumber",
|
|
8085
8104
|
readonly: formUtils.isReadOnly("exemptedFromRegistrationNumber"),
|
|
8086
8105
|
classNameModifiers: ["exempted-from-registration"],
|
|
@@ -13036,6 +13055,9 @@ const rules$2 = ({
|
|
|
13036
13055
|
if (country2 === "DE" && (companyType2 === CompanyTypesValue.GOVERNMENTAL_ORGANIZATION || companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE)) {
|
|
13037
13056
|
return "REQUIRED";
|
|
13038
13057
|
}
|
|
13058
|
+
if (country2 === "DK" && companyType2 === CompanyTypesValue.NON_PROFIT_OR_CHARITABLE) {
|
|
13059
|
+
return "REQUIRED";
|
|
13060
|
+
}
|
|
13039
13061
|
},
|
|
13040
13062
|
countryRequiresRegistrationNumberForSoleProps: () => {
|
|
13041
13063
|
if (!COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION.includes(country2)) {
|
|
@@ -17785,7 +17807,7 @@ function IndividualComponent(props) {
|
|
|
17785
17807
|
}
|
|
17786
17808
|
const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccountNumberMasked2) => {
|
|
17787
17809
|
const {
|
|
17788
|
-
|
|
17810
|
+
validateAccountIdentification: validateAccountIdentification2
|
|
17789
17811
|
} = useConfigurationApi();
|
|
17790
17812
|
const [accountValidationData, setAccountValidationData] = useState({
|
|
17791
17813
|
invalidFields: [],
|
|
@@ -17794,7 +17816,7 @@ const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccou
|
|
|
17794
17816
|
useEffect(() => {
|
|
17795
17817
|
const fetchAccountDetails = async (accountIdentificationPayload) => {
|
|
17796
17818
|
try {
|
|
17797
|
-
const accountIdentificationResponse = await
|
|
17819
|
+
const accountIdentificationResponse = await validateAccountIdentification2(accountIdentificationPayload);
|
|
17798
17820
|
setAccountValidationData(accountIdentificationResponse);
|
|
17799
17821
|
} catch (error) {
|
|
17800
17822
|
console.error("Error fetching account details:", error);
|
|
@@ -17803,7 +17825,7 @@ const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccou
|
|
|
17803
17825
|
if (payload && !hasEmptyFields2 && !isAccountNumberMasked2) {
|
|
17804
17826
|
fetchAccountDetails(payload);
|
|
17805
17827
|
}
|
|
17806
|
-
}, [
|
|
17828
|
+
}, [validateAccountIdentification2, hasEmptyFields2, payload]);
|
|
17807
17829
|
return accountValidationData;
|
|
17808
17830
|
};
|
|
17809
17831
|
const getLegalEntityNameBasedOnType = (legalEntityResponse) => {
|
|
@@ -22010,7 +22032,7 @@ var EntityType = /* @__PURE__ */ ((EntityType2) => {
|
|
|
22010
22032
|
EntityType2["LEGAL_ENTITY"] = "LegalEntity";
|
|
22011
22033
|
return EntityType2;
|
|
22012
22034
|
})(EntityType || {});
|
|
22013
|
-
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8189"];
|
|
22035
|
+
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189"];
|
|
22014
22036
|
const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
|
|
22015
22037
|
const getComponentMappingFromLEFieldPath = (context, entityType2, isExperimentEnabled) => {
|
|
22016
22038
|
if (!(context == null ? void 0 : context.key)) {
|
|
@@ -23471,12 +23493,20 @@ const legalArrangementItems = [{
|
|
|
23471
23493
|
name: "associationIncorporated",
|
|
23472
23494
|
description: "groupOfPeopleActingTogetherForNonCommercialPurpose"
|
|
23473
23495
|
}];
|
|
23474
|
-
const getLegalArrangementOptions = (country2) => legalArrangementItems.filter((legalArrangementItem) =>
|
|
23475
|
-
|
|
23496
|
+
const getLegalArrangementOptions = (country2, experiments) => legalArrangementItems.filter((legalArrangementItem) => {
|
|
23497
|
+
if (legalArrangementItem.id !== "aTrust" && legalArrangementItem.id !== "partnershipUnincorporated") {
|
|
23498
|
+
return true;
|
|
23499
|
+
}
|
|
23500
|
+
if (legalArrangementItem.id === "partnershipUnincorporated" && (experiments == null ? void 0 : experiments.ShowUnsupportedEntityType)) {
|
|
23501
|
+
return true;
|
|
23502
|
+
}
|
|
23503
|
+
return country2 && TRUST_COUNTRIES.includes(country2);
|
|
23504
|
+
});
|
|
23505
|
+
const getSelectionOptions = (legalEntityResponse, experiments) => {
|
|
23476
23506
|
var _a, _b, _c, _d;
|
|
23477
23507
|
const country2 = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? (_b = (_a = legalEntityResponse.individual) == null ? void 0 : _a.residentialAddress) == null ? void 0 : _b.country : (_d = (_c = legalEntityResponse.organization) == null ? void 0 : _c.registeredAddress) == null ? void 0 : _d.country;
|
|
23478
23508
|
const businessTypeOptions = getBusinessTypeOptions(country2);
|
|
23479
|
-
const legalArrangementOptions = getLegalArrangementOptions(country2);
|
|
23509
|
+
const legalArrangementOptions = getLegalArrangementOptions(country2, experiments);
|
|
23480
23510
|
return {
|
|
23481
23511
|
businessTypeOptions,
|
|
23482
23512
|
legalArrangementOptions
|
|
@@ -24196,30 +24226,19 @@ function useCompanySearch({
|
|
|
24196
24226
|
deepSearch
|
|
24197
24227
|
}) => {
|
|
24198
24228
|
try {
|
|
24199
|
-
if (!
|
|
24229
|
+
if (!deepSearch)
|
|
24200
24230
|
return;
|
|
24201
24231
|
setStatus("loading");
|
|
24202
24232
|
setCompaniesList([]);
|
|
24203
24233
|
const {
|
|
24204
|
-
results:
|
|
24205
|
-
} = await
|
|
24234
|
+
results: deepSearchResults
|
|
24235
|
+
} = await deepSearch({
|
|
24206
24236
|
text: companyName2,
|
|
24207
24237
|
country: companyCountry2,
|
|
24208
24238
|
state: companyState,
|
|
24209
24239
|
limit: resultsLimit
|
|
24210
24240
|
});
|
|
24211
|
-
|
|
24212
|
-
const {
|
|
24213
|
-
results: deepSearchResults
|
|
24214
|
-
} = await deepSearch({
|
|
24215
|
-
text: companyName2,
|
|
24216
|
-
country: companyCountry2,
|
|
24217
|
-
state: companyState,
|
|
24218
|
-
limit: resultsLimit
|
|
24219
|
-
});
|
|
24220
|
-
return setCompaniesList(deepSearchResults);
|
|
24221
|
-
}
|
|
24222
|
-
return setCompaniesList(indexSearchResults);
|
|
24241
|
+
return setCompaniesList(deepSearchResults);
|
|
24223
24242
|
} catch (e) {
|
|
24224
24243
|
setStatus("error");
|
|
24225
24244
|
setError(e);
|
|
@@ -24232,37 +24251,26 @@ function useCompanySearch({
|
|
|
24232
24251
|
return setStatus("idle");
|
|
24233
24252
|
}
|
|
24234
24253
|
try {
|
|
24235
|
-
if (!
|
|
24254
|
+
if (!handleCompanyDeepSearch)
|
|
24236
24255
|
return;
|
|
24237
24256
|
setStatus("loading");
|
|
24238
24257
|
setSelectedCompanyId(void 0);
|
|
24239
24258
|
const {
|
|
24240
|
-
results:
|
|
24241
|
-
} = await
|
|
24259
|
+
results: deepSearchResults
|
|
24260
|
+
} = await handleCompanyDeepSearch({
|
|
24242
24261
|
text: legalCompanyName2,
|
|
24243
24262
|
country: country2,
|
|
24244
24263
|
state: stateOrProvince2,
|
|
24245
24264
|
limit
|
|
24246
24265
|
});
|
|
24247
|
-
|
|
24248
|
-
const {
|
|
24249
|
-
results: deepSearchResults
|
|
24250
|
-
} = await handleCompanyDeepSearch({
|
|
24251
|
-
text: legalCompanyName2,
|
|
24252
|
-
country: country2,
|
|
24253
|
-
state: stateOrProvince2,
|
|
24254
|
-
limit
|
|
24255
|
-
});
|
|
24256
|
-
return setCompaniesList(deepSearchResults);
|
|
24257
|
-
}
|
|
24258
|
-
return setCompaniesList(indexSearchResults);
|
|
24266
|
+
return setCompaniesList(deepSearchResults);
|
|
24259
24267
|
} catch (e) {
|
|
24260
24268
|
setStatus("error");
|
|
24261
24269
|
setError(e);
|
|
24262
24270
|
} finally {
|
|
24263
24271
|
setStatus((prevStatus) => prevStatus !== "error" ? "loaded" : prevStatus);
|
|
24264
24272
|
}
|
|
24265
|
-
}, [
|
|
24273
|
+
}, [handleCompanyDeepSearch, country2, legalCompanyName2, limit, stateOrProvince2]);
|
|
24266
24274
|
const verify2 = useCallback(async (companyTIN, company2) => {
|
|
24267
24275
|
try {
|
|
24268
24276
|
if (!handleVerifyTin || !handleGetCompanyDataset || !handleRefreshCompanyDataset)
|
|
@@ -24813,11 +24821,15 @@ function TaxInformationField({
|
|
|
24813
24821
|
readonly,
|
|
24814
24822
|
handleChangeFor,
|
|
24815
24823
|
country: country2,
|
|
24816
|
-
canExempt
|
|
24824
|
+
canExempt,
|
|
24825
|
+
companyType: companyType2,
|
|
24826
|
+
taxIdNumberType,
|
|
24827
|
+
setTaxIdNumberType
|
|
24817
24828
|
}) {
|
|
24829
|
+
var _a;
|
|
24818
24830
|
const currentCountryTaxInformation = useMemo(() => {
|
|
24819
|
-
var
|
|
24820
|
-
return (
|
|
24831
|
+
var _a2;
|
|
24832
|
+
return (_a2 = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a2.find((taxInfo) => taxInfo.country === country2);
|
|
24821
24833
|
}, [data, country2]);
|
|
24822
24834
|
const handleTaxInformationInput = (value) => {
|
|
24823
24835
|
if (!data.taxInformation) {
|
|
@@ -24872,8 +24884,33 @@ function TaxInformationField({
|
|
|
24872
24884
|
});
|
|
24873
24885
|
return handleChangeFor("taxInformation", "blur")(updatedTaxInformation);
|
|
24874
24886
|
};
|
|
24875
|
-
|
|
24876
|
-
|
|
24887
|
+
const showTaxIdExemptedOption = canExempt && (((_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a.length) ?? 0) > 1;
|
|
24888
|
+
const handleTaxIdNumberTypeChange = (taxIdType) => {
|
|
24889
|
+
if (taxIdType === "exempted") {
|
|
24890
|
+
if (!canExempt) {
|
|
24891
|
+
throw Error(`${country2} does not allow tax exemptions`);
|
|
24892
|
+
}
|
|
24893
|
+
handleChangeFor("exemptedFromTax")(true);
|
|
24894
|
+
setTaxIdNumberType(void 0);
|
|
24895
|
+
return;
|
|
24896
|
+
}
|
|
24897
|
+
if (canExempt && data.exemptedFromTax === true) {
|
|
24898
|
+
handleChangeFor("exemptedFromTax")(false);
|
|
24899
|
+
}
|
|
24900
|
+
setTaxIdNumberType(taxIdType);
|
|
24901
|
+
};
|
|
24902
|
+
return jsxs("div", {
|
|
24903
|
+
className: "adyen-kyc-field__tax-information",
|
|
24904
|
+
children: [jsx(TaxIdNumberTypeSelector, {
|
|
24905
|
+
country: country2,
|
|
24906
|
+
companyType: companyType2,
|
|
24907
|
+
setSelected: handleTaxIdNumberTypeChange,
|
|
24908
|
+
selected: data.exemptedFromTax ? "exempted" : taxIdNumberType,
|
|
24909
|
+
exemptedOption: showTaxIdExemptedOption ? labels2.exemptedFromTax : false
|
|
24910
|
+
}), jsx(MaskedInputText, {
|
|
24911
|
+
"aria-required": true,
|
|
24912
|
+
"aria-label": labels2.taxInformation,
|
|
24913
|
+
"aria-invalid": !valid.taxInformation,
|
|
24877
24914
|
name: "taxInformationNumber",
|
|
24878
24915
|
label: labels2.taxInformation ?? "",
|
|
24879
24916
|
formatGuidance: (guidanceText == null ? void 0 : guidanceText.taxInformation) ?? "",
|
|
@@ -24881,15 +24918,12 @@ function TaxInformationField({
|
|
|
24881
24918
|
errorMessage: errors.taxInformation,
|
|
24882
24919
|
placeholder: placeholders == null ? void 0 : placeholders.taxInformation,
|
|
24883
24920
|
isValid: Boolean(valid.taxInformation),
|
|
24884
|
-
"aria-required": true,
|
|
24885
|
-
"aria-label": labels2.taxInformation,
|
|
24886
|
-
"aria-invalid": !valid.taxInformation,
|
|
24887
24921
|
onInput: handleTaxInformationInput,
|
|
24888
24922
|
onBlur: handleTaxInformationBlur,
|
|
24889
24923
|
disabled: data.exemptedFromTax,
|
|
24890
24924
|
readonly,
|
|
24891
24925
|
...mask
|
|
24892
|
-
}), canExempt && jsx(Checkbox, {
|
|
24926
|
+
}), canExempt && !showTaxIdExemptedOption && jsx(Checkbox, {
|
|
24893
24927
|
"aria-required": false,
|
|
24894
24928
|
"aria-label": labels2.exemptedFromTax,
|
|
24895
24929
|
"aria-invalid": false,
|
|
@@ -24956,13 +24990,14 @@ function CompanyBasics({
|
|
|
24956
24990
|
handleRefreshCompanyDataset,
|
|
24957
24991
|
handleVerifyTin,
|
|
24958
24992
|
country: country2,
|
|
24993
|
+
companyType: companyType2 = CompanyTypesValue.PRIVATE_COMPANY,
|
|
24959
24994
|
isTopLevelEntity,
|
|
24960
24995
|
baseTrackingPayload,
|
|
24961
24996
|
kompanyVerifiedData,
|
|
24962
24997
|
setKompanyAddress,
|
|
24963
24998
|
setKompanyVerifiedData
|
|
24964
24999
|
}) {
|
|
24965
|
-
var _a, _b;
|
|
25000
|
+
var _a, _b, _c, _d, _e;
|
|
24966
25001
|
const {
|
|
24967
25002
|
i18n
|
|
24968
25003
|
} = useI18nContext();
|
|
@@ -24974,6 +25009,9 @@ function CompanyBasics({
|
|
|
24974
25009
|
} = useGlobalDataSlice(COMPANY_BASICS_FORM_ID);
|
|
24975
25010
|
const [loading2, setLoading] = useState$1(false);
|
|
24976
25011
|
const allowedCountries = useAllowedCountries();
|
|
25012
|
+
const existingTaxId = (_b = (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _b.number;
|
|
25013
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
|
|
25014
|
+
const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
|
|
24977
25015
|
const initialFormUtilsProps = useMemo$1(() => ({
|
|
24978
25016
|
labels: labels2,
|
|
24979
25017
|
placeholders,
|
|
@@ -25015,13 +25053,13 @@ function CompanyBasics({
|
|
|
25015
25053
|
};
|
|
25016
25054
|
case "taxInformation":
|
|
25017
25055
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
25018
|
-
taxIdNumberType
|
|
25056
|
+
taxIdNumberType
|
|
25019
25057
|
}, defaultFieldMetadata), acc);
|
|
25020
25058
|
default:
|
|
25021
25059
|
return acc;
|
|
25022
25060
|
}
|
|
25023
25061
|
}, initialFormUtilsProps);
|
|
25024
|
-
}, [country2, initialFormUtilsProps]);
|
|
25062
|
+
}, [country2, initialFormUtilsProps, taxIdNumberType]);
|
|
25025
25063
|
const schema = (requiredFields == null ? void 0 : requiredFields.length) ? requiredFields : ["legalCompanyName", "country"];
|
|
25026
25064
|
const {
|
|
25027
25065
|
schema: formSchema,
|
|
@@ -25043,7 +25081,7 @@ function CompanyBasics({
|
|
|
25043
25081
|
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
25044
25082
|
const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
|
|
25045
25083
|
const hasCompanySearchProvider = formData.country && COUNTRIES_WITH_IN_APP_SEARCH_COMPANY_VERIFICATION.includes(formData.country);
|
|
25046
|
-
const currentCountryTaxIdNumber = (
|
|
25084
|
+
const currentCountryTaxIdNumber = (_e = (_d = formData.taxInformation) == null ? void 0 : _d.find((taxInfo) => taxInfo.country === formData.country)) == null ? void 0 : _e.number;
|
|
25047
25085
|
const disabled = (field) => formUtils.isReadOnly(field) || Boolean(kompanyVerifiedData) || loading2;
|
|
25048
25086
|
useEffect$1(() => {
|
|
25049
25087
|
updateStateSlice({
|
|
@@ -25106,7 +25144,9 @@ function CompanyBasics({
|
|
|
25106
25144
|
data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
|
|
25107
25145
|
valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
|
|
25108
25146
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
|
|
25109
|
-
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD
|
|
25147
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
25148
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
25149
|
+
}),
|
|
25110
25150
|
mask: formUtils.getMask("taxInformation"),
|
|
25111
25151
|
helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
|
|
25112
25152
|
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
@@ -25114,7 +25154,10 @@ function CompanyBasics({
|
|
|
25114
25154
|
handleChangeFor,
|
|
25115
25155
|
canExempt: formUtils.isRequiredField("exemptedFromTax"),
|
|
25116
25156
|
isUen: formUtils.isRequiredField("isUen"),
|
|
25117
|
-
country: formData.country
|
|
25157
|
+
country: formData.country,
|
|
25158
|
+
companyType: companyType2 ?? CompanyTypesValue.PRIVATE_COMPANY,
|
|
25159
|
+
taxIdNumberType,
|
|
25160
|
+
setTaxIdNumberType
|
|
25118
25161
|
})
|
|
25119
25162
|
}), hasCompanySearchProvider && jsx(CompanyLookupComponent, {
|
|
25120
25163
|
defaultData: data,
|
|
@@ -25137,7 +25180,7 @@ function CompanyBasics({
|
|
|
25137
25180
|
})]
|
|
25138
25181
|
});
|
|
25139
25182
|
}
|
|
25140
|
-
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && objectsDeepEqual(prevProps.kompanyVerifiedData, nextProps.kompanyVerifiedData));
|
|
25183
|
+
const CompanyBasicsComponent = memo(CompanyBasics, (prevProps, nextProps) => objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.labels, nextProps.labels) && objectsDeepEqual(prevProps.placeholders, nextProps.placeholders) && objectsDeepEqual(prevProps.helperText, nextProps.helperText) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.heading === nextProps.heading && prevProps.description === nextProps.description && prevProps.readOnly === nextProps.readOnly && prevProps.requiredFields === nextProps.requiredFields && prevProps.obscuredFields === nextProps.obscuredFields && prevProps.optionalFields === nextProps.optionalFields && prevProps.readOnlyFields === nextProps.readOnlyFields && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.companyType === nextProps.companyType && objectsDeepEqual(prevProps.kompanyVerifiedData, nextProps.kompanyVerifiedData));
|
|
25141
25184
|
const BUSINESS_REGISTRATION_NUMBER_FIELD = ["registrationNumber", "exemptedFromRegistrationNumber"];
|
|
25142
25185
|
function BusinessRegistrationNumberField({
|
|
25143
25186
|
data,
|
|
@@ -25148,11 +25191,38 @@ function BusinessRegistrationNumberField({
|
|
|
25148
25191
|
guidanceText,
|
|
25149
25192
|
placeholders,
|
|
25150
25193
|
readonly,
|
|
25194
|
+
handleChangeFor,
|
|
25195
|
+
country: country2,
|
|
25151
25196
|
canExempt,
|
|
25152
|
-
|
|
25197
|
+
companyType: companyType2,
|
|
25198
|
+
registrationNumberOptions,
|
|
25199
|
+
registrationNumberType,
|
|
25200
|
+
setRegistrationNumberType
|
|
25153
25201
|
}) {
|
|
25154
|
-
|
|
25155
|
-
|
|
25202
|
+
const showExemptedOption = canExempt && !!registrationNumberOptions && registrationNumberOptions.length > 1;
|
|
25203
|
+
const handleCompanyRegistrationNumberTypeChange = (regNumberType) => {
|
|
25204
|
+
if (regNumberType === "exempted") {
|
|
25205
|
+
if (!canExempt) {
|
|
25206
|
+
throw Error(`${country2} does not allow tax exemptions`);
|
|
25207
|
+
}
|
|
25208
|
+
handleChangeFor("exemptedFromRegistrationNumber")(true);
|
|
25209
|
+
setRegistrationNumberType(void 0);
|
|
25210
|
+
return;
|
|
25211
|
+
}
|
|
25212
|
+
if (canExempt && data.exemptedFromRegistrationNumber === true) {
|
|
25213
|
+
handleChangeFor("exemptedFromRegistrationNumber")(false);
|
|
25214
|
+
}
|
|
25215
|
+
setRegistrationNumberType(regNumberType);
|
|
25216
|
+
};
|
|
25217
|
+
return jsxs("div", {
|
|
25218
|
+
className: "adyen-kyc-field__business-registration",
|
|
25219
|
+
children: [jsx(CompanyRegistrationNumberTypeSelector, {
|
|
25220
|
+
companyType: companyType2,
|
|
25221
|
+
country: country2,
|
|
25222
|
+
setSelected: handleCompanyRegistrationNumberTypeChange,
|
|
25223
|
+
selected: data.exemptedFromRegistrationNumber ? "exempted" : registrationNumberType,
|
|
25224
|
+
exemptedOption: showExemptedOption ? labels2.exemptedFromRegistrationNumber : false
|
|
25225
|
+
}), jsx(MaskedInputText, {
|
|
25156
25226
|
"aria-required": true,
|
|
25157
25227
|
"aria-label": labels2.registrationNumber,
|
|
25158
25228
|
"aria-invalid": !valid.registrationNumber,
|
|
@@ -25297,13 +25367,38 @@ function VatNumberField({
|
|
|
25297
25367
|
placeholders,
|
|
25298
25368
|
readonly,
|
|
25299
25369
|
handleChangeFor,
|
|
25300
|
-
canExempt
|
|
25370
|
+
canExempt,
|
|
25371
|
+
country: country2,
|
|
25372
|
+
vatNumberType,
|
|
25373
|
+
setVatNumberType
|
|
25301
25374
|
}) {
|
|
25375
|
+
var _a;
|
|
25302
25376
|
const {
|
|
25303
25377
|
i18n
|
|
25304
25378
|
} = useI18nContext();
|
|
25305
|
-
|
|
25306
|
-
|
|
25379
|
+
const showVatExemptedOption = canExempt && ((_a = taxIdNumberOptions[country2]) == null ? void 0 : _a.length) > 1;
|
|
25380
|
+
const handleVatNumberTypeChange = (vatType) => {
|
|
25381
|
+
if (vatType === "exempted") {
|
|
25382
|
+
if (!canExempt) {
|
|
25383
|
+
throw Error(`${country2} does not allow VAT exemptions`);
|
|
25384
|
+
}
|
|
25385
|
+
handleChangeFor("exemptedFromVat")(true);
|
|
25386
|
+
setVatNumberType(void 0);
|
|
25387
|
+
return;
|
|
25388
|
+
}
|
|
25389
|
+
if (canExempt && data.exemptedFromVat === true) {
|
|
25390
|
+
handleChangeFor("exemptedFromVat")(false);
|
|
25391
|
+
}
|
|
25392
|
+
setVatNumberType(vatType);
|
|
25393
|
+
};
|
|
25394
|
+
return jsxs("div", {
|
|
25395
|
+
className: "adyen-kyc-field__vat-number",
|
|
25396
|
+
children: [jsx(TaxIdNumberTypeSelector, {
|
|
25397
|
+
country: country2,
|
|
25398
|
+
setSelected: handleVatNumberTypeChange,
|
|
25399
|
+
selected: data.exemptedFromVat ? "exempted" : vatNumberType,
|
|
25400
|
+
exemptedOption: showVatExemptedOption ? labels2.exemptedFromVat : false
|
|
25401
|
+
}), jsx(MaskedInputText, {
|
|
25307
25402
|
"aria-required": true,
|
|
25308
25403
|
"aria-label": labels2.vatNumber,
|
|
25309
25404
|
"aria-invalid": !valid.vatNumber,
|
|
@@ -25323,7 +25418,7 @@ function VatNumberField({
|
|
|
25323
25418
|
disabled: data.exemptedFromVat,
|
|
25324
25419
|
readonly,
|
|
25325
25420
|
...mask
|
|
25326
|
-
}), canExempt && jsx(Checkbox, {
|
|
25421
|
+
}), canExempt && !showVatExemptedOption && jsx(Checkbox, {
|
|
25327
25422
|
"aria-required": false,
|
|
25328
25423
|
"aria-label": labels2 == null ? void 0 : labels2.exemptedFromVat,
|
|
25329
25424
|
"aria-invalid": false,
|
|
@@ -25380,14 +25475,17 @@ function CompanyOtherDetails({
|
|
|
25380
25475
|
i18n
|
|
25381
25476
|
} = useI18nContext();
|
|
25382
25477
|
const {
|
|
25383
|
-
sliceData,
|
|
25384
25478
|
updateStateSlice
|
|
25385
25479
|
} = useGlobalDataSlice(COMPANY_OTHER_DETAILS_FORM_ID);
|
|
25386
|
-
const
|
|
25387
|
-
const
|
|
25388
|
-
const [
|
|
25480
|
+
const registrationNumberOptions = useMemo$1(() => getCompanyRegistrationNumberOptions(country2, companyType2), [country2, companyType2]);
|
|
25481
|
+
const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
|
|
25482
|
+
const [registrationNumberType, setRegistrationNumberType] = useState$1(defaultRegistrationNumberType);
|
|
25483
|
+
const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
|
|
25484
|
+
const [vatNumberType, setVatNumberType] = useState$1(defaultVatNumberType);
|
|
25485
|
+
const existingTaxId = (_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number;
|
|
25486
|
+
const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
|
|
25487
|
+
const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
|
|
25389
25488
|
const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
|
|
25390
|
-
const schema = useMemo$1(() => !(sliceData == null ? void 0 : sliceData.exemptedFromVat) ? (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatAbsenceReason")) ?? directChildFields : (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatNumber")) ?? directChildFields, [requiredFields, directChildFields, sliceData]);
|
|
25391
25489
|
const initialFormUtilsProps = useMemo$1(() => ({
|
|
25392
25490
|
labels: labels2,
|
|
25393
25491
|
placeholders,
|
|
@@ -25430,27 +25528,26 @@ function CompanyOtherDetails({
|
|
|
25430
25528
|
}, defaultFieldMetadata$8), acc);
|
|
25431
25529
|
case "taxInformation":
|
|
25432
25530
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
25433
|
-
taxIdNumberType
|
|
25531
|
+
taxIdNumberType
|
|
25434
25532
|
}, defaultFieldMetadata), acc);
|
|
25435
25533
|
case "vatNumber":
|
|
25436
25534
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
|
|
25437
|
-
vatNumberType
|
|
25535
|
+
vatNumberType
|
|
25438
25536
|
}, defaultFieldMetadata$6), acc);
|
|
25439
25537
|
default:
|
|
25440
25538
|
return acc;
|
|
25441
25539
|
}
|
|
25442
25540
|
}, initialFormUtilsProps);
|
|
25443
|
-
}, [companyType2, country2, initialFormUtilsProps, registrationNumberType,
|
|
25541
|
+
}, [companyType2, country2, initialFormUtilsProps, registrationNumberType, taxIdNumberType, vatNumberType]);
|
|
25444
25542
|
const {
|
|
25445
25543
|
schema: formSchema,
|
|
25446
25544
|
data: formData,
|
|
25447
25545
|
errors: formErrors,
|
|
25448
25546
|
valid: formValid,
|
|
25449
25547
|
fieldProblems: formFieldProblems,
|
|
25450
|
-
handleChangeFor
|
|
25451
|
-
triggerValidation
|
|
25548
|
+
handleChangeFor
|
|
25452
25549
|
} = useForm({
|
|
25453
|
-
schema,
|
|
25550
|
+
schema: (currentData) => !currentData.exemptedFromVat ? (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatAbsenceReason")) ?? directChildFields : (requiredFields == null ? void 0 : requiredFields.filter((field) => field !== "vatNumber")) ?? directChildFields,
|
|
25454
25551
|
defaultData: data,
|
|
25455
25552
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
25456
25553
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
@@ -25459,14 +25556,6 @@ function CompanyOtherDetails({
|
|
|
25459
25556
|
shouldValidate
|
|
25460
25557
|
});
|
|
25461
25558
|
const formUtils = formUtilities(mergedFieldProps ?? initialFormUtilsProps, i18n);
|
|
25462
|
-
const handleBusinessRegistrationNumberTypeChange = useCallback$1((type) => {
|
|
25463
|
-
setRegistrationNumberType(type);
|
|
25464
|
-
triggerValidation(["registrationNumber"]);
|
|
25465
|
-
}, [triggerValidation]);
|
|
25466
|
-
const handleTaxIdentificationNumberTypeChange = useCallback$1((type) => {
|
|
25467
|
-
setTaxIdentificationNumberType(type);
|
|
25468
|
-
triggerValidation(["vatNumber", "taxInformation"]);
|
|
25469
|
-
}, [triggerValidation]);
|
|
25470
25559
|
useEffect$1(() => {
|
|
25471
25560
|
}, [kompanyVerifiedData]);
|
|
25472
25561
|
useEffect$1(() => {
|
|
@@ -25506,44 +25595,46 @@ function CompanyOtherDetails({
|
|
|
25506
25595
|
handleChangeFor,
|
|
25507
25596
|
legalCompanyName: legalCompanyName2
|
|
25508
25597
|
})
|
|
25509
|
-
}), formUtils.isRequiredField("registrationNumber") && jsx(CompanyRegistrationNumberTypeSelector, {
|
|
25510
|
-
companyType: companyType2,
|
|
25511
|
-
country: country2,
|
|
25512
|
-
setSelected: handleBusinessRegistrationNumberTypeChange,
|
|
25513
|
-
selected: registrationNumberType
|
|
25514
25598
|
}), formUtils.isRequiredField("registrationNumber") && jsx("div", {
|
|
25515
25599
|
className: "adyen-kyc-field-wrapper",
|
|
25516
25600
|
children: jsx(BusinessRegistrationNumberField, {
|
|
25517
25601
|
data: formUtils.getFieldData(formData, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25518
25602
|
valid: formUtils.getFieldValid(formValid, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25519
25603
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25520
|
-
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD
|
|
25604
|
+
labels: formUtils.getFieldLabels(BUSINESS_REGISTRATION_NUMBER_FIELD, {
|
|
25605
|
+
exemptedFromRegistrationNumber: "iDontHaveARegistrationNumber"
|
|
25606
|
+
}),
|
|
25521
25607
|
mask: formUtils.getMask("registrationNumber"),
|
|
25522
25608
|
guidanceText: formUtils.getFieldGuidanceText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25523
25609
|
placeholders: formUtils.getFieldPlaceholders(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25524
25610
|
helperText: formUtils.getFieldHelperText(BUSINESS_REGISTRATION_NUMBER_FIELD),
|
|
25525
25611
|
readonly: formUtils.isReadOnly("registrationNumber"),
|
|
25526
25612
|
handleChangeFor,
|
|
25527
|
-
|
|
25613
|
+
country: country2,
|
|
25614
|
+
canExempt: formUtils.isRequiredField("exemptedFromRegistrationNumber"),
|
|
25615
|
+
companyType: companyType2,
|
|
25616
|
+
registrationNumberOptions,
|
|
25617
|
+
registrationNumberType,
|
|
25618
|
+
setRegistrationNumberType
|
|
25528
25619
|
})
|
|
25529
|
-
}), formUtils.isRequiredField("vatNumber") && jsx(TaxIdNumberTypeSelector, {
|
|
25530
|
-
country: country2,
|
|
25531
|
-
setSelected: handleTaxIdentificationNumberTypeChange,
|
|
25532
|
-
selected: taxIdentificationNumberType
|
|
25533
25620
|
}), formUtils.isRequiredField("vatNumber") && jsx("div", {
|
|
25534
25621
|
className: "adyen-kyc-field-wrapper",
|
|
25535
25622
|
children: jsx(VatNumberField, {
|
|
25536
25623
|
data: formUtils.getFieldData(formData, VAT_NUMBER_FIELD),
|
|
25537
25624
|
valid: formUtils.getFieldValid(formValid, VAT_NUMBER_FIELD),
|
|
25538
25625
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, VAT_NUMBER_FIELD),
|
|
25539
|
-
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD
|
|
25626
|
+
labels: formUtils.getFieldLabels(VAT_NUMBER_FIELD, {
|
|
25627
|
+
exemptedFromVat: "iDontHaveAVatNumber"
|
|
25628
|
+
}),
|
|
25540
25629
|
mask: formUtils.getMask("vatNumber"),
|
|
25541
25630
|
guidanceText: formUtils.getFieldGuidanceText(VAT_NUMBER_FIELD),
|
|
25542
25631
|
placeholders: formUtils.getFieldPlaceholders(VAT_NUMBER_FIELD),
|
|
25543
25632
|
readonly: formUtils.isReadOnly("vatNumber"),
|
|
25544
25633
|
handleChangeFor,
|
|
25545
25634
|
country: country2,
|
|
25546
|
-
canExempt: formUtils.isRequiredField("exemptedFromVat")
|
|
25635
|
+
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
25636
|
+
vatNumberType,
|
|
25637
|
+
setVatNumberType
|
|
25547
25638
|
})
|
|
25548
25639
|
}), formUtils.isRequiredField("taxInformation") && jsx("div", {
|
|
25549
25640
|
className: "adyen-kyc-field-wrapper",
|
|
@@ -25551,7 +25642,9 @@ function CompanyOtherDetails({
|
|
|
25551
25642
|
data: formUtils.getFieldData(formData, TAX_INFORMATION_FIELD),
|
|
25552
25643
|
valid: formUtils.getFieldValid(formValid, TAX_INFORMATION_FIELD),
|
|
25553
25644
|
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, TAX_INFORMATION_FIELD),
|
|
25554
|
-
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD
|
|
25645
|
+
labels: formUtils.getFieldLabels(TAX_INFORMATION_FIELD, {
|
|
25646
|
+
exemptedFromTax: "iDontHaveATaxId"
|
|
25647
|
+
}),
|
|
25555
25648
|
mask: formUtils.getMask("taxInformation"),
|
|
25556
25649
|
helperText: formUtils.getFieldHelperText(TAX_INFORMATION_FIELD),
|
|
25557
25650
|
guidanceText: formUtils.getFieldGuidanceText(TAX_INFORMATION_FIELD),
|
|
@@ -25559,7 +25652,10 @@ function CompanyOtherDetails({
|
|
|
25559
25652
|
handleChangeFor,
|
|
25560
25653
|
country: country2,
|
|
25561
25654
|
canExempt: formUtils.isRequiredField("exemptedFromTax"),
|
|
25562
|
-
isUen: formUtils.isRequiredField("isUen")
|
|
25655
|
+
isUen: formUtils.isRequiredField("isUen"),
|
|
25656
|
+
companyType: companyType2,
|
|
25657
|
+
taxIdNumberType,
|
|
25658
|
+
setTaxIdNumberType
|
|
25563
25659
|
})
|
|
25564
25660
|
}), formUtils.isRequiredField("dateOfIncorporation") && jsx("div", {
|
|
25565
25661
|
className: "adyen-kyc-field-wrapper",
|
|
@@ -25650,11 +25746,16 @@ function CompanyStructure({
|
|
|
25650
25746
|
requiredFields
|
|
25651
25747
|
}, i18n);
|
|
25652
25748
|
const disabled = Boolean((_a = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _a.entityType) || formUtils.isReadOnly("entityType");
|
|
25749
|
+
const prevVerifiedDataRef = useRef(kompanyVerifiedData);
|
|
25653
25750
|
useEffect(() => {
|
|
25654
|
-
var _a2, _b;
|
|
25751
|
+
var _a2, _b, _c, _d, _e;
|
|
25655
25752
|
if ((_a2 = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _a2.entityType) {
|
|
25656
25753
|
handleChangeFor("entityType")((_b = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _b.entityType);
|
|
25657
25754
|
}
|
|
25755
|
+
if (((_d = (_c = prevVerifiedDataRef.current) == null ? void 0 : _c.companyStructure) == null ? void 0 : _d.entityType) && !((_e = kompanyVerifiedData == null ? void 0 : kompanyVerifiedData.companyStructure) == null ? void 0 : _e.entityType)) {
|
|
25756
|
+
handleChangeFor("entityType")(void 0);
|
|
25757
|
+
}
|
|
25758
|
+
prevVerifiedDataRef.current = kompanyVerifiedData;
|
|
25658
25759
|
}, [kompanyVerifiedData]);
|
|
25659
25760
|
useEffect(() => {
|
|
25660
25761
|
updateStateSlice({
|
|
@@ -26167,7 +26268,7 @@ function useCompanySearchTaskSubmit({
|
|
|
26167
26268
|
};
|
|
26168
26269
|
}
|
|
26169
26270
|
function CompanySearchComponent(props) {
|
|
26170
|
-
var _a, _b;
|
|
26271
|
+
var _a, _b, _c;
|
|
26171
26272
|
const {
|
|
26172
26273
|
i18n
|
|
26173
26274
|
} = useI18nContext();
|
|
@@ -26198,6 +26299,7 @@ function CompanySearchComponent(props) {
|
|
|
26198
26299
|
id: forms.companyBasics.formId,
|
|
26199
26300
|
heading: i18n.get(forms.companyBasics.formName),
|
|
26200
26301
|
country: country2,
|
|
26302
|
+
companyType: (_a = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _a.entityType,
|
|
26201
26303
|
isTopLevelEntity,
|
|
26202
26304
|
baseTrackingPayload,
|
|
26203
26305
|
handleCompanyIndexSearch,
|
|
@@ -26240,8 +26342,8 @@ function CompanySearchComponent(props) {
|
|
|
26240
26342
|
id: forms.companyOtherDetails.formId,
|
|
26241
26343
|
heading: i18n.get(forms.companyOtherDetails.formName),
|
|
26242
26344
|
country: country2,
|
|
26243
|
-
legalCompanyName: (
|
|
26244
|
-
companyType: (
|
|
26345
|
+
legalCompanyName: (_b = globalData == null ? void 0 : globalData.companyBasics) == null ? void 0 : _b.legalCompanyName,
|
|
26346
|
+
companyType: (_c = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _c.entityType,
|
|
26245
26347
|
kompanyVerifiedData
|
|
26246
26348
|
})
|
|
26247
26349
|
}), jsx("div", {
|
|
@@ -26599,12 +26701,6 @@ function useAssociatedLegalArrangement({
|
|
|
26599
26701
|
associatedLegalArrangement
|
|
26600
26702
|
};
|
|
26601
26703
|
}
|
|
26602
|
-
const useShouldShowBusinessTypeSelection = (accountHolder2) => {
|
|
26603
|
-
const {
|
|
26604
|
-
isExperimentEnabled
|
|
26605
|
-
} = useExperimentsContext();
|
|
26606
|
-
return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
|
|
26607
|
-
};
|
|
26608
26704
|
const logger$c = createLogger("useExemptSettlor");
|
|
26609
26705
|
const useExemptSettlor = ({
|
|
26610
26706
|
trust: trust2,
|
|
@@ -26623,6 +26719,11 @@ const useExemptSettlor = ({
|
|
|
26623
26719
|
}, [trust2, updateExemptSettlor]);
|
|
26624
26720
|
return exemptSettlor;
|
|
26625
26721
|
};
|
|
26722
|
+
const leIdStorageKey = "LE_ID";
|
|
26723
|
+
const useLeId = () => {
|
|
26724
|
+
const [leIdFromLocalStorage, setLeIdIntoLocalStorage] = useLocalStorage(leIdStorageKey, null);
|
|
26725
|
+
return [leIdFromLocalStorage, setLeIdIntoLocalStorage];
|
|
26726
|
+
};
|
|
26626
26727
|
function useSalesChannelsSettings() {
|
|
26627
26728
|
const {
|
|
26628
26729
|
isSettingEnabled
|
|
@@ -27069,6 +27170,9 @@ const BusinessTypeSelection = ({
|
|
|
27069
27170
|
const {
|
|
27070
27171
|
showToast
|
|
27071
27172
|
} = useToastContext();
|
|
27173
|
+
const {
|
|
27174
|
+
isExperimentEnabled
|
|
27175
|
+
} = useExperimentsContext();
|
|
27072
27176
|
const [loadingStatus, setLoadingStatus] = useState();
|
|
27073
27177
|
const [currentStep, setCurrentStep] = useState(
|
|
27074
27178
|
0
|
|
@@ -27084,14 +27188,14 @@ const BusinessTypeSelection = ({
|
|
|
27084
27188
|
const {
|
|
27085
27189
|
businessTypeOptions,
|
|
27086
27190
|
legalArrangementOptions
|
|
27087
|
-
} = getSelectionOptions(legalEntityResponse
|
|
27191
|
+
} = getSelectionOptions(legalEntityResponse, {
|
|
27192
|
+
ShowUnsupportedEntityType: isExperimentEnabled("ShowUnsupportedEntityType")
|
|
27193
|
+
});
|
|
27088
27194
|
const currentLegalEntityType = legalEntityResponse == null ? void 0 : legalEntityResponse.type;
|
|
27089
27195
|
const currentCompanyTypesValue = (_a = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _a.type;
|
|
27090
27196
|
const defaultBusinessType = getBusinessType(businessTypeOptions, accountHolder2, legalEntityResponse == null ? void 0 : legalEntityResponse.type, (_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type);
|
|
27091
27197
|
const getDefaultLegalArrangementSelection = () => legalArrangementOptions.find((item) => item.id === getDefaultLegalArrangementOrSuborganizationType(legalEntityResponse, accountHolder2));
|
|
27092
27198
|
const defaultLegalArrangementType = getDefaultLegalArrangementSelection();
|
|
27093
|
-
console.log("defaultBusinessType", defaultBusinessType);
|
|
27094
|
-
console.log("defaultLegalArrangementType", defaultLegalArrangementType);
|
|
27095
27199
|
const defaultTrusteeType = legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? trusteeTypeItems[0] : trusteeTypeItems[1];
|
|
27096
27200
|
const {
|
|
27097
27201
|
handleChangeFor,
|
|
@@ -28128,6 +28232,22 @@ const introductionScreensByLegalEntityType = {
|
|
|
28128
28232
|
[LegalEntityType.SOLE_PROPRIETORSHIP]: [IntroductionScreens.PROLOGUE, IntroductionScreens.INDIVIDUAL, IntroductionScreens.SOLE_PROPRIETOR_COMPANY, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE],
|
|
28129
28233
|
[LegalEntityType.TRUST]: [IntroductionScreens.PROLOGUE, IntroductionScreens.COMPANY, IntroductionScreens.INDIVIDUAL, IntroductionScreens.DECISION_MAKER, IntroductionScreens.TRUST, IntroductionScreens.TRUST_MEMBER_OVERVIEW, IntroductionScreens.ACCOUNT, IntroductionScreens.EPILOGUE]
|
|
28130
28234
|
};
|
|
28235
|
+
var IntroductionScreenEvent = /* @__PURE__ */ ((IntroductionScreenEvent2) => {
|
|
28236
|
+
IntroductionScreenEvent2["EMPTY"] = "Introduction_Empty";
|
|
28237
|
+
IntroductionScreenEvent2["START_FLOW"] = "Introduction_StartFlow";
|
|
28238
|
+
IntroductionScreenEvent2["START_SCREEN"] = "Introduction_StartScreen";
|
|
28239
|
+
IntroductionScreenEvent2["STOP_SCREEN"] = "Introduction_StopScreen";
|
|
28240
|
+
IntroductionScreenEvent2["STOP_FLOW"] = "Introduction_StopFlow";
|
|
28241
|
+
IntroductionScreenEvent2["NEXT"] = "Introduction_Next";
|
|
28242
|
+
IntroductionScreenEvent2["BACK"] = "Introduction_Back";
|
|
28243
|
+
IntroductionScreenEvent2["SKIP"] = "Introduction_Skip";
|
|
28244
|
+
return IntroductionScreenEvent2;
|
|
28245
|
+
})(IntroductionScreenEvent || {});
|
|
28246
|
+
var IntroductionScreenTiming = /* @__PURE__ */ ((IntroductionScreenTiming2) => {
|
|
28247
|
+
IntroductionScreenTiming2["VIEW_FLOW"] = "Introduction_ViewFlow";
|
|
28248
|
+
IntroductionScreenTiming2["VIEW_SCREEN"] = "Introduction_ViewScreen";
|
|
28249
|
+
return IntroductionScreenTiming2;
|
|
28250
|
+
})(IntroductionScreenTiming || {});
|
|
28131
28251
|
const useIntroductionScreens = ({
|
|
28132
28252
|
legalEntity,
|
|
28133
28253
|
tasks
|
|
@@ -28249,10 +28369,30 @@ const Introduction = ({
|
|
|
28249
28369
|
tasks
|
|
28250
28370
|
});
|
|
28251
28371
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
28372
|
+
const eventSegmentationDefaults = getBaseTrackingPayload({
|
|
28373
|
+
trackingConfig: {
|
|
28374
|
+
topLevelLegalEntity: legalEntity
|
|
28375
|
+
},
|
|
28376
|
+
legalEntity,
|
|
28377
|
+
task: TaskTypes.INTRODUCTION
|
|
28378
|
+
});
|
|
28379
|
+
const eventDetails = {
|
|
28380
|
+
segmentation: {
|
|
28381
|
+
...eventSegmentationDefaults,
|
|
28382
|
+
page: (introductionScreens == null ? void 0 : introductionScreens.length) ? introductionScreens[activeIndex] : null
|
|
28383
|
+
}
|
|
28384
|
+
};
|
|
28252
28385
|
useEffect(() => {
|
|
28253
|
-
if (!(introductionScreens == null ? void 0 : introductionScreens.length))
|
|
28386
|
+
if (!(introductionScreens == null ? void 0 : introductionScreens.length)) {
|
|
28387
|
+
userEvents.addEvent(IntroductionScreenEvent.EMPTY, {
|
|
28388
|
+
segmentation: eventSegmentationDefaults
|
|
28389
|
+
});
|
|
28254
28390
|
onExitIntroduction();
|
|
28255
|
-
|
|
28391
|
+
} else {
|
|
28392
|
+
userEvents.startEvent(IntroductionScreenTiming.VIEW_FLOW);
|
|
28393
|
+
userEvents.addEvent(IntroductionScreenEvent.START_FLOW, eventDetails);
|
|
28394
|
+
}
|
|
28395
|
+
}, [introductionScreens]);
|
|
28256
28396
|
return (introductionScreens == null ? void 0 : introductionScreens.length) ? jsxs("div", {
|
|
28257
28397
|
className: "adyen-kyc-introduction",
|
|
28258
28398
|
children: [jsx(StepProgressIndicator, {
|
|
@@ -28262,7 +28402,10 @@ const Introduction = ({
|
|
|
28262
28402
|
className: "adyen-kyc-introduction__skip",
|
|
28263
28403
|
children: jsx(Button, {
|
|
28264
28404
|
label: i18n.get("goToOverviewFromIntroduction"),
|
|
28265
|
-
onClick: () =>
|
|
28405
|
+
onClick: () => {
|
|
28406
|
+
userEvents.addEvent(IntroductionScreenEvent.SKIP, eventDetails);
|
|
28407
|
+
onExitIntroduction();
|
|
28408
|
+
},
|
|
28266
28409
|
showAsLink: true,
|
|
28267
28410
|
type: "button"
|
|
28268
28411
|
})
|
|
@@ -28276,16 +28419,36 @@ const Introduction = ({
|
|
|
28276
28419
|
children: [jsx(Button, {
|
|
28277
28420
|
disabled: activeIndex === 0,
|
|
28278
28421
|
label: "Back",
|
|
28279
|
-
onClick: () =>
|
|
28422
|
+
onClick: () => {
|
|
28423
|
+
userEvents.addEvent(IntroductionScreenEvent.BACK, eventDetails);
|
|
28424
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
|
|
28425
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
|
|
28426
|
+
setActiveIndex((currentValue) => currentValue - 1);
|
|
28427
|
+
userEvents.startEvent(IntroductionScreenTiming.VIEW_SCREEN);
|
|
28428
|
+
userEvents.addEvent(IntroductionScreenEvent.START_SCREEN, eventDetails);
|
|
28429
|
+
},
|
|
28280
28430
|
secondary: true,
|
|
28281
28431
|
type: "button"
|
|
28282
28432
|
}), activeIndex + 1 === introductionScreens.length ? jsx(Button, {
|
|
28283
28433
|
label: "Start",
|
|
28284
|
-
onClick: () =>
|
|
28434
|
+
onClick: () => {
|
|
28435
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
|
|
28436
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_FLOW, eventDetails);
|
|
28437
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
|
|
28438
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_FLOW, eventDetails);
|
|
28439
|
+
onExitIntroduction();
|
|
28440
|
+
},
|
|
28285
28441
|
type: "button"
|
|
28286
28442
|
}) : jsx(Button, {
|
|
28287
28443
|
label: "Next",
|
|
28288
|
-
onClick: () =>
|
|
28444
|
+
onClick: () => {
|
|
28445
|
+
userEvents.addEvent(IntroductionScreenEvent.NEXT, eventDetails);
|
|
28446
|
+
userEvents.addEvent(IntroductionScreenEvent.STOP_SCREEN, eventDetails);
|
|
28447
|
+
userEvents.endEvent(IntroductionScreenTiming.VIEW_SCREEN, eventDetails);
|
|
28448
|
+
setActiveIndex((currentValue) => currentValue + 1);
|
|
28449
|
+
userEvents.startEvent(IntroductionScreenTiming.VIEW_SCREEN);
|
|
28450
|
+
userEvents.addEvent(IntroductionScreenEvent.START_SCREEN, eventDetails);
|
|
28451
|
+
},
|
|
28289
28452
|
type: "button"
|
|
28290
28453
|
})]
|
|
28291
28454
|
})]
|
|
@@ -28647,6 +28810,7 @@ function TaskListComponent({
|
|
|
28647
28810
|
const {
|
|
28648
28811
|
isExperimentEnabled
|
|
28649
28812
|
} = useExperimentsContext();
|
|
28813
|
+
const limitToOneTransferInstrument = useSetting("limitToOneTransferInstrument");
|
|
28650
28814
|
const isEnableNewEntryFlowEnabled = useEnableNewEntryFlow();
|
|
28651
28815
|
const canSeeIntroduction = useCanSeeIntroduction({
|
|
28652
28816
|
legalEntity: legalEntityResponse
|
|
@@ -28794,7 +28958,7 @@ function TaskListComponent({
|
|
|
28794
28958
|
capabilityProblems,
|
|
28795
28959
|
onNavigateToTask: () => handleOnNavigateToTaskPayout(transferInstrument.id),
|
|
28796
28960
|
onTransferInstrumentDelete: () => onTransferInstrumentDelete(transferInstrument.id)
|
|
28797
|
-
}, transferInstrument.id)), jsxs(Card, {
|
|
28961
|
+
}, transferInstrument.id)), !limitToOneTransferInstrument || transferInstruments.length < 1 ? jsxs(Card, {
|
|
28798
28962
|
stateful: true,
|
|
28799
28963
|
onClick: () => handleOnNavigateToTaskPayout(),
|
|
28800
28964
|
className: "adyen-task adl-add-payout",
|
|
@@ -28805,7 +28969,7 @@ function TaskListComponent({
|
|
|
28805
28969
|
}), jsx("span", {
|
|
28806
28970
|
children: isEnableNewEntryFlowEnabled ? i18n.get("addExtraBankAccount") : i18n.get(hasPayinTaskNotPayout ? "addExtraPayinAccount" : "addExtraPayoutAccount")
|
|
28807
28971
|
})]
|
|
28808
|
-
})]
|
|
28972
|
+
}) : null]
|
|
28809
28973
|
}) : jsx(TaskListItem, {
|
|
28810
28974
|
onNavigateToTask: () => handleOnNavigateToTaskPayout(),
|
|
28811
28975
|
icon: "payout",
|
|
@@ -31989,7 +32153,8 @@ function DropinComposerComponent({
|
|
|
31989
32153
|
showToast
|
|
31990
32154
|
} = useToastContext();
|
|
31991
32155
|
const [isLoadingConfiguration, setIsLoadingConfiguration] = useState(false);
|
|
31992
|
-
const
|
|
32156
|
+
const isNewEntryFlowEnabled = isExperimentEnabled("EnableNewEntryFlow");
|
|
32157
|
+
const [leId, setLeId] = useLeId();
|
|
31993
32158
|
const showIntroduction = useShouldShowIntroduction({
|
|
31994
32159
|
legalEntity: legalEntityResponse
|
|
31995
32160
|
});
|
|
@@ -32000,12 +32165,13 @@ function DropinComposerComponent({
|
|
|
32000
32165
|
});
|
|
32001
32166
|
const [tasks, setTasks] = useState([]);
|
|
32002
32167
|
const initialTask = useMemo(() => {
|
|
32003
|
-
if (
|
|
32168
|
+
if (isNewEntryFlowEnabled && (!accountHolder2 || legalEntityResponse.id !== leId)) {
|
|
32004
32169
|
return TaskTypes.BUSINESS_TYPE_SELECTION;
|
|
32170
|
+
}
|
|
32005
32171
|
if (showIntroduction)
|
|
32006
32172
|
return TaskTypes.INTRODUCTION;
|
|
32007
32173
|
return TaskTypes.TASKS_OVERVIEW;
|
|
32008
|
-
}, [
|
|
32174
|
+
}, [showIntroduction, isNewEntryFlowEnabled, accountHolder2, legalEntityResponse, leId]);
|
|
32009
32175
|
const [taskHistory, setTaskHistory] = useState([initialTask]);
|
|
32010
32176
|
const [rootLegalEntity, setRootLegalEntity] = useState(legalEntityResponse);
|
|
32011
32177
|
const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
|
|
@@ -32529,6 +32695,12 @@ function DropinComposerComponent({
|
|
|
32529
32695
|
clearInterval(timeoutId);
|
|
32530
32696
|
};
|
|
32531
32697
|
}, [refreshLegalEntity, rootLegalEntity, taskHistory]);
|
|
32698
|
+
useEffect(() => {
|
|
32699
|
+
if (!isNewEntryFlowEnabled || leId !== legalEntityResponse.id) {
|
|
32700
|
+
setLeId(null);
|
|
32701
|
+
setAccountHolder(null);
|
|
32702
|
+
}
|
|
32703
|
+
}, [isNewEntryFlowEnabled, setLeId]);
|
|
32532
32704
|
if (isLoadingConfiguration) {
|
|
32533
32705
|
return jsx(Shimmer, {});
|
|
32534
32706
|
}
|
|
@@ -32542,6 +32714,7 @@ function DropinComposerComponent({
|
|
|
32542
32714
|
legalEntityResponse: rootLegalEntity,
|
|
32543
32715
|
accountHolder: accountHolder2,
|
|
32544
32716
|
onAccountHolderSelect: async (newAccountHolder) => {
|
|
32717
|
+
setLeId(legalEntityResponse.id);
|
|
32545
32718
|
setAccountHolder(newAccountHolder);
|
|
32546
32719
|
await refreshLegalEntity();
|
|
32547
32720
|
onNavigateTo(showIntroduction ? TaskTypes.INTRODUCTION : TaskTypes.TASKS_OVERVIEW);
|
|
@@ -34123,17 +34296,32 @@ const getSupportedCountries = async (context) => {
|
|
|
34123
34296
|
}
|
|
34124
34297
|
});
|
|
34125
34298
|
};
|
|
34126
|
-
const
|
|
34299
|
+
const validateAccountIdentification$1 = async (context, payoutAccountDetails) => {
|
|
34127
34300
|
const {
|
|
34301
|
+
loadingContext
|
|
34302
|
+
} = context;
|
|
34303
|
+
return httpPost({
|
|
34128
34304
|
loadingContext,
|
|
34129
|
-
|
|
34305
|
+
authentication: "jwt",
|
|
34306
|
+
errorLevel: "warn",
|
|
34307
|
+
errorMessage: "Account Identification is not available",
|
|
34308
|
+
path: `validations/accountidentification`
|
|
34309
|
+
}, {
|
|
34310
|
+
accountIdentification: {
|
|
34311
|
+
...payoutAccountDetails
|
|
34312
|
+
}
|
|
34313
|
+
});
|
|
34314
|
+
};
|
|
34315
|
+
const validatePhoneNumber$1 = async (context, phoneNumber2) => {
|
|
34316
|
+
const {
|
|
34317
|
+
loadingContext
|
|
34130
34318
|
} = context;
|
|
34131
34319
|
return httpPost({
|
|
34132
34320
|
loadingContext,
|
|
34133
34321
|
authentication: "jwt",
|
|
34134
34322
|
errorLevel: "warn",
|
|
34135
34323
|
errorMessage: "Phone validation is not available",
|
|
34136
|
-
path:
|
|
34324
|
+
path: `validations/phonenumber`
|
|
34137
34325
|
}, {
|
|
34138
34326
|
number: phoneNumber2
|
|
34139
34327
|
});
|
|
@@ -34188,9 +34376,6 @@ const getEmbeddedApi = ({
|
|
|
34188
34376
|
legalEntityId: rootLegalEntityId
|
|
34189
34377
|
};
|
|
34190
34378
|
return {
|
|
34191
|
-
accountIdentification: () => {
|
|
34192
|
-
throw new Error("accountIdentification: Not implemented in onboarding component api");
|
|
34193
|
-
},
|
|
34194
34379
|
getConfiguration: async ({
|
|
34195
34380
|
legalEntityType
|
|
34196
34381
|
}) => {
|
|
@@ -34210,27 +34395,15 @@ const getEmbeddedApi = ({
|
|
|
34210
34395
|
getImageUrl: () => `${base}static/images/`,
|
|
34211
34396
|
getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
|
|
34212
34397
|
getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
|
|
34213
|
-
|
|
34398
|
+
validateAccountIdentification: async (accountIdentificationDetails) => validateAccountIdentification$1({
|
|
34399
|
+
loadingContext
|
|
34400
|
+
}, accountIdentificationDetails),
|
|
34401
|
+
validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1({
|
|
34402
|
+
loadingContext
|
|
34403
|
+
}, phoneNumber2),
|
|
34214
34404
|
verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request)
|
|
34215
34405
|
};
|
|
34216
34406
|
};
|
|
34217
|
-
const accountIdentification = async (context, payoutAccountDetails) => {
|
|
34218
|
-
const {
|
|
34219
|
-
loadingContext,
|
|
34220
|
-
clientKey
|
|
34221
|
-
} = context;
|
|
34222
|
-
return httpPost({
|
|
34223
|
-
loadingContext,
|
|
34224
|
-
clientKey,
|
|
34225
|
-
errorLevel: "warn",
|
|
34226
|
-
errorMessage: "Account Identification is not available",
|
|
34227
|
-
path: "v1/validations/accountidentification"
|
|
34228
|
-
}, {
|
|
34229
|
-
accountIdentification: {
|
|
34230
|
-
...payoutAccountDetails
|
|
34231
|
-
}
|
|
34232
|
-
});
|
|
34233
|
-
};
|
|
34234
34407
|
const getAllowedCountries = async (context) => {
|
|
34235
34408
|
const {
|
|
34236
34409
|
loadingContext,
|
|
@@ -34294,6 +34467,23 @@ const getDataset = async (context, name, locale) => {
|
|
|
34294
34467
|
return datasetResponse;
|
|
34295
34468
|
});
|
|
34296
34469
|
};
|
|
34470
|
+
const validateAccountIdentification = async (context, payoutAccountDetails) => {
|
|
34471
|
+
const {
|
|
34472
|
+
loadingContext,
|
|
34473
|
+
clientKey
|
|
34474
|
+
} = context;
|
|
34475
|
+
return httpPost({
|
|
34476
|
+
loadingContext,
|
|
34477
|
+
clientKey,
|
|
34478
|
+
errorLevel: "warn",
|
|
34479
|
+
errorMessage: "Account Identification is not available",
|
|
34480
|
+
path: "v1/validations/accountidentification"
|
|
34481
|
+
}, {
|
|
34482
|
+
accountIdentification: {
|
|
34483
|
+
...payoutAccountDetails
|
|
34484
|
+
}
|
|
34485
|
+
});
|
|
34486
|
+
};
|
|
34297
34487
|
const validatePhoneNumber = async (context, phoneNumber2) => {
|
|
34298
34488
|
const {
|
|
34299
34489
|
loadingContext,
|
|
@@ -34349,7 +34539,7 @@ const getKycExternalApi = ({
|
|
|
34349
34539
|
loadingContext,
|
|
34350
34540
|
clientKey
|
|
34351
34541
|
}) => ({
|
|
34352
|
-
|
|
34542
|
+
validateAccountIdentification: async (accountIdentificationDetails) => validateAccountIdentification({
|
|
34353
34543
|
loadingContext,
|
|
34354
34544
|
clientKey
|
|
34355
34545
|
}, accountIdentificationDetails),
|
|
@@ -34522,6 +34712,15 @@ const I18nProvider = ({
|
|
|
34522
34712
|
children
|
|
34523
34713
|
});
|
|
34524
34714
|
};
|
|
34715
|
+
const ReactQueryClient = new QueryClient();
|
|
34716
|
+
function ReactQueryProvider({
|
|
34717
|
+
children
|
|
34718
|
+
}) {
|
|
34719
|
+
return jsx(QueryClientProvider, {
|
|
34720
|
+
client: ReactQueryClient,
|
|
34721
|
+
children
|
|
34722
|
+
});
|
|
34723
|
+
}
|
|
34525
34724
|
const settingsDefaults = {
|
|
34526
34725
|
acceptedCountries: void 0,
|
|
34527
34726
|
allowBankAccountFormatSelection: false,
|
|
@@ -34536,7 +34735,8 @@ const settingsDefaults = {
|
|
|
34536
34735
|
hideOnboardingIntroductionOrganization: true,
|
|
34537
34736
|
hideOnboardingIntroductionTrust: true,
|
|
34538
34737
|
hideOnboardingIntroductionSoleProprietor: true,
|
|
34539
|
-
viewOnboardingGuidance: false
|
|
34738
|
+
viewOnboardingGuidance: false,
|
|
34739
|
+
limitToOneTransferInstrument: false
|
|
34540
34740
|
};
|
|
34541
34741
|
function SettingsProvider({
|
|
34542
34742
|
children,
|
|
@@ -34873,9 +35073,11 @@ class UIElement extends BaseElement {
|
|
|
34873
35073
|
children: jsx(AutoResizer, {
|
|
34874
35074
|
children: jsx(ToastContextProvider, {
|
|
34875
35075
|
children: jsx(StateProvider, {
|
|
34876
|
-
children: jsx(
|
|
34877
|
-
|
|
34878
|
-
|
|
35076
|
+
children: jsx(ReactQueryProvider, {
|
|
35077
|
+
children: jsx(Component, {
|
|
35078
|
+
...this.props.componentProps,
|
|
35079
|
+
eventEmitter: this.eventEmitter
|
|
35080
|
+
})
|
|
34879
35081
|
})
|
|
34880
35082
|
})
|
|
34881
35083
|
})
|