@adyen/kyc-components 2.13.2 → 2.13.3
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.
|
@@ -12391,8 +12391,13 @@ const mapIndividualDocumentToApiDocument = async (data, entityId) => {
|
|
|
12391
12391
|
}
|
|
12392
12392
|
};
|
|
12393
12393
|
const mapApiIdDocumentToSchema = (idDocument2) => {
|
|
12394
|
-
const
|
|
12395
|
-
|
|
12394
|
+
const {
|
|
12395
|
+
hasBackPage
|
|
12396
|
+
} = idDocumentTypeOptions.find(({
|
|
12397
|
+
id: id2
|
|
12398
|
+
}) => id2 === idDocument2.type);
|
|
12399
|
+
const frontPage2 = hasBackPage ? getPage(idDocument2, "front") : getPage(idDocument2);
|
|
12400
|
+
const backPage2 = hasBackPage ? getPage(idDocument2, "back") : void 0;
|
|
12396
12401
|
return {
|
|
12397
12402
|
...frontPage2 ? {
|
|
12398
12403
|
idFrontPage: [{
|
|
@@ -12622,40 +12627,34 @@ function IdDocumentManualUploadComponent(props) {
|
|
|
12622
12627
|
prevState,
|
|
12623
12628
|
changeInitiatedBy
|
|
12624
12629
|
}) => {
|
|
12625
|
-
var _a2, _b, _c, _d, _e, _f
|
|
12626
|
-
if (changeInitiatedBy === "idDocument") {
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
if (!isBackPageSelected) {
|
|
12654
|
-
setIdBackPage({
|
|
12655
|
-
idBackPage: null
|
|
12656
|
-
});
|
|
12657
|
-
}
|
|
12658
|
-
}
|
|
12630
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
12631
|
+
if (changeInitiatedBy === "idDocument" && ((_b = (_a2 = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a2.idDocument) == null ? void 0 : _b.idDocumentType) !== ((_d = (_c = prevState == null ? void 0 : prevState.data) == null ? void 0 : _c.idDocument) == null ? void 0 : _d.idDocumentType)) {
|
|
12632
|
+
const idDocumentType = (_f = (_e = currentState.data) == null ? void 0 : _e.idDocument) == null ? void 0 : _f.idDocumentType;
|
|
12633
|
+
const document2 = idDocumentType ? getDocument$1(props.legalEntityId, idDocumentType) : void 0;
|
|
12634
|
+
if (!document2) {
|
|
12635
|
+
setIdFrontPage({
|
|
12636
|
+
idFrontPage: null
|
|
12637
|
+
});
|
|
12638
|
+
setIdBackPage({
|
|
12639
|
+
idBackPage: null
|
|
12640
|
+
});
|
|
12641
|
+
} else if (hasBackPage(idDocumentType)) {
|
|
12642
|
+
setIdFrontPage({
|
|
12643
|
+
idFrontPage: [{
|
|
12644
|
+
name: getPageName(document2, "front")
|
|
12645
|
+
}]
|
|
12646
|
+
});
|
|
12647
|
+
setIdBackPage({
|
|
12648
|
+
idBackPage: [{
|
|
12649
|
+
name: getPageName(document2, "back")
|
|
12650
|
+
}]
|
|
12651
|
+
});
|
|
12652
|
+
} else {
|
|
12653
|
+
setIdFrontPage({
|
|
12654
|
+
idFrontPage: [{
|
|
12655
|
+
name: getPageName(document2)
|
|
12656
|
+
}]
|
|
12657
|
+
});
|
|
12659
12658
|
}
|
|
12660
12659
|
}
|
|
12661
12660
|
};
|