@adyen/kyc-components 4.6.3 → 4.7.1
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-XaeVhsGD.js → AcceptTermsOfServiceComponent-CFuKCmzi.js} +17 -18
- package/dist/{AccountSetupRejected-CCTKPh4T.js → AccountSetupRejected-CJO8fFLr.js} +2 -2
- package/dist/{ActionBar-DIFvfiMP.js → ActionBar-DW4IMRZg.js} +1 -1
- package/dist/{Address-CVPObm6B.js → Address-Czpdu7Iv.js} +15 -15
- package/dist/{Avatar-Cf37hJy8.js → Avatar-CaZQ-oyL.js} +1 -1
- package/dist/{BusinessFinancingComponent-MO_80E8a.js → BusinessFinancingComponent-CvmqdPg-.js} +6 -6
- package/dist/{BusinessFinancingDropin-C6g7xB95.js → BusinessFinancingDropin-CA5D0PgR.js} +28 -30
- package/dist/BusinessFinancingPage-CcCpkh2o.js +43 -0
- package/dist/{BusinessTypeSelectionPage-q-ohll63.js → BusinessTypeSelectionPage-DxpkzhZp.js} +9 -11
- package/dist/{Checkbox-CZ-K3Ygt.js → Checkbox-BbVX_nZi.js} +1 -1
- package/dist/{Confirm-Bfhearjt.js → Confirm-DW7YOE1F.js} +2 -2
- package/dist/{ConstitutionalDocument-BZcUcXNX.js → ConstitutionalDocument-CK6FFFwg.js} +37 -26
- package/dist/{ContactDetails-CLSUzFP_.js → ContactDetails-Dx7dJnqB.js} +9 -19
- package/dist/{ContextGuidance-BopbaLr-.js → ContextGuidance-C7HDkmZU.js} +1 -1
- package/dist/{CountryField-BJAayKID.js → CountryField-CAgo6wFJ.js} +3 -3
- package/dist/{CreateIndividualComponent-D2-0xOiU.js → CreateIndividualComponent-BP_biPqN.js} +6 -6
- package/dist/{CreateTransferInstrumentComponent-CKnK4wTB.js → CreateTransferInstrumentComponent-CAg8dLjP.js} +4 -4
- package/dist/{Currency-BsVi8QRc.js → Currency-DUnZGkXH.js} +7 -7
- package/dist/{CustomerSupport-CJTSCIsJ.js → CustomerSupport-D2iXL505.js} +10 -12
- package/dist/{DebugModal-B44T9eDP.js → DebugModal-CUcMO4o_.js} +7 -7
- package/dist/{DecisionMakerDetails-DJmL0mgp.js → DecisionMakerDetails-Bp33aJUr.js} +9 -9
- package/dist/{DecisionMakerDetailsPage-BBa--1Xr.js → DecisionMakerDetailsPage-DSFo-4Sk.js} +8 -8
- package/dist/{DecisionMakers-B9o4bDnw.js → DecisionMakers-Bnvwoz_7.js} +20 -22
- package/dist/{Dropzone-CHADYCWU.js → Dropzone-F8Ut9D_V.js} +4 -4
- package/dist/{EmbeddedStatus-CUGRqHWU.js → EmbeddedStatus-GocVl-7i.js} +2 -2
- package/dist/{EndStateLayout-CWFjt8_u.js → EndStateLayout-BBLxK9Q1.js} +1 -1
- package/dist/{EntityAssociation-COqNeSzy.js → EntityAssociation-CpVhhf1f.js} +5 -5
- package/dist/{EntityGuidanceStatus-BOjmARXU.js → EntityGuidanceStatus-BBdOh7as.js} +4 -4
- package/dist/{ErrorPanel-BFnWeBCJ.js → ErrorPanel-D3OmtL80.js} +2 -2
- package/dist/{Field-B8NADHt-.js → Field-ClKiPVDa.js} +1 -1
- package/dist/{FormNavigation-CZGO4M_r.js → FormNavigation-CbHvKnKB.js} +2 -2
- package/dist/{Individual.rules-CcCj7FCg.js → Individual.rules-DChMs8iu.js} +6 -6
- package/dist/{IndividualDropin-D4VcAQnB.js → IndividualDropin-D--ImJNx.js} +164 -121
- package/dist/{InputDate-BvgrweAT.js → InputDate-BajoDzsK.js} +2 -2
- package/dist/{InputText-D6VoNS-R.js → InputText-C8kj07ZB.js} +1 -1
- package/dist/{Introduction-DCEmOIU3.js → Introduction-ejHrYyaC.js} +4 -6
- package/dist/{InvitedDecisionMakerComponent-D-Mxf7Sa.js → InvitedDecisionMakerComponent-BUrtBWme.js} +18 -13
- package/dist/{JpAddress-aZ8F40cK.js → JpAddress-BpaKGrVA.js} +10 -10
- package/dist/{LandingLayout-Co0T9hoE.js → LandingLayout-B_Cw3o3Q.js} +5 -3
- package/dist/{LegalCompanyNameField-EsmoOYWn.js → LegalCompanyNameField-BRzGJ-Ov.js} +6 -6
- package/dist/{LegalRepresentativeDetailsPage-ChOjFSdk.js → LegalRepresentativeDetailsPage-D71SlyLs.js} +4 -4
- package/dist/{Link-QFSK0XUO.js → Link-DS54L_TE.js} +1 -1
- package/dist/{ListItem-rRlEZCTu.js → ListItem-CFcOIT6E.js} +2 -2
- package/dist/{LoaderWrapper-DlhbbEYS.js → LoaderWrapper-DvyhRweQ.js} +1 -1
- package/dist/ManageIndividualComponent-BXxl7p95.js +46 -0
- package/dist/{ManageTermsOfServiceComponent-B4WTTK1V.js → ManageTermsOfServiceComponent-4e_ydA_6.js} +3 -3
- package/dist/{ManageTransferInstrumentComponent-C716Mbf2.js → ManageTransferInstrumentComponent-D52NH0jS.js} +10 -10
- package/dist/{MaskedInput-Cj3Be_WU.js → MaskedInput-ApBB9ewS.js} +5 -5
- package/dist/{MaybeModal-nSPl0yfm.js → MaybeModal-l7k-LBMJ.js} +2 -2
- package/dist/{Modal-D1Yiugk1.js → Modal-C5mnAneL.js} +3 -3
- package/dist/{Name-Pp6IOBxl.js → Name-BVk4_a2-.js} +5 -5
- package/dist/{NewSummary-DKld0bET.js → NewSummary-R9k7ZbPo.js} +2 -2
- package/dist/{OnboardingDropinComponent-DsvTtn8J.js → OnboardingDropinComponent-45YclRJI.js} +88 -75
- package/dist/{PayoutDetailsDropin-DANG1pDw.js → PayoutDetailsDropin-1vKgokN-.js} +465 -228
- package/dist/PayoutDetailsPage-CXwueRbW.js +914 -0
- package/dist/{RadioGroup-DwACEtfi.js → RadioGroup-CbeNPI_8.js} +2 -2
- package/dist/{Review-Dsp3Zk67.js → Review-DzrxzNY0.js} +6 -6
- package/dist/{RootBusinessDetailsPage-mquvEyt7.js → RootBusinessDetailsPage-eStzwQJf.js} +5 -5
- package/dist/{RootBusinessLinesPage-DCSgZuZD.js → RootBusinessLinesPage-omnttABd.js} +28 -37
- package/dist/{RootIndividualDetailsPage-BALuMNT2.js → RootIndividualDetailsPage-BcxaLjad.js} +7 -7
- package/dist/{Select-Bp6g62Kp.js → Select-Czm2JclY.js} +3 -3
- package/dist/{SignPCIComponent-CfWNRHUh.js → SignPCIComponent-DXAeetcT.js} +11 -13
- package/dist/{SingpassSelection-Cpouo3cB.js → SingpassSelection-CPgrgp4C.js} +5 -5
- package/dist/{SoleProprietorshipPage-KtyWIVNn.js → SoleProprietorshipPage-DmIKoFtO.js} +4 -4
- package/dist/{SourceOfFundsPage-B1lV40GU.js → SourceOfFundsPage-DofHZlzT.js} +33 -35
- package/dist/{StepProgressIndicator-U5DG_o4X.js → StepProgressIndicator-rIXID-AK.js} +1 -1
- package/dist/{StoreProvider-hNCKWSzB.js → StoreProvider-Bt6bLVE-.js} +111 -91
- package/dist/{Summary-NFgvajMx.js → Summary-BUJLYAgF.js} +7 -20
- package/dist/{TaxInformationField-ef1_TQvO.js → TaxInformationField-CknxoOIl.js} +27 -23
- package/dist/{TaxReportingDropin-OMrPS7PX.js → TaxReportingDropin-Bn4a54-x.js} +14 -16
- package/dist/{TextArea-BnlstVGI.js → TextArea-CKD5zTKW.js} +1 -1
- package/dist/{TileGroup-DTnywnyF.js → TileGroup-UvRO_GGK.js} +2 -2
- package/dist/{TrustDetailsPage-D7FoWYJC.js → TrustDetailsPage-BBg2UhIm.js} +32 -41
- package/dist/{TrustMemberCompanyPage-BaBDjZDf.js → TrustMemberCompanyPage-sG_Tsffg.js} +6 -6
- package/dist/{TrustMemberIndividualPage-BLZwEIxg.js → TrustMemberIndividualPage-Cpk0LIwl.js} +6 -6
- package/dist/{TrustMemberRoleAndTypePage-BVMuoGHX.js → TrustMemberRoleAndTypePage-h8cM9Ltb.js} +22 -22
- package/dist/{TrustMembersOverview-vsUsCHml.js → TrustMembersOverview-Hqb3o_y6.js} +11 -11
- package/dist/{UnincorporatedPartnershipIndividualPage-BBmy3wse.js → UnincorporatedPartnershipIndividualPage-CdpFVv2I.js} +4 -4
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-DqFOtoRR.js → UnincorporatedPartnershipMemberCompanyPage-CuOQsMrw.js} +5 -5
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-CBF8M7cR.js → UnincorporatedPartnershipMemberRoleAndTypePage-BLcsgLCP.js} +11 -11
- package/dist/{UnincorporatedPartnershipMembersOverview-JwdguZNL.js → UnincorporatedPartnershipMembersOverview-ClQQnnrs.js} +7 -7
- package/dist/{VerificationErrorAlert-CpEbIDR3.js → VerificationErrorAlert-Clxb4YjL.js} +2 -2
- package/dist/{ViewVerificationStatusComponent-DgOa7RsZ.js → ViewVerificationStatusComponent-yJyifkQm.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-Cf0EyXIO.js → bafinUtils-DsUdZgzH.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-Cl95UfG4.js → commonValidators-2G1K0mHC.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-BY7YDLvA.js → dropinUtils-D3x5I-79.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-os98XaB-.js → formUtils-C1nur8r7.js} +2 -2
- 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-t_vGHMzu.js → getName-B_JUBLVR.js} +1 -1
- package/dist/{getProblemsForEntity-DKjmIXBa.js → getProblemsForEntity-BSfnPYoe.js} +1 -1
- package/dist/{getTrustedFields-BrXqOBCX.js → getTrustedFields-CEoqo2CR.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-ze-XxTHy.js → isEmpty-CpSE7NAw.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-DYEPbhFP.js → japanSupportUtils-CprkdtHL.js} +1 -1
- package/dist/{localizeDateString-BVk8Wvy3.js → localizeDateString-BLDvqFOU.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-BqPAjtnr.js → mapExistingFile-DUgMBW9t.js} +3 -3
- package/dist/{mapJpAddressSchemaToAddressLocalizations-WxoGOrHr.js → mapJpAddressSchemaToAddressLocalizations-BXIw8J3t.js} +2 -2
- package/dist/{mapLegalEntityToIndividualSchema-B0s8GG9o.js → mapLegalEntityToIndividualSchema-BRQ51OQI.js} +4 -4
- package/dist/{mapTransferInstrumentToPayoutAccount-BsiLVcTY.js → mapTransferInstrumentToPayoutAccount-DaLPVgIK.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-DqCASsJA.js → omitObscuredFieldsIfUnchanged-ChSKB1LF.js} +3 -3
- package/dist/{patternValidators-Dx583C-1.js → patternValidators-0N8_moed.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-DIs_LC2a.js → process-field-configurations-DNb-fWox.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-CoyMk9x-.js → resolveEnvironment-RNyhTkW8.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-NqHcHFCe.js → roleMetadata-CuLbD5YE.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-lbafosQE.js → types-CJnNafzu.js} +2 -2
- package/dist/{types-BRLYR2Wx.js → types-DqaPuyRe.js} +1 -1
- package/dist/{types-C4RAJtRF.js → types-Ds3BWDI-.js} +1 -1
- package/dist/{unincorporated-partnership-KMmroXu1.js → unincorporated-partnership-DDPy7qIp.js} +1 -1
- package/dist/{useAssociatedLegalEntity-Dlgpas6D.js → useAssociatedLegalEntity-R9-aucnr.js} +1 -1
- package/dist/{useBusinessDetailsData-CPww2HAm.js → useBusinessDetailsData-BKgf0j8T.js} +379 -373
- package/dist/{useCreateLegalEntity-D3ObXaof.js → useCreateLegalEntity-BEEy8g0o.js} +1 -1
- package/dist/{useForm-BSHD2KTa.js → useForm-BQaffiEa.js} +3 -3
- package/dist/{useFormContext-DKaDgcgR.js → useFormContext-BZwb6dry.js} +7 -7
- package/dist/{useGlobalData-kQ8hN10Q.js → useGlobalData-RPqQO2_m.js} +9 -9
- package/dist/{useMultiForm-BG8MF6DI.js → useMultiForm-DrspjU-_.js} +4 -4
- package/dist/{useOnboardingStatus-CZ0x4yyk.js → useOnboardingStatus-Cx2RfslI.js} +1 -1
- package/dist/{useScenarios-Bn3EGOHA.js → useScenarios-ZY51ox86.js} +1 -1
- package/dist/{useTermsOfServiceStatus-BscviiB7.js → useTermsOfServiceStatus-C_6N4XIw.js} +1 -1
- package/dist/{useToastContext-Bxju6PLZ.js → useToastContext-CKEFuMZU.js} +1 -1
- package/dist/{useUnincorporatedPartnershipMembers-CmJaMQa-.js → useUnincorporatedPartnershipMembers-B0loJKYp.js} +4 -4
- package/dist/{useUpdateBusinessLines-97t7rLep.js → useUpdateBusinessLines-bS2l9wAZ.js} +5 -7
- package/dist/{useUpdateLegalEntity-CLWcAVwj.js → useUpdateLegalEntity-5AD9uK8f.js} +2 -2
- package/dist/{utils-CKTSKzWR.js → utils-4YBHq5mh.js} +1 -1
- package/dist/{utils-8cw25Nur.js → utils-BuiPHqFZ.js} +1 -1
- package/dist/{utils-C1FWQvf0.js → utils-BzAU2BN1.js} +3 -3
- package/dist/{utils-DPRgxXmU.js → utils-CqJ09Ne0.js} +6 -6
- package/dist/{utils-BN54hZUe.js → utils-DpBs-qSJ.js} +2 -2
- package/dist/{validate-BnCwLSUb.js → validate-BMFS_55S.js} +2 -2
- package/dist/{validate-BxU9EEi6.js → validate-CmVYROUS.js} +3 -3
- package/dist/{validationError-sIV2dUoW.js → validationError-CSob70hx.js} +2 -2
- package/package.json +10 -10
- package/dist/BusinessFinancingPage-B5Nk3rx2.js +0 -43
- package/dist/ManageIndividualComponent-DQ9mC9zr.js +0 -46
- package/dist/PayoutDetailsPage-DCmlsSbE.js +0 -55
- package/dist/en-US-CJDkXFZ6.js +0 -13
- package/dist/types/components/BankAccount/tasks/PayoutDetailsDropin/formatAccountVerificationSummary.d.ts +0 -7
- package/dist/useTaskLandedEvent-Cee5Mvme.js +0 -25
|
@@ -2,64 +2,63 @@
|
|
|
2
2
|
{
|
|
3
3
|
try {
|
|
4
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] = "
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5eb48620-f6c7-48d5-8ace-540fe735d5b6", e._sentryDebugIdIdentifier = "sentry-dbid-5eb48620-f6c7-48d5-8ace-540fe735d5b6");
|
|
6
6
|
} catch (e) {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
;
|
|
10
10
|
import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
|
|
11
|
-
import { signal } from "@preact/signals";
|
|
12
11
|
import { useQuery, useMutation, useQueryClient, skipToken } from "@tanstack/preact-query";
|
|
13
12
|
import { useState, useEffect, useRef, useCallback, useContext, useMemo as useMemo$1 } from "preact/hooks";
|
|
14
|
-
import { b as useApiContext, j as httpPost, k as httpGet, ae as createLogger, a9 as CountryCodes, u as useTranslation, x as useAnalyticsContext, z as Icon, N as Typography, V as Button, ah as objectsDeepEqual, H as useToggleContext, aB as Header, ax as isEmpty, ab as translateTranslatable, q as hasOwnEntityAssociationOfType, L as LegalEntityTypes, t as useAccountHolder, m as useSettingsContext, C as Alert, a8 as getLegalEntityCountry,
|
|
15
|
-
import { u as useTransferInstrument, m as mapTransferInstrumentToPayoutAccount } from "./mapTransferInstrumentToPayoutAccount-
|
|
16
|
-
import { L as LoaderWrapper } from "./LoaderWrapper-
|
|
13
|
+
import { b as useApiContext, j as httpPost, k as httpGet, ae as createLogger, a9 as CountryCodes, u as useTranslation, x as useAnalyticsContext, z as Icon, N as Typography, V as Button, ah as objectsDeepEqual, H as useToggleContext, aB as Header, ax as isEmpty, ab as translateTranslatable, q as hasOwnEntityAssociationOfType, L as LegalEntityTypes, t as useAccountHolder, m as useSettingsContext, C as Alert, a8 as getLegalEntityCountry, aR as Trans, b4 as EEA_Countries, ap as useDataset, O as StackLayout, aq as datasetIdentifier, b5 as isAccountIdentifierObscured, b6 as hasEmptyFields, b7 as extractFieldName, b8 as concatenateFieldNames, aT as keysOf, ak as getCapabilityProblems, w as TaskTypes, an as cloneObject, am as datasetUtilities } from "./StoreProvider-Bt6bLVE-.js";
|
|
14
|
+
import { u as useTransferInstrument, m as mapTransferInstrumentToPayoutAccount } from "./mapTransferInstrumentToPayoutAccount-DaLPVgIK.js";
|
|
15
|
+
import { L as LoaderWrapper } from "./LoaderWrapper-DvyhRweQ.js";
|
|
17
16
|
import { S as SettingNames } from "./types-Dv0COrvY.js";
|
|
18
|
-
import { u as useGlobalDataSlice, a as useGlobalData, b as useResetGlobalData, c as useStateContext, F as FormWrapper } from "./useGlobalData-
|
|
19
|
-
import { a as useInvalidateRootLegalEntity, u as useToastContext } from "./useToastContext-
|
|
20
|
-
import { F as FeatureNames } from "./types-
|
|
21
|
-
import { a as augmentWithCountryConfigs, g as getPropsFromConfigurations } from "./process-field-configurations-
|
|
22
|
-
import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer } from "./dropinUtils-
|
|
23
|
-
import { u as uppercase, p as payoutAccountFormat, m as mapExistingFile, g as getPageName, b as useScenarioConfiguration, c as useUnifyLoadingStatus } from "./mapExistingFile-
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { c as
|
|
27
|
-
import { i as isValidationError, p as processValidationErrors, b as isIdDocumentUploadError, c as isBankStatementUploadError, a as isMaintenanceModeError, m as mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable } from "./validationError-sIV2dUoW.js";
|
|
17
|
+
import { u as useGlobalDataSlice, a as useGlobalData, b as useResetGlobalData, c as useStateContext, F as FormWrapper } from "./useGlobalData-RPqQO2_m.js";
|
|
18
|
+
import { a as useInvalidateRootLegalEntity, u as useToastContext } from "./useToastContext-CKEFuMZU.js";
|
|
19
|
+
import { F as FeatureNames } from "./types-C7ANBXKc.js";
|
|
20
|
+
import { a as augmentWithCountryConfigs, g as getPropsFromConfigurations } from "./process-field-configurations-DNb-fWox.js";
|
|
21
|
+
import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer } from "./dropinUtils-D3x5I-79.js";
|
|
22
|
+
import { u as uppercase, p as payoutAccountFormat, m as mapExistingFile, g as getPageName, b as useScenarioConfiguration, c as useUnifyLoadingStatus } from "./mapExistingFile-DUgMBW9t.js";
|
|
23
|
+
import { C as Confirm } from "./Confirm-DW7YOE1F.js";
|
|
24
|
+
import { c as currencyByCountry } from "./types-CJnNafzu.js";
|
|
25
|
+
import { i as isValidationError, p as processValidationErrors, b as isIdDocumentUploadError, c as isBankStatementUploadError, a as isMaintenanceModeError, m as mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable } from "./validationError-CSob70hx.js";
|
|
28
26
|
import { t as trackNavigation } from "./trackNavigation-db_h46BT.js";
|
|
29
|
-
import { D as DropzoneFile, e as bytesToSize, f as defaultFileValidationOptions, h as fileValidationRules, S as StateContextSetter, i as fileToBase64, a as getDocument, c as createDocumentRequest, d as documentApiUtils, b as getFileExtention } from "./validate-
|
|
30
|
-
import { b as getPayoutAccountHolderName, g as getLegalEntityNameBasedOnType } from "./getName-
|
|
31
|
-
import { o as omitObscuredFieldsIfUnchanged } from "./omitObscuredFieldsIfUnchanged-
|
|
27
|
+
import { D as DropzoneFile, e as bytesToSize, f as defaultFileValidationOptions, h as fileValidationRules, S as StateContextSetter, i as fileToBase64, a as getDocument, c as createDocumentRequest, d as documentApiUtils, b as getFileExtention } from "./validate-CmVYROUS.js";
|
|
28
|
+
import { b as getPayoutAccountHolderName, g as getLegalEntityNameBasedOnType } from "./getName-B_JUBLVR.js";
|
|
29
|
+
import { o as omitObscuredFieldsIfUnchanged } from "./omitObscuredFieldsIfUnchanged-ChSKB1LF.js";
|
|
30
|
+
import { signal } from "@preact/signals";
|
|
32
31
|
import { Show } from "@preact/signals/utils";
|
|
33
|
-
import { s as summaryStep } from "./Summary-
|
|
32
|
+
import { s as summaryStep } from "./Summary-BUJLYAgF.js";
|
|
34
33
|
import { g as getFieldProps, a as getFormProps } from "./getProps-Cc3J2-z9.js";
|
|
35
|
-
import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
|
|
36
|
-
import { s as summaryItem } from "./summaryItem-CAQCQSkt.js";
|
|
37
34
|
import cx from "classnames";
|
|
38
35
|
import { memo, useRef as useRef$1, useState as useState$1, useMemo, useEffect as useEffect$1, lazy } from "preact/compat";
|
|
39
|
-
import { F as Field } from "./Field-
|
|
40
|
-
import { M as Modal } from "./Modal-
|
|
41
|
-
import { T as TextArea } from "./TextArea-
|
|
42
|
-
import { u as useForm } from "./useForm-
|
|
43
|
-
import { E as EndStateLayout } from "./EndStateLayout-
|
|
44
|
-
import { E as ErrorPanel } from "./ErrorPanel-
|
|
45
|
-
import { c as createFormUtils, m as mergeFieldMetadataIntoProps } from "./formUtils-
|
|
36
|
+
import { F as Field } from "./Field-ClKiPVDa.js";
|
|
37
|
+
import { M as Modal } from "./Modal-C5mnAneL.js";
|
|
38
|
+
import { T as TextArea } from "./TextArea-CKD5zTKW.js";
|
|
39
|
+
import { u as useForm } from "./useForm-BQaffiEa.js";
|
|
40
|
+
import { E as EndStateLayout } from "./EndStateLayout-BBLxK9Q1.js";
|
|
41
|
+
import { E as ErrorPanel } from "./ErrorPanel-D3OmtL80.js";
|
|
42
|
+
import { c as createFormUtils, m as mergeFieldMetadataIntoProps } from "./formUtils-C1nur8r7.js";
|
|
46
43
|
import { b as bankStatementDescriptionPattern } from "./basePatterns-BwdnMQxI.js";
|
|
47
44
|
import { createContext } from "preact";
|
|
48
45
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
49
|
-
import { S as Select } from "./Select-
|
|
50
|
-
import { m as makeMask, n as numericInputs, a as nonInputs, s as spacer, c as customInputs, M as MaskedInput, d as alphanumericInputs, b as alphaInputs } from "./MaskedInput-
|
|
46
|
+
import { S as Select } from "./Select-Czm2JclY.js";
|
|
47
|
+
import { m as makeMask, n as numericInputs, a as nonInputs, s as spacer, c as customInputs, M as MaskedInput, d as alphanumericInputs, b as alphaInputs } from "./MaskedInput-ApBB9ewS.js";
|
|
51
48
|
import { r as resolveFieldMetadata } from "./fieldConfigurations-BUT9DTUH.js";
|
|
52
|
-
import { v as validatePatternOnBlur } from "./patternValidators-
|
|
53
|
-
import { a as isNotEmptyValidator } from "./commonValidators-
|
|
54
|
-
import { I as InputText } from "./InputText-
|
|
49
|
+
import { v as validatePatternOnBlur } from "./patternValidators-0N8_moed.js";
|
|
50
|
+
import { a as isNotEmptyValidator } from "./commonValidators-2G1K0mHC.js";
|
|
51
|
+
import { I as InputText } from "./InputText-C8kj07ZB.js";
|
|
55
52
|
import { C as Currencies } from "./currency-CrdnaaDu.js";
|
|
56
|
-
import { u as useUnincorporatedPartnershipMembers } from "./useUnincorporatedPartnershipMembers-
|
|
57
|
-
import { I as Image } from "./unincorporated-partnership-
|
|
58
|
-
import { C as CountryField } from "./CountryField-
|
|
53
|
+
import { u as useUnincorporatedPartnershipMembers } from "./useUnincorporatedPartnershipMembers-B0loJKYp.js";
|
|
54
|
+
import { I as Image } from "./unincorporated-partnership-DDPy7qIp.js";
|
|
55
|
+
import { C as CountryField } from "./CountryField-CAgo6wFJ.js";
|
|
59
56
|
import { C as Card } from "./Card-OQuFzmxm.js";
|
|
60
|
-
import { L as Link } from "./Link-
|
|
57
|
+
import { L as Link } from "./Link-DS54L_TE.js";
|
|
61
58
|
import { T as Tag } from "./Tag-DdkVScyr.js";
|
|
62
|
-
import { C as ContextGuidance } from "./ContextGuidance-
|
|
59
|
+
import { C as ContextGuidance } from "./ContextGuidance-C7HDkmZU.js";
|
|
60
|
+
import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
|
|
61
|
+
import { s as summaryItem } from "./summaryItem-CAQCQSkt.js";
|
|
63
62
|
const getCheck = async (legalEntityId, baseUrl, data) => {
|
|
64
63
|
return httpPost(
|
|
65
64
|
{
|
|
@@ -190,6 +189,7 @@ const getAccountFormatsForCountry = async (country) => {
|
|
|
190
189
|
};
|
|
191
190
|
return expandedBankFormats;
|
|
192
191
|
};
|
|
192
|
+
const showInstantVerificationPayoutModal = signal(false);
|
|
193
193
|
const validateAccountIdentification = async (baseUrl, data) => {
|
|
194
194
|
return httpPost(
|
|
195
195
|
{
|
|
@@ -568,7 +568,10 @@ function BankDocumentClassification(props) {
|
|
|
568
568
|
fieldValidationErrors,
|
|
569
569
|
formVerificationErrors,
|
|
570
570
|
shouldValidate,
|
|
571
|
-
country
|
|
571
|
+
country,
|
|
572
|
+
handleFieldChange,
|
|
573
|
+
valid: propValid,
|
|
574
|
+
errors: propErrors
|
|
572
575
|
} = props;
|
|
573
576
|
const { t } = useTranslation("banking");
|
|
574
577
|
const { t: commonT } = useTranslation("common");
|
|
@@ -603,7 +606,7 @@ function BankDocumentClassification(props) {
|
|
|
603
606
|
}),
|
|
604
607
|
[bankStatementValidationOptions, validators]
|
|
605
608
|
);
|
|
606
|
-
const
|
|
609
|
+
const localForm = useForm({
|
|
607
610
|
...props,
|
|
608
611
|
schema: bankDocumentClassificationFields,
|
|
609
612
|
defaultData: bankData,
|
|
@@ -611,6 +614,13 @@ function BankDocumentClassification(props) {
|
|
|
611
614
|
fieldProblems: fieldValidationErrors,
|
|
612
615
|
shouldValidate
|
|
613
616
|
});
|
|
617
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
618
|
+
const data = useMultiFormMode ? bankData : localForm.data;
|
|
619
|
+
const valid = useMultiFormMode ? propValid : localForm.valid;
|
|
620
|
+
const errors = useMultiFormMode ? propErrors : localForm.errors;
|
|
621
|
+
const fieldProblems = useMultiFormMode ? fieldValidationErrors : localForm.fieldProblems;
|
|
622
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
623
|
+
const { triggerValidation, setData } = localForm;
|
|
614
624
|
const validateDocumentMutation = useValidateDocument({
|
|
615
625
|
onSuccess: (response) => {
|
|
616
626
|
userEvents.addEvent("Success", {
|
|
@@ -653,8 +663,10 @@ function BankDocumentClassification(props) {
|
|
|
653
663
|
}
|
|
654
664
|
});
|
|
655
665
|
const handleDocumentUpload = async (files) => {
|
|
656
|
-
|
|
657
|
-
|
|
666
|
+
handleChange("bankStatementDocument")(files);
|
|
667
|
+
if (!useMultiFormMode) {
|
|
668
|
+
triggerValidation();
|
|
669
|
+
}
|
|
658
670
|
if (!enableBankDocumentClassification && !isShadowMode) return;
|
|
659
671
|
if (files.length > 0) {
|
|
660
672
|
const file = files[0];
|
|
@@ -680,34 +692,42 @@ function BankDocumentClassification(props) {
|
|
|
680
692
|
}
|
|
681
693
|
};
|
|
682
694
|
useEffect$1(() => {
|
|
683
|
-
if (formIsActive && isBankStatementOptional) {
|
|
695
|
+
if (!useMultiFormMode && formIsActive && isBankStatementOptional) {
|
|
684
696
|
triggerValidation();
|
|
685
697
|
}
|
|
686
|
-
}, [formIsActive, isBankStatementOptional, triggerValidation]);
|
|
698
|
+
}, [formIsActive, isBankStatementOptional, triggerValidation, useMultiFormMode]);
|
|
687
699
|
const alreadyUploadedDocuments = useMemo(
|
|
688
700
|
() => bankData?.bankStatementDocument ?? [],
|
|
689
701
|
[bankData?.bankStatementDocument]
|
|
690
702
|
);
|
|
691
703
|
useEffect$1(() => {
|
|
692
|
-
if (alreadyUploadedDocuments.length > 0) {
|
|
704
|
+
if (!useMultiFormMode && alreadyUploadedDocuments.length > 0) {
|
|
693
705
|
setData("bankStatementDocument", alreadyUploadedDocuments);
|
|
694
706
|
if (bankData?.description) setData("description", bankData.description);
|
|
695
707
|
triggerValidation();
|
|
696
708
|
}
|
|
697
|
-
}, [
|
|
709
|
+
}, [
|
|
710
|
+
alreadyUploadedDocuments,
|
|
711
|
+
bankData?.description,
|
|
712
|
+
setData,
|
|
713
|
+
triggerValidation,
|
|
714
|
+
useMultiFormMode
|
|
715
|
+
]);
|
|
698
716
|
useEffect$1(() => {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
717
|
+
if (!useMultiFormMode) {
|
|
718
|
+
stateRef.current?.setState?.({
|
|
719
|
+
type: "addToState",
|
|
720
|
+
value: {
|
|
721
|
+
data,
|
|
722
|
+
valid,
|
|
723
|
+
errors,
|
|
724
|
+
fieldProblems,
|
|
725
|
+
dataStoreId: id,
|
|
726
|
+
schema: bankDocumentClassificationFields
|
|
727
|
+
}
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
}, [data, valid, errors, fieldProblems, id, useMultiFormMode]);
|
|
711
731
|
const handleUploadNewDocument = () => {
|
|
712
732
|
userEvents.addEvent("Clicked button", {
|
|
713
733
|
actionType: "next",
|
|
@@ -732,7 +752,7 @@ function BankDocumentClassification(props) {
|
|
|
732
752
|
});
|
|
733
753
|
};
|
|
734
754
|
const documentPreview = useMemo(() => {
|
|
735
|
-
if (!data
|
|
755
|
+
if (!data?.bankStatementDocument?.[0] || !showReviewModal) return null;
|
|
736
756
|
const file = data.bankStatementDocument?.[0];
|
|
737
757
|
return file.type === "application/pdf" || file.name.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ jsx(
|
|
738
758
|
"object",
|
|
@@ -748,7 +768,7 @@ function BankDocumentClassification(props) {
|
|
|
748
768
|
}, [data?.bankStatementDocument, showReviewModal, t]);
|
|
749
769
|
return /* @__PURE__ */ jsxs("div", { className: styles$3.bankDocumentPage, children: [
|
|
750
770
|
/* @__PURE__ */ jsxs("form", { className: styles$3.bankDocumentClassification, children: [
|
|
751
|
-
/* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
|
|
771
|
+
!useMultiFormMode && /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
|
|
752
772
|
/* @__PURE__ */ jsx(
|
|
753
773
|
Header,
|
|
754
774
|
{
|
|
@@ -781,7 +801,7 @@ function BankDocumentClassification(props) {
|
|
|
781
801
|
{
|
|
782
802
|
className: cx("adyen-kyc-upload-field"),
|
|
783
803
|
name: "bankStatementDocument",
|
|
784
|
-
isValid: valid
|
|
804
|
+
isValid: valid?.bankStatementDocument ?? true,
|
|
785
805
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
786
806
|
"div",
|
|
787
807
|
{
|
|
@@ -791,10 +811,10 @@ function BankDocumentClassification(props) {
|
|
|
791
811
|
{
|
|
792
812
|
...childProps,
|
|
793
813
|
name: "bankStatementDocument",
|
|
794
|
-
files: data
|
|
814
|
+
files: data?.bankStatementDocument ?? [],
|
|
795
815
|
setFiles: handleDocumentUpload,
|
|
796
|
-
isValid: valid
|
|
797
|
-
errorMessage: errors
|
|
816
|
+
isValid: valid?.bankStatementDocument ?? isBankStatementOptional,
|
|
817
|
+
errorMessage: errors?.bankStatementDocument?.errorMessage,
|
|
798
818
|
loading: validateDocumentMutation.isPending && !isShadowMode,
|
|
799
819
|
...bankStatementValidationOptions
|
|
800
820
|
}
|
|
@@ -803,23 +823,23 @@ function BankDocumentClassification(props) {
|
|
|
803
823
|
)
|
|
804
824
|
}
|
|
805
825
|
),
|
|
806
|
-
data
|
|
826
|
+
data?.bankStatementDocument?.length ? /* @__PURE__ */ jsx(
|
|
807
827
|
Field,
|
|
808
828
|
{
|
|
809
829
|
className: "adyen-kyc-document-description",
|
|
810
830
|
name: "description",
|
|
811
831
|
label: formUtils.getLabel("bankDocumentFileDescription"),
|
|
812
832
|
errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
|
|
813
|
-
isValid: valid
|
|
833
|
+
isValid: valid?.description,
|
|
814
834
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
815
835
|
TextArea,
|
|
816
836
|
{
|
|
817
837
|
...childProps,
|
|
818
838
|
name: "description",
|
|
819
|
-
value: data
|
|
839
|
+
value: data?.description,
|
|
820
840
|
maxLength: CHARACTERS_LIMIT,
|
|
821
|
-
onInput:
|
|
822
|
-
"aria-invalid":
|
|
841
|
+
onInput: handleChange("description"),
|
|
842
|
+
"aria-invalid": valid?.description === false
|
|
823
843
|
}
|
|
824
844
|
)
|
|
825
845
|
}
|
|
@@ -1133,55 +1153,68 @@ function BankVerification(props) {
|
|
|
1133
1153
|
data: propData,
|
|
1134
1154
|
provider,
|
|
1135
1155
|
id,
|
|
1136
|
-
fieldValidationErrors
|
|
1156
|
+
fieldValidationErrors,
|
|
1157
|
+
handleFieldChange,
|
|
1158
|
+
valid: propValid,
|
|
1159
|
+
errors: propErrors
|
|
1137
1160
|
} = props;
|
|
1138
1161
|
const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
|
|
1139
1162
|
const schema = accountVerificationFields;
|
|
1140
1163
|
const stateRef = useRef({ setState: null });
|
|
1141
|
-
const
|
|
1164
|
+
const localForm = useForm({
|
|
1142
1165
|
...props,
|
|
1143
1166
|
schema,
|
|
1144
1167
|
defaultData: propData,
|
|
1145
1168
|
rules: bankVerificationValidationRules,
|
|
1146
1169
|
fieldProblems: fieldValidationErrors
|
|
1147
1170
|
});
|
|
1171
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
1172
|
+
const data = useMultiFormMode ? propData : localForm.data;
|
|
1173
|
+
const valid = useMultiFormMode ? propValid : localForm.valid;
|
|
1174
|
+
const errors = useMultiFormMode ? propErrors : localForm.errors;
|
|
1175
|
+
const fieldProblems = useMultiFormMode ? fieldValidationErrors : localForm.fieldProblems;
|
|
1176
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
1148
1177
|
const retrieveBankAccountInfo = async ({
|
|
1149
1178
|
realLastFour,
|
|
1150
1179
|
number,
|
|
1151
1180
|
bankName
|
|
1152
1181
|
}) => {
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1182
|
+
handleChange("verifiedBankAccountNumber")(realLastFour ? `*******${realLastFour}` : number);
|
|
1183
|
+
handleChange("verifiedBankName")(bankName);
|
|
1184
|
+
handleChange("verifiedBankCountry")(country);
|
|
1185
|
+
handleChange("verifiedAccountHolder")(propData?.verifiedAccountHolder);
|
|
1186
|
+
handleChange("verifiedCurrencyCode")(
|
|
1158
1187
|
propData?.verifiedCurrencyCode ?? currencyByCountry[country]?.[0]
|
|
1159
1188
|
);
|
|
1160
1189
|
setBankInfoValidated?.(true);
|
|
1161
1190
|
hideSidebar?.(false);
|
|
1162
|
-
|
|
1191
|
+
if (!useMultiFormMode) {
|
|
1192
|
+
localForm.triggerValidation();
|
|
1193
|
+
}
|
|
1163
1194
|
await invalidateRootLegalEntity();
|
|
1164
1195
|
showInstantVerificationPayoutModal.value = false;
|
|
1165
1196
|
};
|
|
1166
1197
|
useEffect(() => {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1198
|
+
if (!useMultiFormMode) {
|
|
1199
|
+
stateRef.current.setState?.({
|
|
1200
|
+
type: "addToState",
|
|
1201
|
+
value: {
|
|
1202
|
+
data,
|
|
1203
|
+
valid,
|
|
1204
|
+
errors,
|
|
1205
|
+
fieldProblems,
|
|
1206
|
+
dataStoreId: id,
|
|
1207
|
+
schema
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
}, [data, valid, errors, localForm.isValid, useMultiFormMode]);
|
|
1179
1212
|
if (provider) {
|
|
1180
1213
|
if (bankInfoValidated || !showInstantVerificationPayoutModal.value) {
|
|
1181
1214
|
return null;
|
|
1182
1215
|
}
|
|
1183
1216
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1184
|
-
/* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
|
|
1217
|
+
!useMultiFormMode && /* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
|
|
1185
1218
|
/* @__PURE__ */ jsx(
|
|
1186
1219
|
BankVerificationOverlay,
|
|
1187
1220
|
{
|
|
@@ -1224,7 +1257,6 @@ function BankAccountFormat(props) {
|
|
|
1224
1257
|
const simpleBankAccountNumberMetadata = (example, length, maxLength) => {
|
|
1225
1258
|
if (maxLength) {
|
|
1226
1259
|
return {
|
|
1227
|
-
label: "bankAccountNumber",
|
|
1228
1260
|
validators: validatePatternOnBlur(new RegExp(`^\\d{${length},${maxLength}}$`)),
|
|
1229
1261
|
mask: {
|
|
1230
1262
|
mask: makeMask(...numericInputs(length), ...numericInputs(maxLength - length, true))
|
|
@@ -1239,7 +1271,6 @@ const simpleBankAccountNumberMetadata = (example, length, maxLength) => {
|
|
|
1239
1271
|
};
|
|
1240
1272
|
}
|
|
1241
1273
|
return {
|
|
1242
|
-
label: "bankAccountNumber",
|
|
1243
1274
|
validators: validatePatternOnBlur(new RegExp(`^\\d{${length}}$`)),
|
|
1244
1275
|
mask: { mask: makeMask(...numericInputs(length)) },
|
|
1245
1276
|
guidanceText: {
|
|
@@ -1252,13 +1283,11 @@ const simpleBankAccountNumberMetadata = (example, length, maxLength) => {
|
|
|
1252
1283
|
};
|
|
1253
1284
|
};
|
|
1254
1285
|
const defaultFieldMetadata$3 = {
|
|
1255
|
-
label: "bankAccountNumber",
|
|
1256
1286
|
validators: isNotEmptyValidator
|
|
1257
1287
|
};
|
|
1258
1288
|
const defaultFieldConfig$3 = {
|
|
1259
1289
|
[CountryCodes.CzechRepublic]: {
|
|
1260
1290
|
// Validators & masks pulled from https://docs.adyen.com/api-explorer/legalentity/4/post/transferInstruments#request-bankAccount-accountIdentification-CZLocalAccountIdentification
|
|
1261
|
-
label: "bankAccountNumber",
|
|
1262
1291
|
validators: validatePatternOnBlur(/^((\d{2}|\d{6})-)?\d*\d{2}$/),
|
|
1263
1292
|
mask: {
|
|
1264
1293
|
mask: makeMask(
|
|
@@ -1286,7 +1315,6 @@ const defaultFieldConfig$3 = {
|
|
|
1286
1315
|
[CountryCodes.Brazil]: simpleBankAccountNumberMetadata("0009795493", 4, 12),
|
|
1287
1316
|
[CountryCodes.Canada]: simpleBankAccountNumberMetadata("10220001111", 5, 12),
|
|
1288
1317
|
[CountryCodes.HongKong]: {
|
|
1289
|
-
label: "bankAccountNumber",
|
|
1290
1318
|
validators: validatePatternOnBlur(new RegExp(`^\\d{${6},${18}}$`)),
|
|
1291
1319
|
mask: {
|
|
1292
1320
|
mask: makeMask(...numericInputs(6), ...numericInputs(12, true))
|
|
@@ -1305,7 +1333,6 @@ const defaultFieldConfig$3 = {
|
|
|
1305
1333
|
[CountryCodes.Sweden]: simpleBankAccountNumberMetadata("123456789", 7, 10),
|
|
1306
1334
|
[CountryCodes.UnitedStates]: simpleBankAccountNumberMetadata("10220001111", 3, 17),
|
|
1307
1335
|
[CountryCodes.Poland]: {
|
|
1308
|
-
label: "bankAccountNumber",
|
|
1309
1336
|
validators: validatePatternOnBlur(/^\d{26}$/),
|
|
1310
1337
|
mask: {
|
|
1311
1338
|
mask: makeMask(
|
|
@@ -1333,7 +1360,6 @@ const defaultFieldConfig$3 = {
|
|
|
1333
1360
|
}
|
|
1334
1361
|
},
|
|
1335
1362
|
[CountryCodes.NewZealand]: {
|
|
1336
|
-
label: "bankAccountNumber",
|
|
1337
1363
|
validators: validatePatternOnBlur(/^\d{15,16}$/),
|
|
1338
1364
|
mask: {
|
|
1339
1365
|
mask: makeMask(
|
|
@@ -1360,10 +1386,20 @@ const defaultFieldConfig$3 = {
|
|
|
1360
1386
|
const bankAccountNumberFields = ["bankAccountNumber"];
|
|
1361
1387
|
function BankAccountNumber(props) {
|
|
1362
1388
|
const { t } = useTranslation("common");
|
|
1363
|
-
const {
|
|
1389
|
+
const {
|
|
1390
|
+
country,
|
|
1391
|
+
fieldConfig = defaultFieldConfig$3,
|
|
1392
|
+
onFocus,
|
|
1393
|
+
onBlur,
|
|
1394
|
+
handleFieldChange,
|
|
1395
|
+
data: propsData,
|
|
1396
|
+
valid: propsValid,
|
|
1397
|
+
errors: propsErrors,
|
|
1398
|
+
fieldValidationErrors: propsFieldValidationErrors
|
|
1399
|
+
} = props;
|
|
1364
1400
|
const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$3);
|
|
1365
1401
|
const mergedProps = mergeFieldMetadataIntoProps("bankAccountNumber", metadata, props);
|
|
1366
|
-
const
|
|
1402
|
+
const localForm = useForm({
|
|
1367
1403
|
...mergedProps,
|
|
1368
1404
|
schema: bankAccountNumberFields,
|
|
1369
1405
|
rules: mergedProps.validators,
|
|
@@ -1371,34 +1407,42 @@ function BankAccountNumber(props) {
|
|
|
1371
1407
|
fieldProblems: mergedProps?.fieldValidationErrors,
|
|
1372
1408
|
obscuredFields: mergedProps.obscuredFields
|
|
1373
1409
|
});
|
|
1410
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
1411
|
+
const data = useMultiFormMode ? propsData : localForm.data;
|
|
1412
|
+
const valid = useMultiFormMode ? propsValid : localForm.valid;
|
|
1413
|
+
const errors = useMultiFormMode ? propsErrors : localForm.errors;
|
|
1414
|
+
const fieldProblems = useMultiFormMode ? propsFieldValidationErrors : localForm.fieldProblems;
|
|
1415
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
1374
1416
|
const handleBlur = () => {
|
|
1375
1417
|
onBlur?.();
|
|
1376
|
-
|
|
1418
|
+
handleChange("bankAccountNumber", "blur");
|
|
1377
1419
|
};
|
|
1378
1420
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
1379
1421
|
"payoutAccountDetails"
|
|
1380
1422
|
);
|
|
1381
1423
|
useEffect(() => {
|
|
1382
|
-
|
|
1383
|
-
|
|
1424
|
+
if (!useMultiFormMode) {
|
|
1425
|
+
updateStateSlice({ data, valid, errors, fieldProblems });
|
|
1426
|
+
}
|
|
1427
|
+
}, [data, valid, errors, fieldProblems, useMultiFormMode]);
|
|
1384
1428
|
const formUtils = createFormUtils(mergedProps, t);
|
|
1385
1429
|
return /* @__PURE__ */ jsx(
|
|
1386
1430
|
MaskedInput,
|
|
1387
1431
|
{
|
|
1388
1432
|
name: "bankAccountNumber",
|
|
1389
1433
|
type: "text",
|
|
1390
|
-
label:
|
|
1434
|
+
label: t(($) => $["bankAccountNumber"]),
|
|
1391
1435
|
formatGuidance: translateTranslatable(t, metadata.guidanceText),
|
|
1392
1436
|
...formUtils.getMask("bankAccountNumber"),
|
|
1393
|
-
isValid: valid
|
|
1437
|
+
isValid: valid?.bankAccountNumber ?? true,
|
|
1394
1438
|
errorMessage: formUtils.getErrorMessage("bankAccountNumber", errors, fieldProblems),
|
|
1395
1439
|
"aria-required": true,
|
|
1396
|
-
"aria-invalid": !valid
|
|
1440
|
+
"aria-invalid": !valid?.bankAccountNumber,
|
|
1397
1441
|
onBlur: handleBlur,
|
|
1398
|
-
onInput:
|
|
1442
|
+
onInput: handleChange("bankAccountNumber", "input"),
|
|
1399
1443
|
onFocus,
|
|
1400
1444
|
readonly: formUtils.isReadOnly("bankAccountNumber"),
|
|
1401
|
-
value: data
|
|
1445
|
+
value: data?.bankAccountNumber ?? "",
|
|
1402
1446
|
acceptObscuredValue: formUtils.isObscured("bankAccountNumber")
|
|
1403
1447
|
}
|
|
1404
1448
|
);
|
|
@@ -1406,39 +1450,54 @@ function BankAccountNumber(props) {
|
|
|
1406
1450
|
const bankCityFields = ["bankCity"];
|
|
1407
1451
|
function BankCity(props) {
|
|
1408
1452
|
const { t } = useTranslation("common");
|
|
1409
|
-
const {
|
|
1410
|
-
|
|
1453
|
+
const {
|
|
1454
|
+
validators,
|
|
1455
|
+
data: bankCityData,
|
|
1456
|
+
valid: propsValid,
|
|
1457
|
+
errors: propsErrors,
|
|
1458
|
+
fieldValidationErrors,
|
|
1459
|
+
handleFieldChange
|
|
1460
|
+
} = props;
|
|
1461
|
+
const localForm = useForm({
|
|
1411
1462
|
...props,
|
|
1412
1463
|
schema: bankCityFields,
|
|
1413
1464
|
rules: validators,
|
|
1414
1465
|
defaultData: bankCityData,
|
|
1415
1466
|
fieldProblems: fieldValidationErrors
|
|
1416
1467
|
});
|
|
1468
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
1469
|
+
const data = useMultiFormMode ? bankCityData : localForm.data;
|
|
1470
|
+
const valid = useMultiFormMode ? propsValid : localForm.valid;
|
|
1471
|
+
const errors = useMultiFormMode ? propsErrors : localForm.errors;
|
|
1472
|
+
const fieldProblems = useMultiFormMode ? fieldValidationErrors : localForm.fieldProblems;
|
|
1473
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
1417
1474
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
1418
1475
|
"payoutAccountDetails"
|
|
1419
1476
|
);
|
|
1420
1477
|
useEffect(() => {
|
|
1421
|
-
|
|
1422
|
-
|
|
1478
|
+
if (!useMultiFormMode) {
|
|
1479
|
+
updateStateSlice({ data, valid, errors, fieldProblems });
|
|
1480
|
+
}
|
|
1481
|
+
}, [data, valid, errors, fieldProblems, useMultiFormMode]);
|
|
1423
1482
|
const formUtils = createFormUtils(props, t);
|
|
1424
1483
|
return /* @__PURE__ */ jsx(
|
|
1425
1484
|
Field,
|
|
1426
1485
|
{
|
|
1427
1486
|
name: "bankCity",
|
|
1428
|
-
label:
|
|
1487
|
+
label: t(($) => $["bankCityTown"]),
|
|
1429
1488
|
errorMessage: formUtils.getErrorMessage("bankCity", errors, fieldProblems),
|
|
1430
|
-
isValid: valid
|
|
1489
|
+
isValid: valid?.bankCity ?? true,
|
|
1431
1490
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1432
1491
|
InputText,
|
|
1433
1492
|
{
|
|
1434
1493
|
...childProps,
|
|
1435
1494
|
name: "bankCity",
|
|
1436
|
-
value: data
|
|
1495
|
+
value: data?.bankCity,
|
|
1437
1496
|
readonly: formUtils.isReadOnly("bankCity"),
|
|
1438
|
-
onInput:
|
|
1439
|
-
onBlur:
|
|
1497
|
+
onInput: handleChange("bankCity", "input"),
|
|
1498
|
+
onBlur: handleChange("bankCity", "blur"),
|
|
1440
1499
|
"aria-required": true,
|
|
1441
|
-
"aria-invalid": !valid
|
|
1500
|
+
"aria-invalid": !valid?.bankCity
|
|
1442
1501
|
}
|
|
1443
1502
|
)
|
|
1444
1503
|
}
|
|
@@ -1467,7 +1526,7 @@ const defaultFieldConfig$2 = {
|
|
|
1467
1526
|
[CountryCodes.Canada]: simpleBankCodeMetadata(3, "100", "institutionNumber"),
|
|
1468
1527
|
[CountryCodes.CzechRepublic]: simpleBankCodeMetadata(4, "0800"),
|
|
1469
1528
|
[CountryCodes.Denmark]: simpleBankCodeMetadata(4, "5051"),
|
|
1470
|
-
[CountryCodes.HongKong]: simpleBankCodeMetadata(3, "250"
|
|
1529
|
+
[CountryCodes.HongKong]: simpleBankCodeMetadata(3, "250"),
|
|
1471
1530
|
[CountryCodes.Norway]: simpleBankCodeMetadata(4, "8601"),
|
|
1472
1531
|
// Not yet implemented
|
|
1473
1532
|
[CountryCodes.Ecuador]: simpleBankCodeMetadata(4, "1234"),
|
|
@@ -1477,22 +1536,38 @@ const defaultFieldConfig$2 = {
|
|
|
1477
1536
|
const bankCodeFields = ["bankCode"];
|
|
1478
1537
|
function BankCode(props) {
|
|
1479
1538
|
const { t } = useTranslation("common");
|
|
1480
|
-
const {
|
|
1539
|
+
const {
|
|
1540
|
+
country,
|
|
1541
|
+
fieldConfig = defaultFieldConfig$2,
|
|
1542
|
+
handleFieldChange,
|
|
1543
|
+
data: propsData,
|
|
1544
|
+
valid: propsValid,
|
|
1545
|
+
errors: propsErrors,
|
|
1546
|
+
fieldValidationErrors: propsFieldValidationErrors
|
|
1547
|
+
} = props;
|
|
1481
1548
|
const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$2);
|
|
1482
1549
|
const mergedProps = mergeFieldMetadataIntoProps("bankCode", metadata, props);
|
|
1483
|
-
const
|
|
1550
|
+
const localForm = useForm({
|
|
1484
1551
|
...mergedProps,
|
|
1485
1552
|
schema: bankCodeFields,
|
|
1486
1553
|
rules: mergedProps.validators,
|
|
1487
1554
|
defaultData: mergedProps.data,
|
|
1488
1555
|
fieldProblems: mergedProps.fieldValidationErrors
|
|
1489
1556
|
});
|
|
1557
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
1558
|
+
const data = useMultiFormMode ? propsData : localForm.data;
|
|
1559
|
+
const valid = useMultiFormMode ? propsValid : localForm.valid;
|
|
1560
|
+
const errors = useMultiFormMode ? propsErrors : localForm.errors;
|
|
1561
|
+
const fieldProblems = useMultiFormMode ? propsFieldValidationErrors : localForm.fieldProblems;
|
|
1562
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
1490
1563
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
1491
1564
|
"payoutAccountDetails"
|
|
1492
1565
|
);
|
|
1493
1566
|
useEffect(() => {
|
|
1494
|
-
|
|
1495
|
-
|
|
1567
|
+
if (!useMultiFormMode) {
|
|
1568
|
+
updateStateSlice({ data, valid, errors, fieldProblems });
|
|
1569
|
+
}
|
|
1570
|
+
}, [data, valid, errors, fieldProblems, useMultiFormMode]);
|
|
1496
1571
|
const formUtils = createFormUtils(mergedProps, t);
|
|
1497
1572
|
return /* @__PURE__ */ jsx(
|
|
1498
1573
|
MaskedInput,
|
|
@@ -1503,52 +1578,67 @@ function BankCode(props) {
|
|
|
1503
1578
|
errorMessage: formUtils.getErrorMessage("bankCode", errors, fieldProblems),
|
|
1504
1579
|
formatGuidance: translateTranslatable(t, metadata.guidanceText),
|
|
1505
1580
|
...formUtils.getMask("bankCode"),
|
|
1506
|
-
isValid: valid
|
|
1507
|
-
value: data
|
|
1581
|
+
isValid: valid?.bankCode ?? true,
|
|
1582
|
+
value: data?.bankCode ?? "",
|
|
1508
1583
|
readonly: formUtils.isReadOnly("bankCode"),
|
|
1509
|
-
onInput:
|
|
1510
|
-
onBlur:
|
|
1584
|
+
onInput: handleChange("bankCode", "input"),
|
|
1585
|
+
onBlur: handleChange("bankCode", "blur"),
|
|
1511
1586
|
"aria-required": true,
|
|
1512
|
-
"aria-invalid": !valid
|
|
1587
|
+
"aria-invalid": !valid?.bankCode
|
|
1513
1588
|
}
|
|
1514
1589
|
);
|
|
1515
1590
|
}
|
|
1516
1591
|
const bankNameFields = ["bankName"];
|
|
1517
1592
|
function BankName(props) {
|
|
1518
1593
|
const { t } = useTranslation("common");
|
|
1519
|
-
const {
|
|
1520
|
-
|
|
1594
|
+
const {
|
|
1595
|
+
validators,
|
|
1596
|
+
data: bankNameData,
|
|
1597
|
+
valid: propsValid,
|
|
1598
|
+
errors: propsErrors,
|
|
1599
|
+
fieldValidationErrors,
|
|
1600
|
+
handleFieldChange
|
|
1601
|
+
} = props;
|
|
1602
|
+
const localForm = useForm({
|
|
1521
1603
|
...props,
|
|
1522
1604
|
schema: bankNameFields,
|
|
1523
1605
|
rules: validators,
|
|
1524
1606
|
defaultData: bankNameData,
|
|
1525
1607
|
fieldProblems: fieldValidationErrors
|
|
1526
1608
|
});
|
|
1609
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
1610
|
+
const data = useMultiFormMode ? bankNameData : localForm.data;
|
|
1611
|
+
const valid = useMultiFormMode ? propsValid : localForm.valid;
|
|
1612
|
+
const errors = useMultiFormMode ? propsErrors : localForm.errors;
|
|
1613
|
+
const fieldProblems = useMultiFormMode ? fieldValidationErrors : localForm.fieldProblems;
|
|
1614
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
1527
1615
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
1528
1616
|
"payoutAccountDetails"
|
|
1529
1617
|
);
|
|
1530
1618
|
useEffect(() => {
|
|
1531
|
-
|
|
1532
|
-
|
|
1619
|
+
if (!useMultiFormMode) {
|
|
1620
|
+
updateStateSlice({ data, valid, errors, fieldProblems });
|
|
1621
|
+
}
|
|
1622
|
+
}, [data, valid, errors, fieldProblems, useMultiFormMode]);
|
|
1533
1623
|
const formUtils = createFormUtils(props, t);
|
|
1534
1624
|
return /* @__PURE__ */ jsx(
|
|
1535
1625
|
Field,
|
|
1536
1626
|
{
|
|
1537
1627
|
name: "bankName",
|
|
1538
|
-
label:
|
|
1628
|
+
label: t(($) => $["bankName"]),
|
|
1539
1629
|
errorMessage: formUtils.getErrorMessage("bankName", errors, fieldProblems),
|
|
1540
|
-
isValid: valid
|
|
1630
|
+
isValid: valid?.bankName ?? true,
|
|
1541
1631
|
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1542
1632
|
InputText,
|
|
1543
1633
|
{
|
|
1544
1634
|
...childProps,
|
|
1545
1635
|
name: "bankName",
|
|
1546
|
-
value: data
|
|
1636
|
+
value: data?.bankName,
|
|
1547
1637
|
readonly: formUtils.isReadOnly("bankName"),
|
|
1548
|
-
onInput:
|
|
1549
|
-
onBlur:
|
|
1638
|
+
onInput: handleChange("bankName", "input"),
|
|
1639
|
+
onBlur: handleChange("bankName", "blur"),
|
|
1550
1640
|
"aria-required": true,
|
|
1551
|
-
"aria-invalid": !valid
|
|
1641
|
+
"aria-invalid": !valid?.bankName
|
|
1552
1642
|
}
|
|
1553
1643
|
)
|
|
1554
1644
|
}
|
|
@@ -1647,26 +1737,44 @@ const defaultFieldConfig$1 = {
|
|
|
1647
1737
|
const branchCodeFields = ["branchCode"];
|
|
1648
1738
|
function BranchCode(props) {
|
|
1649
1739
|
const { t } = useTranslation("common");
|
|
1650
|
-
const {
|
|
1740
|
+
const {
|
|
1741
|
+
country,
|
|
1742
|
+
fieldConfig = defaultFieldConfig$1,
|
|
1743
|
+
onFocus,
|
|
1744
|
+
onBlur,
|
|
1745
|
+
handleFieldChange,
|
|
1746
|
+
data: propsData,
|
|
1747
|
+
valid: propsValid,
|
|
1748
|
+
errors: propsErrors,
|
|
1749
|
+
fieldValidationErrors: propsFieldValidationErrors
|
|
1750
|
+
} = props;
|
|
1651
1751
|
const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata$1);
|
|
1652
1752
|
const mergedProps = mergeFieldMetadataIntoProps("branchCode", metadata, props);
|
|
1653
|
-
const
|
|
1753
|
+
const localForm = useForm({
|
|
1654
1754
|
...mergedProps,
|
|
1655
1755
|
schema: branchCodeFields,
|
|
1656
1756
|
rules: mergedProps.validators,
|
|
1657
1757
|
defaultData: mergedProps.data,
|
|
1658
1758
|
fieldProblems: mergedProps?.fieldValidationErrors
|
|
1659
1759
|
});
|
|
1760
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
1761
|
+
const data = useMultiFormMode ? propsData : localForm.data;
|
|
1762
|
+
const valid = useMultiFormMode ? propsValid : localForm.valid;
|
|
1763
|
+
const errors = useMultiFormMode ? propsErrors : localForm.errors;
|
|
1764
|
+
const fieldProblems = useMultiFormMode ? propsFieldValidationErrors : localForm.fieldProblems;
|
|
1765
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
1660
1766
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
1661
1767
|
"payoutAccountDetails"
|
|
1662
1768
|
);
|
|
1663
1769
|
const handleBlur = () => {
|
|
1664
1770
|
onBlur?.();
|
|
1665
|
-
|
|
1771
|
+
handleChange("branchCode", "blur");
|
|
1666
1772
|
};
|
|
1667
1773
|
useEffect(() => {
|
|
1668
|
-
|
|
1669
|
-
|
|
1774
|
+
if (!useMultiFormMode) {
|
|
1775
|
+
updateStateSlice({ data, valid, errors, fieldProblems });
|
|
1776
|
+
}
|
|
1777
|
+
}, [data, valid, errors, fieldProblems, useMultiFormMode]);
|
|
1670
1778
|
const formUtils = createFormUtils(mergedProps, t);
|
|
1671
1779
|
return /* @__PURE__ */ jsx(
|
|
1672
1780
|
MaskedInput,
|
|
@@ -1677,14 +1785,14 @@ function BranchCode(props) {
|
|
|
1677
1785
|
formatGuidance: translateTranslatable(t, metadata.guidanceText),
|
|
1678
1786
|
...formUtils.getMask("branchCode"),
|
|
1679
1787
|
errorMessage: formUtils.getErrorMessage("branchCode", errors, fieldProblems),
|
|
1680
|
-
isValid: valid
|
|
1681
|
-
value: data
|
|
1788
|
+
isValid: valid?.branchCode ?? true,
|
|
1789
|
+
value: data?.branchCode ?? "",
|
|
1682
1790
|
readonly: formUtils.isReadOnly("branchCode"),
|
|
1683
|
-
onInput:
|
|
1791
|
+
onInput: handleChange("branchCode", "input"),
|
|
1684
1792
|
onBlur: handleBlur,
|
|
1685
1793
|
onFocus,
|
|
1686
1794
|
"aria-required": true,
|
|
1687
|
-
"aria-invalid": !valid
|
|
1795
|
+
"aria-invalid": !valid?.branchCode
|
|
1688
1796
|
}
|
|
1689
1797
|
);
|
|
1690
1798
|
}
|
|
@@ -1842,7 +1950,6 @@ const ibanGuidance = (type, numDigitsOrChars, example) => type === "digits" ? {
|
|
|
1842
1950
|
}
|
|
1843
1951
|
};
|
|
1844
1952
|
const ibanMetadata = (country, inputLength, example, allowLettersInBban) => ({
|
|
1845
|
-
label: "iban",
|
|
1846
1953
|
validators: validateIbanOnBlurAndInput(country),
|
|
1847
1954
|
mask: ibanMask(country, inputLength, allowLettersInBban),
|
|
1848
1955
|
guidanceText: ibanGuidance(allowLettersInBban ? "characters" : "digits", inputLength, example)
|
|
@@ -1854,7 +1961,6 @@ const gbIbanMetadata = ibanMetadata(
|
|
|
1854
1961
|
true
|
|
1855
1962
|
);
|
|
1856
1963
|
const defaultFieldMetadata = {
|
|
1857
|
-
label: "iban",
|
|
1858
1964
|
validators: isNotEmptyValidator
|
|
1859
1965
|
};
|
|
1860
1966
|
const defaultFieldConfig = {
|
|
@@ -1979,12 +2085,15 @@ function Iban(props) {
|
|
|
1979
2085
|
country,
|
|
1980
2086
|
fieldConfig = defaultFieldConfig,
|
|
1981
2087
|
data: ibanData,
|
|
2088
|
+
valid: propsValid,
|
|
2089
|
+
errors: propsErrors,
|
|
1982
2090
|
obscuredFields,
|
|
1983
|
-
fieldValidationErrors
|
|
2091
|
+
fieldValidationErrors,
|
|
2092
|
+
handleFieldChange
|
|
1984
2093
|
} = props;
|
|
1985
2094
|
const metadata = resolveFieldMetadata(fieldConfig[country], {}, defaultFieldMetadata);
|
|
1986
2095
|
const mergedProps = mergeFieldMetadataIntoProps("iban", metadata, props);
|
|
1987
|
-
const
|
|
2096
|
+
const localForm = useForm({
|
|
1988
2097
|
...mergedProps,
|
|
1989
2098
|
schema: ibanFields,
|
|
1990
2099
|
rules: mergedProps.validators,
|
|
@@ -1992,35 +2101,42 @@ function Iban(props) {
|
|
|
1992
2101
|
fieldProblems: fieldValidationErrors,
|
|
1993
2102
|
obscuredFields
|
|
1994
2103
|
});
|
|
2104
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
2105
|
+
const data = useMultiFormMode ? ibanData : localForm.data;
|
|
2106
|
+
const valid = useMultiFormMode ? propsValid : localForm.valid;
|
|
2107
|
+
const errors = useMultiFormMode ? propsErrors : localForm.errors;
|
|
2108
|
+
const fieldProblems = useMultiFormMode ? fieldValidationErrors : localForm.fieldProblems;
|
|
2109
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
1995
2110
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
1996
2111
|
"payoutAccountDetails"
|
|
1997
2112
|
);
|
|
1998
2113
|
useEffect(() => {
|
|
1999
|
-
|
|
2000
|
-
|
|
2114
|
+
if (!useMultiFormMode) {
|
|
2115
|
+
updateStateSlice({ data, valid, errors, fieldProblems });
|
|
2116
|
+
}
|
|
2117
|
+
}, [data, errors, valid, fieldProblems, useMultiFormMode]);
|
|
2001
2118
|
const formUtils = createFormUtils(mergedProps, t);
|
|
2002
2119
|
return /* @__PURE__ */ jsx(
|
|
2003
2120
|
MaskedInput,
|
|
2004
2121
|
{
|
|
2005
2122
|
name: "iban",
|
|
2006
2123
|
type: "text",
|
|
2007
|
-
label:
|
|
2124
|
+
label: t(($) => $["iban"]),
|
|
2008
2125
|
formatGuidance: translateTranslatable(t, metadata.guidanceText),
|
|
2009
2126
|
...formUtils.getMask("iban"),
|
|
2010
2127
|
errorMessage: formUtils.getErrorMessage("iban", errors, fieldProblems),
|
|
2011
|
-
isValid: valid
|
|
2012
|
-
value: data
|
|
2128
|
+
isValid: valid?.iban ?? true,
|
|
2129
|
+
value: data?.iban ?? "",
|
|
2013
2130
|
readonly: formUtils.isReadOnly("iban"),
|
|
2014
|
-
onInput:
|
|
2015
|
-
onBlur:
|
|
2131
|
+
onInput: handleChange("iban", "input"),
|
|
2132
|
+
onBlur: handleChange("iban", "blur"),
|
|
2016
2133
|
"aria-required": true,
|
|
2017
|
-
"aria-invalid":
|
|
2134
|
+
"aria-invalid": valid?.iban === false,
|
|
2018
2135
|
acceptObscuredValue: formUtils.isObscured("iban")
|
|
2019
2136
|
}
|
|
2020
2137
|
);
|
|
2021
2138
|
}
|
|
2022
2139
|
const swiftCodeFieldMetadata = {
|
|
2023
|
-
label: "bicSwift",
|
|
2024
2140
|
validators: validatePatternOnBlur(/^([a-zA-Z0-9]{8}|[a-zA-Z0-9]{11})$/),
|
|
2025
2141
|
mask: {
|
|
2026
2142
|
mask: makeMask(...alphaInputs(6), ...alphanumericInputs(2), ...alphanumericInputs(3, true)),
|
|
@@ -2030,27 +2146,42 @@ const swiftCodeFieldMetadata = {
|
|
|
2030
2146
|
const swiftCodeFields = ["swiftCode"];
|
|
2031
2147
|
function SwiftCode(props) {
|
|
2032
2148
|
const { t } = useTranslation("common");
|
|
2149
|
+
const {
|
|
2150
|
+
handleFieldChange,
|
|
2151
|
+
data: propsData,
|
|
2152
|
+
valid: propsValid,
|
|
2153
|
+
errors: propsErrors,
|
|
2154
|
+
fieldValidationErrors: propsFieldValidationErrors
|
|
2155
|
+
} = props;
|
|
2033
2156
|
const mergedProps = mergeFieldMetadataIntoProps("swiftCode", swiftCodeFieldMetadata, props);
|
|
2034
|
-
const
|
|
2157
|
+
const localForm = useForm({
|
|
2035
2158
|
...mergedProps,
|
|
2036
2159
|
schema: swiftCodeFields,
|
|
2037
2160
|
rules: mergedProps.validators,
|
|
2038
2161
|
defaultData: mergedProps.data,
|
|
2039
2162
|
fieldProblems: mergedProps?.fieldValidationErrors
|
|
2040
2163
|
});
|
|
2164
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
2165
|
+
const data = useMultiFormMode ? propsData : localForm.data;
|
|
2166
|
+
const valid = useMultiFormMode ? propsValid : localForm.valid;
|
|
2167
|
+
const errors = useMultiFormMode ? propsErrors : localForm.errors;
|
|
2168
|
+
const fieldProblems = useMultiFormMode ? propsFieldValidationErrors : localForm.fieldProblems;
|
|
2169
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
2041
2170
|
const { updateStateSlice } = useGlobalDataSlice(
|
|
2042
2171
|
"payoutAccountDetails"
|
|
2043
2172
|
);
|
|
2044
2173
|
useEffect(() => {
|
|
2045
|
-
|
|
2046
|
-
|
|
2174
|
+
if (!useMultiFormMode) {
|
|
2175
|
+
updateStateSlice({ data, valid, errors, fieldProblems });
|
|
2176
|
+
}
|
|
2177
|
+
}, [data, valid, errors, fieldProblems, useMultiFormMode]);
|
|
2047
2178
|
const formUtils = createFormUtils(mergedProps, t);
|
|
2048
2179
|
return /* @__PURE__ */ jsx(
|
|
2049
2180
|
MaskedInput,
|
|
2050
2181
|
{
|
|
2051
2182
|
name: "swiftCode",
|
|
2052
2183
|
type: "text",
|
|
2053
|
-
label:
|
|
2184
|
+
label: t(($) => $["bicSwift"]),
|
|
2054
2185
|
formatGuidance: t(($) => $["enterXOrYCharactersForExample"], {
|
|
2055
2186
|
xChars: "8",
|
|
2056
2187
|
yChars: "11",
|
|
@@ -2058,13 +2189,13 @@ function SwiftCode(props) {
|
|
|
2058
2189
|
}),
|
|
2059
2190
|
...formUtils.getMask("swiftCode"),
|
|
2060
2191
|
errorMessage: formUtils.getErrorMessage("swiftCode", errors, fieldProblems),
|
|
2061
|
-
isValid: valid
|
|
2062
|
-
value: data
|
|
2192
|
+
isValid: valid?.swiftCode ?? true,
|
|
2193
|
+
value: data?.swiftCode ?? "",
|
|
2063
2194
|
readonly: formUtils.isReadOnly("swiftCode"),
|
|
2064
|
-
onInput:
|
|
2065
|
-
onBlur:
|
|
2195
|
+
onInput: handleChange("swiftCode", "input"),
|
|
2196
|
+
onBlur: handleChange("swiftCode", "blur"),
|
|
2066
2197
|
"aria-required": true,
|
|
2067
|
-
"aria-invalid":
|
|
2198
|
+
"aria-invalid": valid?.swiftCode === false
|
|
2068
2199
|
}
|
|
2069
2200
|
);
|
|
2070
2201
|
}
|
|
@@ -2296,7 +2427,10 @@ function PayoutAccount(props) {
|
|
|
2296
2427
|
formVerificationErrors,
|
|
2297
2428
|
fieldValidationErrors,
|
|
2298
2429
|
preferredCurrencyCode,
|
|
2299
|
-
data
|
|
2430
|
+
data,
|
|
2431
|
+
errors,
|
|
2432
|
+
valid,
|
|
2433
|
+
handleFieldChange
|
|
2300
2434
|
} = props;
|
|
2301
2435
|
const showCheckGuidance = shouldShowCheckGuidance(country);
|
|
2302
2436
|
const formUtils = createFormUtils({ ...props, requiredFields }, commonT);
|
|
@@ -2331,6 +2465,13 @@ function PayoutAccount(props) {
|
|
|
2331
2465
|
handleAccountFormatChange?.("numberAndBic");
|
|
2332
2466
|
}
|
|
2333
2467
|
}, [country, preferredCurrencyCode]);
|
|
2468
|
+
const multiFormProps = handleFieldChange ? {
|
|
2469
|
+
data,
|
|
2470
|
+
valid,
|
|
2471
|
+
errors,
|
|
2472
|
+
fieldValidationErrors,
|
|
2473
|
+
handleFieldChange
|
|
2474
|
+
} : {};
|
|
2334
2475
|
return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__payout-account", "aria-describedby": "ariaErrorField", children: [
|
|
2335
2476
|
heading && /* @__PURE__ */ jsx(Header, { title: heading, children: /* @__PURE__ */ jsx(
|
|
2336
2477
|
AccountHolderDescriptionFragment,
|
|
@@ -2363,7 +2504,8 @@ function PayoutAccount(props) {
|
|
|
2363
2504
|
country,
|
|
2364
2505
|
dataStoreId: id,
|
|
2365
2506
|
onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
|
|
2366
|
-
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
|
|
2507
|
+
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0,
|
|
2508
|
+
...multiFormProps
|
|
2367
2509
|
}
|
|
2368
2510
|
),
|
|
2369
2511
|
formUtils.isRequiredField("bankAccountNumber") && /* @__PURE__ */ jsx(
|
|
@@ -2373,14 +2515,15 @@ function PayoutAccount(props) {
|
|
|
2373
2515
|
country,
|
|
2374
2516
|
dataStoreId: id,
|
|
2375
2517
|
onFocus: showCheckGuidance ? () => setCheckAnnotation("account") : void 0,
|
|
2376
|
-
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
|
|
2518
|
+
onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0,
|
|
2519
|
+
...multiFormProps
|
|
2377
2520
|
}
|
|
2378
2521
|
),
|
|
2379
|
-
formUtils.isRequiredField("iban") && /* @__PURE__ */ jsx(Iban, { ...ibanProps, dataStoreId: id, country }),
|
|
2380
|
-
formUtils.isRequiredField("swiftCode") && /* @__PURE__ */ jsx(SwiftCode, { ...swiftCodeProps, dataStoreId: id }),
|
|
2381
|
-
formUtils.isRequiredField("bankName") && /* @__PURE__ */ jsx(BankName, { ...bankNameProps, dataStoreId: id }),
|
|
2382
|
-
formUtils.isRequiredField("bankCode") && /* @__PURE__ */ jsx(BankCode, { ...bankCodeProps, country, dataStoreId: id }),
|
|
2383
|
-
formUtils.isRequiredField("bankCity") && /* @__PURE__ */ jsx(BankCity, { ...bankCityProps, dataStoreId: id }),
|
|
2522
|
+
formUtils.isRequiredField("iban") && /* @__PURE__ */ jsx(Iban, { ...ibanProps, dataStoreId: id, country, ...multiFormProps }),
|
|
2523
|
+
formUtils.isRequiredField("swiftCode") && /* @__PURE__ */ jsx(SwiftCode, { ...swiftCodeProps, dataStoreId: id, ...multiFormProps }),
|
|
2524
|
+
formUtils.isRequiredField("bankName") && /* @__PURE__ */ jsx(BankName, { ...bankNameProps, dataStoreId: id, ...multiFormProps }),
|
|
2525
|
+
formUtils.isRequiredField("bankCode") && /* @__PURE__ */ jsx(BankCode, { ...bankCodeProps, country, dataStoreId: id, ...multiFormProps }),
|
|
2526
|
+
formUtils.isRequiredField("bankCity") && /* @__PURE__ */ jsx(BankCity, { ...bankCityProps, dataStoreId: id, ...multiFormProps }),
|
|
2384
2527
|
shouldShowPayoutAlert(country) && !isCrossBorderPayoutsEnabled && /* @__PURE__ */ jsx(
|
|
2385
2528
|
Alert,
|
|
2386
2529
|
{
|
|
@@ -2553,7 +2696,15 @@ const DEFAULT_CURRENCY_FALLBACK = "USD";
|
|
|
2553
2696
|
const getDefaultCurrencyForCountry = (country) => currencyByCountry[country]?.[0] ?? DEFAULT_CURRENCY_FALLBACK;
|
|
2554
2697
|
const getCountryCodeFromEvent = (event) => event?.target?.value;
|
|
2555
2698
|
function PayoutCountryDetails(props) {
|
|
2556
|
-
const {
|
|
2699
|
+
const {
|
|
2700
|
+
legalEntityResponse,
|
|
2701
|
+
data: propData,
|
|
2702
|
+
provider,
|
|
2703
|
+
handleFieldChange,
|
|
2704
|
+
valid: propValid,
|
|
2705
|
+
errors: propErrors,
|
|
2706
|
+
fieldValidationErrors: propFieldValidationErrors
|
|
2707
|
+
} = props;
|
|
2557
2708
|
const { t: commonT } = useTranslation("common");
|
|
2558
2709
|
const { t } = useTranslation("banking");
|
|
2559
2710
|
const { isSettingEnabled } = useSettingsContext();
|
|
@@ -2561,7 +2712,7 @@ function PayoutCountryDetails(props) {
|
|
|
2561
2712
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
2562
2713
|
const legalEntityType = legalEntityResponse.type;
|
|
2563
2714
|
const defaultCurrency = getDefaultCurrencyForCountry(country);
|
|
2564
|
-
const
|
|
2715
|
+
const localForm = useForm({
|
|
2565
2716
|
...props,
|
|
2566
2717
|
schema: payoutCountryDetailsFields,
|
|
2567
2718
|
defaultData: {
|
|
@@ -2570,6 +2721,12 @@ function PayoutCountryDetails(props) {
|
|
|
2570
2721
|
},
|
|
2571
2722
|
shouldValidate: true
|
|
2572
2723
|
});
|
|
2724
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
2725
|
+
const data = useMultiFormMode ? propData : localForm.data;
|
|
2726
|
+
const valid = useMultiFormMode ? propValid : localForm.valid;
|
|
2727
|
+
const errors = useMultiFormMode ? propErrors : localForm.errors;
|
|
2728
|
+
const fieldProblems = useMultiFormMode ? propFieldValidationErrors : localForm.fieldProblems;
|
|
2729
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
2573
2730
|
const formUtils = createFormUtils(props, commonT);
|
|
2574
2731
|
const allowedBankCountries = Object.keys(currencyByCountry);
|
|
2575
2732
|
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
@@ -2617,12 +2774,26 @@ function PayoutCountryDetails(props) {
|
|
|
2617
2774
|
"payoutCountryDetails"
|
|
2618
2775
|
);
|
|
2619
2776
|
useEffect(() => {
|
|
2620
|
-
|
|
2621
|
-
|
|
2777
|
+
if (!useMultiFormMode) {
|
|
2778
|
+
updateStateSlice({
|
|
2779
|
+
data: localForm.data,
|
|
2780
|
+
valid: localForm.valid,
|
|
2781
|
+
errors: localForm.errors,
|
|
2782
|
+
fieldProblems: localForm.fieldProblems
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
}, [
|
|
2786
|
+
localForm.data,
|
|
2787
|
+
localForm.valid,
|
|
2788
|
+
localForm.errors,
|
|
2789
|
+
updateStateSlice,
|
|
2790
|
+
localForm.fieldProblems,
|
|
2791
|
+
useMultiFormMode
|
|
2792
|
+
]);
|
|
2622
2793
|
const updateCountryField = (event) => {
|
|
2623
2794
|
const updatedCountry = getCountryCodeFromEvent(event);
|
|
2624
|
-
|
|
2625
|
-
|
|
2795
|
+
handleChange("bankCountry", "input")(updatedCountry);
|
|
2796
|
+
handleChange("preferredCurrency", "input")(getDefaultCurrencyForCountry(updatedCountry));
|
|
2626
2797
|
};
|
|
2627
2798
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2628
2799
|
/* @__PURE__ */ jsxs("form", { style: { minHeight: "480px" }, children: [
|
|
@@ -2633,8 +2804,8 @@ function PayoutCountryDetails(props) {
|
|
|
2633
2804
|
/* @__PURE__ */ jsx(
|
|
2634
2805
|
CountryField,
|
|
2635
2806
|
{
|
|
2636
|
-
data: { country: data
|
|
2637
|
-
valid: { country: valid?.bankCountry },
|
|
2807
|
+
data: { country: data?.bankCountry },
|
|
2808
|
+
valid: { country: valid?.bankCountry ?? true },
|
|
2638
2809
|
errors: { country: formUtils.getErrorMessage("bankCountry", errors, fieldProblems) },
|
|
2639
2810
|
labels: { country: t(($) => $["bankAccountCountryRegion"]) },
|
|
2640
2811
|
readonly: false,
|
|
@@ -2645,9 +2816,9 @@ function PayoutCountryDetails(props) {
|
|
|
2645
2816
|
/* @__PURE__ */ jsx(
|
|
2646
2817
|
PreferredCurrency,
|
|
2647
2818
|
{
|
|
2648
|
-
country: data
|
|
2649
|
-
preferredCurrency: data
|
|
2650
|
-
handleChangeFor
|
|
2819
|
+
country: data?.bankCountry ?? country,
|
|
2820
|
+
preferredCurrency: data?.preferredCurrency ?? defaultCurrency,
|
|
2821
|
+
handleChangeFor: handleChange
|
|
2651
2822
|
}
|
|
2652
2823
|
)
|
|
2653
2824
|
] }),
|
|
@@ -2812,7 +2983,10 @@ function PayoutVerificationMethod(props) {
|
|
|
2812
2983
|
bankInfoValidated,
|
|
2813
2984
|
data: payoutVerificationMethodData,
|
|
2814
2985
|
fieldValidationErrors,
|
|
2815
|
-
formVerificationErrors
|
|
2986
|
+
formVerificationErrors,
|
|
2987
|
+
handleFieldChange,
|
|
2988
|
+
valid: propValid,
|
|
2989
|
+
errors: propErrors
|
|
2816
2990
|
} = props;
|
|
2817
2991
|
const { type: legalEntityType } = legalEntityResponse;
|
|
2818
2992
|
const { t } = useTranslation("banking");
|
|
@@ -2825,7 +2999,7 @@ function PayoutVerificationMethod(props) {
|
|
|
2825
2999
|
SettingNames.AllowIntraRegionCrossBorderPayout
|
|
2826
3000
|
);
|
|
2827
3001
|
const [hasSelectedMethod, setHasSelectedMethod] = useState(false);
|
|
2828
|
-
const
|
|
3002
|
+
const localForm = useForm({
|
|
2829
3003
|
...props,
|
|
2830
3004
|
schema: payoutVerificationMethodFields,
|
|
2831
3005
|
defaultData: {
|
|
@@ -2842,48 +3016,62 @@ function PayoutVerificationMethod(props) {
|
|
|
2842
3016
|
},
|
|
2843
3017
|
fieldProblems: fieldValidationErrors
|
|
2844
3018
|
});
|
|
3019
|
+
const useMultiFormMode = !!handleFieldChange;
|
|
3020
|
+
const data = useMultiFormMode ? payoutVerificationMethodData : localForm.data;
|
|
3021
|
+
const valid = useMultiFormMode ? propValid : localForm.valid;
|
|
3022
|
+
const errors = useMultiFormMode ? propErrors : localForm.errors;
|
|
3023
|
+
const fieldProblems = useMultiFormMode ? fieldValidationErrors : localForm.fieldProblems;
|
|
3024
|
+
const handleChange = useMultiFormMode ? handleFieldChange : localForm.handleChangeFor;
|
|
2845
3025
|
const formUtils = createFormUtils(props, commonT);
|
|
2846
3026
|
const { sliceData, updateStateSlice } = useGlobalDataSlice("payoutVerificationMethod");
|
|
2847
3027
|
const { clearStateSlice: clearPayoutAccountDetails } = useGlobalDataSlice("payoutAccountDetails");
|
|
2848
|
-
useEffect(
|
|
2849
|
-
()
|
|
2850
|
-
|
|
2851
|
-
|
|
3028
|
+
useEffect(() => {
|
|
3029
|
+
if (!useMultiFormMode) {
|
|
3030
|
+
updateStateSlice({
|
|
3031
|
+
data: { ...sliceData, ...localForm.data },
|
|
3032
|
+
errors: localForm.errors,
|
|
3033
|
+
valid: localForm.valid,
|
|
3034
|
+
fieldProblems: localForm.fieldProblems
|
|
3035
|
+
});
|
|
3036
|
+
}
|
|
3037
|
+
}, [localForm.data, localForm.errors, localForm.fieldProblems, localForm.valid]);
|
|
2852
3038
|
const methodsMetadata = makePayoutVerificationMethodsMetadata(provider?.name);
|
|
2853
3039
|
const selectVerificationMethod = (method) => {
|
|
2854
3040
|
setHasSelectedMethod(true);
|
|
2855
|
-
|
|
3041
|
+
handleChange("payoutVerificationMethod")(method);
|
|
2856
3042
|
};
|
|
2857
3043
|
useEffect(() => {
|
|
2858
3044
|
if (bankInfoValidated) return;
|
|
2859
|
-
if (!hasSelectedMethod && instantVerificationAvailable && data
|
|
2860
|
-
|
|
3045
|
+
if (!hasSelectedMethod && instantVerificationAvailable && data?.payoutVerificationMethod !== "instantVerification") {
|
|
3046
|
+
handleChange("payoutVerificationMethod")("instantVerification");
|
|
2861
3047
|
}
|
|
2862
|
-
if (!instantVerificationAvailable && data
|
|
2863
|
-
|
|
3048
|
+
if (!instantVerificationAvailable && data?.payoutVerificationMethod !== "manualVerification") {
|
|
3049
|
+
handleChange("payoutVerificationMethod")("manualVerification");
|
|
2864
3050
|
}
|
|
2865
3051
|
}, [
|
|
2866
|
-
data
|
|
2867
|
-
|
|
3052
|
+
data?.payoutVerificationMethod,
|
|
3053
|
+
handleChange,
|
|
2868
3054
|
instantVerificationAvailable,
|
|
2869
3055
|
hasSelectedMethod,
|
|
2870
3056
|
bankInfoValidated
|
|
2871
3057
|
]);
|
|
2872
3058
|
const { dataset: countries } = useDataset(datasetIdentifier.country);
|
|
2873
|
-
const bankCountryName = countries.find((country2) => country2.id === data
|
|
3059
|
+
const bankCountryName = countries.find((country2) => country2.id === data?.bankCountry)?.name ?? data?.bankCountry;
|
|
2874
3060
|
const allowedBankCountries = getAllowedBankCountries(country);
|
|
2875
3061
|
const countryField = /* @__PURE__ */ jsx(
|
|
2876
3062
|
CountryField,
|
|
2877
3063
|
{
|
|
2878
|
-
data: { country: data
|
|
2879
|
-
valid: { country: valid?.bankCountry },
|
|
3064
|
+
data: { country: data?.bankCountry },
|
|
3065
|
+
valid: { country: valid?.bankCountry ?? true },
|
|
2880
3066
|
errors: { country: formUtils.getErrorMessage("bankCountry", errors, fieldProblems) },
|
|
2881
3067
|
labels: { country: t(($) => $["bankAccountCountryRegion"]) },
|
|
2882
3068
|
readonly: !intraRegionCrossBorderPayoutsAllowed || allowedBankCountries.length === 1 || bankInfoValidated,
|
|
2883
3069
|
allowedCountries: allowedBankCountries,
|
|
2884
3070
|
handleChangeFor: () => (e) => {
|
|
2885
|
-
|
|
2886
|
-
|
|
3071
|
+
if (!useMultiFormMode) {
|
|
3072
|
+
clearPayoutAccountDetails();
|
|
3073
|
+
}
|
|
3074
|
+
return handleChange("bankCountry", "input")(e);
|
|
2887
3075
|
},
|
|
2888
3076
|
helperText: intraRegionCrossBorderPayoutsAllowed ? void 0 : t(
|
|
2889
3077
|
($) => $[legalEntityType === LegalEntityTypes.INDIVIDUAL ? "youCanOnlyUseABankAccountInTheCountryRegionWhereYouLive" : "youCanOnlyUseABankAccountInTheCountryRegionWhereYourCompanyIsRegistered"]
|
|
@@ -2936,7 +3124,7 @@ function PayoutVerificationMethod(props) {
|
|
|
2936
3124
|
tag: /* @__PURE__ */ jsx(Tag, { variant: "blue", className: "adyen-kyc-u-margin-bottom-8", children: t(($) => $["recommended"]) }),
|
|
2937
3125
|
selectVerificationMethod,
|
|
2938
3126
|
methodsMetadata,
|
|
2939
|
-
payoutVerificationMethod: data
|
|
3127
|
+
payoutVerificationMethod: data?.payoutVerificationMethod,
|
|
2940
3128
|
instantVerificationAvailable,
|
|
2941
3129
|
bankInfoValidated
|
|
2942
3130
|
}
|
|
@@ -2949,7 +3137,7 @@ function PayoutVerificationMethod(props) {
|
|
|
2949
3137
|
subtitle: t(($) => $["enterYourAccountsDetailsOnYourOwn"]),
|
|
2950
3138
|
selectVerificationMethod,
|
|
2951
3139
|
methodsMetadata,
|
|
2952
|
-
payoutVerificationMethod: data
|
|
3140
|
+
payoutVerificationMethod: data?.payoutVerificationMethod
|
|
2953
3141
|
}
|
|
2954
3142
|
)
|
|
2955
3143
|
] })
|
|
@@ -3182,7 +3370,11 @@ function PayoutDetails(props) {
|
|
|
3182
3370
|
) })
|
|
3183
3371
|
] });
|
|
3184
3372
|
}
|
|
3185
|
-
const rules = ({
|
|
3373
|
+
const rules = ({
|
|
3374
|
+
data,
|
|
3375
|
+
requiredFields,
|
|
3376
|
+
isFeatureEnabled
|
|
3377
|
+
}) => createFormRules({
|
|
3186
3378
|
whenUsingManualVerification: () => {
|
|
3187
3379
|
if (!data.payoutVerificationMethod) return;
|
|
3188
3380
|
if (data?.payoutVerificationMethod?.payoutVerificationMethod === "manualVerification") {
|
|
@@ -3203,6 +3395,9 @@ const rules = ({ data, requiredFields }) => createFormRules({
|
|
|
3203
3395
|
}
|
|
3204
3396
|
},
|
|
3205
3397
|
bankStatementRequirement: () => {
|
|
3398
|
+
if (isFeatureEnabled?.("EnablePayoutDetailsMultiForm")) {
|
|
3399
|
+
return "REQUIRED";
|
|
3400
|
+
}
|
|
3206
3401
|
if (data?.payoutVerificationMethod?.payoutVerificationMethod === "manualVerification") {
|
|
3207
3402
|
return requiredFields?.bankStatementRequirement;
|
|
3208
3403
|
}
|
|
@@ -3265,22 +3460,6 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
|
|
|
3265
3460
|
existingDocument
|
|
3266
3461
|
});
|
|
3267
3462
|
};
|
|
3268
|
-
const CUSTOM_LABELS = {
|
|
3269
|
-
verifiedAccountHolder: "accountHolder",
|
|
3270
|
-
verifiedBankCountry: "bankCountry",
|
|
3271
|
-
verifiedBankName: "bankName",
|
|
3272
|
-
verifiedCurrencyCode: "currencyCode",
|
|
3273
|
-
verifiedBankAccountNumber: "bankAccountNumber"
|
|
3274
|
-
};
|
|
3275
|
-
const formatAccountVerificationSummary = (data) => {
|
|
3276
|
-
if (!data) return {};
|
|
3277
|
-
const summary = {};
|
|
3278
|
-
keysOf(CUSTOM_LABELS).forEach((key) => {
|
|
3279
|
-
if (!data[key]) return;
|
|
3280
|
-
summary[key] = summaryItem(CUSTOM_LABELS[key], data[key]);
|
|
3281
|
-
});
|
|
3282
|
-
return summary;
|
|
3283
|
-
};
|
|
3284
3463
|
const obscuredPayoutFields = ["bankAccountNumber", "iban"];
|
|
3285
3464
|
const payoutDetailsCountryConfig = {
|
|
3286
3465
|
[CountryCodes.Canada]: {
|
|
@@ -3319,6 +3498,9 @@ function parsePayoutScenarios({
|
|
|
3319
3498
|
bankCountry: {
|
|
3320
3499
|
rule: "REQUIRED"
|
|
3321
3500
|
},
|
|
3501
|
+
preferredCurrency: {
|
|
3502
|
+
rule: "REQUIRED"
|
|
3503
|
+
},
|
|
3322
3504
|
bankStatementDocument: {
|
|
3323
3505
|
rule: "bankStatementRequirement"
|
|
3324
3506
|
},
|
|
@@ -3370,6 +3552,13 @@ const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailabl
|
|
|
3370
3552
|
}
|
|
3371
3553
|
return dependentSteps;
|
|
3372
3554
|
};
|
|
3555
|
+
const CUSTOM_LABELS = {
|
|
3556
|
+
verifiedAccountHolder: "accountHolder",
|
|
3557
|
+
verifiedBankCountry: "bankCountry",
|
|
3558
|
+
verifiedBankName: "bankName",
|
|
3559
|
+
verifiedCurrencyCode: "currencyCode",
|
|
3560
|
+
verifiedBankAccountNumber: "bankAccountNumber"
|
|
3561
|
+
};
|
|
3373
3562
|
const getInvalidFieldsErrorHeader = (invalidField) => {
|
|
3374
3563
|
switch (invalidField) {
|
|
3375
3564
|
case "LEGAL_BUSINESS_NAME":
|
|
@@ -3417,7 +3606,15 @@ const getPayoutVerificationMethod = (transferInstrument, instantVerificationEnab
|
|
|
3417
3606
|
return instantVerificationEnabled ? "instantVerification" : "manualVerification";
|
|
3418
3607
|
}
|
|
3419
3608
|
};
|
|
3420
|
-
const
|
|
3609
|
+
const formatAccountVerificationSummary = (data) => {
|
|
3610
|
+
if (!data) return {};
|
|
3611
|
+
const summary = {};
|
|
3612
|
+
keysOf(CUSTOM_LABELS).forEach((key) => {
|
|
3613
|
+
if (!data[key]) return;
|
|
3614
|
+
summary[key] = summaryItem(CUSTOM_LABELS[key], data[key]);
|
|
3615
|
+
});
|
|
3616
|
+
return summary;
|
|
3617
|
+
};
|
|
3421
3618
|
function PayoutDetailsDropin({
|
|
3422
3619
|
legalEntityResponse,
|
|
3423
3620
|
problems: propProblems,
|
|
@@ -3519,7 +3716,6 @@ function PayoutDetailsDropin({
|
|
|
3519
3716
|
const [hasAsyncValidationError, setHasAsyncValidationError] = useState(false);
|
|
3520
3717
|
const isMaskedBankAccountNumber = data.payoutAccountDetails?.bankAccountNumber?.includes("*") || data.payoutAccountDetails?.iban?.includes("*");
|
|
3521
3718
|
const existingBankAccountFormat = transferInstrument ? transferInstrument?.bankAccount?.accountIdentification?.type === "numberAndBic" ? "numberAndBic" : existingPayoutDetails?.payoutAccountDetails?.iban ? "iban" : "local" : void 0;
|
|
3522
|
-
useTaskLandedEvent(taskType);
|
|
3523
3719
|
useEffect(() => {
|
|
3524
3720
|
setData({
|
|
3525
3721
|
...currentState.data,
|
|
@@ -3564,7 +3760,8 @@ function PayoutDetailsDropin({
|
|
|
3564
3760
|
const fieldsFromCustomRules = useMemo$1(
|
|
3565
3761
|
() => rules({
|
|
3566
3762
|
data,
|
|
3567
|
-
requiredFields
|
|
3763
|
+
requiredFields,
|
|
3764
|
+
isFeatureEnabled
|
|
3568
3765
|
}),
|
|
3569
3766
|
[bankAccountCountry, data, taskType, isFeatureEnabled]
|
|
3570
3767
|
);
|
|
@@ -3985,5 +4182,45 @@ function PayoutDetailsDropin({
|
|
|
3985
4182
|
);
|
|
3986
4183
|
}
|
|
3987
4184
|
export {
|
|
3988
|
-
|
|
4185
|
+
rules as A,
|
|
4186
|
+
BankVerification as B,
|
|
4187
|
+
mapPayoutAccountSchemaToApiBankAccount as C,
|
|
4188
|
+
useCheck as D,
|
|
4189
|
+
getAppropriatePayoutDetailsSteps as E,
|
|
4190
|
+
mapApiDocumentToPayoutDocuments as F,
|
|
4191
|
+
getInvalidFieldsErrorMessage as G,
|
|
4192
|
+
parseConfiguration as H,
|
|
4193
|
+
InstantVerificationErrorContext as I,
|
|
4194
|
+
mapPayoutDetailsToTransferInstrument as J,
|
|
4195
|
+
createTransferInstrument as K,
|
|
4196
|
+
formatAccountVerificationSummary as L,
|
|
4197
|
+
MemoizedBankDocumentClassification as M,
|
|
4198
|
+
mapPayoutDocumentsToApiDocuments as N,
|
|
4199
|
+
PayoutDetailsDropin as P,
|
|
4200
|
+
useAsyncAccountDetailsValidationRules as a,
|
|
4201
|
+
PayoutAccount as b,
|
|
4202
|
+
PayoutVerificationMethod as c,
|
|
4203
|
+
PayoutCountryDetails as d,
|
|
4204
|
+
bankVerificationValidationRules as e,
|
|
4205
|
+
bankDocumentValidationRules as f,
|
|
4206
|
+
getAccountIdentificationFromPayoutAccountSchema as g,
|
|
4207
|
+
defaultFieldMetadata$1 as h,
|
|
4208
|
+
defaultFieldConfig$1 as i,
|
|
4209
|
+
defaultFieldMetadata$3 as j,
|
|
4210
|
+
defaultFieldConfig$3 as k,
|
|
4211
|
+
defaultFieldMetadata as l,
|
|
4212
|
+
defaultFieldConfig as m,
|
|
4213
|
+
defaultFieldMetadata$2 as n,
|
|
4214
|
+
defaultFieldConfig$2 as o,
|
|
4215
|
+
payoutSteps as p,
|
|
4216
|
+
swiftCodeFieldMetadata as q,
|
|
4217
|
+
useUpdateTransferInstrument as r,
|
|
4218
|
+
showInstantVerificationPayoutModal as s,
|
|
4219
|
+
useUpdateTrustedTransferInstrument as t,
|
|
4220
|
+
useInstantVerificationErrorNotification as u,
|
|
4221
|
+
useCreateTrustedTransferInstrument as v,
|
|
4222
|
+
getPayoutVerificationMethod as w,
|
|
4223
|
+
getDefaultCurrencyForCountry as x,
|
|
4224
|
+
useBankVerificationProviders as y,
|
|
4225
|
+
getAccountFormatsForCountry as z
|
|
3989
4226
|
};
|