@adyen/kyc-components 2.26.0 → 2.26.2
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 +76 -44
- package/dist/types/components/CompanyBasics/types.d.ts +2 -0
- package/dist/types/components/CompanySearch/types.d.ts +2 -0
- package/dist/types/components/CompanyStructure/types.d.ts +1 -1
- package/dist/types/components/Dropins/CompanySearchDropin/components/CompanySearchDropinComponent.d.ts +1 -1
- package/dist/types/components/internal/IdFieldTypeSelector/inferCompanyRegistrationNumberType.d.ts +12 -0
- package/dist/types/core/models/api/capability.d.ts +33 -25
- package/dist/types/core/models/api/legal-entity.d.ts +2 -2
- package/dist/types/utils/mapping/companySearch/mapLegalEntityToCompanySearchSchema.d.ts +1 -1
- package/package.json +1 -1
|
@@ -7918,6 +7918,24 @@ function CompanyRegistrationNumberTypeSelector({
|
|
|
7918
7918
|
})
|
|
7919
7919
|
});
|
|
7920
7920
|
}
|
|
7921
|
+
const inferCompanyRegistrationNumberType = (registrationNumber2, country2, companyType2) => {
|
|
7922
|
+
const optionsForCountry = companyRegistrationNumberOptions[country2];
|
|
7923
|
+
const metadataFn = defaultFieldConfig[country2];
|
|
7924
|
+
if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function")
|
|
7925
|
+
return void 0;
|
|
7926
|
+
for (const option of optionsForCountry) {
|
|
7927
|
+
const fieldMetadata = metadataFn({
|
|
7928
|
+
companyType: companyType2,
|
|
7929
|
+
registrationNumberType: option.id
|
|
7930
|
+
});
|
|
7931
|
+
if (!fieldMetadata.validators)
|
|
7932
|
+
continue;
|
|
7933
|
+
const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
|
|
7934
|
+
if (validators.every((validator) => validator.validate(registrationNumber2))) {
|
|
7935
|
+
return option.id;
|
|
7936
|
+
}
|
|
7937
|
+
}
|
|
7938
|
+
};
|
|
7921
7939
|
function TaxIdNumberTypeSelector({
|
|
7922
7940
|
country: country2,
|
|
7923
7941
|
selected,
|
|
@@ -8934,14 +8952,14 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
|
|
|
8934
8952
|
}];
|
|
8935
8953
|
const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
|
|
8936
8954
|
function CompanyRegistrationDetailsComponent(props) {
|
|
8937
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
8955
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
8938
8956
|
const {
|
|
8939
8957
|
i18n
|
|
8940
8958
|
} = useI18nContext();
|
|
8941
8959
|
const {
|
|
8942
8960
|
isExperimentEnabled
|
|
8943
8961
|
} = useExperimentsContext();
|
|
8944
|
-
const
|
|
8962
|
+
const isTypeSelectorEnabled = isExperimentEnabled(ExperimentNames.EnableIdentityFieldTypeSelector);
|
|
8945
8963
|
const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === props.country && f.companyType.includes(props.companyType));
|
|
8946
8964
|
const stateRef = useRef({
|
|
8947
8965
|
setState: null
|
|
@@ -8974,8 +8992,8 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
8974
8992
|
rules: companyRegistrationDetailsValidationRules,
|
|
8975
8993
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
8976
8994
|
});
|
|
8977
|
-
const defaultRegistrationNumberType =
|
|
8978
|
-
const defaultVatNumberType = ((
|
|
8995
|
+
const defaultRegistrationNumberType = props.data.registrationNumber ? inferCompanyRegistrationNumberType(props.data.registrationNumber, props.country, props.companyType) : (_e = companyRegistrationNumberOptions[companyCountry2]) == null ? void 0 : _e[0].id;
|
|
8996
|
+
const defaultVatNumberType = ((_f = taxIdNumberOptions[companyCountry2]) == null ? void 0 : _f[0].id) ?? ((_g = props.labels) == null ? void 0 : _g.vatNumber);
|
|
8979
8997
|
const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
|
|
8980
8998
|
const [vatNumberType, setVatNumberType] = useState(defaultVatNumberType);
|
|
8981
8999
|
useEffect(() => {
|
|
@@ -9143,7 +9161,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
9143
9161
|
"aria-label": formUtils.getLabel("stockISIN"),
|
|
9144
9162
|
"aria-invalid": !valid.stockISIN
|
|
9145
9163
|
})
|
|
9146
|
-
}),
|
|
9164
|
+
}), isTypeSelectorEnabled && formUtils.isRequiredField("registrationNumber") && jsx(CompanyRegistrationNumberTypeSelector, {
|
|
9147
9165
|
companyType: props.companyType,
|
|
9148
9166
|
country: props.country,
|
|
9149
9167
|
setSelected: setRegistrationNumberType,
|
|
@@ -9155,7 +9173,7 @@ function CompanyRegistrationDetailsComponent(props) {
|
|
|
9155
9173
|
dataStoreId: COMPANY_REGISTRATION_DETAILS,
|
|
9156
9174
|
labels: registrationNumberCustomLabel,
|
|
9157
9175
|
registrationNumberType
|
|
9158
|
-
}),
|
|
9176
|
+
}), isTypeSelectorEnabled && formUtils.isRequiredField("vatNumber") && jsx(TaxIdNumberTypeSelector, {
|
|
9159
9177
|
country: props.country,
|
|
9160
9178
|
setSelected: setVatNumberType,
|
|
9161
9179
|
selected: vatNumberType
|
|
@@ -24319,13 +24337,8 @@ function TradingNameField({
|
|
|
24319
24337
|
}
|
|
24320
24338
|
}, [handleChangeFor, legalCompanyName2]);
|
|
24321
24339
|
useEffect(() => {
|
|
24322
|
-
if (
|
|
24323
|
-
|
|
24324
|
-
}
|
|
24325
|
-
}, [data.tradingName, handleSameAsLegalName]);
|
|
24326
|
-
useEffect(() => {
|
|
24327
|
-
if (data.sameNameAsLegalName && legalCompanyName2 !== data.tradingName) {
|
|
24328
|
-
handleChangeFor("tradingName")(legalCompanyName2);
|
|
24340
|
+
if (data.sameNameAsLegalName && data.tradingName && legalCompanyName2 && data.tradingName !== legalCompanyName2) {
|
|
24341
|
+
return handleChangeFor("tradingName")(legalCompanyName2);
|
|
24329
24342
|
}
|
|
24330
24343
|
}, [legalCompanyName2, data.sameNameAsLegalName, data.tradingName, handleChangeFor]);
|
|
24331
24344
|
return jsxs(Fragment, {
|
|
@@ -25296,13 +25309,22 @@ const mapApiDocumentToCompanySearchDocuments = (entityId) => {
|
|
|
25296
25309
|
} : void 0
|
|
25297
25310
|
};
|
|
25298
25311
|
};
|
|
25299
|
-
const mapLegalEntityToCompanySearchSchema = (legalEntity
|
|
25312
|
+
const mapLegalEntityToCompanySearchSchema = (legalEntity) => {
|
|
25300
25313
|
const companySearchSchema = {
|
|
25301
|
-
|
|
25302
|
-
|
|
25314
|
+
companyBasics: {},
|
|
25315
|
+
companyRegistrationAddress: {},
|
|
25316
|
+
companyStructure: {},
|
|
25317
|
+
companyOtherDetails: {},
|
|
25318
|
+
companyRegistrationDocument: {},
|
|
25319
|
+
companyTaxDocument: {},
|
|
25320
|
+
...formatObject(legalEntity, companySearchComponentsKeyMapping)
|
|
25303
25321
|
};
|
|
25322
|
+
const {
|
|
25323
|
+
companyRegistrationDocument: companyRegistrationDocument2,
|
|
25324
|
+
companyTaxDocument
|
|
25325
|
+
} = mapApiDocumentToCompanySearchDocuments(legalEntity == null ? void 0 : legalEntity.id);
|
|
25304
25326
|
return entriesOf(companySearchSchema).reduce((componentData, [key, value]) => {
|
|
25305
|
-
var _a, _b;
|
|
25327
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
25306
25328
|
switch (key) {
|
|
25307
25329
|
case "companyBasics": {
|
|
25308
25330
|
return {
|
|
@@ -25324,7 +25346,8 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity, documents2) => {
|
|
|
25324
25346
|
...componentData,
|
|
25325
25347
|
[key]: {
|
|
25326
25348
|
...value,
|
|
25327
|
-
|
|
25349
|
+
tradingName: !((_b = legalEntity.organization) == null ? void 0 : _b.doingBusinessAs) ? (_c = legalEntity.organization) == null ? void 0 : _c.legalName : (_d = legalEntity.organization) == null ? void 0 : _d.doingBusinessAs,
|
|
25350
|
+
sameNameAsLegalName: !((_e = legalEntity.organization) == null ? void 0 : _e.doingBusinessAs) || ((_f = legalEntity.organization) == null ? void 0 : _f.doingBusinessAs) === ((_g = legalEntity.organization) == null ? void 0 : _g.legalName)
|
|
25328
25351
|
}
|
|
25329
25352
|
};
|
|
25330
25353
|
}
|
|
@@ -25337,13 +25360,17 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity, documents2) => {
|
|
|
25337
25360
|
case "companyRegistrationDocument": {
|
|
25338
25361
|
return {
|
|
25339
25362
|
...componentData,
|
|
25340
|
-
[key]:
|
|
25363
|
+
[key]: {
|
|
25364
|
+
...companyRegistrationDocument2
|
|
25365
|
+
}
|
|
25341
25366
|
};
|
|
25342
25367
|
}
|
|
25343
25368
|
case "companyTaxDocument": {
|
|
25344
25369
|
return {
|
|
25345
25370
|
...componentData,
|
|
25346
|
-
[key]:
|
|
25371
|
+
[key]: {
|
|
25372
|
+
...companyTaxDocument
|
|
25373
|
+
}
|
|
25347
25374
|
};
|
|
25348
25375
|
}
|
|
25349
25376
|
default:
|
|
@@ -25483,12 +25510,12 @@ function useCompanySearchTaskSubmit({
|
|
|
25483
25510
|
};
|
|
25484
25511
|
}
|
|
25485
25512
|
function CompanySearchComponent(props) {
|
|
25486
|
-
var _a, _b
|
|
25513
|
+
var _a, _b;
|
|
25487
25514
|
const {
|
|
25488
25515
|
i18n
|
|
25489
25516
|
} = useI18nContext();
|
|
25490
25517
|
const {
|
|
25491
|
-
|
|
25518
|
+
country: country2,
|
|
25492
25519
|
activeForm,
|
|
25493
25520
|
problems,
|
|
25494
25521
|
handleAddressSearch,
|
|
@@ -25501,10 +25528,6 @@ function CompanySearchComponent(props) {
|
|
|
25501
25528
|
} = props;
|
|
25502
25529
|
const globalData = useGlobalData();
|
|
25503
25530
|
const [kompanyAddress, setKompanyAddress] = useState();
|
|
25504
|
-
const country2 = useMemo(() => {
|
|
25505
|
-
var _a2, _b2;
|
|
25506
|
-
return ((_a2 = globalData.companyBasics) == null ? void 0 : _a2.country) ?? ((_b2 = data == null ? void 0 : data.companyBasics) == null ? void 0 : _b2.country);
|
|
25507
|
-
}, [globalData, (_a = data == null ? void 0 : data.companyBasics) == null ? void 0 : _a.country]);
|
|
25508
25531
|
const formWrapperClasses = (formId) => (activeForm == null ? void 0 : activeForm.formId) !== formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper";
|
|
25509
25532
|
return jsxs("div", {
|
|
25510
25533
|
className: "adyen-kyc-company",
|
|
@@ -25514,6 +25537,7 @@ function CompanySearchComponent(props) {
|
|
|
25514
25537
|
...getFormProps(props, forms.companyBasics.formId),
|
|
25515
25538
|
id: forms.companyBasics.formId,
|
|
25516
25539
|
heading: i18n.get(forms.companyBasics.formName),
|
|
25540
|
+
country: country2,
|
|
25517
25541
|
handleCompanyIndexSearch,
|
|
25518
25542
|
handleCompanyDeepSearch,
|
|
25519
25543
|
handleGetCompanyDataset,
|
|
@@ -25552,8 +25576,8 @@ function CompanySearchComponent(props) {
|
|
|
25552
25576
|
id: forms.companyOtherDetails.formId,
|
|
25553
25577
|
heading: i18n.get(forms.companyOtherDetails.formName),
|
|
25554
25578
|
country: country2,
|
|
25555
|
-
legalCompanyName: (
|
|
25556
|
-
companyType: (
|
|
25579
|
+
legalCompanyName: (_a = globalData == null ? void 0 : globalData.companyBasics) == null ? void 0 : _a.legalCompanyName,
|
|
25580
|
+
companyType: (_b = globalData == null ? void 0 : globalData.companyStructure) == null ? void 0 : _b.entityType
|
|
25557
25581
|
})
|
|
25558
25582
|
}), jsx("div", {
|
|
25559
25583
|
className: formWrapperClasses(forms.companyRegistrationDocument.formId),
|
|
@@ -25623,11 +25647,14 @@ function CompanySearchComponent(props) {
|
|
|
25623
25647
|
});
|
|
25624
25648
|
}
|
|
25625
25649
|
function CompanySearchDropinComponent({
|
|
25650
|
+
country: parentCountry,
|
|
25651
|
+
problems: propProblems,
|
|
25626
25652
|
legalEntityResponse,
|
|
25627
25653
|
parentLegalEntity,
|
|
25628
25654
|
trackingConfig,
|
|
25629
25655
|
eventEmitter,
|
|
25630
25656
|
taskType = TaskTypes.COMPANY_SEARCH,
|
|
25657
|
+
capabilities,
|
|
25631
25658
|
taskName,
|
|
25632
25659
|
hideDropinLayout,
|
|
25633
25660
|
homeButtonLabel,
|
|
@@ -25646,7 +25673,7 @@ function CompanySearchDropinComponent({
|
|
|
25646
25673
|
handleRefreshCompanyDataset,
|
|
25647
25674
|
handleVerifyTin
|
|
25648
25675
|
}) {
|
|
25649
|
-
var _a, _b, _c
|
|
25676
|
+
var _a, _b, _c;
|
|
25650
25677
|
const {
|
|
25651
25678
|
state: {
|
|
25652
25679
|
currentState
|
|
@@ -25670,30 +25697,32 @@ function CompanySearchDropinComponent({
|
|
|
25670
25697
|
isExperimentEnabled
|
|
25671
25698
|
} = useExperimentsContext();
|
|
25672
25699
|
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
25673
|
-
const [
|
|
25674
|
-
const [problems, setProblems] = useState((_b = (_a = getCapabilityProblems(legalEntityResponse, isExperimentEnabled)) == null ? void 0 : _a.LegalEntity) == null ? void 0 : _b[legalEntityResponse.id]);
|
|
25675
|
-
const legalEntityResponseData = useMemo(() => mapLegalEntityToCompanySearchSchema(legalEntityResponse, documents2), [legalEntityResponse, documents2]);
|
|
25676
|
-
const capabilities = useMemo(() => Object.keys(legalEntityResponse.capabilities), [legalEntityResponse]);
|
|
25700
|
+
const [initialData, setInitialData] = useState(mapLegalEntityToCompanySearchSchema(legalEntityResponse));
|
|
25701
|
+
const [problems, setProblems] = useState(propProblems ?? ((_b = (_a = getCapabilityProblems(legalEntityResponse, isExperimentEnabled)) == null ? void 0 : _a.LegalEntity) == null ? void 0 : _b[legalEntityResponse.id]));
|
|
25677
25702
|
const country2 = useMemo(() => {
|
|
25678
|
-
var _a2
|
|
25679
|
-
return ((_a2 = currentState.data.companyBasics) == null ? void 0 : _a2.country) ??
|
|
25680
|
-
}, [(_c = currentState.data.companyBasics) == null ? void 0 : _c.country,
|
|
25703
|
+
var _a2;
|
|
25704
|
+
return ((_a2 = currentState.data.companyBasics) == null ? void 0 : _a2.country) ?? parentCountry;
|
|
25705
|
+
}, [(_c = currentState.data.companyBasics) == null ? void 0 : _c.country, parentCountry]);
|
|
25681
25706
|
const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
|
|
25682
25707
|
useEffect(() => {
|
|
25683
25708
|
var _a2;
|
|
25709
|
+
eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
25684
25710
|
const documentIds = ((_a2 = legalEntityResponse == null ? void 0 : legalEntityResponse.documentDetails) == null ? void 0 : _a2.map((documentReference) => documentReference.id)) || [];
|
|
25685
25711
|
if (!documentIds.length)
|
|
25686
25712
|
return;
|
|
25687
25713
|
documentUtils.fetchDocuments(documentIds, legalEntityResponse.id).then(() => {
|
|
25688
|
-
|
|
25714
|
+
setInitialData({
|
|
25715
|
+
...initialData,
|
|
25716
|
+
...mapApiDocumentToCompanySearchDocuments(legalEntityResponse.id)
|
|
25717
|
+
});
|
|
25689
25718
|
}).catch(() => showToast({
|
|
25690
25719
|
label: i18n.get("failedToFetchRelevantDocuments"),
|
|
25691
25720
|
type: ToastType.ERROR
|
|
25692
25721
|
}));
|
|
25693
|
-
}, [i18n, legalEntityResponse]);
|
|
25722
|
+
}, [documentUtils, eventEmitter, i18n, initialData, legalEntityResponse, setLocale, showToast]);
|
|
25694
25723
|
const getConfigurationData = useCallback(() => getConfiguration2({
|
|
25695
25724
|
legalEntityType: LegalEntityType.ORGANIZATION,
|
|
25696
|
-
capabilities,
|
|
25725
|
+
capabilities: capabilities ?? [],
|
|
25697
25726
|
country: country2
|
|
25698
25727
|
}), [getConfiguration2, capabilities, country2]);
|
|
25699
25728
|
const {
|
|
@@ -25731,7 +25760,7 @@ function CompanySearchDropinComponent({
|
|
|
25731
25760
|
data: formatDataForSummary(currentState.data, forms$1, i18n),
|
|
25732
25761
|
omittedKeys: ["operationalAddressIsSame"]
|
|
25733
25762
|
}), [currentState.data, forms$1, i18n]);
|
|
25734
|
-
const canSubmitForm = useMemo(() => canSubmit(currentState.data) && hasDataChanged(
|
|
25763
|
+
const canSubmitForm = useMemo(() => canSubmit(currentState.data) && hasDataChanged(initialData, currentState.data), [initialData, currentState.data]);
|
|
25735
25764
|
const baseTrackingPayload = useMemo(() => getBaseTrackingPayload({
|
|
25736
25765
|
trackingConfig,
|
|
25737
25766
|
parentLegalEntity,
|
|
@@ -25770,12 +25799,11 @@ function CompanySearchDropinComponent({
|
|
|
25770
25799
|
})
|
|
25771
25800
|
});
|
|
25772
25801
|
useEffect(() => {
|
|
25773
|
-
eventEmitter.on("updateLocale", (locale) => setLocale(locale));
|
|
25774
25802
|
userEvents.addPageView("Company search dropin");
|
|
25775
25803
|
userEvents.addEvent("Started company search task", {
|
|
25776
25804
|
segmentation: baseTrackingPayload
|
|
25777
25805
|
});
|
|
25778
|
-
}, [baseTrackingPayload
|
|
25806
|
+
}, [baseTrackingPayload]);
|
|
25779
25807
|
return jsx(FormWrapper, {
|
|
25780
25808
|
taskName,
|
|
25781
25809
|
gotoFormByFormIndex,
|
|
@@ -25799,7 +25827,8 @@ function CompanySearchDropinComponent({
|
|
|
25799
25827
|
children: jsx(CompanySearchComponent, {
|
|
25800
25828
|
...derivedProps,
|
|
25801
25829
|
ref: formRef,
|
|
25802
|
-
data:
|
|
25830
|
+
data: initialData,
|
|
25831
|
+
country: country2,
|
|
25803
25832
|
problems,
|
|
25804
25833
|
activeForm,
|
|
25805
25834
|
shouldValidate,
|
|
@@ -31883,7 +31912,7 @@ function DropinComposerComponent({
|
|
|
31883
31912
|
const [serviceAgreementTypes, setServiceAgreementTypes] = useState([]);
|
|
31884
31913
|
const [serviceAgreementAcceptanceInfos, setServiceAgreementAcceptanceInfos] = useState([]);
|
|
31885
31914
|
const [transferInstrument, setTransferInstrument] = useState(null);
|
|
31886
|
-
const [capabilityProblems, setCapabilityProblems] = useState(getCapabilityProblems(legalEntityResponse));
|
|
31915
|
+
const [capabilityProblems, setCapabilityProblems] = useState(getCapabilityProblems(legalEntityResponse, isExperimentEnabled));
|
|
31887
31916
|
const [bankVerificationVendors, setBankVerificationVendors] = useState();
|
|
31888
31917
|
const rootLegalEntityCountry = rootLegalEntity.type === LegalEntityType.INDIVIDUAL ? (_a = rootLegalEntity.individual.residentialAddress) == null ? void 0 : _a.country : (_b = rootLegalEntity.organization.registeredAddress) == null ? void 0 : _b.country;
|
|
31889
31918
|
const hasTrust = accountHolder2 === "aTrust" || isPartOfTrustFromLegalEntity(legalEntityResponse);
|
|
@@ -32580,7 +32609,10 @@ function DropinComposerComponent({
|
|
|
32580
32609
|
taskType: TaskTypes.COMPANY_SEARCH,
|
|
32581
32610
|
taskName: hasTrust ? "companyTrusteeDetails" : "companyDetails",
|
|
32582
32611
|
legalEntityResponse: rootLegalEntity,
|
|
32612
|
+
capabilities: Object.keys((legalEntityResponse == null ? void 0 : legalEntityResponse.capabilities) ?? {}),
|
|
32613
|
+
problems: getLegalEntityProblems(rootLegalEntity),
|
|
32583
32614
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
32615
|
+
country: legalEntityResponse.organization.registeredAddress.country ?? contextCountry,
|
|
32584
32616
|
onChange: componentOnChange,
|
|
32585
32617
|
onSubmit: async (data) => {
|
|
32586
32618
|
onSubmit == null ? void 0 : onSubmit(data);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { StateUpdater } from 'preact/hooks';
|
|
2
2
|
import type { BaseInnerFormProps } from '../../core/hooks/useForm';
|
|
3
|
+
import type { CountryCode } from '../../core/models/country-code';
|
|
3
4
|
import type { DropinAPIHandlers } from '../Dropins/types';
|
|
4
5
|
import type { CountryFieldSchema } from '../internal/CountryField/types';
|
|
5
6
|
import type { LegalCompanyNameFieldSchema } from '../internal/LegalCompanyNameField/types';
|
|
@@ -8,6 +9,7 @@ import type { TaxInformationFieldSchema } from '../internal/TaxInformationField/
|
|
|
8
9
|
export interface CompanyBasicsSchema extends LegalCompanyNameFieldSchema, CountryFieldSchema, StateFieldSchema, TaxInformationFieldSchema {
|
|
9
10
|
}
|
|
10
11
|
export interface CompanyBasicsProps extends BaseInnerFormProps<CompanyBasicsSchema> {
|
|
12
|
+
country: CountryCode;
|
|
11
13
|
kompanyAddress?: string;
|
|
12
14
|
setKompanyAddress: StateUpdater<string | undefined>;
|
|
13
15
|
handleCompanyIndexSearch: DropinAPIHandlers['handleCompanyIndexSearch'];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BaseOuterFormProps } from '../../core/hooks/useForm';
|
|
2
|
+
import type { CountryCode } from '../../core/models/country-code';
|
|
2
3
|
import type { FormModel } from '../../core/models/form';
|
|
3
4
|
import type { CompanyBasicsSchema } from '../CompanyBasics/types';
|
|
4
5
|
import type { CompanyOtherDetailsSchema } from '../CompanyOtherDetails/types';
|
|
@@ -15,6 +16,7 @@ export interface CompanySearchSchema {
|
|
|
15
16
|
companyTaxDocument?: DocumentUploadSchema;
|
|
16
17
|
}
|
|
17
18
|
export interface CompanySearchProps extends BaseOuterFormProps<CompanySearchSchema> {
|
|
19
|
+
country: CountryCode;
|
|
18
20
|
forms?: FormModel[];
|
|
19
21
|
handleAddressSearch: DropinAPIHandlers['handleAddressSearch'];
|
|
20
22
|
handleFindAddress: DropinAPIHandlers['handleFindAddress'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseInnerFormProps } from '../../core/hooks/useForm';
|
|
2
2
|
import type { CompanyTypesValue } from '../../core/models/api/company-types-value';
|
|
3
3
|
export interface CompanyStructureSchema {
|
|
4
|
-
entityType
|
|
4
|
+
entityType?: CompanyTypesValue;
|
|
5
5
|
}
|
|
6
6
|
export type CompanyStructureProps = BaseInnerFormProps<CompanyStructureSchema>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CompanySearchDropinProps } from '../types';
|
|
2
|
-
export declare function CompanySearchDropinComponent({ legalEntityResponse, parentLegalEntity, trackingConfig, eventEmitter, taskType, taskName, hideDropinLayout, homeButtonLabel, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, }: CompanySearchDropinProps): import("preact").JSX.Element;
|
|
2
|
+
export declare function CompanySearchDropinComponent({ country: parentCountry, problems: propProblems, legalEntityResponse, parentLegalEntity, trackingConfig, eventEmitter, taskType, capabilities, taskName, hideDropinLayout, homeButtonLabel, onChange, onSubmit: onExternalSubmit, handleHomeClick, handleCreateDocument, handleGetDocument, handleUpdateDocument, handleAddressSearch, handleFindAddress, handleUpdateLegalEntity, handleCompanyIndexSearch, handleCompanyDeepSearch, handleGetCompanyDataset, handleRefreshCompanyDataset, handleVerifyTin, }: CompanySearchDropinProps): import("preact").JSX.Element;
|
package/dist/types/components/internal/IdFieldTypeSelector/inferCompanyRegistrationNumberType.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CompanyTypesValue } from '../../../core/models/api/company-types-value';
|
|
2
|
+
import { CountryCode } from '../../../core/models/country-code';
|
|
3
|
+
import { CompanyRegistrationNumberType } from './countryIdNumberTypes';
|
|
4
|
+
/**
|
|
5
|
+
* For existing data, we need to infer the company registration number type from the existing data.
|
|
6
|
+
* Otherwise, the incorrect mask will be applied.
|
|
7
|
+
* We don't store this choice in the API.
|
|
8
|
+
* @param registrationNumber the existing company registration number
|
|
9
|
+
* @param country the country of the LE
|
|
10
|
+
* @param companyType the company type, e.g. `nonProfit`
|
|
11
|
+
*/
|
|
12
|
+
export declare const inferCompanyRegistrationNumberType: (registrationNumber: string, country: CountryCode, companyType: CompanyTypesValue) => CompanyRegistrationNumberType | undefined;
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
import { Problem } from './problem';
|
|
2
2
|
import { VerificationStatus } from './verification-status';
|
|
3
|
-
export
|
|
4
|
-
AUTHORISED_PAYMENT_INSTRUMENT_USER = "authorisedPaymentInstrumentUser",
|
|
5
|
-
GET_GRANT_OFFERS = "getGrantOffers",
|
|
6
|
-
ISSUE_BANK_ACCOUNT = "issueBankAccount",
|
|
7
|
-
ISSUE_CARD = "issueCard",
|
|
8
|
-
RECEIVE_FROM_TRANSFER_INSTRUMENT = "receiveFromTransferInstrument",
|
|
9
|
-
RECEIVE_FROM_BALANCE_ACCOUNT = "receiveFromBalanceAccount",
|
|
10
|
-
RECEIVE_FROM_PLATFORM_PAYMENTS = "receiveFromPlatformPayments",
|
|
11
|
-
RECEIVE_FROM_THIRD_PARTY = "receiveFromThirdParty",
|
|
12
|
-
RECEIVE_PAYMENTS = "receivePayments",
|
|
13
|
-
RECEIVE_GRANTS = "receiveGrants",
|
|
14
|
-
SEND_TO_BALANCE_ACCOUNT = "sendToBalanceAccount",
|
|
15
|
-
SEND_TO_TRANSFER_INSTRUMENT = "sendToTransferInstrument",
|
|
16
|
-
SEND_TO_THIRD_PARTY = "sendToThirdParty",
|
|
17
|
-
USE_CARD = "useCard",
|
|
18
|
-
USE_CARD_IN_RESTRICTED_COUNTRIES = "useCardInRestrictedCountries",
|
|
19
|
-
USE_CARD_IN_RESTRICTED_INDUSTRIES = "useCardInRestrictedIndustries",
|
|
20
|
-
WITHDRAW_FROM_ATM = "withdrawFromAtm",
|
|
21
|
-
WITHDRAW_FROM_ATM_IN_RESTRICTED_COUNTRIES = "withdrawFromAtmInRestrictedCountries"
|
|
22
|
-
}
|
|
23
|
-
export type CapabilityType = `${Capabilities}`;
|
|
3
|
+
export type CapabilityName = 'acceptExternalFunding' | 'acceptPspFunding' | 'acceptTransactionInRestrictedCountries' | 'acceptTransactionInRestrictedCountriesCommercial' | 'acceptTransactionInRestrictedCountriesConsumer' | 'acceptTransactionInRestrictedIndustries' | 'acceptTransactionInRestrictedIndustriesCommercial' | 'acceptTransactionInRestrictedIndustriesConsumer' | 'acquiring' | 'atmWithdrawal' | 'atmWithdrawalCommercial' | 'atmWithdrawalConsumer' | 'atmWithdrawalInRestrictedCountries' | 'atmWithdrawalInRestrictedCountriesCommercial' | 'atmWithdrawalInRestrictedCountriesConsumer' | 'authorisedPaymentInstrumentUser' | 'getGrantOffers' | 'issueBankAccount' | 'issueCard' | 'issueCardCommercial' | 'issueCardConsumer' | 'localAcceptance' | 'payout' | 'payoutToTransferInstrument' | 'processing' | 'receiveFromBalanceAccount' | 'receiveFromPlatformPayments' | 'receiveFromThirdParty' | 'receiveFromTransferInstrument' | 'receiveGrants' | 'receivePayments' | 'sendToBalanceAccount' | 'sendToThirdParty' | 'sendToTransferInstrument' | 'thirdPartyFunding' | 'useCard' | 'useCardCommercial' | 'useCardConsumer' | 'useCardInRestrictedCountries' | 'useCardInRestrictedCountriesCommercial' | 'useCardInRestrictedCountriesConsumer' | 'useCardInRestrictedIndustries' | 'useCardInRestrictedIndustriesCommercial' | 'useCardInRestrictedIndustriesConsumer' | 'withdrawFromAtm' | 'withdrawFromAtmCommercial' | 'withdrawFromAtmConsumer' | 'withdrawFromAtmInRestrictedCountries' | 'withdrawFromAtmInRestrictedCountriesCommercial' | 'withdrawFromAtmInRestrictedCountriesConsumer';
|
|
24
4
|
export interface Capability {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
/** @description Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful */
|
|
6
|
+
allowed?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @description The capability level that is allowed for the legal entity.
|
|
9
|
+
*
|
|
10
|
+
* Possible values: **notApplicable**, **low**, **medium**, **high**.
|
|
11
|
+
* @enum {string}
|
|
12
|
+
*/
|
|
13
|
+
allowedLevel?: 'high' | 'low' | 'medium' | 'notApplicable';
|
|
14
|
+
/** @description Indicates whether the capability is requested. To check whether the Legal Entity is permitted to use the capability, */
|
|
15
|
+
requested?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @description The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring.
|
|
18
|
+
*
|
|
19
|
+
* Possible values: **notApplicable**, **low**, **medium**, **high**.
|
|
20
|
+
* @enum {string}
|
|
21
|
+
*/
|
|
22
|
+
requestedLevel?: 'high' | 'low' | 'medium' | 'notApplicable';
|
|
23
|
+
/**
|
|
24
|
+
* @description The status of the verification checks for the capability.
|
|
25
|
+
*
|
|
26
|
+
* Possible values:
|
|
27
|
+
*
|
|
28
|
+
* * **pending**: Adyen is running the verification.
|
|
29
|
+
*
|
|
30
|
+
* * **invalid**: The verification failed. Check if the `errors` array contains more information.
|
|
31
|
+
*
|
|
32
|
+
* * **valid**: The verification has been successfully completed.
|
|
33
|
+
*
|
|
34
|
+
* * **rejected**: Adyen has verified the information, but found reasons to not allow the capability.
|
|
35
|
+
*/
|
|
36
|
+
verificationStatus?: VerificationStatus;
|
|
28
37
|
problems: Problem[];
|
|
29
|
-
verificationStatus: VerificationStatus;
|
|
30
38
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PartialDeep } from 'type-fest';
|
|
2
|
-
import { Capability,
|
|
2
|
+
import { Capability, CapabilityName } from './capability';
|
|
3
3
|
import { DocumentDetail } from './documentDetail';
|
|
4
4
|
import { Individual } from './individual';
|
|
5
5
|
import { LegalEntityAssociation } from './legal-entity-association';
|
|
@@ -18,7 +18,7 @@ export interface LegalEntity {
|
|
|
18
18
|
trust?: Trust;
|
|
19
19
|
type?: LegalEntityType;
|
|
20
20
|
capabilities?: {
|
|
21
|
-
[key in
|
|
21
|
+
[key in CapabilityName]?: Capability;
|
|
22
22
|
};
|
|
23
23
|
transferInstruments?: TransferInstrumentOverview[];
|
|
24
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CompanySearchSchema } from '../../../components/CompanySearch/types';
|
|
2
2
|
import { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
|
|
3
3
|
export declare const mapApiDocumentToCompanySearchDocuments: (entityId: string) => CompanySearchSchema;
|
|
4
|
-
export declare const mapLegalEntityToCompanySearchSchema: (legalEntity: ExistingLegalEntity
|
|
4
|
+
export declare const mapLegalEntityToCompanySearchSchema: (legalEntity: ExistingLegalEntity) => CompanySearchSchema;
|