@adyen/kyc-components 4.6.1 → 4.7.0-beta.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/{AcceptTermsOfServiceComponent-B3l9btP-.js → AcceptTermsOfServiceComponent-RYwThKmu.js} +17 -16
- package/dist/{AccountSetupRejected-DbdJB-OJ.js → AccountSetupRejected-DhwwBH0S.js} +2 -2
- package/dist/{ActionBar-BUo_zptQ.js → ActionBar-u-Qc7Y4w.js} +1 -1
- package/dist/{Address-B1q0i8VT.js → Address-TGZeMCUA.js} +15 -15
- package/dist/{Avatar-V--81dug.js → Avatar-LSd9cIJV.js} +1 -1
- package/dist/{BusinessFinancingComponent-yACwTlmi.js → BusinessFinancingComponent-DAeZTKW1.js} +6 -6
- package/dist/{BusinessFinancingDropin-DwMpqWbh.js → BusinessFinancingDropin-BVgSTmUm.js} +27 -27
- package/dist/BusinessFinancingPage-vKWY2gWN.js +43 -0
- package/dist/{BusinessTypeSelectionPage-RRp8YkIk.js → BusinessTypeSelectionPage-DhpGpgac.js} +9 -9
- package/dist/{Checkbox-CBsyuXip.js → Checkbox-D5-_dw4-.js} +1 -1
- package/dist/{Confirm-BLjnKmbU.js → Confirm-BoQbVMKQ.js} +2 -2
- package/dist/{ConstitutionalDocument-aYMC7Qld.js → ConstitutionalDocument-CjUSPI6f.js} +37 -26
- package/dist/{ContactDetails-BBTAGuyq.js → ContactDetails-Bj1jL-WF.js} +9 -19
- package/dist/{ContextGuidance-BJIBM5W-.js → ContextGuidance-CoDkF9Kh.js} +1 -1
- package/dist/{CountryField-o99j4P7E.js → CountryField-DPtohqO0.js} +3 -3
- package/dist/{CreateIndividualComponent-CmhrM9Gy.js → CreateIndividualComponent-DnDxRY8S.js} +6 -6
- package/dist/{CreateTransferInstrumentComponent-CHaq9Cug.js → CreateTransferInstrumentComponent-BB1v1vPR.js} +4 -4
- package/dist/{Currency-hrruvtK7.js → Currency-DjKXc6D1.js} +7 -7
- package/dist/{CustomerSupport-D9V9znlz.js → CustomerSupport-nxoB2aXL.js} +9 -9
- package/dist/{DebugModal-C3ODQ7HG.js → DebugModal-DK9xbFjU.js} +7 -7
- package/dist/{DecisionMakerDetails-BUm0ukYp.js → DecisionMakerDetails-D-POvfJr.js} +9 -9
- package/dist/{DecisionMakerDetailsPage-DiYr15fi.js → DecisionMakerDetailsPage-CABFACYm.js} +8 -8
- package/dist/{DecisionMakers-BCk4n5BI.js → DecisionMakers-B4gmdJ-s.js} +20 -20
- package/dist/{Dropzone-Dled5Xv_.js → Dropzone-IwRNw22i.js} +3 -3
- package/dist/{EmbeddedStatus-a9eBGaNp.js → EmbeddedStatus-BU2hma9l.js} +2 -2
- package/dist/{EndStateLayout-Doxwm8Bv.js → EndStateLayout-DURCt96r.js} +1 -1
- package/dist/{EntityAssociation-BdpQ9IKO.js → EntityAssociation-TBvPBEGa.js} +4 -4
- package/dist/{EntityGuidanceStatus-CqfeJN28.js → EntityGuidanceStatus-CFRY8Yia.js} +4 -4
- package/dist/{ErrorPanel-B_t2Mr0a.js → ErrorPanel-ALBlWg3_.js} +2 -2
- package/dist/{Field-DhGlekN4.js → Field--T3FQepj.js} +1 -1
- package/dist/{FormNavigation-zwvQFKf1.js → FormNavigation-nE2uj2oQ.js} +3 -3
- package/dist/{Individual.rules-DnqpK01d.js → Individual.rules-DotRDPTM.js} +6 -6
- package/dist/{IndividualDropin-CaQg4nGw.js → IndividualDropin-eiRXQvS_.js} +164 -119
- package/dist/{InputDate-MfbWpC8K.js → InputDate-BAzF-upe.js} +1 -1
- package/dist/{InputText-BsC-S1uD.js → InputText-CywP4Ojh.js} +2 -2
- package/dist/{Introduction-XVVXz1r8.js → Introduction-CKoQlTAr.js} +3 -3
- package/dist/{InvitedDecisionMakerComponent-CHrA8mQR.js → InvitedDecisionMakerComponent-CV8OExOI.js} +18 -13
- package/dist/{JpAddress-BDGwDEOX.js → JpAddress-BIgqDfQ0.js} +10 -10
- package/dist/{LandingLayout-DJR_oP_0.js → LandingLayout-DEgZw1-N.js} +5 -3
- package/dist/{LegalCompanyNameField-CzsW7440.js → LegalCompanyNameField-CblBotGC.js} +5 -5
- package/dist/{LegalRepresentativeDetailsPage-umA-1VaQ.js → LegalRepresentativeDetailsPage-BYgKGZL1.js} +4 -4
- package/dist/{Link-CuEU7lsc.js → Link-BVdY7Jkl.js} +1 -1
- package/dist/{ListItem-De_7UUwH.js → ListItem-CNuX4D7n.js} +2 -2
- package/dist/{LoaderWrapper-BUn-b8AB.js → LoaderWrapper-CU0bf3jD.js} +1 -1
- package/dist/ManageIndividualComponent-BYBvuHfj.js +46 -0
- package/dist/{ManageTermsOfServiceComponent-ChalvP2J.js → ManageTermsOfServiceComponent-CfN53LIT.js} +3 -3
- package/dist/{ManageTransferInstrumentComponent-C4oiwftt.js → ManageTransferInstrumentComponent-B7gKGWHz.js} +10 -10
- package/dist/{MaskedInput-BWp2Akul.js → MaskedInput-BNceotwn.js} +4 -4
- package/dist/{MaybeModal-C7EW70Xg.js → MaybeModal-hVrKDPDU.js} +2 -2
- package/dist/{Modal-D_LDmrcf.js → Modal-C8kGCLbp.js} +3 -3
- package/dist/{Name-D8B6J9x4.js → Name-GILpP1SS.js} +4 -4
- package/dist/{NewSummary-BjYCAFDe.js → NewSummary-C5UR_Xj1.js} +2 -2
- package/dist/{OnboardingDropinComponent-CFcJQhCb.js → OnboardingDropinComponent-CK5KIhNx.js} +74 -74
- package/dist/{PayoutDetailsDropin-Beeag1MS.js → PayoutDetailsDropin-CLdEm9BA.js} +465 -226
- package/dist/PayoutDetailsPage-s-_gJFC2.js +914 -0
- package/dist/{RadioGroup-DvrpVP2i.js → RadioGroup-PEWX2KAj.js} +1 -1
- package/dist/{Review-D8hiQo3n.js → Review-CFnIOiZT.js} +6 -6
- package/dist/{RootBusinessDetailsPage-OjbFMdJ2.js → RootBusinessDetailsPage-mnrfIy0-.js} +4 -4
- package/dist/{RootBusinessLinesPage-CIECoCW3.js → RootBusinessLinesPage-BH3Lns3X.js} +28 -35
- package/dist/{RootIndividualDetailsPage-kvCZ8gLE.js → RootIndividualDetailsPage-BzgHIe3h.js} +7 -7
- package/dist/{Select-t-h8dau1.js → Select-C4C8R-Ci.js} +4 -4
- package/dist/{SignPCIComponent-BTd1hGFj.js → SignPCIComponent-B7rKUpjS.js} +11 -11
- package/dist/{SingpassSelection-BUVrRdZ4.js → SingpassSelection-WxIUEYNK.js} +4 -4
- package/dist/{SoleProprietorshipPage-BoUgRvvr.js → SoleProprietorshipPage-C_fewFI3.js} +3 -3
- package/dist/{SourceOfFundsPage-DNth1tGN.js → SourceOfFundsPage-UeXmtQEJ.js} +33 -33
- package/dist/{StepProgressIndicator-CHQ02q0R.js → StepProgressIndicator-DiB-t9hK.js} +1 -1
- package/dist/{StoreProvider-Do1odp3Z.js → StoreProvider-C4og8Y8I.js} +111 -91
- package/dist/{Summary-s4DquGfj.js → Summary-DkZ_an9u.js} +7 -20
- package/dist/{TaxInformationField-DS9fsrYp.js → TaxInformationField-BOZj8YLo.js} +27 -23
- package/dist/{TaxReportingDropin-CsCwca9A.js → TaxReportingDropin-9HGGrPyM.js} +14 -14
- package/dist/{TextArea-DI9q4r1R.js → TextArea-Bu9ppy0I.js} +2 -2
- package/dist/{TileGroup-CAyozQI4.js → TileGroup-BRzhDdL0.js} +2 -2
- package/dist/{TrustDetailsPage-Dp7MPmlU.js → TrustDetailsPage-C3gYEzPT.js} +32 -38
- package/dist/{TrustMemberCompanyPage-D-6ls2Oq.js → TrustMemberCompanyPage-BK54Of_F.js} +5 -5
- package/dist/{TrustMemberIndividualPage-MrBsjChK.js → TrustMemberIndividualPage-fVZrXJjA.js} +5 -5
- package/dist/{TrustMemberRoleAndTypePage-D901ZC2E.js → TrustMemberRoleAndTypePage-BVHOuXP3.js} +22 -22
- package/dist/{TrustMembersOverview-D-39F-pm.js → TrustMembersOverview-Ab-dwNTz.js} +11 -11
- package/dist/{UnincorporatedPartnershipIndividualPage-CYyfQrYN.js → UnincorporatedPartnershipIndividualPage-C32LEyHG.js} +4 -4
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-DO5iP4Dt.js → UnincorporatedPartnershipMemberCompanyPage-22Bl_EUP.js} +4 -4
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-CBQerXfu.js → UnincorporatedPartnershipMemberRoleAndTypePage-BjywaZQe.js} +10 -10
- package/dist/{UnincorporatedPartnershipMembersOverview-e_5NAEac.js → UnincorporatedPartnershipMembersOverview-RY7m4iC5.js} +7 -7
- package/dist/{VerificationErrorAlert-Bnnuucqh.js → VerificationErrorAlert-CCJ0vNsY.js} +2 -2
- package/dist/{ViewVerificationStatusComponent-CVVTKfrQ.js → ViewVerificationStatusComponent-Bg1I1q10.js} +2 -2
- package/dist/adyen-business-financing.js +2 -2
- package/dist/adyen-individual-configuration.js +2 -2
- package/dist/adyen-individual-status.js +2 -2
- package/dist/adyen-invited-decision-maker.js +2 -2
- package/dist/adyen-kyc-components.js +15 -15
- package/dist/adyen-onboarding.js +2 -2
- package/dist/adyen-terms-of-service-management.js +2 -2
- package/dist/adyen-terms-of-service-status.js +2 -2
- package/dist/adyen-transfer-instrument-configuration.js +2 -2
- package/dist/adyen-transfer-instrument-management.js +2 -2
- package/dist/adyen-verification-status.js +2 -2
- package/dist/{bafinUtils-DNleI80l.js → bafinUtils-DkCSO6ft.js} +1 -1
- package/dist/{bg-BG-DMNRRZZE.js → bg-BG-89Mw-9Lv.js} +7 -7
- package/dist/{bg-BG-Cj3_UGTi.js → bg-BG-C9zrgb_c.js} +7 -1
- package/dist/{bg-BG-C6dSR1jk.js → bg-BG-dmpv4Zom.js} +2 -2
- package/dist/{commonValidators-B93jw3zT.js → commonValidators-Dd4wegC9.js} +1 -1
- package/dist/{cs-CZ-B6atm9_Q.js → cs-CZ-6rOIfRJu.js} +2 -2
- package/dist/{cs-CZ-DxfB5dcV.js → cs-CZ-B-zm6HVH.js} +7 -1
- package/dist/{cs-CZ-DXSMRqPu.js → cs-CZ-CTxXvHtH.js} +7 -7
- package/dist/{da-DK-BfsYpvel.js → da-DK-CGhsIGZt.js} +7 -1
- package/dist/{da-DK-Cv6XUSoW.js → da-DK-C_GqHCay.js} +2 -2
- package/dist/{da-DK-CMVthpSr.js → da-DK-D_TOcmOO.js} +7 -7
- package/dist/{de-DE-BplDsJEb.js → de-DE-BmWBo3gX.js} +2 -2
- package/dist/{de-DE-B5TOuf7l.js → de-DE-DYzAiXHM.js} +7 -7
- package/dist/{de-DE-CEsDXBn-.js → de-DE-K9FyOJiI.js} +7 -1
- package/dist/{dropinUtils-iBTioaF7.js → dropinUtils-vsDEK6cs.js} +17 -6
- package/dist/{el-GR-BNNlN4l2.js → el-GR-DItzpoar.js} +7 -7
- package/dist/{el-GR-dRK7xHn2.js → el-GR-Fo7-xCrc.js} +2 -2
- package/dist/{el-GR-CM3bIzr7.js → el-GR-L-39cQfz.js} +7 -1
- package/dist/en-US-qlQTJNiL.js +13 -0
- package/dist/{es-ES-DRsix_Xn.js → es-ES-BkqlH093.js} +2 -2
- package/dist/{es-ES-Wcpc6fm1.js → es-ES-BmH6eADf.js} +7 -7
- package/dist/{es-ES-BWFP5itn.js → es-ES-TUyeIp6F.js} +7 -1
- package/dist/{et-EE-CcXrAAc7.js → et-EE-Cw_VydGb.js} +7 -1
- package/dist/{et-EE-DNC4hcxm.js → et-EE-DSZa_33d.js} +7 -7
- package/dist/{et-EE-BXiYapXy.js → et-EE-H8yxvhQj.js} +2 -2
- package/dist/{fi-FI-BftTiz0c.js → fi-FI-BfwJVwi9.js} +2 -2
- package/dist/{fi-FI-BJLU1JHw.js → fi-FI-DJ8BbVPT.js} +7 -7
- package/dist/{fi-FI-DenK0WPz.js → fi-FI-tgvQX_Iq.js} +7 -1
- package/dist/{formUtils-lkF9e5IB.js → formUtils-DFuc8i5Q.js} +3 -3
- package/dist/{fr-FR-C6jxjXAI.js → fr-FR-CzjsW73Q.js} +2 -2
- package/dist/{fr-FR-DodNoPid.js → fr-FR-D533_MOG.js} +7 -7
- package/dist/{fr-FR-BmTswZU5.js → fr-FR-ynC19lSF.js} +7 -1
- package/dist/{getName-f5vInm5O.js → getName-D3Sba-PI.js} +1 -1
- package/dist/{getProblemsForEntity-D8b_EJeC.js → getProblemsForEntity-Db-ejW4z.js} +1 -1
- package/dist/{getTrustedFields-D2WVcNYC.js → getTrustedFields-DUXTMWcg.js} +1 -1
- package/dist/{hr-HR-SDrDZRLV.js → hr-HR--5syrowD.js} +7 -1
- package/dist/{hr-HR-C0NLgF1r.js → hr-HR-CIxdonpk.js} +7 -7
- package/dist/{hr-HR-B_TEU3r4.js → hr-HR-ZrpQrsik.js} +2 -2
- package/dist/{hu-HU-C3ZiFh1F.js → hu-HU--6ZxXlbV.js} +7 -7
- package/dist/{hu-HU-DSVf2zbX.js → hu-HU-BFiGk_QT.js} +7 -1
- package/dist/{hu-HU-CX83V9tu.js → hu-HU-Ds3go4h4.js} +2 -2
- package/dist/{isEmpty-u6uLWpz1.js → isEmpty-DFqK5kY2.js} +2 -2
- package/dist/{it-IT-CZ4aDoVQ.js → it-IT-B5cf2VTN.js} +7 -7
- package/dist/{it-IT-DJe5OflH.js → it-IT-C0Zv5ms9.js} +7 -1
- package/dist/{it-IT-CXlaZNIj.js → it-IT-Dx15tkIe.js} +2 -2
- package/dist/{ja-JP-GGV_-V6p.js → ja-JP--u211vje.js} +7 -1
- package/dist/{ja-JP-BpeNsNhn.js → ja-JP-DY4CJlUf.js} +7 -7
- package/dist/{ja-JP-A6ArIIZ8.js → ja-JP-Qu7oEIEy.js} +2 -2
- package/dist/{japanSupportUtils-By6GI65W.js → japanSupportUtils-DqXOWm97.js} +1 -1
- package/dist/{localizeDateString-CYVOqiuH.js → localizeDateString-D8JgUqw2.js} +1 -1
- package/dist/{lt-LT-ww192lYg.js → lt-LT-BebOeKIA.js} +2 -2
- package/dist/{lt-LT-C8n1GZoU.js → lt-LT-CkjEvGSp.js} +7 -7
- package/dist/{lt-LT-C9nsCODy.js → lt-LT-D2Hrhr7v.js} +7 -1
- package/dist/{lv-LV-BdPdaVGy.js → lv-LV-BdZK9nQA.js} +7 -7
- package/dist/{lv-LV-CpHy-ZoF.js → lv-LV-CYcrO-6d.js} +2 -2
- package/dist/{lv-LV-Bue450PR.js → lv-LV-D04q9r-y.js} +7 -1
- package/dist/{mapExistingFile-9oZpCz9G.js → mapExistingFile-BIYg1E5G.js} +2 -2
- package/dist/{mapJpAddressSchemaToAddressLocalizations-DhgNqKwy.js → mapJpAddressSchemaToAddressLocalizations-D5xnQLSI.js} +2 -2
- package/dist/{mapLegalEntityToIndividualSchema-BY73qAGj.js → mapLegalEntityToIndividualSchema-By5v9v9G.js} +4 -4
- package/dist/{mapTransferInstrumentToPayoutAccount-BYhssQ5b.js → mapTransferInstrumentToPayoutAccount-BM24JYqT.js} +2 -2
- package/dist/{nl-NL-4Mv4rnYy.js → nl-NL-CJ7MoBj2.js} +7 -1
- package/dist/{nl-NL-BwWFlBOs.js → nl-NL-FbJ2sHba.js} +2 -2
- package/dist/{nl-NL-B2Uku0lw.js → nl-NL-YcL7Gufl.js} +7 -7
- package/dist/{no-NO-JWsSd7iY.js → no-NO-B5BjEy8n.js} +2 -2
- package/dist/{no-NO-ByCZ3mhz.js → no-NO-C20s6CoP.js} +7 -1
- package/dist/{no-NO-DjOcJWnC.js → no-NO-KkYB-VQD.js} +7 -7
- package/dist/{omitObscuredFieldsIfUnchanged-BukQYYUl.js → omitObscuredFieldsIfUnchanged-CyJfNYkP.js} +2 -2
- package/dist/{patternValidators-BAI5QGjT.js → patternValidators-DRSnA1z7.js} +2 -2
- package/dist/{pl-PL-DCi5Lf4k.js → pl-PL-C19Btj2D.js} +7 -1
- package/dist/{pl-PL-Bmaq3IC3.js → pl-PL-CPdKf-J0.js} +7 -7
- package/dist/{pl-PL-CLmmSNgn.js → pl-PL-DuM6hbqZ.js} +2 -2
- package/dist/{process-field-configurations-BsVn1sDe.js → process-field-configurations-Cl2nqpBp.js} +2 -2
- package/dist/{pt-BR-BJOww8U1.js → pt-BR-BKKQIUJP.js} +2 -2
- package/dist/{pt-BR-BKdT0Bpl.js → pt-BR-ERWeus3c.js} +7 -7
- package/dist/{pt-BR-DRz5cG4o.js → pt-BR-zOjPTIPu.js} +7 -1
- package/dist/{pt-PT-CL9VzmZE.js → pt-PT-CC7zlk3R.js} +2 -2
- package/dist/{pt-PT-C2li07N1.js → pt-PT-DUTGt5L5.js} +7 -7
- package/dist/{pt-PT-ChRbnn0k.js → pt-PT-t5M8xwTU.js} +7 -1
- package/dist/{resolveEnvironment-qgplleRV.js → resolveEnvironment-BIF7mwM5.js} +3 -3
- package/dist/{ro-RO-iPjOeKwM.js → ro-RO-BnFjok5O.js} +7 -7
- package/dist/{ro-RO-Cu1T3z6k.js → ro-RO-CuabgXj1.js} +2 -2
- package/dist/{ro-RO-Dgie5z3m.js → ro-RO-DK9gVwS9.js} +7 -1
- package/dist/{roleMetadata-BqDkoUz9.js → roleMetadata-BAURfCmh.js} +3 -3
- package/dist/{sk-SK-bMDoNP19.js → sk-SK-2J6iKfmK.js} +7 -1
- package/dist/{sk-SK-3_SoEn6P.js → sk-SK-CLPd85I3.js} +7 -7
- package/dist/{sk-SK-CEjJ-qZG.js → sk-SK-DM1yY8DA.js} +2 -2
- package/dist/{sl-SI-BfO3xEJx.js → sl-SI--pDTatHh.js} +2 -2
- package/dist/{sl-SI-DKSu25rO.js → sl-SI-D82ccY62.js} +7 -1
- package/dist/{sl-SI-DbfswGh0.js → sl-SI-T9_Ty-NS.js} +7 -7
- package/dist/style.css +9 -21
- package/dist/styles-CLV89_hH.js +9 -21
- package/dist/{sv-SE-Blw4s8bC.js → sv-SE-3-h2VlYi.js} +7 -7
- package/dist/{sv-SE-CMLKzwtj.js → sv-SE-CDxyyNV0.js} +2 -2
- package/dist/{sv-SE-Co7Nkd06.js → sv-SE-CrBkos0z.js} +7 -1
- package/dist/types/api/companySearch/useCompanySearch.d.ts +289 -0
- package/dist/types/api/companySelection/useCompanySelection.d.ts +2 -4
- package/dist/types/api/configurations/useScenarios.d.ts +1 -1
- package/dist/types/api/idVerificationProviders/useExtractDocumentInformation.d.ts +4 -4
- package/dist/types/api/queryKeys.d.ts +1 -2
- package/dist/types/api/tinVerification/useVerifyTin.d.ts +245 -1
- package/dist/types/api/uiAnalytics/uiAnalytics.types.d.ts +6 -1
- package/dist/types/components/BankAccount/forms/BankVerification/store.d.ts +1 -0
- package/dist/types/components/BankAccount/forms/PayoutCountryDetails/PayoutCountryDetails.d.ts +3 -0
- package/dist/types/components/BankAccount/forms/PayoutDetails/PayoutDetailsMultiform.d.ts +27 -0
- package/dist/types/components/BankAccount/forms/PayoutDetails/rules.d.ts +2 -2
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +25 -25
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropin.d.ts +0 -1
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/PayoutDetailsDropinMultiForm.d.ts +2 -0
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/utils.d.ts +7 -0
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/validate.d.ts +23 -0
- package/dist/types/components/Business/forms/BusinessSelection/BusinessInformationCard/BusinessInformationCard.d.ts +3 -4
- package/dist/types/components/Business/forms/rules.d.ts +6 -6
- package/dist/types/components/Business/mapping/businessDetails/businessBankAccountTaxIdUtils.d.ts +10 -0
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsStore.d.ts +0 -1
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +1 -4
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +2 -3
- package/dist/types/components/BusinessLines/fields/SalesChannels/SalesChannels.d.ts +1 -1
- package/dist/types/components/BusinessLines/fields/SalesChannels/types.d.ts +1 -1
- package/dist/types/components/Contract/tasks/ServiceAgreementDropin/types.d.ts +2 -1
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +499 -487
- package/dist/types/components/Individual/forms/Individual.rules.d.ts +2 -2
- package/dist/types/components/Individual/forms/InviteDetails/utils.d.ts +2 -0
- package/dist/types/components/Individual/forms/InviteDetails/validate.d.ts +2 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +1 -2
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/registrationNumberTypes.d.ts +5 -0
- package/dist/types/components/Shared/fields/DBANameField/DBANameField.d.ts +1 -1
- package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/DateOfIncorporationField/DateOfIncorporationField.d.ts +1 -1
- package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/IndustryCodeField/IndustryCodeField.d.ts +1 -1
- package/dist/types/components/Shared/fields/IndustryCodeField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/Name/validate.d.ts +2 -1
- package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -1
- package/dist/types/components/Shared/fields/PhoneField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockExchangeMICField/StockExchangeMICField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockISINField/StockISINField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockISINField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockTickerSymbol/StockTickerSymbolField.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockTickerSymbol/types.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Shared/forms/Address/validate.d.ts +1 -1
- package/dist/types/components/Trust/forms/Trust/rules.d.ts +2 -2
- package/dist/types/context/ToggleContext/types.d.ts +51 -56
- package/dist/types/core/models/api/branchAllocation.d.ts +5 -0
- package/dist/types/core/models/api/get-scenarios.d.ts +2 -0
- package/dist/types/core/models/api/organization.d.ts +2 -0
- package/dist/types/core/user-events.d.ts +1 -1
- package/dist/types/hooks/useForm/types.d.ts +1 -0
- package/dist/types/hooks/usePageLandedEvent.d.ts +3 -3
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/validatorUtils.d.ts +1 -0
- package/dist/{types-CTwBMnPB.js → types-C7ANBXKc.js} +56 -61
- package/dist/{types-CfnPVq7b.js → types-DsA42AXS.js} +1 -1
- package/dist/{types-tdqAwKL7.js → types-DxlKs1U5.js} +1 -1
- package/dist/{types-DKR2ZuTD.js → types-VsWq4EjV.js} +1 -1
- package/dist/{unincorporated-partnership-DiT1SZMx.js → unincorporated-partnership-uA1X2l53.js} +1 -1
- package/dist/{useAssociatedLegalEntity-Bwe18_3D.js → useAssociatedLegalEntity-3LNpnrN6.js} +1 -1
- package/dist/{useBusinessDetailsData-S4H6u7aV.js → useBusinessDetailsData-dZbZQSmY.js} +330 -314
- package/dist/{useCreateLegalEntity-DugB4CeD.js → useCreateLegalEntity-DDkkYr4O.js} +1 -1
- package/dist/{useForm-Chyn6I7t.js → useForm-Y4-kimHb.js} +3 -3
- package/dist/{useFormContext-D0VUus9N.js → useFormContext-TKoF8IdB.js} +7 -7
- package/dist/{useGlobalData-BOpkYARg.js → useGlobalData-DZvXyS0l.js} +9 -9
- package/dist/{useMultiForm-AyBSOBoC.js → useMultiForm-ieaYM7hW.js} +4 -4
- package/dist/{useOnboardingStatus-DHIZ68CF.js → useOnboardingStatus-DhxCTR8e.js} +1 -1
- package/dist/{useScenarios-C--d6gPw.js → useScenarios-CwSfXmoW.js} +1 -1
- package/dist/{useTermsOfServiceStatus-OVxuF0N1.js → useTermsOfServiceStatus-DPGw4QdQ.js} +1 -1
- package/dist/{useToastContext-DHFV4LJC.js → useToastContext-BdsMS3mt.js} +1 -1
- package/dist/{useUnincorporatedPartnershipMembers-B9S2O4tQ.js → useUnincorporatedPartnershipMembers-D5ndPAbv.js} +4 -4
- package/dist/{useUpdateBusinessLines-D-2SFDbh.js → useUpdateBusinessLines-Dwk23sZB.js} +5 -7
- package/dist/{useUpdateLegalEntity-CFRYUBdP.js → useUpdateLegalEntity-5lOidXXX.js} +2 -2
- package/dist/{utils-BlKniCje.js → utils-BwwVW2aU.js} +6 -6
- package/dist/{utils-CmyEO2z6.js → utils-C5ekxdx1.js} +1 -1
- package/dist/{utils-HEJUczlg.js → utils-C_Fyu6Kr.js} +1 -1
- package/dist/{utils-DzZSy2n_.js → utils-CdhuiXMy.js} +1 -1
- package/dist/{utils-CG9hxJ09.js → utils-Dny5dbku.js} +2 -2
- package/dist/{validate-DKsP8XGZ.js → validate-CFI052fe.js} +3 -3
- package/dist/{validate-DkaJWAVo.js → validate-bZBB2yOu.js} +2 -2
- package/dist/{validationError-yKQW3P6f.js → validationError-XxBa8ECY.js} +2 -2
- package/package.json +10 -10
- package/dist/BusinessFinancingPage-Bgh0dGq3.js +0 -43
- package/dist/ManageIndividualComponent-BK6fjFPh.js +0 -46
- package/dist/PayoutDetailsPage-Q6XPaC0y.js +0 -55
- package/dist/en-US-CJDkXFZ6.js +0 -13
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/formatAccountVerificationSummary.d.ts +0 -7
|
@@ -0,0 +1,914 @@
|
|
|
1
|
+
;
|
|
2
|
+
{
|
|
3
|
+
try {
|
|
4
|
+
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2de02629-f043-481c-8bb2-706fd4f21599", e._sentryDebugIdIdentifier = "sentry-dbid-2de02629-f043-481c-8bb2-706fd4f21599");
|
|
6
|
+
} catch (e) {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
;
|
|
10
|
+
import { u as useTranslation, H as useToggleContext, m as useSettingsContext, b5 as isAccountIdentifierObscured, b6 as hasEmptyFields, b7 as extractFieldName, b8 as concatenateFieldNames, b as useApiContext, x as useAnalyticsContext, a8 as getLegalEntityCountry, w as TaskTypes, an as cloneObject, am as datasetUtilities, P as useLegalEntity, a as addResourceBundles, U as Loader, R as ROOT_LE, E as EntityTypes, _ as __variableDynamicImportRuntimeHelper } from "./StoreProvider-C4og8Y8I.js";
|
|
11
|
+
import { jsxs, jsx } from "preact/jsx-runtime";
|
|
12
|
+
import { useParams } from "wouter-preact";
|
|
13
|
+
import { f as useNavigate } from "./OnboardingDropinComponent-CK5KIhNx.js";
|
|
14
|
+
import { u as useCapabilityProblems, g as getProblemsForEntity } from "./getProblemsForEntity-Db-ejW4z.js";
|
|
15
|
+
import { u as useInstantVerificationErrorNotification, g as getAccountIdentificationFromPayoutAccountSchema, a as useAsyncAccountDetailsValidationRules, s as showInstantVerificationPayoutModal, B as BankVerification, p as payoutSteps, M as MemoizedBankDocumentClassification, b as PayoutAccount, I as InstantVerificationErrorContext, c as PayoutVerificationMethod, d as PayoutCountryDetails, e as bankVerificationValidationRules, f as bankDocumentValidationRules, h as defaultFieldMetadata, i as defaultFieldConfig, j as defaultFieldMetadata$1, k as defaultFieldConfig$1, l as defaultFieldMetadata$2, m as defaultFieldConfig$2, n as defaultFieldMetadata$3, o as defaultFieldConfig$3, q as swiftCodeFieldMetadata, r as useUpdateTransferInstrument, t as useUpdateTrustedTransferInstrument, v as useCreateTrustedTransferInstrument, w as getPayoutVerificationMethod, x as getDefaultCurrencyForCountry, y as useBankVerificationProviders, z as getAccountFormatsForCountry, A as rules, C as mapPayoutAccountSchemaToApiBankAccount, D as useCheck, E as getAppropriatePayoutDetailsSteps, F as mapApiDocumentToPayoutDocuments, G as getInvalidFieldsErrorMessage, H as parseConfiguration, J as mapPayoutDetailsToTransferInstrument, K as createTransferInstrument, L as formatAccountVerificationSummary, N as mapPayoutDocumentsToApiDocuments, P as PayoutDetailsDropin } from "./PayoutDetailsDropin-CLdEm9BA.js";
|
|
16
|
+
import { skipToken } from "@tanstack/preact-query";
|
|
17
|
+
import { useState, useMemo, useEffect, useCallback } from "preact/hooks";
|
|
18
|
+
import { u as useTransferInstrument, m as mapTransferInstrumentToPayoutAccount } from "./mapTransferInstrumentToPayoutAccount-BM24JYqT.js";
|
|
19
|
+
import { L as LoaderWrapper } from "./LoaderWrapper-CU0bf3jD.js";
|
|
20
|
+
import { u as useFormContext, F as FormContextProvider, a as FormFlow } from "./useFormContext-TKoF8IdB.js";
|
|
21
|
+
import { S as SettingNames } from "./types-Dv0COrvY.js";
|
|
22
|
+
import { u as useToastContext } from "./useToastContext-BdsMS3mt.js";
|
|
23
|
+
import { F as FeatureNames } from "./types-C7ANBXKc.js";
|
|
24
|
+
import { g as getPropsFromConfigurations } from "./process-field-configurations-Cl2nqpBp.js";
|
|
25
|
+
import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer } from "./dropinUtils-vsDEK6cs.js";
|
|
26
|
+
import { u as useMultiForm } from "./useMultiForm-ieaYM7hW.js";
|
|
27
|
+
import { b as useScenarioConfiguration, c as useUnifyLoadingStatus } from "./mapExistingFile-BIYg1E5G.js";
|
|
28
|
+
import { C as Confirm } from "./Confirm-BoQbVMKQ.js";
|
|
29
|
+
import { c as currencyByCountry } from "./types-DsA42AXS.js";
|
|
30
|
+
import { s as summaryStep } from "./Summary-DkZ_an9u.js";
|
|
31
|
+
import { i as isValidationError, p as processValidationErrors, b as isIdDocumentUploadError, c as isBankStatementUploadError, a as isMaintenanceModeError, m as mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable } from "./validationError-XxBa8ECY.js";
|
|
32
|
+
import { t as trackNavigation } from "./trackNavigation-db_h46BT.js";
|
|
33
|
+
import { h as fileValidationRules, f as defaultFileValidationOptions, d as documentApiUtils, b as getFileExtention } from "./validate-CFI052fe.js";
|
|
34
|
+
import { b as getPayoutAccountHolderName, g as getLegalEntityNameBasedOnType } from "./getName-D3Sba-PI.js";
|
|
35
|
+
import { o as omitObscuredFieldsIfUnchanged } from "./omitObscuredFieldsIfUnchanged-CyJfNYkP.js";
|
|
36
|
+
import { Show } from "@preact/signals/utils";
|
|
37
|
+
import { r as resolveFieldMetadata } from "./fieldConfigurations-BUT9DTUH.js";
|
|
38
|
+
const PayoutCountryDetailsFormID = payoutSteps.payoutCountryDetails.formId;
|
|
39
|
+
const PayoutVerificationMethodFormID = payoutSteps.payoutVerificationMethod.formId;
|
|
40
|
+
const PayoutAccountDetailsFormID = payoutSteps.payoutAccountDetails.formId;
|
|
41
|
+
const PayoutAccountDocumentsFormID = payoutSteps.payoutAccountDocuments.formId;
|
|
42
|
+
const PayoutAccountVerificationFormID = payoutSteps.payoutAccountVerification.formId;
|
|
43
|
+
function PayoutDetailsMultiform({
|
|
44
|
+
activeForm,
|
|
45
|
+
shouldValidate,
|
|
46
|
+
problems = {},
|
|
47
|
+
country,
|
|
48
|
+
accountHolder,
|
|
49
|
+
legalEntityResponse,
|
|
50
|
+
provider,
|
|
51
|
+
bankVendorsLoadingStatus,
|
|
52
|
+
instantVerificationAvailable,
|
|
53
|
+
setHideSidebar,
|
|
54
|
+
createTrustedTransferInstrument,
|
|
55
|
+
accountDetailsFromInput,
|
|
56
|
+
onBack,
|
|
57
|
+
setHasAsyncValidationError
|
|
58
|
+
}) {
|
|
59
|
+
const { t } = useTranslation("banking");
|
|
60
|
+
const { t: commonT } = useTranslation("common");
|
|
61
|
+
const { form } = useFormContext();
|
|
62
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
63
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
64
|
+
const isCrossBorderPayoutsEnabled = isFeatureEnabled(FeatureNames.EnableCrossBorderPayouts) && isSettingEnabled(SettingNames.AllowCrossBorderPayout);
|
|
65
|
+
const [instantVerificationError, setInstantVerificationError] = useInstantVerificationErrorNotification(1e4);
|
|
66
|
+
const bankCountry = (isCrossBorderPayoutsEnabled ? form.data?.payoutCountryDetails?.bankCountry : form.data?.payoutVerificationMethod?.bankCountry) ?? country;
|
|
67
|
+
const [bankInfoValidated, setBankInfoValidated] = useState(false);
|
|
68
|
+
const [arePayoutAccountDetailsInvalid, setArePayoutAccountDetailsInvalid] = useState(false);
|
|
69
|
+
const [invalidFieldNames, setInvalidFieldNames] = useState("");
|
|
70
|
+
const payload = useMemo(
|
|
71
|
+
() => bankCountry && accountDetailsFromInput ? getAccountIdentificationFromPayoutAccountSchema(
|
|
72
|
+
accountDetailsFromInput,
|
|
73
|
+
bankCountry,
|
|
74
|
+
isCrossBorderPayoutsEnabled
|
|
75
|
+
) : {},
|
|
76
|
+
[accountDetailsFromInput, bankCountry, isCrossBorderPayoutsEnabled]
|
|
77
|
+
);
|
|
78
|
+
const validateAccountDetails = useAsyncAccountDetailsValidationRules(
|
|
79
|
+
payload,
|
|
80
|
+
hasEmptyFields(payload),
|
|
81
|
+
isAccountIdentifierObscured(payload)
|
|
82
|
+
);
|
|
83
|
+
const resetInvalidFieldState = () => {
|
|
84
|
+
setInvalidFieldNames("");
|
|
85
|
+
setArePayoutAccountDetailsInvalid(false);
|
|
86
|
+
};
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (validateAccountDetails?.invalidFields && validateAccountDetails.invalidFields.length > 0) {
|
|
89
|
+
setHasAsyncValidationError?.(true);
|
|
90
|
+
const fieldNames = validateAccountDetails.invalidFields.map((field) => extractFieldName(field.name)).map((key) => commonT(($) => $[key]));
|
|
91
|
+
const invalidFieldsString = concatenateFieldNames(fieldNames);
|
|
92
|
+
setInvalidFieldNames(invalidFieldsString);
|
|
93
|
+
setArePayoutAccountDetailsInvalid(true);
|
|
94
|
+
} else {
|
|
95
|
+
setHasAsyncValidationError?.(false);
|
|
96
|
+
resetInvalidFieldState();
|
|
97
|
+
}
|
|
98
|
+
}, [commonT, validateAccountDetails, setHasAsyncValidationError]);
|
|
99
|
+
const renderActiveForm = (activeForm2) => {
|
|
100
|
+
switch (activeForm2.formId) {
|
|
101
|
+
case PayoutCountryDetailsFormID:
|
|
102
|
+
return /* @__PURE__ */ jsx(
|
|
103
|
+
PayoutCountryDetails,
|
|
104
|
+
{
|
|
105
|
+
id: activeForm2.formId,
|
|
106
|
+
legalEntityResponse,
|
|
107
|
+
provider,
|
|
108
|
+
shouldValidate,
|
|
109
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
110
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
111
|
+
data: form.data.payoutCountryDetails,
|
|
112
|
+
errors: form.errors.payoutCountryDetails,
|
|
113
|
+
valid: form.valid.payoutCountryDetails,
|
|
114
|
+
allFields: form.allFields?.payoutCountryDetails,
|
|
115
|
+
requiredFields: form.requiredFields?.payoutCountryDetails,
|
|
116
|
+
optionalFields: form.optionalFields?.payoutCountryDetails,
|
|
117
|
+
trustedFields: form.trustedFields?.payoutCountryDetails,
|
|
118
|
+
handleFieldChange: (fieldName, mode) => form.handleChangeFor(fieldName, "payoutCountryDetails", mode)
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
case PayoutVerificationMethodFormID:
|
|
122
|
+
return /* @__PURE__ */ jsx(InstantVerificationErrorContext.Provider, { value: instantVerificationError, children: /* @__PURE__ */ jsx(
|
|
123
|
+
PayoutVerificationMethod,
|
|
124
|
+
{
|
|
125
|
+
id: activeForm2.formId,
|
|
126
|
+
heading: t(($) => $["addABankAccountForPayouts"]),
|
|
127
|
+
country,
|
|
128
|
+
accountHolder,
|
|
129
|
+
legalEntityResponse,
|
|
130
|
+
provider,
|
|
131
|
+
bankVendorsLoadingStatus,
|
|
132
|
+
bankInfoValidated,
|
|
133
|
+
instantVerificationAvailable,
|
|
134
|
+
shouldValidate,
|
|
135
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
136
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
137
|
+
data: form.data.payoutVerificationMethod,
|
|
138
|
+
errors: form.errors.payoutVerificationMethod,
|
|
139
|
+
valid: form.valid.payoutVerificationMethod,
|
|
140
|
+
allFields: form.allFields?.payoutVerificationMethod,
|
|
141
|
+
requiredFields: form.requiredFields?.payoutVerificationMethod,
|
|
142
|
+
optionalFields: form.optionalFields?.payoutVerificationMethod,
|
|
143
|
+
trustedFields: form.trustedFields?.payoutVerificationMethod,
|
|
144
|
+
handleFieldChange: (fieldName, mode) => form.handleChangeFor(fieldName, "payoutVerificationMethod", mode)
|
|
145
|
+
}
|
|
146
|
+
) });
|
|
147
|
+
case PayoutAccountDetailsFormID:
|
|
148
|
+
return /* @__PURE__ */ jsx(
|
|
149
|
+
PayoutAccount,
|
|
150
|
+
{
|
|
151
|
+
id: activeForm2.formId,
|
|
152
|
+
heading: t(($) => $["addABankAccountForPayouts"]),
|
|
153
|
+
country: bankCountry,
|
|
154
|
+
legalEntityResponse,
|
|
155
|
+
arePayoutAccountDetailsInvalid,
|
|
156
|
+
invalidFieldNames,
|
|
157
|
+
preferredCurrencyCode: form.data?.payoutCountryDetails?.preferredCurrency,
|
|
158
|
+
shouldValidate,
|
|
159
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
160
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
161
|
+
data: form.data.payoutAccountDetails,
|
|
162
|
+
errors: form.errors.payoutAccountDetails,
|
|
163
|
+
valid: form.valid.payoutAccountDetails,
|
|
164
|
+
allFields: form.allFields?.payoutAccountDetails,
|
|
165
|
+
requiredFields: form.requiredFields?.payoutAccountDetails,
|
|
166
|
+
optionalFields: form.optionalFields?.payoutAccountDetails,
|
|
167
|
+
trustedFields: form.trustedFields?.payoutAccountDetails,
|
|
168
|
+
obscuredFields: form.obscuredFields?.payoutAccountDetails,
|
|
169
|
+
handleFieldChange: (fieldName, mode) => form.handleChangeFor(fieldName, "payoutAccountDetails", mode)
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
case PayoutAccountDocumentsFormID:
|
|
173
|
+
return /* @__PURE__ */ jsx(
|
|
174
|
+
MemoizedBankDocumentClassification,
|
|
175
|
+
{
|
|
176
|
+
id: activeForm2.formId,
|
|
177
|
+
legalEntity: legalEntityResponse,
|
|
178
|
+
country: bankCountry,
|
|
179
|
+
formIsActive: activeForm2.formId === PayoutAccountDocumentsFormID,
|
|
180
|
+
shouldValidate,
|
|
181
|
+
fieldValidationErrors: problems.validationErrors?.[activeForm2.formId] ?? {},
|
|
182
|
+
formVerificationErrors: problems.verificationErrors?.[activeForm2.formId] ?? {},
|
|
183
|
+
data: form.data.payoutAccountDocuments,
|
|
184
|
+
errors: form.errors.payoutAccountDocuments,
|
|
185
|
+
valid: form.valid.payoutAccountDocuments,
|
|
186
|
+
allFields: form.allFields?.payoutAccountDocuments,
|
|
187
|
+
requiredFields: form.requiredFields?.payoutAccountDocuments,
|
|
188
|
+
optionalFields: form.optionalFields?.payoutAccountDocuments,
|
|
189
|
+
trustedFields: form.trustedFields?.payoutAccountDocuments,
|
|
190
|
+
handleFieldChange: (fieldName, mode) => form.handleChangeFor(fieldName, "payoutAccountDocuments", mode)
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
default:
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-payout", children: [
|
|
198
|
+
/* @__PURE__ */ jsx("div", { className: "adyen-kyc-form-wrapper", children: renderActiveForm(activeForm) }),
|
|
199
|
+
/* @__PURE__ */ jsx(Show, { when: showInstantVerificationPayoutModal, children: /* @__PURE__ */ jsx(
|
|
200
|
+
BankVerification,
|
|
201
|
+
{
|
|
202
|
+
id: PayoutAccountVerificationFormID,
|
|
203
|
+
heading: t(($) => $["bankAccountVerification"]),
|
|
204
|
+
provider,
|
|
205
|
+
country: bankCountry,
|
|
206
|
+
onBack,
|
|
207
|
+
hideSidebar: setHideSidebar,
|
|
208
|
+
setBankVerificationError: setInstantVerificationError,
|
|
209
|
+
bankInfoValidated,
|
|
210
|
+
setBankInfoValidated,
|
|
211
|
+
formIsActive: activeForm.formId === PayoutVerificationMethodFormID,
|
|
212
|
+
createTrustedTransferInstrument,
|
|
213
|
+
shouldValidate,
|
|
214
|
+
fieldValidationErrors: problems.validationErrors?.[PayoutAccountVerificationFormID] ?? {},
|
|
215
|
+
formVerificationErrors: problems.verificationErrors?.[PayoutAccountVerificationFormID] ?? {},
|
|
216
|
+
data: form.data.payoutAccountVerification,
|
|
217
|
+
errors: form.errors.payoutAccountVerification,
|
|
218
|
+
valid: form.valid.payoutAccountVerification,
|
|
219
|
+
allFields: form.allFields?.payoutAccountVerification,
|
|
220
|
+
requiredFields: form.requiredFields?.payoutAccountVerification,
|
|
221
|
+
optionalFields: form.optionalFields?.payoutAccountVerification,
|
|
222
|
+
trustedFields: form.trustedFields?.payoutAccountVerification,
|
|
223
|
+
handleFieldChange: (fieldName, mode) => form.handleChangeFor(fieldName, "payoutAccountVerification", mode)
|
|
224
|
+
}
|
|
225
|
+
) })
|
|
226
|
+
] });
|
|
227
|
+
}
|
|
228
|
+
function payoutCountryDetailsValidators() {
|
|
229
|
+
return {};
|
|
230
|
+
}
|
|
231
|
+
function payoutVerificationMethodValidators() {
|
|
232
|
+
return {
|
|
233
|
+
payoutVerificationMethod: {
|
|
234
|
+
modes: ["blur"],
|
|
235
|
+
validate: (payoutVerificationMethod) => !!payoutVerificationMethod
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function payoutAccountDetailsValidators({
|
|
240
|
+
country
|
|
241
|
+
}) {
|
|
242
|
+
const branchCodeMetadata = resolveFieldMetadata(
|
|
243
|
+
defaultFieldConfig[country],
|
|
244
|
+
{},
|
|
245
|
+
defaultFieldMetadata
|
|
246
|
+
);
|
|
247
|
+
const bankAccountNumberMetadata = resolveFieldMetadata(
|
|
248
|
+
defaultFieldConfig$1[country],
|
|
249
|
+
{},
|
|
250
|
+
defaultFieldMetadata$1
|
|
251
|
+
);
|
|
252
|
+
const ibanMetadata = resolveFieldMetadata(defaultFieldConfig$2[country], {}, defaultFieldMetadata$2);
|
|
253
|
+
const bankCodeMetadata = resolveFieldMetadata(
|
|
254
|
+
defaultFieldConfig$3[country],
|
|
255
|
+
{},
|
|
256
|
+
defaultFieldMetadata$3
|
|
257
|
+
);
|
|
258
|
+
return {
|
|
259
|
+
branchCode: branchCodeMetadata.validators,
|
|
260
|
+
bankAccountNumber: bankAccountNumberMetadata.validators,
|
|
261
|
+
iban: ibanMetadata.validators,
|
|
262
|
+
swiftCode: swiftCodeFieldMetadata.validators,
|
|
263
|
+
bankCode: bankCodeMetadata.validators
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
function payoutAccountDocumentsValidators() {
|
|
267
|
+
return {
|
|
268
|
+
...bankDocumentValidationRules,
|
|
269
|
+
bankStatementDocument: fileValidationRules(defaultFileValidationOptions)
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function payoutAccountVerificationValidators() {
|
|
273
|
+
return bankVerificationValidationRules;
|
|
274
|
+
}
|
|
275
|
+
function PayoutDetailsDropinMultiForm({
|
|
276
|
+
legalEntityResponse,
|
|
277
|
+
problems: propProblems,
|
|
278
|
+
onSubmit: externalOnSubmit,
|
|
279
|
+
asModal = false,
|
|
280
|
+
handleCloseClick,
|
|
281
|
+
taskType: propTaskType,
|
|
282
|
+
handleHomeClick,
|
|
283
|
+
currentTransferInstrumentId,
|
|
284
|
+
navigateBackToTaskList,
|
|
285
|
+
handleBackClick: externalBackClick,
|
|
286
|
+
openBankingPartnerConfigId
|
|
287
|
+
}) {
|
|
288
|
+
const { baseUrl, rootLegalEntityId } = useApiContext();
|
|
289
|
+
const {
|
|
290
|
+
data: transferInstrument,
|
|
291
|
+
refetch: refetchTransferInstrument,
|
|
292
|
+
isLoading: isTransferInstrumentLoading
|
|
293
|
+
} = useTransferInstrument(currentTransferInstrumentId ?? skipToken);
|
|
294
|
+
const { mutateAsync: handleUpdateTransferInstrument } = useUpdateTransferInstrument();
|
|
295
|
+
const { mutateAsync: handleUpdateTrustedTransferInstrument } = useUpdateTrustedTransferInstrument();
|
|
296
|
+
const {
|
|
297
|
+
mutateAsync: handleCreateTrustedTransferInstrument,
|
|
298
|
+
status: createTrustedTransferInstrumentStatus
|
|
299
|
+
} = useCreateTrustedTransferInstrument();
|
|
300
|
+
const [previousTrustedInstrumentStatus, setPreviousTrustedInstrumentStatus] = useState(
|
|
301
|
+
createTrustedTransferInstrumentStatus
|
|
302
|
+
);
|
|
303
|
+
const { t, i18n: i18next } = useTranslation("banking");
|
|
304
|
+
const { t: commonT } = useTranslation("common");
|
|
305
|
+
const userEvents = useAnalyticsContext();
|
|
306
|
+
const { showToast, clearToasts } = useToastContext();
|
|
307
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
308
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
309
|
+
const enabledCrossBorderPayouts = isFeatureEnabled(FeatureNames.EnableCrossBorderPayouts) && isSettingEnabled(SettingNames.AllowCrossBorderPayout);
|
|
310
|
+
const defaultPayoutCountry = getLegalEntityCountry(legalEntityResponse);
|
|
311
|
+
const existingPayoutDetails = useMemo(
|
|
312
|
+
() => transferInstrument ? mapTransferInstrumentToPayoutAccount(transferInstrument, enabledCrossBorderPayouts) : void 0,
|
|
313
|
+
[transferInstrument, enabledCrossBorderPayouts]
|
|
314
|
+
);
|
|
315
|
+
const [documents, setDocuments] = useState();
|
|
316
|
+
const [isCaasCalled, setIsCaasCalled] = useState(false);
|
|
317
|
+
const accountHolder = getPayoutAccountHolderName(legalEntityResponse, t);
|
|
318
|
+
const fallbackCurrency = currencyByCountry[defaultPayoutCountry]?.[0];
|
|
319
|
+
const accountHolderName = accountHolder || getLegalEntityNameBasedOnType(legalEntityResponse);
|
|
320
|
+
const instantVerificationEnabled = Boolean(
|
|
321
|
+
!isTransferInstrumentLoading && !transferInstrument && isSettingEnabled("instantBankVerification")
|
|
322
|
+
);
|
|
323
|
+
const taskType = propTaskType ?? TaskTypes.PAYOUT;
|
|
324
|
+
const [trustedTransferInstrumentId, setTrustedTransferInstrumentId] = useState();
|
|
325
|
+
const prefilledData = useMemo(
|
|
326
|
+
() => ({
|
|
327
|
+
payoutCountryDetails: {
|
|
328
|
+
bankCountry: existingPayoutDetails?.payoutCountryDetails?.bankCountry ?? defaultPayoutCountry,
|
|
329
|
+
preferredCurrency: existingPayoutDetails?.payoutCountryDetails?.preferredCurrency ?? getDefaultCurrencyForCountry(defaultPayoutCountry)
|
|
330
|
+
},
|
|
331
|
+
payoutAccountDetails: {
|
|
332
|
+
accountHolder: accountHolderName,
|
|
333
|
+
currency: fallbackCurrency,
|
|
334
|
+
...existingPayoutDetails?.payoutAccountDetails
|
|
335
|
+
},
|
|
336
|
+
payoutVerificationMethod: {
|
|
337
|
+
payoutVerificationMethod: getPayoutVerificationMethod(
|
|
338
|
+
transferInstrument,
|
|
339
|
+
instantVerificationEnabled
|
|
340
|
+
),
|
|
341
|
+
bankCountry: defaultPayoutCountry,
|
|
342
|
+
...existingPayoutDetails?.payoutVerificationMethod
|
|
343
|
+
},
|
|
344
|
+
payoutAccountVerification: {
|
|
345
|
+
verifiedAccountHolder: accountHolderName,
|
|
346
|
+
verifiedBankCountry: defaultPayoutCountry,
|
|
347
|
+
...existingPayoutDetails?.payoutAccountVerification
|
|
348
|
+
}
|
|
349
|
+
}),
|
|
350
|
+
[
|
|
351
|
+
existingPayoutDetails,
|
|
352
|
+
defaultPayoutCountry,
|
|
353
|
+
accountHolderName,
|
|
354
|
+
fallbackCurrency,
|
|
355
|
+
instantVerificationEnabled,
|
|
356
|
+
transferInstrument
|
|
357
|
+
]
|
|
358
|
+
);
|
|
359
|
+
const documentUtils = documentApiUtils({
|
|
360
|
+
baseUrl: baseUrl.value,
|
|
361
|
+
rootLegalEntityId: rootLegalEntityId.value
|
|
362
|
+
});
|
|
363
|
+
const [skipSubmit, setSkipSubmit] = useState(false);
|
|
364
|
+
const [loadingStatus, setLoadingStatus] = useState("loading");
|
|
365
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
366
|
+
const [configurationLoadingStatus, setConfigurationLoadingStatus] = useState("loading");
|
|
367
|
+
const [accountDetailsFromInput, setAccountDetailsFromInput] = useState(
|
|
368
|
+
prefilledData.payoutAccountDetails
|
|
369
|
+
);
|
|
370
|
+
const [derivedProps, setDerivedProps] = useState();
|
|
371
|
+
const [initialBankAccountCountry] = useState(defaultPayoutCountry);
|
|
372
|
+
const [problems, setProblems] = useState(propProblems);
|
|
373
|
+
const [hasAsyncValidationError, setHasAsyncValidationError] = useState(false);
|
|
374
|
+
const buildFieldValidations = useCallback(
|
|
375
|
+
(data) => {
|
|
376
|
+
const country = (enabledCrossBorderPayouts ? data?.payoutCountryDetails?.bankCountry : data?.payoutVerificationMethod?.bankCountry) ?? defaultPayoutCountry;
|
|
377
|
+
return {
|
|
378
|
+
payoutCountryDetails: payoutCountryDetailsValidators(),
|
|
379
|
+
payoutVerificationMethod: payoutVerificationMethodValidators(),
|
|
380
|
+
payoutAccountDetails: payoutAccountDetailsValidators({ country }),
|
|
381
|
+
payoutAccountDocuments: payoutAccountDocumentsValidators(),
|
|
382
|
+
payoutAccountVerification: payoutAccountVerificationValidators()
|
|
383
|
+
};
|
|
384
|
+
},
|
|
385
|
+
[enabledCrossBorderPayouts, defaultPayoutCountry]
|
|
386
|
+
);
|
|
387
|
+
const defaultData = useMemo(() => {
|
|
388
|
+
return {
|
|
389
|
+
...prefilledData,
|
|
390
|
+
payoutAccountDocuments: documents
|
|
391
|
+
};
|
|
392
|
+
}, [prefilledData, documents]);
|
|
393
|
+
const multiForm = useMultiForm({
|
|
394
|
+
defaultData,
|
|
395
|
+
allFields: derivedProps?.allFields,
|
|
396
|
+
requiredFields: derivedProps?.requiredFields,
|
|
397
|
+
optionalFields: derivedProps?.optionalFields,
|
|
398
|
+
obscuredFields: derivedProps?.obscuredFields,
|
|
399
|
+
trustedFields: derivedProps?.trustedFields,
|
|
400
|
+
rules: buildFieldValidations
|
|
401
|
+
});
|
|
402
|
+
const bankAccountCountry = (enabledCrossBorderPayouts ? multiForm.data?.payoutCountryDetails?.bankCountry : multiForm.data?.payoutVerificationMethod?.bankCountry) ?? initialBankAccountCountry;
|
|
403
|
+
const isMaskedBankAccountNumber = multiForm.data.payoutAccountDetails?.bankAccountNumber?.includes("*") || multiForm.data.payoutAccountDetails?.iban?.includes("*");
|
|
404
|
+
const existingBankAccountFormat = transferInstrument ? transferInstrument?.bankAccount?.accountIdentification?.type === "numberAndBic" ? "numberAndBic" : existingPayoutDetails?.payoutAccountDetails?.iban ? "iban" : "local" : void 0;
|
|
405
|
+
useEffect(() => {
|
|
406
|
+
userEvents.updateBaseTrackingPayload({ task: taskType });
|
|
407
|
+
userEvents.addTaskEvent("Landed on page", {
|
|
408
|
+
actionType: "start"
|
|
409
|
+
});
|
|
410
|
+
}, []);
|
|
411
|
+
const {
|
|
412
|
+
data: providers,
|
|
413
|
+
refetch: refetchBankVerificationProviders,
|
|
414
|
+
status: bankVendorsLoadingStatus
|
|
415
|
+
} = useBankVerificationProviders(
|
|
416
|
+
{
|
|
417
|
+
country: bankAccountCountry,
|
|
418
|
+
configId: openBankingPartnerConfigId,
|
|
419
|
+
locale: i18next.language
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
enabled: instantVerificationEnabled
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
const instantVerificationAvailable = useMemo(
|
|
426
|
+
() => Boolean(instantVerificationEnabled && providers?.[0]?.redirectUrl),
|
|
427
|
+
[instantVerificationEnabled, providers]
|
|
428
|
+
);
|
|
429
|
+
const getPayoutAccountFormatData = useCallback(
|
|
430
|
+
async () => getAccountFormatsForCountry(bankAccountCountry),
|
|
431
|
+
[bankAccountCountry]
|
|
432
|
+
);
|
|
433
|
+
const { fieldConfigurations, requiredFields } = useScenarioConfiguration({
|
|
434
|
+
parseConfiguration,
|
|
435
|
+
legalEntityType: legalEntityResponse.type,
|
|
436
|
+
getPayoutAccountFormatData,
|
|
437
|
+
instantVerificationAvailable,
|
|
438
|
+
setLoadingStatus: setConfigurationLoadingStatus,
|
|
439
|
+
country: bankAccountCountry,
|
|
440
|
+
existingBankAccountFormat
|
|
441
|
+
});
|
|
442
|
+
const fieldsFromCustomRules = useMemo(
|
|
443
|
+
() => rules({
|
|
444
|
+
data: multiForm.data,
|
|
445
|
+
requiredFields,
|
|
446
|
+
isFeatureEnabled
|
|
447
|
+
}),
|
|
448
|
+
[multiForm.data, bankAccountCountry, taskType, requiredFields, isFeatureEnabled]
|
|
449
|
+
);
|
|
450
|
+
const apiBankAccount = useMemo(() => {
|
|
451
|
+
const payoutAccountDetails = multiForm.data.payoutAccountDetails ?? { bankAccountNumber: "" };
|
|
452
|
+
return mapPayoutAccountSchemaToApiBankAccount(payoutAccountDetails, bankAccountCountry);
|
|
453
|
+
}, [multiForm.data, bankAccountCountry]);
|
|
454
|
+
const {
|
|
455
|
+
data: checkAsAServiceData,
|
|
456
|
+
refetch: refetchCheckAsAService,
|
|
457
|
+
isLoading: isCheckAsAServiceLoading,
|
|
458
|
+
isError: isCheckAsAServiceError
|
|
459
|
+
} = useCheck(apiBankAccount.accountIdentification, {
|
|
460
|
+
enabled: false
|
|
461
|
+
});
|
|
462
|
+
const checkAsAServiceResultStatus = checkAsAServiceData?.status;
|
|
463
|
+
const checkAsAServiceResultErrors = checkAsAServiceData?.errors;
|
|
464
|
+
const provider = providers?.[0];
|
|
465
|
+
const isInstantVerificationFlow = multiForm.data.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification";
|
|
466
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
467
|
+
const payoutDetailsSteps = useMemo(() => {
|
|
468
|
+
const appropriatePayoutDetailsSteps = getAppropriatePayoutDetailsSteps(
|
|
469
|
+
Boolean(prefilledData?.payoutAccountDetails?.transferInstrumentId),
|
|
470
|
+
instantVerificationAvailable,
|
|
471
|
+
isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
|
|
472
|
+
enabledCrossBorderPayouts
|
|
473
|
+
);
|
|
474
|
+
if (!isCheckAsAServiceError && checkAsAServiceResultStatus === "VALID" && !isMaskedBankAccountNumber) {
|
|
475
|
+
delete appropriatePayoutDetailsSteps[payoutSteps.payoutAccountDocuments.formId];
|
|
476
|
+
}
|
|
477
|
+
return appropriatePayoutDetailsSteps;
|
|
478
|
+
}, [providers, checkAsAServiceResultStatus, isCheckAsAServiceError, isMaskedBankAccountNumber]);
|
|
479
|
+
useEffect(() => {
|
|
480
|
+
const props = getPropsFromConfigurations({
|
|
481
|
+
scenarioConfiguration: fieldConfigurations,
|
|
482
|
+
forms: payoutDetailsSteps,
|
|
483
|
+
remediationActions: problems?.remediationActions ? Object.values(problems?.remediationActions) : [],
|
|
484
|
+
dataMissingErrors: problems?.missingData ?? [],
|
|
485
|
+
fieldsWithExistingData: [],
|
|
486
|
+
customRules: fieldsFromCustomRules,
|
|
487
|
+
legalEntityType: legalEntityResponse.type
|
|
488
|
+
});
|
|
489
|
+
setDerivedProps(props);
|
|
490
|
+
}, [
|
|
491
|
+
fieldConfigurations,
|
|
492
|
+
payoutDetailsSteps,
|
|
493
|
+
problems?.remediationActions,
|
|
494
|
+
problems?.missingData,
|
|
495
|
+
fieldsFromCustomRules,
|
|
496
|
+
legalEntityResponse.type
|
|
497
|
+
]);
|
|
498
|
+
useUnifyLoadingStatus(
|
|
499
|
+
setLoadingStatus,
|
|
500
|
+
configurationLoadingStatus,
|
|
501
|
+
// bank vendor loading status only matters when we fetch bank vendors
|
|
502
|
+
instantVerificationEnabled ? bankVendorsLoadingStatus : "success",
|
|
503
|
+
isSubmitting ? "loading" : "success"
|
|
504
|
+
);
|
|
505
|
+
const forms = useMemo(() => {
|
|
506
|
+
const requiredForms = getRequiredForms(
|
|
507
|
+
payoutDetailsSteps,
|
|
508
|
+
derivedProps?.requiredFields,
|
|
509
|
+
derivedProps?.optionalFields
|
|
510
|
+
);
|
|
511
|
+
const adjustedFormValidity = hasAsyncValidationError ? { ...multiForm.isValid, payoutAccountDetails: false } : multiForm.isValid;
|
|
512
|
+
return addValidityToForms(requiredForms, adjustedFormValidity, problems);
|
|
513
|
+
}, [derivedProps, hasAsyncValidationError, multiForm.isValid, problems, payoutDetailsSteps]);
|
|
514
|
+
useEffect(() => {
|
|
515
|
+
if (!transferInstrument?.documentDetails?.length) return;
|
|
516
|
+
if (transferInstrument.id) {
|
|
517
|
+
documentUtils.fetchDocuments(transferInstrument.documentDetails, transferInstrument.id).then(() => {
|
|
518
|
+
const documents2 = mapApiDocumentToPayoutDocuments(transferInstrument.id);
|
|
519
|
+
setDocuments(documents2);
|
|
520
|
+
multiForm.handleChangeFor(
|
|
521
|
+
"bankStatementDocument",
|
|
522
|
+
"payoutAccountDocuments"
|
|
523
|
+
)(documents2.bankStatementDocument);
|
|
524
|
+
multiForm.handleChangeFor("description", "payoutAccountDocuments")(documents2.description);
|
|
525
|
+
}).catch(() => {
|
|
526
|
+
showToast({
|
|
527
|
+
label: commonT(($) => $["failedToFetchRelevantDocuments"]),
|
|
528
|
+
variant: "error"
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}, [transferInstrument?.documentDetails]);
|
|
533
|
+
const submitDocuments = async ({
|
|
534
|
+
forms: forms2,
|
|
535
|
+
transferInstrument: transferInstrument2,
|
|
536
|
+
dataSubmitted
|
|
537
|
+
}) => {
|
|
538
|
+
const isBankDocumentFormPresent = forms2.some(
|
|
539
|
+
(form) => form.formId === payoutSteps.payoutAccountDocuments.formId
|
|
540
|
+
);
|
|
541
|
+
if (isBankDocumentFormPresent) {
|
|
542
|
+
const documentToUpload = await mapPayoutDocumentsToApiDocuments(
|
|
543
|
+
dataSubmitted,
|
|
544
|
+
transferInstrument2.id
|
|
545
|
+
);
|
|
546
|
+
if (documentToUpload) {
|
|
547
|
+
try {
|
|
548
|
+
const documents2 = await documentUtils.uploadDocuments(
|
|
549
|
+
[documentToUpload],
|
|
550
|
+
transferInstrument2.id
|
|
551
|
+
);
|
|
552
|
+
documents2.forEach((document) => {
|
|
553
|
+
userEvents.addTaskEvent("Success", {
|
|
554
|
+
actionType: "upload",
|
|
555
|
+
documentType: dataSubmitted.payoutAccountDocuments?.documentType ?? document.type,
|
|
556
|
+
// tracks BankDocumentTypes
|
|
557
|
+
fileExtention: document.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? void 0
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
} catch {
|
|
561
|
+
setProblems({
|
|
562
|
+
...problems,
|
|
563
|
+
validationErrors: {
|
|
564
|
+
payoutAccountDocuments: { bankStatementDocument: true }
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
throw new Error(commonT(($) => $["remediationMessage_1_704"]));
|
|
568
|
+
} finally {
|
|
569
|
+
if (currentTransferInstrumentId) {
|
|
570
|
+
await refetchTransferInstrument?.();
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
useEffect(() => {
|
|
577
|
+
const payoutAccountData = cloneObject(multiForm.data)?.payoutAccountDetails;
|
|
578
|
+
if (payoutAccountData) setAccountDetailsFromInput(payoutAccountData);
|
|
579
|
+
}, [multiForm.data]);
|
|
580
|
+
const onSubmit = async () => {
|
|
581
|
+
setIsSubmitting(true);
|
|
582
|
+
const dataSubmitted = cloneObject({ ...prefilledData, ...multiForm.data });
|
|
583
|
+
const { payoutAccountDetails, payoutVerificationMethod } = dataSubmitted;
|
|
584
|
+
const baseTracking = {
|
|
585
|
+
actionType: "submit",
|
|
586
|
+
documentType: "bankStatement",
|
|
587
|
+
bankCountry: payoutVerificationMethod?.bankCountry ?? defaultPayoutCountry,
|
|
588
|
+
bankCurrency: payoutAccountDetails?.currency ?? null
|
|
589
|
+
};
|
|
590
|
+
let transferInstrumentFromInput = mapPayoutDetailsToTransferInstrument({
|
|
591
|
+
data: dataSubmitted,
|
|
592
|
+
legalEntity: legalEntityResponse,
|
|
593
|
+
enabledCrossBorderPayouts
|
|
594
|
+
});
|
|
595
|
+
transferInstrumentFromInput = omitObscuredFieldsIfUnchanged(
|
|
596
|
+
["bankAccount.accountIdentification.accountNumber", "bankAccount.accountIdentification.iban"],
|
|
597
|
+
transferInstrumentFromInput,
|
|
598
|
+
transferInstrument
|
|
599
|
+
);
|
|
600
|
+
try {
|
|
601
|
+
if (!transferInstrumentFromInput) return;
|
|
602
|
+
const response = await (transferInstrument ? handleUpdateTransferInstrument({
|
|
603
|
+
transferInstrument: transferInstrumentFromInput,
|
|
604
|
+
transferInstrumentId: transferInstrument.id
|
|
605
|
+
}) : createTransferInstrument(
|
|
606
|
+
rootLegalEntityId.value,
|
|
607
|
+
baseUrl.value,
|
|
608
|
+
transferInstrumentFromInput
|
|
609
|
+
));
|
|
610
|
+
userEvents.addTaskEvent("Success", {
|
|
611
|
+
...baseTracking
|
|
612
|
+
});
|
|
613
|
+
try {
|
|
614
|
+
await submitDocuments({ forms, transferInstrument: response, dataSubmitted });
|
|
615
|
+
clearToasts();
|
|
616
|
+
externalOnSubmit?.({ ...dataSubmitted, id: response?.id });
|
|
617
|
+
} catch (e) {
|
|
618
|
+
showToast({ label: e.message, variant: "error" });
|
|
619
|
+
userEvents.addTaskEvent("Encountered error", {
|
|
620
|
+
...baseTracking,
|
|
621
|
+
returnType: e?.errorCode || "backend",
|
|
622
|
+
returnValue: e?.title || e?.message
|
|
623
|
+
});
|
|
624
|
+
} finally {
|
|
625
|
+
setIsSubmitting(false);
|
|
626
|
+
}
|
|
627
|
+
} catch (e) {
|
|
628
|
+
if (isValidationError(e)) {
|
|
629
|
+
const validationErrors = processValidationErrors(e, taskType);
|
|
630
|
+
setProblems({ ...problems, validationErrors });
|
|
631
|
+
} else if (isIdDocumentUploadError(e)) {
|
|
632
|
+
showToast({ label: t(($) => $["idDocumentAlreadyUploaded"]), variant: "error" });
|
|
633
|
+
} else if (isBankStatementUploadError(e)) {
|
|
634
|
+
showToast({ label: t(($) => $["bankStatementAlreadyUploaded"]), variant: "error" });
|
|
635
|
+
} else if (isMaintenanceModeError(e)) {
|
|
636
|
+
showToast({
|
|
637
|
+
label: commonT(($) => $["maintenanceModeMessage"]),
|
|
638
|
+
variant: "error",
|
|
639
|
+
duration: "indefinite"
|
|
640
|
+
});
|
|
641
|
+
} else {
|
|
642
|
+
const errorTranslatable = mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable(e);
|
|
643
|
+
showToast({ label: commonT(($) => $[errorTranslatable]), variant: "error" });
|
|
644
|
+
}
|
|
645
|
+
setIsSubmitting(false);
|
|
646
|
+
userEvents.addTaskEvent("Encountered error", {
|
|
647
|
+
...baseTracking,
|
|
648
|
+
returnType: e?.errorCode || "backend",
|
|
649
|
+
returnValue: e?.title || e?.message
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
const formatFileSummaryData = (bankDocuments) => {
|
|
654
|
+
const bankStatementDocument = bankDocuments?.bankStatementDocument?.[0];
|
|
655
|
+
return {
|
|
656
|
+
documentType: bankDocuments?.documentType && commonT(($) => $[bankDocuments?.documentType]),
|
|
657
|
+
fileName: bankStatementDocument?.name,
|
|
658
|
+
description: bankDocuments?.description
|
|
659
|
+
};
|
|
660
|
+
};
|
|
661
|
+
const datasetUtils = datasetUtilities(i18next.language);
|
|
662
|
+
const formatDataForSummary = () => {
|
|
663
|
+
const summaryData = cloneObject(multiForm.data);
|
|
664
|
+
if (summaryData.payoutAccountDetails) {
|
|
665
|
+
summaryData.payoutAccountDetails.accountHolder = accountHolderName;
|
|
666
|
+
}
|
|
667
|
+
if (summaryData.payoutVerificationMethod?.bankCountry && summaryData.payoutAccountDetails) {
|
|
668
|
+
summaryData.payoutAccountDetails.bankCountry = datasetUtils.getCountryName(
|
|
669
|
+
summaryData.payoutVerificationMethod.bankCountry
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
if (summaryData.payoutAccountDocuments) {
|
|
673
|
+
summaryData.payoutAccountDocuments = formatFileSummaryData(
|
|
674
|
+
multiForm.data?.payoutAccountDocuments
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
summaryData.payoutAccountVerification = formatAccountVerificationSummary(
|
|
678
|
+
multiForm.data.payoutAccountVerification
|
|
679
|
+
);
|
|
680
|
+
return summaryData;
|
|
681
|
+
};
|
|
682
|
+
const createTrustedTransferInstrumentHandler = async (code, state) => {
|
|
683
|
+
try {
|
|
684
|
+
const trustedTransferInstrument = await handleCreateTrustedTransferInstrument({
|
|
685
|
+
code,
|
|
686
|
+
state
|
|
687
|
+
});
|
|
688
|
+
if (trustedTransferInstrument) {
|
|
689
|
+
setTrustedTransferInstrumentId(trustedTransferInstrument.verificationReference);
|
|
690
|
+
return trustedTransferInstrument;
|
|
691
|
+
}
|
|
692
|
+
} catch (e) {
|
|
693
|
+
refetchBankVerificationProviders();
|
|
694
|
+
const errorTranslatable = mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable(e);
|
|
695
|
+
if (errorTranslatable === "transferInstrumentLimitHasAlreadyBeenMet") {
|
|
696
|
+
showToast({ label: commonT(($) => $[errorTranslatable]), variant: "error" });
|
|
697
|
+
}
|
|
698
|
+
throw e;
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
const {
|
|
702
|
+
handleNextClick,
|
|
703
|
+
handleBackClick,
|
|
704
|
+
activeForm,
|
|
705
|
+
shouldValidate,
|
|
706
|
+
gotoFormByFormIndex,
|
|
707
|
+
gotoFormByFormId,
|
|
708
|
+
steps
|
|
709
|
+
} = useFormComposer({
|
|
710
|
+
problems,
|
|
711
|
+
forms,
|
|
712
|
+
externalBackClick,
|
|
713
|
+
triggerValidation: async (formName) => {
|
|
714
|
+
if (!multiForm.requiredFields?.[formName]) {
|
|
715
|
+
return true;
|
|
716
|
+
}
|
|
717
|
+
return multiForm.triggerValidation(formName);
|
|
718
|
+
},
|
|
719
|
+
onSubmit: skipSubmit ? async () => {
|
|
720
|
+
if (enabledCrossBorderPayouts && trustedTransferInstrumentId && multiForm.data.payoutCountryDetails?.preferredCurrency) {
|
|
721
|
+
try {
|
|
722
|
+
await handleUpdateTrustedTransferInstrument({
|
|
723
|
+
transferInstrumentId: trustedTransferInstrumentId,
|
|
724
|
+
preferredCurrencyCode: multiForm.data.payoutCountryDetails?.preferredCurrency
|
|
725
|
+
});
|
|
726
|
+
} catch {
|
|
727
|
+
showToast({ label: commonT(($) => $["failedToUpdateDetails"]), variant: "error" });
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if (trustedTransferInstrumentId) {
|
|
731
|
+
externalOnSubmit?.({ ...multiForm.data, id: trustedTransferInstrumentId });
|
|
732
|
+
}
|
|
733
|
+
userEvents.addTaskEvent("Success", {
|
|
734
|
+
actionType: "submit"
|
|
735
|
+
});
|
|
736
|
+
navigateBackToTaskList?.();
|
|
737
|
+
} : onSubmit
|
|
738
|
+
});
|
|
739
|
+
useEffect(() => {
|
|
740
|
+
if (activeForm?.formId === summaryStep.formId && isInstantVerificationFlow && trustedTransferInstrumentId) {
|
|
741
|
+
setSkipSubmit?.(true);
|
|
742
|
+
}
|
|
743
|
+
}, [activeForm?.formId, trustedTransferInstrumentId, isInstantVerificationFlow, setSkipSubmit]);
|
|
744
|
+
useEffect(() => {
|
|
745
|
+
if (!isCaasCalled || !forms) return;
|
|
746
|
+
setIsCaasCalled(false);
|
|
747
|
+
if (checkAsAServiceResultStatus !== "VALID" && checkAsAServiceResultStatus !== "INCOMPLETE_INPUT") {
|
|
748
|
+
const formIndex = forms.findIndex((f) => f.formId === "payoutAccountDocuments");
|
|
749
|
+
if (formIndex > -1) {
|
|
750
|
+
gotoFormByFormIndex(formIndex);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
if (checkAsAServiceResultStatus === "VALID") {
|
|
754
|
+
handleNextClick();
|
|
755
|
+
}
|
|
756
|
+
}, [forms, checkAsAServiceResultStatus, isCaasCalled]);
|
|
757
|
+
const handleFormNextClick = async () => {
|
|
758
|
+
if (activeForm.formId === "payoutVerificationMethod") {
|
|
759
|
+
if (isInstantVerificationFlow) {
|
|
760
|
+
trackNavigation({
|
|
761
|
+
userEvents,
|
|
762
|
+
actionType: "next",
|
|
763
|
+
label: "instantVerification",
|
|
764
|
+
toForm: "instantVerification"
|
|
765
|
+
});
|
|
766
|
+
showInstantVerificationPayoutModal.value = true;
|
|
767
|
+
return;
|
|
768
|
+
} else {
|
|
769
|
+
handleNextClick();
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
if (activeForm.formId === "payoutAccountDetails" && activeForm.isValid && multiForm.data.payoutAccountDetails && !isMaskedBankAccountNumber) {
|
|
774
|
+
try {
|
|
775
|
+
const { data: response } = await refetchCheckAsAService();
|
|
776
|
+
setIsCaasCalled(true);
|
|
777
|
+
if (response?.status === "INCOMPLETE_INPUT") {
|
|
778
|
+
setIsModalOpen(true);
|
|
779
|
+
}
|
|
780
|
+
} catch {
|
|
781
|
+
handleNextClick();
|
|
782
|
+
}
|
|
783
|
+
} else {
|
|
784
|
+
handleNextClick();
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
if (previousTrustedInstrumentStatus !== createTrustedTransferInstrumentStatus) {
|
|
788
|
+
if (activeForm.formId === "payoutAccountVerification" && activeForm.isValid && createTrustedTransferInstrumentStatus === "success" && multiForm.data.payoutAccountVerification?.verifiedBankAccountNumber) {
|
|
789
|
+
handleNextClick();
|
|
790
|
+
setPreviousTrustedInstrumentStatus(createTrustedTransferInstrumentStatus);
|
|
791
|
+
}
|
|
792
|
+
if (activeForm.formId === "payoutVerificationMethod" && createTrustedTransferInstrumentStatus === "success") {
|
|
793
|
+
gotoFormByFormIndex(forms.length - 1);
|
|
794
|
+
setPreviousTrustedInstrumentStatus(createTrustedTransferInstrumentStatus);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
const omittedForms = multiForm.data?.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification" ? [] : [payoutSteps.payoutVerificationMethod.formId];
|
|
798
|
+
const { header: invalidFieldHeader, content: invalidFieldContent } = getInvalidFieldsErrorMessage(
|
|
799
|
+
checkAsAServiceResultErrors ?? []
|
|
800
|
+
);
|
|
801
|
+
return /* @__PURE__ */ jsxs(
|
|
802
|
+
LoaderWrapper,
|
|
803
|
+
{
|
|
804
|
+
showSpinner: true,
|
|
805
|
+
status: isCheckAsAServiceLoading || isModalOpen || createTrustedTransferInstrumentStatus === "pending" ? "loading" : "success",
|
|
806
|
+
formOpacityWhenLoading: 0.3,
|
|
807
|
+
children: [
|
|
808
|
+
isModalOpen && /* @__PURE__ */ jsx(
|
|
809
|
+
Confirm,
|
|
810
|
+
{
|
|
811
|
+
title: t(($) => $[invalidFieldHeader]),
|
|
812
|
+
description: t(($) => $[invalidFieldContent]),
|
|
813
|
+
cancelText: commonT(($) => $["editDetails"]),
|
|
814
|
+
confirmText: t(($) => $["continueAnyway"]),
|
|
815
|
+
onConfirm: () => {
|
|
816
|
+
handleNextClick();
|
|
817
|
+
setIsModalOpen(false);
|
|
818
|
+
},
|
|
819
|
+
onCancel: () => {
|
|
820
|
+
gotoFormByFormIndex(0);
|
|
821
|
+
setIsModalOpen(false);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
),
|
|
825
|
+
/* @__PURE__ */ jsx(FormContextProvider, { form: multiForm, children: /* @__PURE__ */ jsx(
|
|
826
|
+
FormFlow,
|
|
827
|
+
{
|
|
828
|
+
summary: {
|
|
829
|
+
data: formatDataForSummary(),
|
|
830
|
+
omitted: {
|
|
831
|
+
keys: ["transferInstrumentId", "payoutVerificationMethod"],
|
|
832
|
+
forms: omittedForms,
|
|
833
|
+
summaryEditButton: ["payoutVerificationMethod", "payoutAccountVerification"]
|
|
834
|
+
},
|
|
835
|
+
problems
|
|
836
|
+
},
|
|
837
|
+
asModal,
|
|
838
|
+
currentStep: steps.current,
|
|
839
|
+
totalSteps: steps.total,
|
|
840
|
+
forms,
|
|
841
|
+
activeForm,
|
|
842
|
+
gotoFormByFormIndex,
|
|
843
|
+
gotoFormByFormId,
|
|
844
|
+
handleNextClick: handleFormNextClick,
|
|
845
|
+
handleBackClick: activeForm.formId !== "summary" ? handleBackClick : void 0,
|
|
846
|
+
handleCancelClick: handleCloseClick || handleHomeClick,
|
|
847
|
+
loadingStatus: isTransferInstrumentLoading ? "loading" : loadingStatus,
|
|
848
|
+
children: (!isTransferInstrumentLoading || isSubmitting) && /* @__PURE__ */ jsx(
|
|
849
|
+
PayoutDetailsMultiform,
|
|
850
|
+
{
|
|
851
|
+
activeForm,
|
|
852
|
+
shouldValidate,
|
|
853
|
+
problems,
|
|
854
|
+
country: defaultPayoutCountry,
|
|
855
|
+
accountHolder: accountHolder ?? getLegalEntityNameBasedOnType(legalEntityResponse),
|
|
856
|
+
legalEntityResponse,
|
|
857
|
+
provider,
|
|
858
|
+
bankVendorsLoadingStatus,
|
|
859
|
+
instantVerificationAvailable,
|
|
860
|
+
createTrustedTransferInstrument: createTrustedTransferInstrumentHandler,
|
|
861
|
+
accountDetailsFromInput,
|
|
862
|
+
trustedTransferInstrumentId,
|
|
863
|
+
onBack: handleBackClick,
|
|
864
|
+
setHasAsyncValidationError
|
|
865
|
+
}
|
|
866
|
+
)
|
|
867
|
+
}
|
|
868
|
+
) })
|
|
869
|
+
]
|
|
870
|
+
}
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
function PayoutDetailsPage({
|
|
874
|
+
transferInstrumentId: transferInstrumentIdProp,
|
|
875
|
+
setTransferInstrumentId: setTransferInstrumentIdProp,
|
|
876
|
+
taskType,
|
|
877
|
+
openBankingPartnerConfigId,
|
|
878
|
+
onSubmit,
|
|
879
|
+
handleHomeClick
|
|
880
|
+
}) {
|
|
881
|
+
const routeParams = useParams();
|
|
882
|
+
const navigate = useNavigate();
|
|
883
|
+
const transferInstrumentId = transferInstrumentIdProp ?? routeParams.transferInstrumentId;
|
|
884
|
+
const setTransferInstrumentId = setTransferInstrumentIdProp ?? ((id) => navigate.replace(taskType, { transferInstrumentId: id }));
|
|
885
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
886
|
+
const { i18n } = useTranslation();
|
|
887
|
+
const { data: rootLe } = useLegalEntity(ROOT_LE);
|
|
888
|
+
const capabilityProblems = useCapabilityProblems();
|
|
889
|
+
addResourceBundles(i18n, [
|
|
890
|
+
{ ns: "banking", importFn: (lang) => __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "../language/bg-BG.json": () => import("./bg-BG-BnwkqGm9.js"), "../language/cs-CZ.json": () => import("./cs-CZ-BeMYkFfD.js"), "../language/da-DK.json": () => import("./da-DK-mUuPR2YO.js"), "../language/de-DE.json": () => import("./de-DE-CwT6O212.js"), "../language/el-GR.json": () => import("./el-GR-BuAfpG6u.js"), "../language/en-US.json": () => import("./en-US-DrUYyPhF.js"), "../language/es-ES.json": () => import("./es-ES-Bh8k9Zx8.js"), "../language/et-EE.json": () => import("./et-EE-BBnYC5q8.js"), "../language/fi-FI.json": () => import("./fi-FI-DhUeTfn1.js"), "../language/fr-FR.json": () => import("./fr-FR-CocDMzBc.js"), "../language/hr-HR.json": () => import("./hr-HR-D9OGeEuB.js"), "../language/hu-HU.json": () => import("./hu-HU-DjaoFDqm.js"), "../language/it-IT.json": () => import("./it-IT-B4bk2Xev.js"), "../language/ja-JP.json": () => import("./ja-JP-DK55NCZY.js"), "../language/lt-LT.json": () => import("./lt-LT-CfQUS8PP.js"), "../language/lv-LV.json": () => import("./lv-LV-DoKxsoVR.js"), "../language/nl-NL.json": () => import("./nl-NL-J7XpCpQm.js"), "../language/no-NO.json": () => import("./no-NO-CtDyNTm6.js"), "../language/pl-PL.json": () => import("./pl-PL-CCX1rSGF.js"), "../language/pt-BR.json": () => import("./pt-BR-D4BTdo_w.js"), "../language/pt-PT.json": () => import("./pt-PT-DBZj2dDI.js"), "../language/ro-RO.json": () => import("./ro-RO-DaU2--fX.js"), "../language/sk-SK.json": () => import("./sk-SK-B-1yRol7.js"), "../language/sl-SI.json": () => import("./sl-SI-C_4ajjU4.js"), "../language/sv-SE.json": () => import("./sv-SE-DKnUr7xo.js") }), `../language/${lang}.json`, 3) }
|
|
891
|
+
]);
|
|
892
|
+
if (!rootLe) {
|
|
893
|
+
return /* @__PURE__ */ jsx(Loader, {});
|
|
894
|
+
}
|
|
895
|
+
const problems = capabilityProblems && transferInstrumentId ? getProblemsForEntity(capabilityProblems, EntityTypes.BANK_ACCOUNT, transferInstrumentId) : void 0;
|
|
896
|
+
const PayoutPageDetailsDropin = isFeatureEnabled("EnablePayoutDetailsMultiForm") ? PayoutDetailsDropinMultiForm : PayoutDetailsDropin;
|
|
897
|
+
return /* @__PURE__ */ jsx(
|
|
898
|
+
PayoutPageDetailsDropin,
|
|
899
|
+
{
|
|
900
|
+
taskType,
|
|
901
|
+
currentTransferInstrumentId: transferInstrumentId,
|
|
902
|
+
setCurrentTransferInstrumentId: setTransferInstrumentId,
|
|
903
|
+
legalEntityResponse: rootLe,
|
|
904
|
+
problems,
|
|
905
|
+
onSubmit,
|
|
906
|
+
handleHomeClick,
|
|
907
|
+
navigateBackToTaskList: handleHomeClick,
|
|
908
|
+
openBankingPartnerConfigId
|
|
909
|
+
}
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
export {
|
|
913
|
+
PayoutDetailsPage
|
|
914
|
+
};
|