@adyen/kyc-components 2.22.0 → 2.23.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 +326 -135
- package/dist/types/components/internal/Address/utils.d.ts +1 -1
- package/dist/types/components/internal/ContractViewer/ReferenceContext/ReferenceContext.d.ts +10 -0
- package/dist/types/components/internal/ContractViewer/ReferenceContext/ReferenceContextProvider.d.ts +6 -0
- package/dist/types/components/internal/ContractViewer/ReferenceContext/useReferenceContext.d.ts +1 -0
- package/dist/types/components/internal/ContractViewer/components/InternalReference/InternalReference.d.ts +1 -1
- package/dist/types/components/internal/ContractViewer/components/Section/Section.d.ts +1 -1
- package/dist/types/components/internal/ContractViewer/components/Table/Table.d.ts +1 -1
- package/dist/types/components/internal/ContractViewer/utils/format-id.d.ts +1 -0
- package/dist/types/components/internal/Iban/ibanValidator.d.ts +2 -1
- package/dist/types/components/internal/Iban/types.d.ts +2 -1
- package/dist/types/core/Services/componentApi/get-address.d.ts +3 -0
- package/dist/types/core/Services/componentApi/get-idverification-token.d.ts +3 -0
- package/dist/types/core/Services/componentApi/idVerification-startcheck.d.ts +3 -0
- package/dist/types/core/Services/componentApi/search-address.d.ts +3 -0
- package/dist/types/core/Services/componentApi/validate-phone-number.d.ts +3 -0
- package/dist/types/core/Services/componentApi/verify-id-number.d.ts +3 -0
- package/dist/types/core/hooks/useComponentApi.d.ts +4 -4
- package/dist/types/language/config.d.ts +0 -1
- package/dist/types/utils/delay.d.ts +1 -0
- package/dist/types/utils/entity-status-util.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/components/PersonalDetails/component/IdentityComponent/IdentityAu/component/ProofOfIdentityCard.d.ts +0 -15
|
@@ -78,7 +78,6 @@ const invalidFormatForAuDriversLicenseNumber = "This isn't a valid Australian dr
|
|
|
78
78
|
const invalidFormatForNZDriversLicenseNumber = "Expected format should be: 2 characters, followed by 6 digits";
|
|
79
79
|
const invalidFormatForAuDriversLicenseCardNumber = "This isn't a valid Australian driver's license card number. Expected format: 6-10 alphanumeric characters.";
|
|
80
80
|
const invalidFormatForNZDriversLicenseCardNumber = "Expected format should be: 3 digits";
|
|
81
|
-
const invalidFormatForAuProofOfIdentityCardNumber = "This isn't a valid Australian proof of identity card number. Expected format: 6-10 alphanumeric characters.";
|
|
82
81
|
const invalidFormatForHKPassportNumber = "Not valid for HK. Format should be: 9-character alphanumeric. For example: K12345599";
|
|
83
82
|
const invalidFormatForHKDriversLicenseNumber = "Not valid for HK. Format should be: 8-character alphanumeric. For example: A1234567";
|
|
84
83
|
const invalidFormatForHKIdentityCardNumber = "Not valid for HK. Format should be: 8 or 9-character alphanumeric. For example: C668668A";
|
|
@@ -739,7 +738,7 @@ const noGoBack = "No, go back";
|
|
|
739
738
|
const continueCompany = "Continue as company";
|
|
740
739
|
const continueIndividual = "Continue as individual";
|
|
741
740
|
const addManually = "Add manually";
|
|
742
|
-
const searchAddress = "Search address";
|
|
741
|
+
const searchAddress$1 = "Search address";
|
|
743
742
|
const startTypingTheAddress = "Start typing the address";
|
|
744
743
|
const addresses = "Addresses";
|
|
745
744
|
const loading = "Loading";
|
|
@@ -1216,7 +1215,6 @@ const defaultTrans = {
|
|
|
1216
1215
|
invalidFormatForNZDriversLicenseNumber,
|
|
1217
1216
|
invalidFormatForAuDriversLicenseCardNumber,
|
|
1218
1217
|
invalidFormatForNZDriversLicenseCardNumber,
|
|
1219
|
-
invalidFormatForAuProofOfIdentityCardNumber,
|
|
1220
1218
|
invalidFormatForHKPassportNumber,
|
|
1221
1219
|
invalidFormatForHKDriversLicenseNumber,
|
|
1222
1220
|
invalidFormatForHKIdentityCardNumber,
|
|
@@ -1892,7 +1890,7 @@ const defaultTrans = {
|
|
|
1892
1890
|
continueCompany,
|
|
1893
1891
|
continueIndividual,
|
|
1894
1892
|
addManually,
|
|
1895
|
-
searchAddress,
|
|
1893
|
+
searchAddress: searchAddress$1,
|
|
1896
1894
|
startTypingTheAddress,
|
|
1897
1895
|
addresses,
|
|
1898
1896
|
loading,
|
|
@@ -3005,7 +3003,7 @@ const createLogger = (namespace) => {
|
|
|
3005
3003
|
});
|
|
3006
3004
|
return methods;
|
|
3007
3005
|
};
|
|
3008
|
-
const logger$
|
|
3006
|
+
const logger$p = createLogger("Link");
|
|
3009
3007
|
const getIconClass = (icon, external) => {
|
|
3010
3008
|
if (external) {
|
|
3011
3009
|
return "adl-link__icon adyen-kyc-icon-external-link";
|
|
@@ -3017,7 +3015,7 @@ const getIconClass = (icon, external) => {
|
|
|
3017
3015
|
};
|
|
3018
3016
|
const isValidLink = (href) => {
|
|
3019
3017
|
if (href === "#") {
|
|
3020
|
-
logger$
|
|
3018
|
+
logger$p.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
3021
3019
|
return false;
|
|
3022
3020
|
}
|
|
3023
3021
|
return true;
|
|
@@ -3294,14 +3292,14 @@ function useResetGlobalData(caller) {
|
|
|
3294
3292
|
}
|
|
3295
3293
|
}), [dispatch, caller]);
|
|
3296
3294
|
}
|
|
3297
|
-
const logger$
|
|
3295
|
+
const logger$o = createLogger("useAllowedCountries");
|
|
3298
3296
|
const useAllowedCountries = () => {
|
|
3299
3297
|
const {
|
|
3300
3298
|
getAllowedCountries: getAllowedCountries2
|
|
3301
3299
|
} = useConfigurationApi();
|
|
3302
3300
|
const [allowedCountries, setAllowedCountries] = useState();
|
|
3303
3301
|
useEffect(() => {
|
|
3304
|
-
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$
|
|
3302
|
+
getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$o.error);
|
|
3305
3303
|
}, []);
|
|
3306
3304
|
return allowedCountries;
|
|
3307
3305
|
};
|
|
@@ -3640,7 +3638,7 @@ class ValidationResult {
|
|
|
3640
3638
|
return this.validationResults.filter((result) => result.hasError);
|
|
3641
3639
|
}
|
|
3642
3640
|
}
|
|
3643
|
-
const logger$
|
|
3641
|
+
const logger$n = createLogger("useAsyncValidator");
|
|
3644
3642
|
const useAsyncValidator = (asyncRules) => {
|
|
3645
3643
|
const [asyncValidationResults, setAsyncValidationResults] = useState({});
|
|
3646
3644
|
const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
|
|
@@ -3663,7 +3661,7 @@ const useAsyncValidator = (asyncRules) => {
|
|
|
3663
3661
|
hasError: !isValid
|
|
3664
3662
|
}])
|
|
3665
3663
|
});
|
|
3666
|
-
}).catch(logger$
|
|
3664
|
+
}).catch(logger$n.error);
|
|
3667
3665
|
}, [asyncRules, clearAsyncValidationResults]);
|
|
3668
3666
|
return {
|
|
3669
3667
|
asyncValidationResults,
|
|
@@ -5082,7 +5080,7 @@ const Select = ({
|
|
|
5082
5080
|
})]
|
|
5083
5081
|
});
|
|
5084
5082
|
};
|
|
5085
|
-
const logger$
|
|
5083
|
+
const logger$m = createLogger("CountryField");
|
|
5086
5084
|
const COUNTRY_FIELD = ["country"];
|
|
5087
5085
|
function CountryField({
|
|
5088
5086
|
data,
|
|
@@ -5105,7 +5103,7 @@ function CountryField({
|
|
|
5105
5103
|
dataset: countriesFromApi
|
|
5106
5104
|
} = useDataset(datasetIdentifier.country);
|
|
5107
5105
|
useEffect(() => {
|
|
5108
|
-
loadFlags2().catch(logger$
|
|
5106
|
+
loadFlags2().catch(logger$m.error);
|
|
5109
5107
|
}, [loadFlags2]);
|
|
5110
5108
|
const countries = countriesFromApi.filter((country2) => allowedCountries ? allowedCountries.includes(country2.id) : true).map((item) => ({
|
|
5111
5109
|
...item,
|
|
@@ -6717,11 +6715,6 @@ function AccordionItem({
|
|
|
6717
6715
|
newItems.find((item) => item.id === id2).isOpen = newValue;
|
|
6718
6716
|
setItems(newItems);
|
|
6719
6717
|
}
|
|
6720
|
-
if (isOpen) {
|
|
6721
|
-
onClose();
|
|
6722
|
-
} else {
|
|
6723
|
-
onOpen();
|
|
6724
|
-
}
|
|
6725
6718
|
};
|
|
6726
6719
|
useEffect(() => {
|
|
6727
6720
|
setItems((items2) => [...items2, {
|
|
@@ -6737,8 +6730,12 @@ function AccordionItem({
|
|
|
6737
6730
|
setIsOpen((_a = items.find((item) => item.id === id2)) == null ? void 0 : _a.isOpen);
|
|
6738
6731
|
}, [items]);
|
|
6739
6732
|
useEffect(() => {
|
|
6740
|
-
if (isOpen)
|
|
6733
|
+
if (isOpen) {
|
|
6741
6734
|
onExpandSection == null ? void 0 : onExpandSection(title);
|
|
6735
|
+
onOpen();
|
|
6736
|
+
} else {
|
|
6737
|
+
onClose();
|
|
6738
|
+
}
|
|
6742
6739
|
}, [isOpen]);
|
|
6743
6740
|
return jsxs("div", {
|
|
6744
6741
|
className: "adl-accordion__item",
|
|
@@ -8946,7 +8943,7 @@ const accountHolderValidationRules = {
|
|
|
8946
8943
|
}
|
|
8947
8944
|
};
|
|
8948
8945
|
const accountHolderFields = ["accountHolder"];
|
|
8949
|
-
const logger$
|
|
8946
|
+
const logger$l = createLogger("AccountHolder");
|
|
8950
8947
|
function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
|
|
8951
8948
|
switch (legalEntityType) {
|
|
8952
8949
|
case LegalEntityType.ORGANIZATION: {
|
|
@@ -8956,7 +8953,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
|
|
|
8956
8953
|
return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
|
|
8957
8954
|
}
|
|
8958
8955
|
default:
|
|
8959
|
-
logger$
|
|
8956
|
+
logger$l.error(`No available account holder options for legal entity type '${legalEntityType}'`);
|
|
8960
8957
|
return [];
|
|
8961
8958
|
}
|
|
8962
8959
|
}
|
|
@@ -9704,7 +9701,7 @@ function Dropzone(props) {
|
|
|
9704
9701
|
})]
|
|
9705
9702
|
});
|
|
9706
9703
|
}
|
|
9707
|
-
const logger$
|
|
9704
|
+
const logger$k = createLogger("TextArea");
|
|
9708
9705
|
function TextArea(props) {
|
|
9709
9706
|
const {
|
|
9710
9707
|
classNameModifiers,
|
|
@@ -9725,7 +9722,7 @@ function TextArea(props) {
|
|
|
9725
9722
|
} = useI18nContext();
|
|
9726
9723
|
const [value, setValue] = useState("");
|
|
9727
9724
|
if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
|
|
9728
|
-
logger$
|
|
9725
|
+
logger$k.error("Error: Form fields that rely on InputBase may not have an onChange property");
|
|
9729
9726
|
}
|
|
9730
9727
|
const handleInput = (e) => {
|
|
9731
9728
|
var _a;
|
|
@@ -10138,7 +10135,7 @@ function FieldContainer(props) {
|
|
|
10138
10135
|
}
|
|
10139
10136
|
return renderField(fieldName);
|
|
10140
10137
|
}
|
|
10141
|
-
const logger$
|
|
10138
|
+
const logger$j = createLogger("SearchAddress");
|
|
10142
10139
|
const SearchAddress = ({
|
|
10143
10140
|
data,
|
|
10144
10141
|
legalEntityId,
|
|
@@ -10164,7 +10161,7 @@ const SearchAddress = ({
|
|
|
10164
10161
|
const response = await handleFindAddress(selectedAddressId);
|
|
10165
10162
|
autocompleteAddressForm(response);
|
|
10166
10163
|
} catch (e) {
|
|
10167
|
-
logger$
|
|
10164
|
+
logger$j.error(e);
|
|
10168
10165
|
}
|
|
10169
10166
|
};
|
|
10170
10167
|
const onDrilldown = async (selectedAddress) => {
|
|
@@ -10176,7 +10173,7 @@ const SearchAddress = ({
|
|
|
10176
10173
|
}, legalEntityId);
|
|
10177
10174
|
setItems((response == null ? void 0 : response.results) || []);
|
|
10178
10175
|
} catch (e) {
|
|
10179
|
-
logger$
|
|
10176
|
+
logger$j.error(e);
|
|
10180
10177
|
}
|
|
10181
10178
|
};
|
|
10182
10179
|
const onChange = (e) => {
|
|
@@ -10231,7 +10228,7 @@ const SearchAddress = ({
|
|
|
10231
10228
|
setItems([]);
|
|
10232
10229
|
}
|
|
10233
10230
|
} catch (e) {
|
|
10234
|
-
logger$
|
|
10231
|
+
logger$j.error(e);
|
|
10235
10232
|
}
|
|
10236
10233
|
setLoading(false);
|
|
10237
10234
|
}
|
|
@@ -13185,7 +13182,7 @@ const initOnfido = async ({
|
|
|
13185
13182
|
language: getOnfidoLocaleConfig(i18n)
|
|
13186
13183
|
});
|
|
13187
13184
|
};
|
|
13188
|
-
const logger$
|
|
13185
|
+
const logger$i = createLogger("IdVerificationComponent");
|
|
13189
13186
|
function IdVerificationComponent({
|
|
13190
13187
|
userDetails,
|
|
13191
13188
|
legalEntityId,
|
|
@@ -13218,7 +13215,7 @@ function IdVerificationComponent({
|
|
|
13218
13215
|
onIdVerificationError,
|
|
13219
13216
|
onIdVerificationComplete
|
|
13220
13217
|
});
|
|
13221
|
-
})().catch(logger$
|
|
13218
|
+
})().catch(logger$i.error);
|
|
13222
13219
|
return () => {
|
|
13223
13220
|
if (onfidoSdk.current)
|
|
13224
13221
|
onfidoSdk.current.tearDown();
|
|
@@ -13270,7 +13267,7 @@ function IdDocumentAlreadyUpload(props) {
|
|
|
13270
13267
|
})]
|
|
13271
13268
|
});
|
|
13272
13269
|
}
|
|
13273
|
-
const logger$
|
|
13270
|
+
const logger$h = createLogger("IdDocumentInstantVerificationComponent");
|
|
13274
13271
|
const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
|
|
13275
13272
|
const documentTypeValidationRules = {
|
|
13276
13273
|
instantIdVerificationData: {
|
|
@@ -13352,7 +13349,7 @@ function IdDocumentInstantVerificationComponent(props) {
|
|
|
13352
13349
|
userDetails: props.userDetails,
|
|
13353
13350
|
legalEntityId: props.legalEntityId,
|
|
13354
13351
|
onIdVerificationComplete: handleIdVerificationComplete,
|
|
13355
|
-
onIdVerificationError: logger$
|
|
13352
|
+
onIdVerificationError: logger$h.error
|
|
13356
13353
|
}), jsxs("div", {
|
|
13357
13354
|
className: "adyen-kyc-document-upload__manual-upload",
|
|
13358
13355
|
children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
|
|
@@ -14687,8 +14684,6 @@ const auIdentityValidationRules = {
|
|
|
14687
14684
|
return PassportNumberPatterns.AU.test(value ?? "");
|
|
14688
14685
|
case "driversLicense":
|
|
14689
14686
|
return DriversLicenseNumberPatterns.AU.test(value ?? "");
|
|
14690
|
-
case "proofOfIdentityCard":
|
|
14691
|
-
return ProofOfIdentityCardPatterns.AU.test(value ?? "");
|
|
14692
14687
|
default:
|
|
14693
14688
|
return false;
|
|
14694
14689
|
}
|
|
@@ -14699,8 +14694,6 @@ const auIdentityValidationRules = {
|
|
|
14699
14694
|
return "invalidFormatForAuPassportNumber";
|
|
14700
14695
|
case "driversLicense":
|
|
14701
14696
|
return "invalidFormatForAuDriversLicenseNumber";
|
|
14702
|
-
case "proofOfIdentityCard":
|
|
14703
|
-
return "invalidFormatForAuProofOfIdentityCardNumber";
|
|
14704
14697
|
}
|
|
14705
14698
|
},
|
|
14706
14699
|
modes: ["blur"]
|
|
@@ -14813,29 +14806,6 @@ const PassportNumber$2 = ({
|
|
|
14813
14806
|
placeholder: ""
|
|
14814
14807
|
})
|
|
14815
14808
|
});
|
|
14816
|
-
const ProofOfIdentityCard$1 = ({
|
|
14817
|
-
cardNumber,
|
|
14818
|
-
onInput,
|
|
14819
|
-
onBlur,
|
|
14820
|
-
formUtils: {
|
|
14821
|
-
getLabel
|
|
14822
|
-
},
|
|
14823
|
-
errorMessage,
|
|
14824
|
-
isValid
|
|
14825
|
-
}) => jsx(Field, {
|
|
14826
|
-
name: "cardNumber",
|
|
14827
|
-
label: getLabel("idNumber", "proofOfIdentityCardNumber"),
|
|
14828
|
-
errorMessage,
|
|
14829
|
-
isValid,
|
|
14830
|
-
children: (childProps) => jsx(InputText, {
|
|
14831
|
-
...childProps,
|
|
14832
|
-
name: "cardNumber",
|
|
14833
|
-
value: cardNumber,
|
|
14834
|
-
onInput,
|
|
14835
|
-
onBlur,
|
|
14836
|
-
placeholder: ""
|
|
14837
|
-
})
|
|
14838
|
-
});
|
|
14839
14809
|
function IdentityAuComponent(props) {
|
|
14840
14810
|
var _a;
|
|
14841
14811
|
if (((_a = props.data) == null ? void 0 : _a.typeOfIdentity) === "nationalIdNumber") {
|
|
@@ -14877,7 +14847,7 @@ function IdentityAuComponent(props) {
|
|
|
14877
14847
|
i18n
|
|
14878
14848
|
} = useI18nContext();
|
|
14879
14849
|
const formUtils = formUtilities(props, i18n);
|
|
14880
|
-
const availableIdentityTypes = ["passport", "driversLicense"
|
|
14850
|
+
const availableIdentityTypes = ["passport", "driversLicense"];
|
|
14881
14851
|
const selectedIdentityType = data.typeOfIdentity;
|
|
14882
14852
|
return jsxs(Fragment, {
|
|
14883
14853
|
children: [jsx(TypeOfIdentity, {
|
|
@@ -14894,13 +14864,6 @@ function IdentityAuComponent(props) {
|
|
|
14894
14864
|
formUtils,
|
|
14895
14865
|
isValid: valid.idNumber,
|
|
14896
14866
|
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
|
|
14897
|
-
}) : data.typeOfIdentity === "proofOfIdentityCard" ? jsx(ProofOfIdentityCard$1, {
|
|
14898
|
-
cardNumber: data.idNumber ?? "",
|
|
14899
|
-
onInput: handleChangeFor("idNumber", "input"),
|
|
14900
|
-
onBlur: handleChangeFor("idNumber", "blur"),
|
|
14901
|
-
formUtils,
|
|
14902
|
-
isValid: valid.idNumber,
|
|
14903
|
-
errorMessage: formUtils.getErrorMessage("idNumber", errors, fieldProblems)
|
|
14904
14867
|
}) : data.typeOfIdentity === "driversLicense" ? jsx(DriversLicense$2, {
|
|
14905
14868
|
driversLicense: data,
|
|
14906
14869
|
onIssuerStateChange: handleChangeFor("issuerState"),
|
|
@@ -16110,7 +16073,7 @@ class AdyenKycSdkError extends Error {
|
|
|
16110
16073
|
}
|
|
16111
16074
|
let sdkToken;
|
|
16112
16075
|
let fetchSdkToken;
|
|
16113
|
-
const logger$
|
|
16076
|
+
const logger$g = createLogger("Session");
|
|
16114
16077
|
const setSdkToken = (token) => {
|
|
16115
16078
|
sdkToken = token;
|
|
16116
16079
|
};
|
|
@@ -16128,7 +16091,7 @@ const refreshSession = async () => {
|
|
|
16128
16091
|
} = await fetchSdkToken();
|
|
16129
16092
|
setSdkToken(token);
|
|
16130
16093
|
} catch (e) {
|
|
16131
|
-
logger$
|
|
16094
|
+
logger$g.error("Failed to fetch sdk token", e);
|
|
16132
16095
|
}
|
|
16133
16096
|
};
|
|
16134
16097
|
const addAnimationStartListener = (element, listener) => {
|
|
@@ -16137,7 +16100,7 @@ const addAnimationStartListener = (element, listener) => {
|
|
|
16137
16100
|
const removeAnimationStartListener = (element, listener) => {
|
|
16138
16101
|
element.removeEventListener("animationstart", listener, false);
|
|
16139
16102
|
};
|
|
16140
|
-
const logger$
|
|
16103
|
+
const logger$f = createLogger("Fetch");
|
|
16141
16104
|
const getRequestObject = (options, data) => {
|
|
16142
16105
|
const {
|
|
16143
16106
|
headers = [],
|
|
@@ -16184,10 +16147,10 @@ const logFetchError = (message, level) => {
|
|
|
16184
16147
|
case "info":
|
|
16185
16148
|
case "warn":
|
|
16186
16149
|
case "error":
|
|
16187
|
-
logger$
|
|
16150
|
+
logger$f[level](message);
|
|
16188
16151
|
break;
|
|
16189
16152
|
default:
|
|
16190
|
-
logger$
|
|
16153
|
+
logger$f.error(message);
|
|
16191
16154
|
}
|
|
16192
16155
|
};
|
|
16193
16156
|
const handleFetchResponse = async (response, responseType) => {
|
|
@@ -16278,7 +16241,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
|
|
|
16278
16241
|
const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
|
|
16279
16242
|
const MOUNT_TIMEOUT = 10 * 1e3;
|
|
16280
16243
|
const TINK_VENDOR = "Tink";
|
|
16281
|
-
const logger$
|
|
16244
|
+
const logger$e = createLogger("iframeWidget");
|
|
16282
16245
|
const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
|
|
16283
16246
|
const isTerminalMessageData = (data) => Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
|
|
16284
16247
|
const parseMessageJson = (message) => {
|
|
@@ -16297,7 +16260,7 @@ const callbackErrorHandler = async (response) => {
|
|
|
16297
16260
|
try {
|
|
16298
16261
|
await response;
|
|
16299
16262
|
} catch (ex) {
|
|
16300
|
-
logger$
|
|
16263
|
+
logger$e.error(ex);
|
|
16301
16264
|
}
|
|
16302
16265
|
return {
|
|
16303
16266
|
error: "UNKNOWN_ERROR",
|
|
@@ -16403,7 +16366,7 @@ class IFrameWidget {
|
|
|
16403
16366
|
message = responseData.errorMessage;
|
|
16404
16367
|
}
|
|
16405
16368
|
} catch (ex) {
|
|
16406
|
-
logger$
|
|
16369
|
+
logger$e.error(ex);
|
|
16407
16370
|
}
|
|
16408
16371
|
throw new AdyenKycSdkError(reason, jsonData.error);
|
|
16409
16372
|
}
|
|
@@ -16589,7 +16552,7 @@ function BankVerificationWidget({
|
|
|
16589
16552
|
ref: widgetContainerRef
|
|
16590
16553
|
});
|
|
16591
16554
|
}
|
|
16592
|
-
const logger$
|
|
16555
|
+
const logger$d = createLogger("BankVerification");
|
|
16593
16556
|
const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
|
|
16594
16557
|
const InstantVerificationErrorContext = createContext(null);
|
|
16595
16558
|
const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
|
|
@@ -16623,7 +16586,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
|
|
|
16623
16586
|
const preferredVendor2 = vendors[0];
|
|
16624
16587
|
setPreferredVendor(preferredVendor2.name ? preferredVendor2 : null);
|
|
16625
16588
|
};
|
|
16626
|
-
getPreferredVendor().catch(logger$
|
|
16589
|
+
getPreferredVendor().catch(logger$d.error);
|
|
16627
16590
|
}, [country2, getBankVerificationVendors]);
|
|
16628
16591
|
return preferredVendor;
|
|
16629
16592
|
};
|
|
@@ -17308,7 +17271,11 @@ const bbanPatternsByCountry = {
|
|
|
17308
17271
|
GB: /[A-Z]{4}\d{14}/,
|
|
17309
17272
|
VG: /[\dA-Z]{4}\d{16}/
|
|
17310
17273
|
};
|
|
17274
|
+
const regionsWithSharedIbanFormat = {
|
|
17275
|
+
GB: ["GG", "IM", "JE"]
|
|
17276
|
+
};
|
|
17311
17277
|
function ibanValidator(input, bankCountries) {
|
|
17278
|
+
var _a;
|
|
17312
17279
|
if (isEmpty(input))
|
|
17313
17280
|
return "fieldIsRequired";
|
|
17314
17281
|
const ibanInput = input.replace(/ /g, "").toUpperCase();
|
|
@@ -17316,7 +17283,7 @@ function ibanValidator(input, bankCountries) {
|
|
|
17316
17283
|
return "validationPleaseEnterAValidIban";
|
|
17317
17284
|
}
|
|
17318
17285
|
const countryCode = ibanInput.substring(0, 2);
|
|
17319
|
-
if (bankCountries && !bankCountries.includes(countryCode)) {
|
|
17286
|
+
if (bankCountries && !bankCountries.includes(countryCode) && !((_a = regionsWithSharedIbanFormat[countryCode]) == null ? void 0 : _a.includes(bankCountries[0]))) {
|
|
17320
17287
|
return {
|
|
17321
17288
|
translationKey: "yourIbanShouldBeginWith_",
|
|
17322
17289
|
translationObject: {
|
|
@@ -18058,7 +18025,7 @@ function PayoutBankStatementComponent(props) {
|
|
|
18058
18025
|
const PayoutBankStatement = memo(PayoutBankStatementComponent, (prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.heading === nextProps.heading);
|
|
18059
18026
|
const VerificationMethod = "";
|
|
18060
18027
|
const hasLoaded = (loadedValue) => loadedValue !== "loading";
|
|
18061
|
-
const eeaCountries = [CountryCodes.Austria, CountryCodes.Belgium, CountryCodes.Bulgaria, CountryCodes.Croatia, CountryCodes.Cyprus, CountryCodes.CzechRepublic, CountryCodes.Denmark, CountryCodes.Estonia, CountryCodes.Finland, CountryCodes.France, CountryCodes.Germany, CountryCodes.Greece, CountryCodes.
|
|
18028
|
+
const eeaCountries = [CountryCodes.Austria, CountryCodes.Belgium, CountryCodes.Bulgaria, CountryCodes.Croatia, CountryCodes.Cyprus, CountryCodes.CzechRepublic, CountryCodes.Denmark, CountryCodes.Estonia, CountryCodes.Finland, CountryCodes.France, CountryCodes.Germany, CountryCodes.Greece, CountryCodes.Hungary, CountryCodes.Ireland, CountryCodes.Italy, CountryCodes.Latvia, CountryCodes.Liechtenstein, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Malta, CountryCodes.Netherlands, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Portugal, CountryCodes.Romania, CountryCodes.Slovakia, CountryCodes.Slovenia, CountryCodes.Spain, CountryCodes.Sweden];
|
|
18062
18029
|
const regions = {
|
|
18063
18030
|
europe: [...eeaCountries, CountryCodes.Switzerland, CountryCodes.UnitedKingdom],
|
|
18064
18031
|
apac: [CountryCodes.NewZealand, CountryCodes.Australia]
|
|
@@ -20245,7 +20212,7 @@ const defaultPayoutAccountFormat = {
|
|
|
20245
20212
|
[CountryCodes.Sweden]: "local",
|
|
20246
20213
|
[CountryCodes.UnitedKingdom]: "local"
|
|
20247
20214
|
};
|
|
20248
|
-
const logger$
|
|
20215
|
+
const logger$c = createLogger("useScenarioConfiguration");
|
|
20249
20216
|
const useScenarioConfiguration = ({
|
|
20250
20217
|
getConfigurationData,
|
|
20251
20218
|
getPayoutAccountFormatData,
|
|
@@ -20267,12 +20234,12 @@ const useScenarioConfiguration = ({
|
|
|
20267
20234
|
const response = await getConfigurationData();
|
|
20268
20235
|
setConfigurationResponse(response);
|
|
20269
20236
|
} catch (err) {
|
|
20270
|
-
logger$
|
|
20237
|
+
logger$c.warn("WARNING: Configuration request failed - error:", err);
|
|
20271
20238
|
} finally {
|
|
20272
20239
|
setLoadingStatus("success");
|
|
20273
20240
|
}
|
|
20274
20241
|
};
|
|
20275
|
-
makeConfigCallAndSave().catch(logger$
|
|
20242
|
+
makeConfigCallAndSave().catch(logger$c.error);
|
|
20276
20243
|
}, [getConfigurationData, setLoadingStatus]);
|
|
20277
20244
|
useEffect(() => {
|
|
20278
20245
|
setLoadingStatus("loading");
|
|
@@ -20288,12 +20255,12 @@ const useScenarioConfiguration = ({
|
|
|
20288
20255
|
const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
|
|
20289
20256
|
setAccountFormat(defaultAccountFormat);
|
|
20290
20257
|
} catch (err) {
|
|
20291
|
-
logger$
|
|
20258
|
+
logger$c.warn("WARNING: Payout format request failed - error:", err);
|
|
20292
20259
|
} finally {
|
|
20293
20260
|
setLoadingStatus("success");
|
|
20294
20261
|
}
|
|
20295
20262
|
};
|
|
20296
|
-
makePayoutFormatCallAndSave().catch(logger$
|
|
20263
|
+
makePayoutFormatCallAndSave().catch(logger$c.error);
|
|
20297
20264
|
}, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus]);
|
|
20298
20265
|
const {
|
|
20299
20266
|
fieldConfigurations,
|
|
@@ -20955,7 +20922,7 @@ var ToastType = /* @__PURE__ */ ((ToastType2) => {
|
|
|
20955
20922
|
return ToastType2;
|
|
20956
20923
|
})(ToastType || {});
|
|
20957
20924
|
const FormComposer = "";
|
|
20958
|
-
const logger$
|
|
20925
|
+
const logger$b = createLogger("FormRouterContextProvider");
|
|
20959
20926
|
function FormRouterContextProvider({
|
|
20960
20927
|
children,
|
|
20961
20928
|
forms,
|
|
@@ -20975,7 +20942,7 @@ function FormRouterContextProvider({
|
|
|
20975
20942
|
if (formIndex > -1) {
|
|
20976
20943
|
setFormIndex(formIndex);
|
|
20977
20944
|
} else {
|
|
20978
|
-
logger$
|
|
20945
|
+
logger$b.error("No form was found to have that field so form navigation failed.");
|
|
20979
20946
|
}
|
|
20980
20947
|
}
|
|
20981
20948
|
}), [forms, handleGetIdVerificationToken, setFormIndex]);
|
|
@@ -21578,7 +21545,7 @@ function CompanyDropinComponent({
|
|
|
21578
21545
|
})
|
|
21579
21546
|
});
|
|
21580
21547
|
}
|
|
21581
|
-
const logger$
|
|
21548
|
+
const logger$a = createLogger("useLocalStorage");
|
|
21582
21549
|
const useLocalStorage = (key, defaultValue, options) => {
|
|
21583
21550
|
const {
|
|
21584
21551
|
serializer,
|
|
@@ -21599,7 +21566,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
21599
21566
|
const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
|
|
21600
21567
|
return res;
|
|
21601
21568
|
} catch (err) {
|
|
21602
|
-
logger$
|
|
21569
|
+
logger$a.error(err);
|
|
21603
21570
|
return defaultValue;
|
|
21604
21571
|
}
|
|
21605
21572
|
});
|
|
@@ -21631,7 +21598,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
21631
21598
|
try {
|
|
21632
21599
|
updateLocalStorage();
|
|
21633
21600
|
} catch (err) {
|
|
21634
|
-
logger$
|
|
21601
|
+
logger$a.error(err);
|
|
21635
21602
|
}
|
|
21636
21603
|
}, [value]);
|
|
21637
21604
|
useEffect(() => {
|
|
@@ -21646,7 +21613,7 @@ const useLocalStorage = (key, defaultValue, options) => {
|
|
|
21646
21613
|
setValue(event.newValue ? parser(event.newValue) : void 0);
|
|
21647
21614
|
}
|
|
21648
21615
|
} catch (err) {
|
|
21649
|
-
logger$
|
|
21616
|
+
logger$a.error(err);
|
|
21650
21617
|
}
|
|
21651
21618
|
};
|
|
21652
21619
|
if (typeof window === "undefined")
|
|
@@ -21727,7 +21694,7 @@ const useShouldShowBusinessTypeSelection = (accountHolder2) => {
|
|
|
21727
21694
|
} = useExperimentsContext();
|
|
21728
21695
|
return isExperimentEnabled("EnableNewEntryFlow") && !accountHolder2;
|
|
21729
21696
|
};
|
|
21730
|
-
const logger$
|
|
21697
|
+
const logger$9 = createLogger("useExemptSettlor");
|
|
21731
21698
|
const useExemptSettlor = ({
|
|
21732
21699
|
trust: trust2,
|
|
21733
21700
|
handleGetLegalEntity
|
|
@@ -21741,7 +21708,7 @@ const useExemptSettlor = ({
|
|
|
21741
21708
|
useEffect(() => {
|
|
21742
21709
|
if (!trust2)
|
|
21743
21710
|
return;
|
|
21744
|
-
updateExemptSettlor(trust2).catch(logger$
|
|
21711
|
+
updateExemptSettlor(trust2).catch(logger$9.error);
|
|
21745
21712
|
}, [trust2, updateExemptSettlor]);
|
|
21746
21713
|
return exemptSettlor;
|
|
21747
21714
|
};
|
|
@@ -25463,12 +25430,41 @@ function Chapter({
|
|
|
25463
25430
|
})]
|
|
25464
25431
|
});
|
|
25465
25432
|
}
|
|
25433
|
+
const delay = (time) => new Promise((resolve) => {
|
|
25434
|
+
setTimeout(resolve, time);
|
|
25435
|
+
});
|
|
25436
|
+
const ReferenceContext = createContext({
|
|
25437
|
+
references: {},
|
|
25438
|
+
addReference: () => {
|
|
25439
|
+
}
|
|
25440
|
+
});
|
|
25441
|
+
function useReferenceContext() {
|
|
25442
|
+
const context = useContext(ReferenceContext);
|
|
25443
|
+
if (context === void 0) {
|
|
25444
|
+
throw new Error("useReferenceContext must be used within a ReferenceProvider");
|
|
25445
|
+
}
|
|
25446
|
+
return context;
|
|
25447
|
+
}
|
|
25448
|
+
const formatId = (id2) => {
|
|
25449
|
+
if (!id2)
|
|
25450
|
+
return;
|
|
25451
|
+
const strippedId = id2.replace(/[^\w-]/g, "");
|
|
25452
|
+
return `document-viewer-${strippedId}`;
|
|
25453
|
+
};
|
|
25466
25454
|
function InternalReference({
|
|
25467
|
-
referencedLabel,
|
|
25455
|
+
referencedLabel: originalReferencedLabel,
|
|
25468
25456
|
displayText
|
|
25469
25457
|
}) {
|
|
25458
|
+
const referencedLabel = formatId(originalReferencedLabel) ?? "";
|
|
25470
25459
|
const label = displayText ? displayText.content : referencedLabel;
|
|
25471
|
-
const
|
|
25460
|
+
const {
|
|
25461
|
+
references
|
|
25462
|
+
} = useReferenceContext();
|
|
25463
|
+
const scrollIntoView = async () => {
|
|
25464
|
+
if (references && referencedLabel && references[referencedLabel]) {
|
|
25465
|
+
references[referencedLabel].openSection();
|
|
25466
|
+
await delay(150);
|
|
25467
|
+
}
|
|
25472
25468
|
const scrollParent = getScrollParent(document.getElementById(referencedLabel));
|
|
25473
25469
|
const element = scrollParent == null ? void 0 : scrollParent.querySelector(`#${referencedLabel}`);
|
|
25474
25470
|
element == null ? void 0 : element.scrollIntoView({
|
|
@@ -25518,14 +25514,62 @@ function Paragraph({
|
|
|
25518
25514
|
});
|
|
25519
25515
|
}
|
|
25520
25516
|
const Section$1 = "";
|
|
25517
|
+
const extractLabels = (contentElements) => {
|
|
25518
|
+
if (!contentElements || !Array.isArray(contentElements))
|
|
25519
|
+
return [];
|
|
25520
|
+
return contentElements.flatMap((element) => {
|
|
25521
|
+
if ("type" in element) {
|
|
25522
|
+
switch (element.type) {
|
|
25523
|
+
case ElementTypes.Section:
|
|
25524
|
+
case ElementTypes.Table:
|
|
25525
|
+
return "label" in element ? [element.label] : [];
|
|
25526
|
+
default:
|
|
25527
|
+
return [];
|
|
25528
|
+
}
|
|
25529
|
+
}
|
|
25530
|
+
if ("contentElements" in element) {
|
|
25531
|
+
return extractLabels(element.contentElements);
|
|
25532
|
+
}
|
|
25533
|
+
return [];
|
|
25534
|
+
});
|
|
25535
|
+
};
|
|
25521
25536
|
function Section({
|
|
25522
25537
|
title,
|
|
25523
|
-
label,
|
|
25538
|
+
label: originalLabel,
|
|
25524
25539
|
isTopLevel,
|
|
25525
25540
|
contentElements
|
|
25526
25541
|
}) {
|
|
25542
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
25543
|
+
const {
|
|
25544
|
+
addReference
|
|
25545
|
+
} = useReferenceContext();
|
|
25546
|
+
const label = formatId(originalLabel);
|
|
25547
|
+
useEffect(() => {
|
|
25548
|
+
if (isTopLevel) {
|
|
25549
|
+
const references = extractLabels(contentElements).map(formatId);
|
|
25550
|
+
if (label) {
|
|
25551
|
+
references.push(label);
|
|
25552
|
+
}
|
|
25553
|
+
if (references.length) {
|
|
25554
|
+
references.forEach((reference) => {
|
|
25555
|
+
addReference({
|
|
25556
|
+
[reference]: {
|
|
25557
|
+
openSection: () => setIsOpen(true)
|
|
25558
|
+
}
|
|
25559
|
+
});
|
|
25560
|
+
});
|
|
25561
|
+
}
|
|
25562
|
+
}
|
|
25563
|
+
}, []);
|
|
25527
25564
|
return isTopLevel ? jsx(AccordionItem, {
|
|
25528
25565
|
title: title.content,
|
|
25566
|
+
open: isOpen,
|
|
25567
|
+
onOpen: () => {
|
|
25568
|
+
setIsOpen(true);
|
|
25569
|
+
},
|
|
25570
|
+
onClose: () => {
|
|
25571
|
+
setIsOpen(false);
|
|
25572
|
+
},
|
|
25529
25573
|
children: jsx("section", {
|
|
25530
25574
|
className: "adyen-kyc-section-box",
|
|
25531
25575
|
id: label,
|
|
@@ -25550,12 +25594,13 @@ function Section({
|
|
|
25550
25594
|
const _table_component = "";
|
|
25551
25595
|
function Table({
|
|
25552
25596
|
rows,
|
|
25553
|
-
label,
|
|
25597
|
+
label: originalLabel,
|
|
25554
25598
|
captions,
|
|
25555
25599
|
titlePrefix,
|
|
25556
25600
|
title
|
|
25557
25601
|
}) {
|
|
25558
25602
|
const id2 = useId$1();
|
|
25603
|
+
const label = formatId(originalLabel);
|
|
25559
25604
|
return jsxs("div", {
|
|
25560
25605
|
id: label,
|
|
25561
25606
|
children: [jsxs("div", {
|
|
@@ -25686,26 +25731,46 @@ function ContentElements({
|
|
|
25686
25731
|
children: elements
|
|
25687
25732
|
});
|
|
25688
25733
|
}
|
|
25734
|
+
function ReferenceContextProvider({
|
|
25735
|
+
children
|
|
25736
|
+
}) {
|
|
25737
|
+
const [references, setReferences] = useState({});
|
|
25738
|
+
const contextValue = useMemo(() => ({
|
|
25739
|
+
addReference: (reference) => {
|
|
25740
|
+
setReferences((prevReferences) => ({
|
|
25741
|
+
...prevReferences,
|
|
25742
|
+
...reference
|
|
25743
|
+
}));
|
|
25744
|
+
},
|
|
25745
|
+
references
|
|
25746
|
+
}), [references, setReferences]);
|
|
25747
|
+
return jsx(ReferenceContext.Provider, {
|
|
25748
|
+
value: contextValue,
|
|
25749
|
+
children
|
|
25750
|
+
});
|
|
25751
|
+
}
|
|
25689
25752
|
function ContractViewer({
|
|
25690
25753
|
contract,
|
|
25691
25754
|
className,
|
|
25692
25755
|
onExpandSection
|
|
25693
25756
|
}) {
|
|
25694
25757
|
const classNames = cx("adyen-contract-viewer", className);
|
|
25695
|
-
return
|
|
25696
|
-
|
|
25697
|
-
|
|
25698
|
-
|
|
25699
|
-
|
|
25700
|
-
|
|
25701
|
-
|
|
25702
|
-
|
|
25703
|
-
|
|
25704
|
-
|
|
25705
|
-
|
|
25706
|
-
|
|
25707
|
-
|
|
25708
|
-
|
|
25758
|
+
return jsx(ReferenceContextProvider, {
|
|
25759
|
+
children: jsxs("main", {
|
|
25760
|
+
className: classNames,
|
|
25761
|
+
children: [jsx(Heading, {
|
|
25762
|
+
level: 1,
|
|
25763
|
+
className: "adl-u-margin-top-24 adl-u-margin-bottom-16",
|
|
25764
|
+
children: jsx(Text, {
|
|
25765
|
+
content: contract.title.content,
|
|
25766
|
+
styles: contract.title.styles
|
|
25767
|
+
})
|
|
25768
|
+
}), jsx(ContentElements, {
|
|
25769
|
+
contentElements: contract.contentElements,
|
|
25770
|
+
onExpandSection,
|
|
25771
|
+
isTopLevel: true
|
|
25772
|
+
})]
|
|
25773
|
+
})
|
|
25709
25774
|
});
|
|
25710
25775
|
}
|
|
25711
25776
|
const pciValidationRules = {
|
|
@@ -26571,7 +26636,7 @@ const serviceAgreementValidationRules = {
|
|
|
26571
26636
|
errorMessage: "fieldIsRequired"
|
|
26572
26637
|
}
|
|
26573
26638
|
};
|
|
26574
|
-
const logger$
|
|
26639
|
+
const logger$8 = createLogger("useServiceAgreement");
|
|
26575
26640
|
const FALLBACK_LANGUAGE_CODE = "en";
|
|
26576
26641
|
const useServiceAgreement = ({
|
|
26577
26642
|
handleGetServiceAgreement,
|
|
@@ -26600,7 +26665,7 @@ const useServiceAgreement = ({
|
|
|
26600
26665
|
language: agreementLanguage
|
|
26601
26666
|
});
|
|
26602
26667
|
if (!document2) {
|
|
26603
|
-
logger$
|
|
26668
|
+
logger$8.log('"document" field was missing in response');
|
|
26604
26669
|
return;
|
|
26605
26670
|
}
|
|
26606
26671
|
const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
|
|
@@ -26618,7 +26683,7 @@ const useServiceAgreement = ({
|
|
|
26618
26683
|
throw err;
|
|
26619
26684
|
}
|
|
26620
26685
|
};
|
|
26621
|
-
requestServiceAgreement().catch(logger$
|
|
26686
|
+
requestServiceAgreement().catch(logger$8.error);
|
|
26622
26687
|
}, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
|
|
26623
26688
|
return {
|
|
26624
26689
|
loading: loading2,
|
|
@@ -27961,7 +28026,7 @@ function TrustDropinComponent(props) {
|
|
|
27961
28026
|
}
|
|
27962
28027
|
const PAGES_WITH_STATUS = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
|
|
27963
28028
|
const POLLING_INTERVAL = 3e3;
|
|
27964
|
-
const logger$
|
|
28029
|
+
const logger$7 = createLogger("DropinComposerComponent");
|
|
27965
28030
|
const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
|
|
27966
28031
|
function DropinComposerComponent({
|
|
27967
28032
|
capabilities,
|
|
@@ -28054,7 +28119,7 @@ function DropinComposerComponent({
|
|
|
28054
28119
|
setPciStatus(response);
|
|
28055
28120
|
return response;
|
|
28056
28121
|
} catch (e) {
|
|
28057
|
-
logger$
|
|
28122
|
+
logger$7.warn(i18n.get("failedToGetPciStatus"));
|
|
28058
28123
|
}
|
|
28059
28124
|
}
|
|
28060
28125
|
return void 0;
|
|
@@ -28083,7 +28148,7 @@ function DropinComposerComponent({
|
|
|
28083
28148
|
useEffect(() => {
|
|
28084
28149
|
if (!tasks.includes(TaskTypes.PCI_DSS))
|
|
28085
28150
|
return;
|
|
28086
|
-
getPciTemplate().catch(logger$
|
|
28151
|
+
getPciTemplate().catch(logger$7.error);
|
|
28087
28152
|
}, [getPciTemplate, tasks]);
|
|
28088
28153
|
const getServiceAgreementAcceptanceInfos = async () => {
|
|
28089
28154
|
if (rootLegalEntity.id && (args == null ? void 0 : args.handleGetServiceAgreementAcceptanceInfos)) {
|
|
@@ -28091,7 +28156,7 @@ function DropinComposerComponent({
|
|
|
28091
28156
|
const response = await args.handleGetServiceAgreementAcceptanceInfos(rootLegalEntity.id);
|
|
28092
28157
|
setServiceAgreementAcceptanceInfos(response.data);
|
|
28093
28158
|
} catch (e) {
|
|
28094
|
-
logger$
|
|
28159
|
+
logger$7.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
28095
28160
|
}
|
|
28096
28161
|
}
|
|
28097
28162
|
};
|
|
@@ -28101,7 +28166,7 @@ function DropinComposerComponent({
|
|
|
28101
28166
|
const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
|
|
28102
28167
|
setServiceAgreementTypes(response.termsOfServiceTypes);
|
|
28103
28168
|
} catch (e) {
|
|
28104
|
-
logger$
|
|
28169
|
+
logger$7.warn(i18n.get("failedToGetServiceAgreementStatus"));
|
|
28105
28170
|
}
|
|
28106
28171
|
}
|
|
28107
28172
|
};
|
|
@@ -28140,7 +28205,7 @@ function DropinComposerComponent({
|
|
|
28140
28205
|
setCapabilityProblems(getCapabilityProblems(response));
|
|
28141
28206
|
return response;
|
|
28142
28207
|
} catch (e) {
|
|
28143
|
-
logger$
|
|
28208
|
+
logger$7.warn(i18n.get("failedToFetchLegalEntityDetails"));
|
|
28144
28209
|
}
|
|
28145
28210
|
}
|
|
28146
28211
|
return void 0;
|
|
@@ -28152,7 +28217,7 @@ function DropinComposerComponent({
|
|
|
28152
28217
|
setTrust(response);
|
|
28153
28218
|
return response;
|
|
28154
28219
|
} catch (e) {
|
|
28155
|
-
logger$
|
|
28220
|
+
logger$7.warn(i18n.get("failedToFetchTrustDetails"));
|
|
28156
28221
|
}
|
|
28157
28222
|
}
|
|
28158
28223
|
return void 0;
|
|
@@ -28202,7 +28267,7 @@ function DropinComposerComponent({
|
|
|
28202
28267
|
label: i18n.get("successFullyRemovedTrustMember")
|
|
28203
28268
|
});
|
|
28204
28269
|
} catch (err) {
|
|
28205
|
-
logger$
|
|
28270
|
+
logger$7.error(`Failed to delete trust member`, err);
|
|
28206
28271
|
showToast({
|
|
28207
28272
|
type: ToastType.ERROR,
|
|
28208
28273
|
label: i18n.get("failedToRemoveTrustMember")
|
|
@@ -28272,7 +28337,7 @@ function DropinComposerComponent({
|
|
|
28272
28337
|
}
|
|
28273
28338
|
break;
|
|
28274
28339
|
default:
|
|
28275
|
-
logger$
|
|
28340
|
+
logger$7.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
|
|
28276
28341
|
}
|
|
28277
28342
|
showToast({
|
|
28278
28343
|
label: i18n.get("successfullyUpdatedDetails"),
|
|
@@ -28280,7 +28345,7 @@ function DropinComposerComponent({
|
|
|
28280
28345
|
});
|
|
28281
28346
|
await refreshTrustAndRunOnSubmit(trust2, 1);
|
|
28282
28347
|
} catch (err) {
|
|
28283
|
-
logger$
|
|
28348
|
+
logger$7.error(err);
|
|
28284
28349
|
showToast({
|
|
28285
28350
|
label: i18n.get("failedToUpdateDetails"),
|
|
28286
28351
|
type: ToastType.ERROR
|
|
@@ -28503,7 +28568,7 @@ function DropinComposerComponent({
|
|
|
28503
28568
|
}
|
|
28504
28569
|
};
|
|
28505
28570
|
setIsLoadingConfiguration(true);
|
|
28506
|
-
fetchConfiguration().catch(logger$
|
|
28571
|
+
fetchConfiguration().catch(logger$7.error).finally(() => {
|
|
28507
28572
|
setIsLoadingConfiguration(false);
|
|
28508
28573
|
onLoad();
|
|
28509
28574
|
});
|
|
@@ -29110,6 +29175,38 @@ const createTrustedTransferInstrument = async (context, code2, state2) => {
|
|
|
29110
29175
|
state: state2
|
|
29111
29176
|
});
|
|
29112
29177
|
};
|
|
29178
|
+
const getAddress = async (context, addressId) => {
|
|
29179
|
+
const {
|
|
29180
|
+
loadingContext,
|
|
29181
|
+
legalEntityId
|
|
29182
|
+
} = context;
|
|
29183
|
+
return httpGet({
|
|
29184
|
+
loadingContext,
|
|
29185
|
+
errorLevel: "warn",
|
|
29186
|
+
errorMessage: `Failed to find address`,
|
|
29187
|
+
path: `${legalEntityId}/addresses/${addressId}`,
|
|
29188
|
+
authentication: "jwt",
|
|
29189
|
+
headers: {
|
|
29190
|
+
"Content-Type": "application/json"
|
|
29191
|
+
}
|
|
29192
|
+
});
|
|
29193
|
+
};
|
|
29194
|
+
const getIdverificationToken = async (context, request) => {
|
|
29195
|
+
const {
|
|
29196
|
+
loadingContext,
|
|
29197
|
+
legalEntityId
|
|
29198
|
+
} = context;
|
|
29199
|
+
return httpPost({
|
|
29200
|
+
loadingContext,
|
|
29201
|
+
errorLevel: "warn",
|
|
29202
|
+
errorMessage: `Failed to find address`,
|
|
29203
|
+
path: `${legalEntityId}/providers/IdVerification/initiate`,
|
|
29204
|
+
authentication: "jwt",
|
|
29205
|
+
headers: {
|
|
29206
|
+
"Content-Type": "application/json"
|
|
29207
|
+
}
|
|
29208
|
+
}, request);
|
|
29209
|
+
};
|
|
29113
29210
|
const handleBankVerificationError = async (context, errorCode, errorMessage, state2, metadata) => {
|
|
29114
29211
|
const {
|
|
29115
29212
|
loadingContext,
|
|
@@ -29132,6 +29229,38 @@ const handleBankVerificationError = async (context, errorCode, errorMessage, sta
|
|
|
29132
29229
|
metadata
|
|
29133
29230
|
});
|
|
29134
29231
|
};
|
|
29232
|
+
const idVerificationStartcheck = async (context, request) => {
|
|
29233
|
+
const {
|
|
29234
|
+
loadingContext,
|
|
29235
|
+
legalEntityId
|
|
29236
|
+
} = context;
|
|
29237
|
+
return httpPost({
|
|
29238
|
+
loadingContext,
|
|
29239
|
+
errorLevel: "warn",
|
|
29240
|
+
errorMessage: `Failed to find address`,
|
|
29241
|
+
path: `${legalEntityId}/providers/IdVerification/process`,
|
|
29242
|
+
authentication: "jwt",
|
|
29243
|
+
headers: {
|
|
29244
|
+
"Content-Type": "application/json"
|
|
29245
|
+
}
|
|
29246
|
+
}, request);
|
|
29247
|
+
};
|
|
29248
|
+
const searchAddress = async (context, address2) => {
|
|
29249
|
+
const {
|
|
29250
|
+
loadingContext,
|
|
29251
|
+
legalEntityId
|
|
29252
|
+
} = context;
|
|
29253
|
+
return httpPost({
|
|
29254
|
+
loadingContext,
|
|
29255
|
+
errorLevel: "warn",
|
|
29256
|
+
errorMessage: `Failed to search address`,
|
|
29257
|
+
path: `${legalEntityId}/addresses`,
|
|
29258
|
+
authentication: "jwt",
|
|
29259
|
+
headers: {
|
|
29260
|
+
"Content-Type": "application/json"
|
|
29261
|
+
}
|
|
29262
|
+
}, address2);
|
|
29263
|
+
};
|
|
29135
29264
|
const COMPONENTS_API_VERSION = "v1";
|
|
29136
29265
|
const useComponentApi = (rootLegalEntityId) => {
|
|
29137
29266
|
const authContext = useAuthContext();
|
|
@@ -29169,7 +29298,11 @@ const useComponentApi = (rootLegalEntityId) => {
|
|
|
29169
29298
|
createTransferInstrument: async (transferInstrument) => createTransferInstrument(baseRequestContext, transferInstrument),
|
|
29170
29299
|
updateTransferInstrument: async (transferInstrument, transferInstrumentId) => updateTransferInstrument(baseRequestContext, transferInstrument, transferInstrumentId),
|
|
29171
29300
|
createTrustedTransferInstrument: async (code2, state2) => createTrustedTransferInstrument(baseRequestContext, code2, state2),
|
|
29172
|
-
handleBankVerificationError: async (errorCode, errorMessage, state2, metadata) => handleBankVerificationError(baseRequestContext, errorCode, errorMessage, state2, metadata)
|
|
29301
|
+
handleBankVerificationError: async (errorCode, errorMessage, state2, metadata) => handleBankVerificationError(baseRequestContext, errorCode, errorMessage, state2, metadata),
|
|
29302
|
+
searchAddress: async (address2) => searchAddress(baseRequestContext, address2),
|
|
29303
|
+
getAddress: async (address2) => getAddress(baseRequestContext, address2),
|
|
29304
|
+
getIdVerificationToken: async (legalEntityId, data) => getIdverificationToken(baseRequestContext, data),
|
|
29305
|
+
idVerificationStartCheck: async (legalEntityId, data) => idVerificationStartcheck(baseRequestContext, data)
|
|
29173
29306
|
};
|
|
29174
29307
|
}, [base, rootLegalEntityId]);
|
|
29175
29308
|
};
|
|
@@ -29192,7 +29325,7 @@ class EventEmitter {
|
|
|
29192
29325
|
};
|
|
29193
29326
|
}
|
|
29194
29327
|
}
|
|
29195
|
-
const logger$
|
|
29328
|
+
const logger$6 = createLogger("CreateIndividualComponent");
|
|
29196
29329
|
function CreateIndividualComponent({
|
|
29197
29330
|
parentLegalEntityId,
|
|
29198
29331
|
legalEntityId,
|
|
@@ -29210,7 +29343,11 @@ function CreateIndividualComponent({
|
|
|
29210
29343
|
updateLegalEntity: updateLegalEntity2,
|
|
29211
29344
|
getDocument: getDocument2,
|
|
29212
29345
|
createDocument: createDocument2,
|
|
29213
|
-
updateDocument: updateDocument2
|
|
29346
|
+
updateDocument: updateDocument2,
|
|
29347
|
+
searchAddress: searchAddress2,
|
|
29348
|
+
getAddress: getAddress2,
|
|
29349
|
+
getIdVerificationToken,
|
|
29350
|
+
idVerificationStartCheck
|
|
29214
29351
|
} = useComponentApi(legalEntityId ?? parentLegalEntityId);
|
|
29215
29352
|
const [legalEntity, setLegalEntity] = useState();
|
|
29216
29353
|
const [parentLegalEntity, setParentLegalEntity] = useState();
|
|
@@ -29221,13 +29358,13 @@ function CreateIndividualComponent({
|
|
|
29221
29358
|
setParentLegalEntity(parentEntity);
|
|
29222
29359
|
setLegalEntity(entity);
|
|
29223
29360
|
} catch (error) {
|
|
29224
|
-
logger$
|
|
29361
|
+
logger$6.error(error);
|
|
29225
29362
|
} finally {
|
|
29226
29363
|
setLoadingStatus("success");
|
|
29227
29364
|
}
|
|
29228
29365
|
}, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
|
|
29229
29366
|
useEffect(() => {
|
|
29230
|
-
fetchLegalEntity().catch(logger$
|
|
29367
|
+
fetchLegalEntity().catch(logger$6.error);
|
|
29231
29368
|
}, [fetchLegalEntity]);
|
|
29232
29369
|
return loadingStatus === "loading" ? jsx(Loader, {
|
|
29233
29370
|
size: "medium"
|
|
@@ -29240,13 +29377,17 @@ function CreateIndividualComponent({
|
|
|
29240
29377
|
handleUpdateDocument: updateDocument2,
|
|
29241
29378
|
handleUpdateLegalEntity: updateLegalEntity2,
|
|
29242
29379
|
handleCreateLegalEntity: createLegalEntity2,
|
|
29380
|
+
handleFindAddress: getAddress2,
|
|
29381
|
+
handleAddressSearch: searchAddress2,
|
|
29382
|
+
handleGetIdVerificationToken: getIdVerificationToken,
|
|
29383
|
+
handleGetIdVerificationStartCheck: idVerificationStartCheck,
|
|
29243
29384
|
handleBackClick,
|
|
29244
29385
|
hideNavigation: true,
|
|
29245
29386
|
onSubmit: onSubmitSuccess,
|
|
29246
29387
|
taskType
|
|
29247
29388
|
});
|
|
29248
29389
|
}
|
|
29249
|
-
const logger$
|
|
29390
|
+
const logger$5 = createLogger("CreateTransferInstrumentComponent");
|
|
29250
29391
|
function CreateTransferInstrumentComponent({
|
|
29251
29392
|
legalEntityId,
|
|
29252
29393
|
transferInstrumentId,
|
|
@@ -29280,7 +29421,7 @@ function CreateTransferInstrumentComponent({
|
|
|
29280
29421
|
const ti = await getTransferInstrument2(transferInstrumentId);
|
|
29281
29422
|
setTransferInstrument(ti);
|
|
29282
29423
|
}
|
|
29283
|
-
})().catch(logger$
|
|
29424
|
+
})().catch(logger$5.error);
|
|
29284
29425
|
}, [transferInstrumentId, fetchLegalEntity]);
|
|
29285
29426
|
return legalEntity ? jsx(PayoutDetailsDropinComponent, {
|
|
29286
29427
|
eventEmitter: eventEmitter ?? new EventEmitter(),
|
|
@@ -29382,6 +29523,60 @@ const getSupportedCountries = async (context) => {
|
|
|
29382
29523
|
}
|
|
29383
29524
|
});
|
|
29384
29525
|
};
|
|
29526
|
+
const validatePhoneNumber$1 = async (context, phoneNumber2) => {
|
|
29527
|
+
const {
|
|
29528
|
+
loadingContext,
|
|
29529
|
+
legalEntityId
|
|
29530
|
+
} = context;
|
|
29531
|
+
return httpPost({
|
|
29532
|
+
loadingContext,
|
|
29533
|
+
authentication: "jwt",
|
|
29534
|
+
errorLevel: "warn",
|
|
29535
|
+
errorMessage: "Phone validation is not available",
|
|
29536
|
+
path: `${legalEntityId}/validations/phonenumber`
|
|
29537
|
+
}, {
|
|
29538
|
+
number: phoneNumber2
|
|
29539
|
+
});
|
|
29540
|
+
};
|
|
29541
|
+
const logger$4 = createLogger("verify-id-number");
|
|
29542
|
+
const verifyIdNumber$1 = async (context, request) => {
|
|
29543
|
+
const {
|
|
29544
|
+
loadingContext,
|
|
29545
|
+
legalEntityId
|
|
29546
|
+
} = context;
|
|
29547
|
+
try {
|
|
29548
|
+
return await httpPost({
|
|
29549
|
+
loadingContext,
|
|
29550
|
+
errorLevel: "warn",
|
|
29551
|
+
errorMessage: `Id number verification is not available`,
|
|
29552
|
+
path: `${legalEntityId}/verifications/idNumber`,
|
|
29553
|
+
authentication: "jwt",
|
|
29554
|
+
headers: {
|
|
29555
|
+
"Content-Type": "application/json"
|
|
29556
|
+
},
|
|
29557
|
+
// Handler for unhappy flows, i.e. status != 200, in the idNumber verification process
|
|
29558
|
+
errorHandler: async (response) => {
|
|
29559
|
+
const responseData = await response;
|
|
29560
|
+
if (responseData.status === 422) {
|
|
29561
|
+
return {
|
|
29562
|
+
status: 422,
|
|
29563
|
+
message: responseData.detail,
|
|
29564
|
+
errorCode: responseData.errorCode
|
|
29565
|
+
};
|
|
29566
|
+
}
|
|
29567
|
+
if (responseData.status === 500) {
|
|
29568
|
+
return {
|
|
29569
|
+
status: 500,
|
|
29570
|
+
message: "Service did not respond, do not block verification"
|
|
29571
|
+
};
|
|
29572
|
+
}
|
|
29573
|
+
return logger$4.warn(`Unexpected response status ${responseData.status}`);
|
|
29574
|
+
}
|
|
29575
|
+
}, request);
|
|
29576
|
+
} catch (e) {
|
|
29577
|
+
logger$4.warn("WARNING: idNumber verification failed - error:", e);
|
|
29578
|
+
}
|
|
29579
|
+
};
|
|
29385
29580
|
const getEmbeddedApi = ({
|
|
29386
29581
|
base,
|
|
29387
29582
|
rootLegalEntityId
|
|
@@ -29414,12 +29609,8 @@ const getEmbeddedApi = ({
|
|
|
29414
29609
|
getImageUrl: () => `${base}static/images/`,
|
|
29415
29610
|
getAllowedCountries: async () => getSupportedCountries(baseRequestContext),
|
|
29416
29611
|
getAllowedLocales: async () => getAllowedLocales$1(baseRequestContext),
|
|
29417
|
-
validatePhoneNumber: () =>
|
|
29418
|
-
|
|
29419
|
-
},
|
|
29420
|
-
verifyIdNumber: () => {
|
|
29421
|
-
throw new Error("verifyIdNumber: Not implemented in onboarding component api");
|
|
29422
|
-
},
|
|
29612
|
+
validatePhoneNumber: async (phoneNumber2) => validatePhoneNumber$1(baseRequestContext, phoneNumber2),
|
|
29613
|
+
verifyIdNumber: async (request) => verifyIdNumber$1(baseRequestContext, request),
|
|
29423
29614
|
companyIndexSearch: () => {
|
|
29424
29615
|
throw new Error("companyIndexSearch: Not implemented in onboarding component api");
|
|
29425
29616
|
},
|