@adyen/kyc-components 4.5.1 → 4.6.0-beta.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/README.md +31 -43
- package/dist/{AcceptTermsOfServiceComponent-CDgZIoAy.js → AcceptTermsOfServiceComponent-Bd0fuzJX.js} +17 -20
- package/dist/{AccountSetupRejected-Bwu8xLmZ.js → AccountSetupRejected-t4tPei0K.js} +2 -2
- package/dist/{ActionBar-Cs-ZFNhk.js → ActionBar-Ruw6z6LR.js} +2 -2
- package/dist/{Address-Cdkbwzso.js → Address-D0JjbOT4.js} +16 -16
- package/dist/{Avatar-DtFyP488.js → Avatar-Dp70m25u.js} +2 -2
- package/dist/{BusinessFinancingComponent-DmYxCifv.js → BusinessFinancingComponent-DAj2gvCq.js} +5 -5
- package/dist/{BusinessFinancingDropin-DbkFhxJT.js → BusinessFinancingDropin-RImpwNje.js} +31 -34
- package/dist/{BusinessFinancingPage-DulUJR2t.js → BusinessFinancingPage-B3XW6vMz.js} +4 -4
- package/dist/{BusinessTypeSelectionPage-B-vdLokC.js → BusinessTypeSelectionPage-D_yQV_GP.js} +9 -14
- package/dist/{Checkbox-D3Z0AWKj.js → Checkbox-DQGjbUsQ.js} +2 -2
- package/dist/{Confirm-C42kXNcg.js → Confirm-roUo52pe.js} +3 -3
- package/dist/{ConstitutionalDocument-DzgtU8np.js → ConstitutionalDocument-BW87TDZl.js} +336 -92
- package/dist/{ContactDetails--t1QRowR.js → ContactDetails-CGss-4M6.js} +12 -7
- package/dist/{ContextGuidance-C2yYCn3r.js → ContextGuidance-8vbKs48u.js} +2 -2
- package/dist/{CountryField-DzcOrjgs.js → CountryField-Cxih2YUu.js} +3 -3
- package/dist/{CreateIndividualComponent-BGs4XVIx.js → CreateIndividualComponent-k3J84uhw.js} +6 -6
- package/dist/{CreateTransferInstrumentComponent-8qbVjvCk.js → CreateTransferInstrumentComponent-bam-U6uj.js} +5 -5
- package/dist/{Currency-D_JvTwxX.js → Currency-DhqTdIeI.js} +7 -7
- package/dist/{CustomerSupport-C-r0iCOW.js → CustomerSupport-CdhIJFEE.js} +11 -16
- package/dist/{DebugModal-UZ3iEF4d.js → DebugModal-yfBBhyjs.js} +127 -98
- package/dist/DecisionMakerDetails-D0-COO1N.js +275 -0
- package/dist/{DecisionMakerDetailsPage-CORpG8qd.js → DecisionMakerDetailsPage-C-LGLbrJ.js} +10 -10
- package/dist/{DecisionMakers-D_B8GhAP.js → DecisionMakers-Bx51Ewcv.js} +22 -259
- package/dist/{Dropzone-CqXwk4Vf.js → Dropzone-Dy3XmCix.js} +4 -4
- package/dist/{EmbeddedStatus-Cq3s0VKQ.js → EmbeddedStatus-PFK1NCkS.js} +3 -3
- package/dist/{EndStateLayout-DyV9bKDz.js → EndStateLayout-5kx0pljK.js} +2 -2
- package/dist/{EntityAssociation-DoTWA9hu.js → EntityAssociation-BVxUknEP.js} +5 -5
- package/dist/{EntityGuidanceStatus-xpPB9g8U.js → EntityGuidanceStatus-CbP4RqW4.js} +4 -4
- package/dist/{ErrorPanel-BuHWbhfh.js → ErrorPanel-Cn8gzNGG.js} +11 -12
- package/dist/{Field-Dr2nucSo.js → Field-BDI27kIy.js} +2 -2
- package/dist/{FormNavigation-bTHzHm_a.js → FormNavigation-D90R1OgK.js} +3 -3
- package/dist/{Individual.rules-CvBrD7Ad.js → Individual.rules-BrdY-Rew.js} +12 -12
- package/dist/{IndividualDropin-DhipTriL.js → IndividualDropin-D5FrKUb-.js} +252 -97
- package/dist/{InputDate-HsJIDMnw.js → InputDate-nNag-jcu.js} +1 -1
- package/dist/{InputText-Cmp-jxkq.js → InputText-DFjKyN6O.js} +2 -2
- package/dist/{Introduction-CVb0Xx-s.js → Introduction-DhEG_Jvt.js} +4 -9
- package/dist/InvitedDecisionMakerComponent-DT_SCB2u.js +211 -0
- package/dist/{JpAddress-CC_IvY9U.js → JpAddress-DcJCN9dG.js} +11 -11
- package/dist/{LandingLayout-Hw-QdoQL.js → LandingLayout-CC_FGMAs.js} +2 -2
- package/dist/{LegalCompanyNameField-CWRd7AEp.js → LegalCompanyNameField-CgTgIMv8.js} +16 -16
- package/dist/{LegalRepresentativeDetailsPage-CY_iMQTc.js → LegalRepresentativeDetailsPage-D4d4eelX.js} +5 -5
- package/dist/{Link-DDnVkilX.js → Link-C30mEtLP.js} +2 -2
- package/dist/{ListItem-C5VcmY-s.js → ListItem-BQLamvB-.js} +3 -3
- package/dist/{LoaderWrapper-BFpnMaZr.js → LoaderWrapper-CgNgcjW-.js} +2 -2
- package/dist/{ManageIndividualComponent-Cb5wNkz0.js → ManageIndividualComponent-DKVcaPI6.js} +5 -5
- package/dist/{ManageTermsOfServiceComponent-10j2xeZu.js → ManageTermsOfServiceComponent-T_K9BahM.js} +4 -4
- package/dist/{ManageTransferInstrumentComponent-BpnoK4Sd.js → ManageTransferInstrumentComponent-Ch79d8JP.js} +11 -11
- package/dist/{MaskedInput-D6wQgEqZ.js → MaskedInput-B9djDROe.js} +5 -5
- package/dist/{MaybeModal-w8BdVyL9.js → MaybeModal-BYsvKCcc.js} +3 -3
- package/dist/{Modal-CBxIPgQb.js → Modal-727fSuFr.js} +2 -2
- package/dist/{Name-CFTJ-03j.js → Name-BN-K6-N2.js} +4 -4
- package/dist/{NewSummary-Bzl3znax.js → NewSummary-DTuLIMtG.js} +5 -5
- package/dist/{OnboardingDropinComponent-D6UOdrFV.js → OnboardingDropinComponent-CaRk-dgZ.js} +145 -218
- package/dist/{PayoutDetailsDropin-hc2Lwjfg.js → PayoutDetailsDropin-CaJE5U6g.js} +183 -1065
- package/dist/{PayoutDetailsPage-C2UkSM42.js → PayoutDetailsPage-B0i-iUKS.js} +6 -6
- package/dist/{RadioGroup-tAaHg-3v.js → RadioGroup-DQa-nkgM.js} +2 -2
- package/dist/{Review-Bhbx2iLe.js → Review-CgkKBldb.js} +6 -6
- package/dist/{RootBusinessDetailsPage-BtxfStzp.js → RootBusinessDetailsPage-Bh3M9G8g.js} +6 -6
- package/dist/{RootBusinessLinesPage-SBl1RJnK.js → RootBusinessLinesPage-C4wzI8-k.js} +93 -91
- package/dist/{RootIndividualDetailsPage-BKrFR8kJ.js → RootIndividualDetailsPage-GBrzZTH2.js} +7 -6
- package/dist/{Select-CDjrCQMg.js → Select-Bt5Y91sI.js} +4 -4
- package/dist/{SignPCIComponent-CsBd4n0S.js → SignPCIComponent-BxzfAQvx.js} +12 -19
- package/dist/{SingpassSelection-BLw_O_To.js → SingpassSelection-hjBRnBDR.js} +144 -7
- package/dist/{SoleProprietorshipPage-DugLl7bw.js → SoleProprietorshipPage-B6HqJtcC.js} +5 -5
- package/dist/{SourceOfFundsPage-BOpuSCH-.js → SourceOfFundsPage-D6V3pwXP.js} +270 -98
- package/dist/{StepProgressIndicator-U5i4HLMS.js → StepProgressIndicator-DhfpqmVy.js} +2 -2
- package/dist/{StoreProvider-DS3-j_yO.js → StoreProvider-CGAl-5Sk.js} +155 -148
- package/dist/{Summary-B4rVi_1E.js → Summary-DKmu4xU7.js} +25 -22
- package/dist/{TaxInformationField-Gascwiqq.js → TaxInformationField-wLMc_uT-.js} +568 -795
- package/dist/{TaxReportingDropin-BiUeYocK.js → TaxReportingDropin-DsPw-MUV.js} +26 -26
- package/dist/{TextArea-DHLHMQS0.js → TextArea-BGhv4y1a.js} +2 -2
- package/dist/{TileGroup-TQqcisEg.js → TileGroup-D3HIe8QQ.js} +3 -3
- package/dist/{TrustDetailsPage-B9qgsL7n.js → TrustDetailsPage-CWKPHxTe.js} +64 -65
- package/dist/{TrustMemberCompanyPage-Dv8gB3AJ.js → TrustMemberCompanyPage-C89-gUpd.js} +7 -7
- package/dist/{TrustMemberIndividualPage-B61REKTA.js → TrustMemberIndividualPage-Cz-Z8U7w.js} +6 -6
- package/dist/{TrustMemberRoleAndTypePage-B-937gVA.js → TrustMemberRoleAndTypePage-BxzEkGzE.js} +27 -27
- package/dist/{TrustMembersOverview-BUdUHg0i.js → TrustMembersOverview-BtycEgbW.js} +16 -18
- package/dist/{UnincorporatedPartnershipIndividualPage-CiXV1GFq.js → UnincorporatedPartnershipIndividualPage-CSQjYe4p.js} +5 -5
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-DBvCnN3w.js → UnincorporatedPartnershipMemberCompanyPage-ZAQkvjQr.js} +6 -6
- package/dist/{UnincorporatedPartnershipMemberRoleAndTypePage-C5tojfbL.js → UnincorporatedPartnershipMemberRoleAndTypePage-B9bvg2ra.js} +11 -11
- package/dist/{UnincorporatedPartnershipMembersOverview-DPrp3a67.js → UnincorporatedPartnershipMembersOverview-DYDDYisa.js} +7 -7
- package/dist/{VerificationErrorAlert-DUcGedHl.js → VerificationErrorAlert-Sf7ovPdg.js} +3 -3
- package/dist/{ViewVerificationStatusComponent-ucroS2ge.js → ViewVerificationStatusComponent-D6qJacuF.js} +3 -3
- package/dist/adyen-business-financing.js +4 -4
- package/dist/adyen-individual-configuration.js +4 -4
- package/dist/adyen-individual-status.js +4 -4
- package/dist/adyen-invited-decision-maker.js +4 -117
- package/dist/adyen-kyc-components.js +17 -17
- package/dist/adyen-onboarding.js +4 -4
- package/dist/adyen-terms-of-service-management.js +4 -4
- package/dist/adyen-terms-of-service-status.js +4 -4
- package/dist/adyen-transfer-instrument-configuration.js +4 -4
- package/dist/adyen-transfer-instrument-management.js +4 -4
- package/dist/adyen-verification-status.js +4 -4
- package/dist/{bafinUtils-YlO-EQ-z.js → bafinUtils-4YaweTCy.js} +2 -2
- package/dist/{commonValidators-Z8GTyWt2.js → commonValidators-nusLcRK6.js} +1 -1
- package/dist/{dropinUtils-DuoGe_aD.js → dropinUtils-DoPR1iTm.js} +53 -9
- package/dist/en-US-CJDkXFZ6.js +13 -0
- package/dist/en-US-CTbVLoNF.js +13 -0
- package/dist/en-US-CfazE4ht.js +13 -0
- package/dist/{en-US-G607HIyo.js → en-US-DPoDE0uz.js} +7 -7
- package/dist/en-US-DrUYyPhF.js +13 -0
- package/dist/{formUtils-OvyHeoEE.js → formUtils-zdJ_jyqE.js} +3 -3
- package/dist/{getName-DxauASkL.js → getName-Ca2cTXzw.js} +2 -2
- package/dist/{getProblemsForEntity-yYZx85SH.js → getProblemsForEntity-CNltAsMa.js} +2 -2
- package/dist/getTrustedFields-rU6j1TOQ.js +104 -0
- package/dist/{isEmpty-CUJ_MTvj.js → isEmpty-BN2tOceJ.js} +1 -1
- package/dist/japanSupportUtils-B76IOTvL.js +16 -0
- package/dist/{localizeDateString-Cdq_DxXh.js → localizeDateString-9ciBezNu.js} +2 -2
- package/dist/{mapExistingFile-BX4VgHc9.js → mapExistingFile-BS79kq3W.js} +3 -76
- package/dist/{mapJpAddressSchemaToAddressLocalizations-fM535qJi.js → mapJpAddressSchemaToAddressLocalizations--7Bt3usJ.js} +2 -36
- package/dist/{mapLegalEntityToIndividualSchema-CtUOM-Zl.js → mapLegalEntityToIndividualSchema-BxOmNDle.js} +4 -4
- package/dist/{mapTransferInstrumentToPayoutAccount-CwsN-a7n.js → mapTransferInstrumentToPayoutAccount-ONPBT9KF.js} +2 -2
- package/dist/omitObscuredFieldsIfUnchanged-DhUQJrjg.js +29 -0
- package/dist/{patternValidators-vRnpmLkN.js → patternValidators-Cem-Icxv.js} +2 -2
- package/dist/{process-field-configurations-BGd8lBcb.js → process-field-configurations-BWC3i2at.js} +2 -2
- package/dist/{resolveEnvironment-CnQ__7cb.js → resolveEnvironment-BLaPb5Nd.js} +17 -24
- package/dist/{roleMetadata-B5g5kSns.js → roleMetadata-RivmWKE-.js} +3 -3
- package/dist/style.css +230 -275
- package/dist/styles-CLV89_hH.js +230 -275
- package/dist/types/api/toggles/useToggles.d.ts +2 -1
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentClassification.d.ts +2 -1
- package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +0 -29
- package/dist/types/components/BankAccount/forms/BankVerification/BankVerification.d.ts +1 -1
- package/dist/types/components/BankAccount/forms/BankVerification/verification/{widget → overlay}/types.d.ts +4 -14
- package/dist/types/components/BankAccount/forms/PayoutVerificationMethod/payoutVerificationMethodMetadata.d.ts +1 -1
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +4 -5
- package/dist/types/components/Business/forms/rules.d.ts +1 -1
- package/dist/types/components/Business/mapping/businessDetails/mapBusinessDetailsSchemaToLegalEntity.d.ts +2 -2
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/BusinessDetailsGettingStarted.d.ts +6 -0
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/types.d.ts +2 -2
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/validate.d.ts +7 -5
- package/dist/types/components/Business/utils/companyUtil.d.ts +2 -2
- package/dist/types/components/Business/utils/formatDataForSummary.d.ts +3 -2
- package/dist/types/components/Business/utils/submit.d.ts +1 -1
- package/dist/types/components/Business/utils/useCompanySearchFeature.d.ts +5 -0
- package/dist/types/components/BusinessLines/forms/SalesChannelsForm/types.d.ts +1 -1
- package/dist/types/components/BusinessLines/tasks/BusinessLines/BusinessLinesDropin.d.ts +1 -1
- package/dist/types/components/Contract/tasks/PciDropin/PciDropin.d.ts +1 -1
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +9 -9
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/types.d.ts +11 -0
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/utils.d.ts +15 -0
- package/dist/types/components/Individual/forms/AdditionalPersonalDetails/validate.d.ts +5 -4
- package/dist/types/components/Individual/forms/BasicDetails/validate.d.ts +3 -3
- package/dist/types/components/Individual/forms/IdNowVerificationModal/IFrameWidget.d.ts +9 -0
- package/dist/types/components/Individual/forms/Individual.rules.d.ts +1 -1
- package/dist/types/components/Individual/mapping/mapIndividualSchemaToLegalEntity.d.ts +2 -2
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakerDetails/DecisionMakerDetails.types.d.ts +2 -2
- package/dist/types/components/Individual/tasks/DecisionMakers/InvitedDecisionMaker/InvitedDecisionMakerSubmitSuccess/InvitedDecisionMakerSubmitSuccess.d.ts +6 -1
- package/dist/types/components/Individual/tasks/DecisionMakers/hooks/useTaskStatusWithTimeout.d.ts +15 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/utils.d.ts +14 -0
- package/dist/types/components/Shared/FormFlow/FormFlow.d.ts +1 -1
- package/dist/types/components/Shared/FormFlow/FormFlow.types.d.ts +1 -0
- package/dist/types/components/Shared/FormWrapper/FormWrapper.d.ts +2 -1
- package/dist/types/components/Shared/devex/DebugListener/DebugTogglesAndSettings.d.ts +8 -0
- package/dist/types/components/Shared/devex/DebugListener/debugInfo.d.ts +2 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/RegistrationNumberTypeSelector/CompanyRegistrationNumberTypeSelector.d.ts +12 -0
- package/dist/types/components/Shared/fields/{IdFieldTypeSelector → BusinessRegistrationNumberField/RegistrationNumberTypeSelector}/getDefaultRegistrationNumberType.d.ts +4 -4
- package/dist/types/components/Shared/fields/{IdFieldTypeSelector → BusinessRegistrationNumberField/RegistrationNumberTypeSelector}/inferCompanyRegistrationNumberType.d.ts +3 -3
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/fieldConfig.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/registrationNumberTypes.d.ts +92 -0
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +8 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/countryIdNumberTypes.d.ts +0 -483
- package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -1
- package/dist/types/components/Shared/fields/LegalCompanyNameField/fieldConfig.d.ts +2 -2
- package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/LocalizedNameFields/validate.d.ts +2 -2
- package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -1
- package/dist/types/components/Shared/fields/PhoneField/types.d.ts +2 -0
- package/dist/types/components/Shared/fields/{IdFieldTypeSelector → TaxInformationField/TaxIdNumberTypeSelector}/TaxIdNumberTypeSelector.d.ts +5 -5
- package/dist/types/components/Shared/fields/{IdFieldTypeSelector → TaxInformationField/TaxIdNumberTypeSelector}/getDefaultTaxIdNumberType.d.ts +5 -5
- package/dist/types/components/Shared/fields/{IdFieldTypeSelector → TaxInformationField/TaxIdNumberTypeSelector}/inferTaxIdNumberType.d.ts +5 -5
- package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +1 -2
- package/dist/types/components/Shared/fields/TaxInformationField/taxIdNumberTypes.d.ts +232 -0
- package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +8 -0
- package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/VatNumberTypeSelector.d.ts +14 -0
- package/dist/types/components/Shared/fields/{IdFieldTypeSelector → VatNumberField/VatNumberTypeSelector}/getDefaultVatNumberType.d.ts +2 -2
- package/dist/types/components/Shared/fields/VatNumberField/VatNumberTypeSelector/inferVatNumberType.d.ts +3 -0
- package/dist/types/components/Shared/fields/VatNumberField/fieldConfig.d.ts +1 -2
- package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +10 -1
- package/dist/types/components/Shared/fields/VatNumberField/vatNumberTypes.d.ts +149 -0
- package/dist/types/components/Shared/forms/Address/localized/jp/mapJpAddressSummary.d.ts +5 -0
- package/dist/types/components/Shared/forms/Address/utils.d.ts +6 -1
- package/dist/types/components/Shared/forms/Address/validate.d.ts +3 -3
- package/dist/types/components/Trust/mapping/mapLegalEntityToTrust.d.ts +2 -2
- package/dist/types/components/Trust/mapping/mapTrustToLegalEntity.d.ts +2 -2
- package/dist/types/components/Trust/tasks/TrustDropin/validate.d.ts +2 -2
- package/dist/types/components/UnincorporatedPartnership/mapping/mapLegalEntityToUnincorporatedPartnership.d.ts +2 -2
- package/dist/types/components/UnincorporatedPartnership/mapping/mapUnincorporatedPartnershipToLegalEntity.d.ts +2 -2
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/context/FormRouterContext/FormRouterContext.d.ts +5 -0
- package/dist/types/context/FormRouterContext/FormRouterContextProvider.d.ts +1 -1
- package/dist/types/context/FormRouterContext/types.d.ts +1 -0
- package/dist/types/context/FormRouterContext/useFormRouterContext.d.ts +4 -0
- package/dist/types/context/SettingsContext/types.d.ts +2 -0
- package/dist/types/context/ToggleContext/ToggleContext.d.ts +2 -0
- package/dist/types/context/ToggleContext/ToggleContextProvider.d.ts +9 -0
- package/dist/types/context/{ExperimentContext → ToggleContext}/types.d.ts +42 -32
- package/dist/types/context/ToggleContext/useToggleContext.d.ts +1 -0
- package/dist/types/core/EmbedShell/EmbedShell.d.ts +3 -3
- package/dist/types/core/UIElement/UIElement.d.ts +3 -2
- package/dist/types/core/models/api/organization.d.ts +1 -1
- package/dist/types/embeds/baseEmbedProps.d.ts +3 -3
- package/dist/types/hooks/useFormComposer.d.ts +1 -0
- package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +1 -1
- package/dist/types/hooks/useTaskLandedEvent.d.ts +7 -0
- package/dist/types/language/types.d.ts +2 -9
- package/dist/types/language/utils.d.ts +2 -2
- package/dist/types/router/routeConfig.d.ts +1 -0
- package/dist/types/stores/globalStore/taskTypes.d.ts +1 -0
- package/dist/types/types/form-rules.d.ts +2 -2
- package/dist/types/utils/api/processCapabilitites.d.ts +1 -1
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/japanSupportUtils.d.ts +2 -2
- package/dist/{types-C_a8jv29.js → types-BLjngIPE.js} +2 -2
- package/dist/{types-_ugkpUNx.js → types-CTwBMnPB.js} +46 -37
- package/dist/{types-H2FCJ1-C.js → types-DmjPF4Sw.js} +2 -2
- package/dist/{types-CQ2p58-6.js → types-Dv0COrvY.js} +3 -2
- package/dist/{types-xe96hgXI.js → types-i_4sFTBn.js} +2 -2
- package/dist/{unincorporated-partnership-B6NRgago.js → unincorporated-partnership-R_fKlee-.js} +2 -2
- package/dist/{useAssociatedLegalEntity-CVzKts0I.js → useAssociatedLegalEntity-sPi1NDib.js} +2 -2
- package/dist/{useBusinessDetailsData-DfwcFRlQ.js → useBusinessDetailsData-Bqk04i4C.js} +443 -397
- package/dist/{useCreateLegalEntity-hrStnY6W.js → useCreateLegalEntity-Bsp9NV_x.js} +2 -2
- package/dist/{useForm-D6L2c9Li.js → useForm-OoKBR6oR.js} +3 -3
- package/dist/{useFormContext-CMsS317D.js → useFormContext-DSPJpGk8.js} +17 -8
- package/dist/{useGlobalData-6k8_ruDF.js → useGlobalData-Crfi88kZ.js} +24 -15
- package/dist/{useMultiForm-DM2vK1Np.js → useMultiForm-CvhpFewv.js} +4 -4
- package/dist/{useOnboardingStatus-DhKdv_Y5.js → useOnboardingStatus-CAHU1D0X.js} +2 -2
- package/dist/{useScenarios-CUR2KnWg.js → useScenarios-DBv_dA-7.js} +2 -2
- package/dist/{useTermsOfServiceStatus-BDMVKqbS.js → useTermsOfServiceStatus-ZQHlgGZB.js} +2 -2
- package/dist/{useToastContext-D4gUb18d.js → useToastContext-fRmLeQb3.js} +2 -2
- package/dist/{useUnincorporatedPartnershipMembers-DR2H0kGz.js → useUnincorporatedPartnershipMembers-DiyYkTfs.js} +5 -5
- package/dist/{useUpdateBusinessLines-DePb7PWG.js → useUpdateBusinessLines-R_TsTeL9.js} +6 -6
- package/dist/{useUpdateLegalEntity-DAa_GfP9.js → useUpdateLegalEntity-B08ICvGj.js} +3 -3
- package/dist/{utils-Dl-sL-p9.js → utils-3lClW_1M.js} +2 -2
- package/dist/{utils-BWV6yYFy.js → utils-B0FPRdWI.js} +22 -2
- package/dist/{utils-CnnnCh8B.js → utils-BRoXRTJU.js} +6 -6
- package/dist/{utils--FMWv23g.js → utils-Bjuz29z7.js} +53 -6
- package/dist/{utils-Cm_KCWsB.js → utils-CPMlF6U8.js} +1 -1
- package/dist/{validate-C7J6rZcj.js → validate-Bkn-4Xav.js} +1 -1
- package/dist/{validate-C-38T_GY.js → validate-DXgI7aOv.js} +3 -3
- package/dist/{validationError-C6qoE3Ei.js → validationError-1Dg0ubhb.js} +2 -2
- package/package.json +1 -5
- package/dist/RadioGroupCard-fFofJm6m.js +0 -152
- package/dist/en-US--1W760fR.js +0 -13
- package/dist/en-US-CKLQU2sJ.js +0 -13
- package/dist/en-US-CozY33On.js +0 -13
- package/dist/en-US-DLY20x1O.js +0 -13
- package/dist/iframeWidget-D0lDhWvH.js +0 -234
- package/dist/instant-verification-UrnuHTYn.js +0 -40
- package/dist/japanSupportUtils-9uEg0pbP.js +0 -16
- package/dist/manual-verification-BO8zgAYT.js +0 -41
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocument.d.ts +0 -5
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirements.d.ts +0 -9
- package/dist/types/components/BankAccount/forms/BankDocument/BankDocumentRequirementsModal.d.ts +0 -6
- package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/BankVerificationWidget.d.ts +0 -3
- package/dist/types/components/BankAccount/forms/BankVerification/verification/widget/iframeWidget.d.ts +0 -32
- package/dist/types/components/Business/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +0 -4
- package/dist/types/components/Business/utils/useCompanySearchExperiments.d.ts +0 -5
- package/dist/types/components/Shared/devex/DebugListener/DebugExperimentsAndSettings.d.ts +0 -7
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/CompanyRegistrationNumberTypeSelector.d.ts +0 -20
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/VatNumberTypeSelector.d.ts +0 -21
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/inferVatNumberType.d.ts +0 -3
- package/dist/types/context/ExperimentContext/ExperimentsContext.d.ts +0 -2
- package/dist/types/context/ExperimentContext/ExperimentsContextProvider.d.ts +0 -8
- package/dist/types/context/ExperimentContext/useExperimentsContext.d.ts +0 -1
- package/dist/types/utils/bankVerification/dom.d.ts +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
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] = "ab442435-ec41-4648-9d4d-3ece62dd3646", e._sentryDebugIdIdentifier = "sentry-dbid-ab442435-ec41-4648-9d4d-3ece62dd3646");
|
|
6
6
|
} catch (e) {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -10,58 +10,55 @@
|
|
|
10
10
|
import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
|
|
11
11
|
import { signal } from "@preact/signals";
|
|
12
12
|
import { useQuery, useMutation, useQueryClient, skipToken } from "@tanstack/preact-query";
|
|
13
|
-
import { useState, useEffect, useRef,
|
|
14
|
-
import { b as useApiContext,
|
|
15
|
-
import { u as useTransferInstrument, m as mapTransferInstrumentToPayoutAccount } from "./mapTransferInstrumentToPayoutAccount-
|
|
16
|
-
import { L as LoaderWrapper } from "./LoaderWrapper-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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 {
|
|
24
|
-
import { C as Confirm } from "./Confirm-
|
|
25
|
-
import { c as currencyByCountry } from "./types-
|
|
26
|
-
import { i as isValidationError, p as processValidationErrors, b as isIdDocumentUploadError, c as isBankStatementUploadError, a as isMaintenanceModeError, m as mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable } from "./validationError-
|
|
13
|
+
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, aQ as Trans, b3 as EEA_Countries, ap as useDataset, O as StackLayout, aq as datasetIdentifier, b4 as isAccountIdentifierObscured, b5 as hasEmptyFields, b6 as extractFieldName, b7 as concatenateFieldNames, aS as keysOf, ak as getCapabilityProblems, w as TaskTypes, an as cloneObject, am as datasetUtilities } from "./StoreProvider-CGAl-5Sk.js";
|
|
15
|
+
import { u as useTransferInstrument, m as mapTransferInstrumentToPayoutAccount } from "./mapTransferInstrumentToPayoutAccount-ONPBT9KF.js";
|
|
16
|
+
import { L as LoaderWrapper } from "./LoaderWrapper-CgNgcjW-.js";
|
|
17
|
+
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-Crfi88kZ.js";
|
|
19
|
+
import { a as useInvalidateRootLegalEntity, u as useToastContext } from "./useToastContext-fRmLeQb3.js";
|
|
20
|
+
import { F as FeatureNames } from "./types-CTwBMnPB.js";
|
|
21
|
+
import { a as augmentWithCountryConfigs, g as getPropsFromConfigurations } from "./process-field-configurations-BWC3i2at.js";
|
|
22
|
+
import { g as getRequiredForms, a as addValidityToForms, u as useFormComposer } from "./dropinUtils-DoPR1iTm.js";
|
|
23
|
+
import { u as uppercase, p as payoutAccountFormat, m as mapExistingFile, g as getPageName, b as useScenarioConfiguration, c as useUnifyLoadingStatus } from "./mapExistingFile-BS79kq3W.js";
|
|
24
|
+
import { C as Confirm } from "./Confirm-roUo52pe.js";
|
|
25
|
+
import { c as currencyByCountry } from "./types-i_4sFTBn.js";
|
|
26
|
+
import { i as isValidationError, p as processValidationErrors, b as isIdDocumentUploadError, c as isBankStatementUploadError, a as isMaintenanceModeError, m as mapCreateOrUpdateTransferInstrumentErrorMessageToTranslatable } from "./validationError-1Dg0ubhb.js";
|
|
27
27
|
import { t as trackNavigation } from "./trackNavigation-db_h46BT.js";
|
|
28
|
-
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-
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
28
|
+
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-DXgI7aOv.js";
|
|
29
|
+
import { b as getPayoutAccountHolderName, g as getLegalEntityNameBasedOnType } from "./getName-Ca2cTXzw.js";
|
|
30
|
+
import { o as omitObscuredFieldsIfUnchanged } from "./omitObscuredFieldsIfUnchanged-DhUQJrjg.js";
|
|
31
31
|
import { Show } from "@preact/signals/utils";
|
|
32
|
-
import { s as summaryStep } from "./Summary-
|
|
32
|
+
import { s as summaryStep } from "./Summary-DKmu4xU7.js";
|
|
33
33
|
import { g as getFieldProps, a as getFormProps } from "./getProps-Cc3J2-z9.js";
|
|
34
34
|
import { c as createFormRules } from "./form-rules-DhbF2mY4.js";
|
|
35
35
|
import { s as summaryItem } from "./summaryItem-CAQCQSkt.js";
|
|
36
36
|
import cx from "classnames";
|
|
37
|
-
import { memo, useRef as useRef$1, useState as useState$1, useMemo
|
|
38
|
-
import { F as Field } from "./Field-
|
|
39
|
-
import {
|
|
40
|
-
import { T as TextArea } from "./TextArea-
|
|
41
|
-
import { u as
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import { c as createFormUtils, m as mergeFieldMetadataIntoProps } from "./formUtils-OvyHeoEE.js";
|
|
37
|
+
import { memo, useRef as useRef$1, useState as useState$1, useMemo, useEffect as useEffect$1, lazy } from "preact/compat";
|
|
38
|
+
import { F as Field } from "./Field-BDI27kIy.js";
|
|
39
|
+
import { M as Modal } from "./Modal-727fSuFr.js";
|
|
40
|
+
import { T as TextArea } from "./TextArea-BGhv4y1a.js";
|
|
41
|
+
import { u as useForm } from "./useForm-OoKBR6oR.js";
|
|
42
|
+
import { E as EndStateLayout } from "./EndStateLayout-5kx0pljK.js";
|
|
43
|
+
import { E as ErrorPanel } from "./ErrorPanel-Cn8gzNGG.js";
|
|
44
|
+
import { c as createFormUtils, m as mergeFieldMetadataIntoProps } from "./formUtils-zdJ_jyqE.js";
|
|
46
45
|
import { b as bankStatementDescriptionPattern } from "./basePatterns-BwdnMQxI.js";
|
|
47
|
-
import { M as Modal } from "./Modal-CBxIPgQb.js";
|
|
48
|
-
import { E as EndStateLayout } from "./EndStateLayout-DyV9bKDz.js";
|
|
49
46
|
import { createContext } from "preact";
|
|
50
|
-
import { A as ActionBar } from "./ActionBar-Cs-ZFNhk.js";
|
|
51
47
|
import OpenBankingSDK from "@adyen/openbankingsdk";
|
|
52
|
-
import {
|
|
48
|
+
import { S as Select } from "./Select-Bt5Y91sI.js";
|
|
49
|
+
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-B9djDROe.js";
|
|
53
50
|
import { r as resolveFieldMetadata } from "./fieldConfigurations-BUT9DTUH.js";
|
|
54
|
-
import { v as validatePatternOnBlur } from "./patternValidators-
|
|
55
|
-
import { a as isNotEmptyValidator } from "./commonValidators-
|
|
56
|
-
import { I as InputText } from "./InputText-
|
|
51
|
+
import { v as validatePatternOnBlur } from "./patternValidators-Cem-Icxv.js";
|
|
52
|
+
import { a as isNotEmptyValidator } from "./commonValidators-nusLcRK6.js";
|
|
53
|
+
import { I as InputText } from "./InputText-DFjKyN6O.js";
|
|
57
54
|
import { C as Currencies } from "./currency-CrdnaaDu.js";
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
55
|
+
import { u as useUnincorporatedPartnershipMembers } from "./useUnincorporatedPartnershipMembers-DiyYkTfs.js";
|
|
56
|
+
import { I as Image } from "./unincorporated-partnership-R_fKlee-.js";
|
|
57
|
+
import { C as CountryField } from "./CountryField-Cxih2YUu.js";
|
|
60
58
|
import { C as Card } from "./Card-OQuFzmxm.js";
|
|
61
|
-
import { L as Link } from "./Link-
|
|
62
|
-
import { R as RadioGroupCard } from "./RadioGroupCard-fFofJm6m.js";
|
|
59
|
+
import { L as Link } from "./Link-C30mEtLP.js";
|
|
63
60
|
import { T as Tag } from "./Tag-DdkVScyr.js";
|
|
64
|
-
import { C as ContextGuidance } from "./ContextGuidance-
|
|
61
|
+
import { C as ContextGuidance } from "./ContextGuidance-8vbKs48u.js";
|
|
65
62
|
const getCheck = async (legalEntityId, baseUrl, data) => {
|
|
66
63
|
return httpPost(
|
|
67
64
|
{
|
|
@@ -354,14 +351,14 @@ const mapPayoutAccountSchemaToApiBankAccount = (payoutAccount, bankCountry, pref
|
|
|
354
351
|
countryCode: bankCountry,
|
|
355
352
|
bankName: payoutAccount.bankName
|
|
356
353
|
});
|
|
357
|
-
const validateDocument = async (context,
|
|
354
|
+
const validateDocument = async (context, document) => {
|
|
358
355
|
const { baseUrl, rootLegalEntityId } = context;
|
|
359
356
|
return httpPost(
|
|
360
357
|
{
|
|
361
358
|
baseUrl,
|
|
362
359
|
path: `legalEntities/${rootLegalEntityId}/genai/classify`
|
|
363
360
|
},
|
|
364
|
-
|
|
361
|
+
document
|
|
365
362
|
);
|
|
366
363
|
};
|
|
367
364
|
const useValidateDocument = (options) => {
|
|
@@ -507,478 +504,6 @@ function FilePicker({
|
|
|
507
504
|
hasRequiredError && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: t(($) => $["fieldIsRequired"]) })
|
|
508
505
|
] });
|
|
509
506
|
}
|
|
510
|
-
const bankDocument = "adyen-kyc-bank-document";
|
|
511
|
-
const bankDocumentDocumentUpload = "adyen-kyc-bank-document-document-upload";
|
|
512
|
-
const bankDocumentDocumentDescription = "adyen-kyc-bank-document-document-description";
|
|
513
|
-
const styles$5 = {
|
|
514
|
-
bankDocument,
|
|
515
|
-
bankDocumentDocumentUpload,
|
|
516
|
-
bankDocumentDocumentDescription
|
|
517
|
-
};
|
|
518
|
-
const documentRequirements$1 = "adyen-kyc-document-requirements";
|
|
519
|
-
const documentRequirementsSubtitle = "adyen-kyc-document-requirements-subtitle";
|
|
520
|
-
const styles$4 = {
|
|
521
|
-
documentRequirements: documentRequirements$1,
|
|
522
|
-
documentRequirementsSubtitle
|
|
523
|
-
};
|
|
524
|
-
const BankDocumentTypes = {
|
|
525
|
-
BANK_STATEMENT: "bankStatement",
|
|
526
|
-
DEPOSIT_SLIP: "depositSlip",
|
|
527
|
-
SCREENSHOT_OF_BANK: "screenshotOfOnlineBankingEnviroment",
|
|
528
|
-
A_LETTER_FROM_YOUR_BANK: "aLetterFromYourBank",
|
|
529
|
-
CHECK: "check"
|
|
530
|
-
};
|
|
531
|
-
const bankDocumentOptions = [
|
|
532
|
-
{ id: BankDocumentTypes.BANK_STATEMENT, name: "bankStatementDocument" },
|
|
533
|
-
{ id: BankDocumentTypes.DEPOSIT_SLIP, name: "depositSlip" },
|
|
534
|
-
{ id: BankDocumentTypes.SCREENSHOT_OF_BANK, name: "screenshotOfOnlineBankingEnviroment" },
|
|
535
|
-
{ id: BankDocumentTypes.A_LETTER_FROM_YOUR_BANK, name: "aLetterFromYourBank" },
|
|
536
|
-
{ id: BankDocumentTypes.CHECK, name: "check" }
|
|
537
|
-
];
|
|
538
|
-
const BankDocumentRequirement = {
|
|
539
|
-
ACCOUNT_NAME_INDIVIDUAL: "bankAccountNameIndividual",
|
|
540
|
-
ACCOUNT_NAME_ORGANIZATION: "bankAccountNameOrganization",
|
|
541
|
-
ACCOUNT_NAME_WITH_SOLE_PROP: "bankAccountNameWithSoleProprietor",
|
|
542
|
-
ACCOUNT_NAME_WITH_TRUST: "bankAccountNameWithTrust",
|
|
543
|
-
ACCOUNT_NAME_WITH_UNINCORPORATED_PARTNERSHIP: "accountMustBeInTheNameOfUnincorporatedPartnership",
|
|
544
|
-
ACCOUNT_NUMBER_OR_IBAN: "accountNumberOrIbanVisible",
|
|
545
|
-
ACCOUNT_NUMBER: "accountNumberVisible",
|
|
546
|
-
ACCOUNT_NUMBER_FULL_OR_PARTIAL: "accountNumberFullOrPartialVisible",
|
|
547
|
-
DATE_ON_DOCUMENT: "datedInTheLastXMonths",
|
|
548
|
-
COUNTRY_OF_BANK: "showsCountryOfBankAccount",
|
|
549
|
-
OFFICIAL_DOCUMENT: "hasToBeOfficialDocumentFromBank",
|
|
550
|
-
STAMP_OR_SIGNATURE: "hasBankStampOrBankSignature",
|
|
551
|
-
HIGH_RESOLUTION_CHECK: "highResolutionCheck"
|
|
552
|
-
};
|
|
553
|
-
const accountNameRequirement = {
|
|
554
|
-
[LegalEntityTypes.INDIVIDUAL]: {
|
|
555
|
-
default: BankDocumentRequirement.ACCOUNT_NAME_INDIVIDUAL
|
|
556
|
-
},
|
|
557
|
-
[LegalEntityTypes.ORGANIZATION]: {
|
|
558
|
-
default: BankDocumentRequirement.ACCOUNT_NAME_ORGANIZATION
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
const accountNameRequirementWithLegalArrangement = {
|
|
562
|
-
[LegalEntityTypes.INDIVIDUAL]: {
|
|
563
|
-
[LegalEntityTypes.SOLE_PROPRIETORSHIP]: {
|
|
564
|
-
default: BankDocumentRequirement.ACCOUNT_NAME_WITH_SOLE_PROP
|
|
565
|
-
},
|
|
566
|
-
[LegalEntityTypes.TRUST]: {
|
|
567
|
-
[CountryCodes.UnitedStates]: "bankAccountNameWithTrust_US",
|
|
568
|
-
default: BankDocumentRequirement.ACCOUNT_NAME_WITH_TRUST
|
|
569
|
-
},
|
|
570
|
-
[LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: {
|
|
571
|
-
default: BankDocumentRequirement.ACCOUNT_NAME_WITH_UNINCORPORATED_PARTNERSHIP
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
[LegalEntityTypes.ORGANIZATION]: {
|
|
575
|
-
[LegalEntityTypes.TRUST]: {
|
|
576
|
-
[CountryCodes.UnitedStates]: "bankAccountNameWithTrust_US",
|
|
577
|
-
default: BankDocumentRequirement.ACCOUNT_NAME_WITH_TRUST
|
|
578
|
-
},
|
|
579
|
-
[LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]: {
|
|
580
|
-
default: BankDocumentRequirement.ACCOUNT_NAME_WITH_UNINCORPORATED_PARTNERSHIP
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
};
|
|
584
|
-
const applyNamedModifiers = (country, documentModifiers) => {
|
|
585
|
-
if (!documentModifiers.associatedEntityType || !documentModifiers.associatedEntityLegalName) {
|
|
586
|
-
switch (documentModifiers.rootEntityType) {
|
|
587
|
-
case LegalEntityTypes.INDIVIDUAL:
|
|
588
|
-
return {
|
|
589
|
-
key: accountNameRequirement[LegalEntityTypes.INDIVIDUAL].default,
|
|
590
|
-
options: { values: { individualLegalName: documentModifiers.rootEntityLegalName } }
|
|
591
|
-
};
|
|
592
|
-
case LegalEntityTypes.ORGANIZATION:
|
|
593
|
-
default:
|
|
594
|
-
return {
|
|
595
|
-
key: accountNameRequirement[LegalEntityTypes.ORGANIZATION].default,
|
|
596
|
-
options: { values: { companyLegalName: documentModifiers.rootEntityLegalName } }
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
switch (documentModifiers.rootEntityType) {
|
|
601
|
-
case LegalEntityTypes.INDIVIDUAL:
|
|
602
|
-
switch (documentModifiers.associatedEntityType) {
|
|
603
|
-
case LegalEntityTypes.TRUST:
|
|
604
|
-
return {
|
|
605
|
-
key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.TRUST]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.TRUST].default,
|
|
606
|
-
options: {
|
|
607
|
-
values: {
|
|
608
|
-
trusteeName: documentModifiers.rootEntityLegalName,
|
|
609
|
-
trustLegalName: documentModifiers.associatedEntityLegalName,
|
|
610
|
-
trustTradingName: documentModifiers.associatedEntityTradingName ?? documentModifiers.associatedEntityLegalName
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
|
|
615
|
-
return {
|
|
616
|
-
key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP].default,
|
|
617
|
-
options: {
|
|
618
|
-
values: {
|
|
619
|
-
partnerNames: documentModifiers.unincorporatedPartnershipMembers || "",
|
|
620
|
-
partnershipName: documentModifiers.associatedEntityLegalName
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
case LegalEntityTypes.SOLE_PROPRIETORSHIP:
|
|
625
|
-
default:
|
|
626
|
-
return {
|
|
627
|
-
key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.INDIVIDUAL][LegalEntityTypes.SOLE_PROPRIETORSHIP].default,
|
|
628
|
-
options: {
|
|
629
|
-
values: {
|
|
630
|
-
individualLegalName: documentModifiers.rootEntityLegalName,
|
|
631
|
-
soleProprietorshipName: documentModifiers.associatedEntityLegalName
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
case LegalEntityTypes.ORGANIZATION:
|
|
637
|
-
default:
|
|
638
|
-
switch (documentModifiers.associatedEntityType) {
|
|
639
|
-
case LegalEntityTypes.TRUST:
|
|
640
|
-
return {
|
|
641
|
-
key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.TRUST]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.TRUST].default,
|
|
642
|
-
options: {
|
|
643
|
-
values: {
|
|
644
|
-
trusteeName: documentModifiers.rootEntityLegalName,
|
|
645
|
-
trustLegalName: documentModifiers.associatedEntityLegalName,
|
|
646
|
-
trustTradingName: documentModifiers.associatedEntityTradingName ?? documentModifiers.associatedEntityLegalName
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
};
|
|
650
|
-
case LegalEntityTypes.UNINCORPORATED_PARTNERSHIP:
|
|
651
|
-
return {
|
|
652
|
-
key: accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP]?.[country] ?? accountNameRequirementWithLegalArrangement[LegalEntityTypes.ORGANIZATION][LegalEntityTypes.UNINCORPORATED_PARTNERSHIP].default,
|
|
653
|
-
options: {
|
|
654
|
-
values: {
|
|
655
|
-
partnerNames: documentModifiers.unincorporatedPartnershipMembers || "",
|
|
656
|
-
partnershipName: documentModifiers.associatedEntityLegalName
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
};
|
|
660
|
-
default:
|
|
661
|
-
return { key: accountNameRequirement[LegalEntityTypes.ORGANIZATION].default };
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
};
|
|
665
|
-
const getBankDocumentRequirements = (country, documentType, documentModifiers) => {
|
|
666
|
-
const isBasedInUS = country === "US";
|
|
667
|
-
const baseRequirements = isBasedInUS ? [{ key: BankDocumentRequirement.OFFICIAL_DOCUMENT }] : [
|
|
668
|
-
{ key: BankDocumentRequirement.OFFICIAL_DOCUMENT },
|
|
669
|
-
{ key: BankDocumentRequirement.COUNTRY_OF_BANK }
|
|
670
|
-
];
|
|
671
|
-
const accountNumberRequirement = isBasedInUS ? documentType === BankDocumentTypes.CHECK || documentType === BankDocumentTypes.DEPOSIT_SLIP ? [{ key: BankDocumentRequirement.ACCOUNT_NUMBER }] : [{ key: BankDocumentRequirement.ACCOUNT_NUMBER_FULL_OR_PARTIAL }] : [{ key: BankDocumentRequirement.ACCOUNT_NUMBER_OR_IBAN }];
|
|
672
|
-
const requireLast12Months = isBasedInUS ? documentType === BankDocumentTypes.A_LETTER_FROM_YOUR_BANK || documentType === BankDocumentTypes.BANK_STATEMENT : documentType !== BankDocumentTypes.SCREENSHOT_OF_BANK;
|
|
673
|
-
const requireStampOrSignature = !isBasedInUS && (documentType === BankDocumentTypes.DEPOSIT_SLIP || documentType === BankDocumentTypes.A_LETTER_FROM_YOUR_BANK);
|
|
674
|
-
const requirements = [
|
|
675
|
-
applyNamedModifiers(country, documentModifiers),
|
|
676
|
-
...accountNumberRequirement,
|
|
677
|
-
...baseRequirements
|
|
678
|
-
];
|
|
679
|
-
if (requireLast12Months) {
|
|
680
|
-
requirements.push({
|
|
681
|
-
key: BankDocumentRequirement.DATE_ON_DOCUMENT,
|
|
682
|
-
options: { values: { number: 12 } }
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
if (requireStampOrSignature) {
|
|
686
|
-
requirements.push({ key: BankDocumentRequirement.STAMP_OR_SIGNATURE });
|
|
687
|
-
}
|
|
688
|
-
if (isBasedInUS && documentType === BankDocumentTypes.CHECK) {
|
|
689
|
-
requirements.push({ key: BankDocumentRequirement.HIGH_RESOLUTION_CHECK });
|
|
690
|
-
}
|
|
691
|
-
return requirements;
|
|
692
|
-
};
|
|
693
|
-
const BankDocumentRequirements = ({
|
|
694
|
-
country,
|
|
695
|
-
documentType,
|
|
696
|
-
documentModifiers
|
|
697
|
-
}) => {
|
|
698
|
-
const { t } = useTranslation("banking");
|
|
699
|
-
const { t: commonT } = useTranslation("common");
|
|
700
|
-
const documentRequirements2 = getBankDocumentRequirements(
|
|
701
|
-
country,
|
|
702
|
-
documentType,
|
|
703
|
-
documentModifiers
|
|
704
|
-
);
|
|
705
|
-
return /* @__PURE__ */ jsxs("div", { className: styles$4.documentRequirements, children: [
|
|
706
|
-
/* @__PURE__ */ jsx("strong", { className: styles$4.documentRequirementsSubtitle, children: commonT(($) => $["documentRequirements"]) }),
|
|
707
|
-
/* @__PURE__ */ jsx("ul", { children: documentRequirements2.map(({ key, options }, i) => /* @__PURE__ */ jsx("li", { "data-testid": key, children: t(($) => $[key], options?.values) }, i)) })
|
|
708
|
-
] });
|
|
709
|
-
};
|
|
710
|
-
const bankDocumentValidationRules = {
|
|
711
|
-
description: {
|
|
712
|
-
modes: ["blur"],
|
|
713
|
-
validate: (description2) => description2 ? bankStatementDescriptionPattern.test(description2) : true,
|
|
714
|
-
errorMessage: "invalidFormatBankStatementDescription"
|
|
715
|
-
}
|
|
716
|
-
};
|
|
717
|
-
const getValidationIssuesKeys = (validationResponse) => {
|
|
718
|
-
const issues2 = [];
|
|
719
|
-
const { blurryOrLowQuality, documentType } = validationResponse;
|
|
720
|
-
if (blurryOrLowQuality) {
|
|
721
|
-
issues2.push("documentIsntReadable");
|
|
722
|
-
}
|
|
723
|
-
if (documentType === "other" || documentType !== "bankDocument") {
|
|
724
|
-
issues2.push("documentIsNotBankDocument");
|
|
725
|
-
}
|
|
726
|
-
if (!documentType || documentType === "other") {
|
|
727
|
-
issues2.push("documentNameMissing");
|
|
728
|
-
}
|
|
729
|
-
return issues2;
|
|
730
|
-
};
|
|
731
|
-
const CHARACTERS_LIMIT$1 = 200;
|
|
732
|
-
const bankDocumentFields = [
|
|
733
|
-
"documentType",
|
|
734
|
-
"bankStatementDocument",
|
|
735
|
-
"description"
|
|
736
|
-
];
|
|
737
|
-
function BankDocument(props) {
|
|
738
|
-
const {
|
|
739
|
-
legalEntity,
|
|
740
|
-
country,
|
|
741
|
-
optionalFields,
|
|
742
|
-
validators,
|
|
743
|
-
data: bankData,
|
|
744
|
-
id,
|
|
745
|
-
formIsActive,
|
|
746
|
-
fieldValidationErrors,
|
|
747
|
-
shouldValidate
|
|
748
|
-
} = props;
|
|
749
|
-
const { data: associatedLegalArrangement } = useAssociatedLegalEntity(legalEntity, [
|
|
750
|
-
LegalEntityTypes.SOLE_PROPRIETORSHIP,
|
|
751
|
-
LegalEntityTypes.TRUST,
|
|
752
|
-
LegalEntityTypes.UNINCORPORATED_PARTNERSHIP
|
|
753
|
-
]);
|
|
754
|
-
const { t } = useTranslation("banking");
|
|
755
|
-
const { t: commonT } = useTranslation("common");
|
|
756
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
757
|
-
const userEvents = useAnalyticsContext();
|
|
758
|
-
const isBankDocumentClassificationShadowModeEnabled = isExperimentEnabled(
|
|
759
|
-
ExperimentNames.EnableBankDocumentClassificationShadowMode
|
|
760
|
-
);
|
|
761
|
-
const stateRef = useRef({ setState: null });
|
|
762
|
-
const isBankStatementOptional = optionalFields?.includes("bankStatementDocument") ?? false;
|
|
763
|
-
const heading = t(
|
|
764
|
-
($) => $[isBankStatementOptional ? "uploadABankDocumentOptional" : "uploadABankDocument"]
|
|
765
|
-
);
|
|
766
|
-
const description2 = t(
|
|
767
|
-
($) => $[legalEntity.type === "individual" ? "toHelpVerifyYourBankDetailsIndividual" : "toHelpVerifyYourBankDetailsBusiness"]
|
|
768
|
-
);
|
|
769
|
-
const formUtils = createFormUtils(props, commonT);
|
|
770
|
-
const bankStatementValidationOptions = useMemo(
|
|
771
|
-
() => ({
|
|
772
|
-
...defaultFileValidationOptions,
|
|
773
|
-
isOptional: isBankStatementOptional
|
|
774
|
-
}),
|
|
775
|
-
[isBankStatementOptional]
|
|
776
|
-
);
|
|
777
|
-
const rules2 = useMemo(
|
|
778
|
-
() => ({
|
|
779
|
-
...validators || bankDocumentValidationRules,
|
|
780
|
-
bankStatementDocument: fileValidationRules(bankStatementValidationOptions)
|
|
781
|
-
}),
|
|
782
|
-
[bankStatementValidationOptions, validators]
|
|
783
|
-
);
|
|
784
|
-
const { handleChangeFor, data, setData, valid, fieldProblems, errors, triggerValidation } = useForm({
|
|
785
|
-
...props,
|
|
786
|
-
schema: bankDocumentFields,
|
|
787
|
-
defaultData: bankData,
|
|
788
|
-
rules: rules2,
|
|
789
|
-
fieldProblems: fieldValidationErrors,
|
|
790
|
-
shouldValidate
|
|
791
|
-
});
|
|
792
|
-
useEffect(() => {
|
|
793
|
-
if (formIsActive) {
|
|
794
|
-
triggerValidation();
|
|
795
|
-
}
|
|
796
|
-
}, [formIsActive, triggerValidation]);
|
|
797
|
-
const alreadyUploadedDocuments = useMemo(
|
|
798
|
-
() => bankData?.bankStatementDocument ?? [],
|
|
799
|
-
[bankData?.bankStatementDocument]
|
|
800
|
-
);
|
|
801
|
-
const hasAlreadyUploadedDocuments = alreadyUploadedDocuments.length > 0;
|
|
802
|
-
const usingExistingUploadedDocuments = data.bankStatementDocument && doArraysMatch(alreadyUploadedDocuments, data.bankStatementDocument);
|
|
803
|
-
useEffect(() => {
|
|
804
|
-
if (hasAlreadyUploadedDocuments) {
|
|
805
|
-
setData("bankStatementDocument", alreadyUploadedDocuments);
|
|
806
|
-
if (bankData?.description) setData("description", bankData.description);
|
|
807
|
-
triggerValidation();
|
|
808
|
-
}
|
|
809
|
-
}, [
|
|
810
|
-
alreadyUploadedDocuments,
|
|
811
|
-
hasAlreadyUploadedDocuments,
|
|
812
|
-
bankData?.description,
|
|
813
|
-
setData,
|
|
814
|
-
triggerValidation
|
|
815
|
-
]);
|
|
816
|
-
useEffect(() => {
|
|
817
|
-
stateRef.current?.setState?.({
|
|
818
|
-
type: "addToState",
|
|
819
|
-
value: {
|
|
820
|
-
data,
|
|
821
|
-
valid,
|
|
822
|
-
errors,
|
|
823
|
-
fieldProblems,
|
|
824
|
-
dataStoreId: id,
|
|
825
|
-
schema: bankDocumentFields
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
}, [data, valid, errors, fieldProblems, id]);
|
|
829
|
-
const getBankDocumentOptions = () => bankDocumentOptions.map(({ id: id2, name }) => ({ id: id2, name: t(($) => $[name]) }));
|
|
830
|
-
const unincorporatedPartnershipMembers = useUnincorporatedPartnershipMembers();
|
|
831
|
-
const documentsModifiers = useMemo(
|
|
832
|
-
() => ({
|
|
833
|
-
rootEntityType: legalEntity.type,
|
|
834
|
-
rootEntityLegalName: getLegalEntityNameBasedOnType(legalEntity),
|
|
835
|
-
associatedEntityType: associatedLegalArrangement?.type,
|
|
836
|
-
associatedEntityLegalName: associatedLegalArrangement?.[associatedLegalArrangement?.type]?.name,
|
|
837
|
-
associatedEntityTradingName: associatedLegalArrangement?.[associatedLegalArrangement?.type]?.doingBusinessAs,
|
|
838
|
-
unincorporatedPartnershipMembers: unincorporatedPartnershipMembers?.map((member) => member?.name)?.join(", ")
|
|
839
|
-
}),
|
|
840
|
-
[legalEntity, associatedLegalArrangement, unincorporatedPartnershipMembers]
|
|
841
|
-
);
|
|
842
|
-
const validateDocumentMutation = useValidateDocument({
|
|
843
|
-
onSuccess: (response) => {
|
|
844
|
-
userEvents.addEvent("Success", {
|
|
845
|
-
actionType: "upload",
|
|
846
|
-
actionLevel: "journey",
|
|
847
|
-
label: "bankDocumentClassificationShadowMode",
|
|
848
|
-
additionalData: {
|
|
849
|
-
documentType: response?.documentType,
|
|
850
|
-
subDocumentType: response?.subDocumentType,
|
|
851
|
-
blurryOrLowQuality: response?.blurryOrLowQuality
|
|
852
|
-
}
|
|
853
|
-
});
|
|
854
|
-
},
|
|
855
|
-
onError: () => {
|
|
856
|
-
userEvents.addEvent("Encountered error", {
|
|
857
|
-
actionType: "upload",
|
|
858
|
-
actionLevel: "journey",
|
|
859
|
-
label: "bankDocumentClassificationShadowMode"
|
|
860
|
-
});
|
|
861
|
-
}
|
|
862
|
-
});
|
|
863
|
-
const handleDocumentUpload = async (files) => {
|
|
864
|
-
handleChangeFor("bankStatementDocument")(files);
|
|
865
|
-
const allowedCountries = ["US", "FR", "GB", "AU"];
|
|
866
|
-
const shouldClassifyDocument = files?.length > 0 && allowedCountries.includes(country || "") && isBankDocumentClassificationShadowModeEnabled;
|
|
867
|
-
if (shouldClassifyDocument) {
|
|
868
|
-
const file = files[0];
|
|
869
|
-
if (file && file instanceof File) {
|
|
870
|
-
try {
|
|
871
|
-
const base64Content = await fileToBase64(file);
|
|
872
|
-
const document2 = {
|
|
873
|
-
documentType: "bankStatement",
|
|
874
|
-
fileName: file.name,
|
|
875
|
-
sessionId: legalEntity.id,
|
|
876
|
-
attachments: [
|
|
877
|
-
{
|
|
878
|
-
content: base64Content,
|
|
879
|
-
pageName: file.name
|
|
880
|
-
}
|
|
881
|
-
]
|
|
882
|
-
};
|
|
883
|
-
validateDocumentMutation.mutate(document2);
|
|
884
|
-
} catch {
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
};
|
|
890
|
-
return /* @__PURE__ */ jsxs("form", { className: styles$5.bankDocument, children: [
|
|
891
|
-
/* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
|
|
892
|
-
heading && /* @__PURE__ */ jsx(Header, { title: heading, description: description2 }),
|
|
893
|
-
/* @__PURE__ */ jsx(
|
|
894
|
-
ErrorPanel,
|
|
895
|
-
{
|
|
896
|
-
verificationErrors: props?.formVerificationErrors,
|
|
897
|
-
validationErrors: props?.fieldValidationErrors,
|
|
898
|
-
formUtils,
|
|
899
|
-
id: "ariaErrorField"
|
|
900
|
-
}
|
|
901
|
-
),
|
|
902
|
-
formUtils.isVisibleField("bankStatementDocument") && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
903
|
-
!usingExistingUploadedDocuments && /* @__PURE__ */ jsx(
|
|
904
|
-
Field,
|
|
905
|
-
{
|
|
906
|
-
name: "documentType",
|
|
907
|
-
label: formUtils.getLabel("bankStatementDocument", "selectDocumentType"),
|
|
908
|
-
className: "adyen-kyc-bank-document__document-type",
|
|
909
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
910
|
-
Select,
|
|
911
|
-
{
|
|
912
|
-
...childProps,
|
|
913
|
-
onChange: handleChangeFor("documentType"),
|
|
914
|
-
name: "documentType",
|
|
915
|
-
placeholder: commonT(($) => $["selectDocument"]),
|
|
916
|
-
isInvalid: false,
|
|
917
|
-
items: getBankDocumentOptions(),
|
|
918
|
-
selected: data.documentType
|
|
919
|
-
}
|
|
920
|
-
)
|
|
921
|
-
}
|
|
922
|
-
),
|
|
923
|
-
data.documentType ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
924
|
-
country ? /* @__PURE__ */ jsx(
|
|
925
|
-
BankDocumentRequirements,
|
|
926
|
-
{
|
|
927
|
-
country,
|
|
928
|
-
documentType: data.documentType,
|
|
929
|
-
documentModifiers: documentsModifiers
|
|
930
|
-
}
|
|
931
|
-
) : void 0,
|
|
932
|
-
/* @__PURE__ */ jsx(DocumentGuidance, { type: "bankStatement", className: "adyen-kyc-u-margin-y-24" })
|
|
933
|
-
] }) : null,
|
|
934
|
-
data.documentType || usingExistingUploadedDocuments ? /* @__PURE__ */ jsx(
|
|
935
|
-
Field,
|
|
936
|
-
{
|
|
937
|
-
className: cx(styles$5.bankDocumentDocumentUpload, "adyen-kyc-upload-field"),
|
|
938
|
-
name: "bankStatementDocument",
|
|
939
|
-
isValid: valid.bankStatementDocument,
|
|
940
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
941
|
-
FilePicker,
|
|
942
|
-
{
|
|
943
|
-
...childProps,
|
|
944
|
-
name: "bankStatementDocument",
|
|
945
|
-
files: data.bankStatementDocument ?? [],
|
|
946
|
-
setFiles: handleDocumentUpload,
|
|
947
|
-
isValid: valid.bankStatementDocument ?? isBankStatementOptional,
|
|
948
|
-
errorMessage: errors.bankStatementDocument?.errorMessage,
|
|
949
|
-
...bankStatementValidationOptions
|
|
950
|
-
}
|
|
951
|
-
)
|
|
952
|
-
}
|
|
953
|
-
) : null
|
|
954
|
-
] }),
|
|
955
|
-
data.documentType || usingExistingUploadedDocuments ? /* @__PURE__ */ jsx(
|
|
956
|
-
Field,
|
|
957
|
-
{
|
|
958
|
-
className: cx(styles$5.bankDocumentDocumentDescription),
|
|
959
|
-
name: "description",
|
|
960
|
-
label: formUtils.getLabel("bankDocumentFileDescription"),
|
|
961
|
-
errorMessage: formUtils.getErrorMessage("description", errors, fieldProblems),
|
|
962
|
-
isValid: valid.description,
|
|
963
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
964
|
-
TextArea,
|
|
965
|
-
{
|
|
966
|
-
...childProps,
|
|
967
|
-
name: "description",
|
|
968
|
-
value: data.description,
|
|
969
|
-
maxLength: CHARACTERS_LIMIT$1,
|
|
970
|
-
onInput: handleChangeFor("description"),
|
|
971
|
-
"aria-invalid": !valid.description
|
|
972
|
-
}
|
|
973
|
-
)
|
|
974
|
-
}
|
|
975
|
-
) : null
|
|
976
|
-
] });
|
|
977
|
-
}
|
|
978
|
-
const MemoizedBankDocument = memo(
|
|
979
|
-
BankDocument,
|
|
980
|
-
(prevProps, nextProps) => objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate && prevProps.formIsActive === nextProps.formIsActive
|
|
981
|
-
);
|
|
982
507
|
const bankDocumentClassification = "adyen-kyc-bank-document-classification";
|
|
983
508
|
const requirementsList = "adyen-kyc-requirements-list";
|
|
984
509
|
const filePickerDisabled = "adyen-kyc-file-picker-disabled";
|
|
@@ -1005,64 +530,27 @@ const styles$3 = {
|
|
|
1005
530
|
issues,
|
|
1006
531
|
confirmationModal
|
|
1007
532
|
};
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
] });
|
|
1014
|
-
}
|
|
1015
|
-
const commonRequirementsKeys = [
|
|
1016
|
-
"bankAccountInYourName",
|
|
1017
|
-
"includesFullOrPartialAccountNumber",
|
|
1018
|
-
"includesBankLogoOrName"
|
|
1019
|
-
];
|
|
1020
|
-
const documentRequirements = [
|
|
1021
|
-
{
|
|
1022
|
-
titleKey: "bankStatements",
|
|
1023
|
-
additionalKeys: ["datedInLast12Months"]
|
|
1024
|
-
},
|
|
1025
|
-
{
|
|
1026
|
-
titleKey: "depositSlips"
|
|
1027
|
-
},
|
|
1028
|
-
{
|
|
1029
|
-
titleKey: "onlineBankingScreenshots"
|
|
1030
|
-
},
|
|
1031
|
-
{
|
|
1032
|
-
titleKey: "lettersFromBank",
|
|
1033
|
-
additionalKeys: ["datedInLast12Months"]
|
|
1034
|
-
},
|
|
1035
|
-
{
|
|
1036
|
-
titleKey: "checks",
|
|
1037
|
-
additionalKeys: ["highResolutionImageFullCheck"]
|
|
533
|
+
const bankDocumentValidationRules = {
|
|
534
|
+
description: {
|
|
535
|
+
modes: ["blur"],
|
|
536
|
+
validate: (description2) => description2 ? bankStatementDescriptionPattern.test(description2) : true,
|
|
537
|
+
errorMessage: "invalidFormatBankStatementDescription"
|
|
1038
538
|
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body", children: t(($) => $["bankDocumentRequirementsIntro"]) })
|
|
1055
|
-
] }),
|
|
1056
|
-
documentRequirements.map(({ titleKey, additionalKeys }) => /* @__PURE__ */ jsx(
|
|
1057
|
-
RequirementsSection,
|
|
1058
|
-
{
|
|
1059
|
-
titleKey,
|
|
1060
|
-
requirementKeys: commonRequirementsKeys.concat(additionalKeys || [])
|
|
1061
|
-
},
|
|
1062
|
-
titleKey
|
|
1063
|
-
))
|
|
1064
|
-
] }) });
|
|
1065
|
-
}
|
|
539
|
+
};
|
|
540
|
+
const getValidationIssuesKeys = (validationResponse) => {
|
|
541
|
+
const issues2 = [];
|
|
542
|
+
const { blurryOrLowQuality, documentType } = validationResponse;
|
|
543
|
+
if (blurryOrLowQuality) {
|
|
544
|
+
issues2.push("documentIsntReadable");
|
|
545
|
+
}
|
|
546
|
+
if (documentType === "other" || documentType !== "bankDocument") {
|
|
547
|
+
issues2.push("documentIsNotBankDocument");
|
|
548
|
+
}
|
|
549
|
+
if (!documentType || documentType === "other") {
|
|
550
|
+
issues2.push("documentNameMissing");
|
|
551
|
+
}
|
|
552
|
+
return issues2;
|
|
553
|
+
};
|
|
1066
554
|
const CHARACTERS_LIMIT = 200;
|
|
1067
555
|
const bankDocumentClassificationFields = [
|
|
1068
556
|
"bankStatementDocument",
|
|
@@ -1078,14 +566,14 @@ function BankDocumentClassification(props) {
|
|
|
1078
566
|
formIsActive,
|
|
1079
567
|
fieldValidationErrors,
|
|
1080
568
|
formVerificationErrors,
|
|
1081
|
-
shouldValidate
|
|
569
|
+
shouldValidate,
|
|
570
|
+
country
|
|
1082
571
|
} = props;
|
|
1083
572
|
const { t } = useTranslation("banking");
|
|
1084
573
|
const { t: commonT } = useTranslation("common");
|
|
1085
574
|
const stateRef = useRef$1({ setState: null });
|
|
1086
575
|
const [showReviewModal, setShowReviewModal] = useState$1(false);
|
|
1087
576
|
const [showConfirmationModal, setShowConfirmationModal] = useState$1(false);
|
|
1088
|
-
const [showRequirementsModal, setShowRequirementsModal] = useState$1(false);
|
|
1089
577
|
const [validationResponse, setValidationResponse] = useState$1(
|
|
1090
578
|
null
|
|
1091
579
|
);
|
|
@@ -1095,14 +583,19 @@ function BankDocumentClassification(props) {
|
|
|
1095
583
|
const userEvents = useAnalyticsContext();
|
|
1096
584
|
const isBankStatementOptional = optionalFields?.includes("bankStatementDocument") ?? false;
|
|
1097
585
|
const formUtils = createFormUtils(props, commonT);
|
|
1098
|
-
const
|
|
586
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
587
|
+
const enableBankDocumentClassification = isFeatureEnabled(
|
|
588
|
+
FeatureNames.EnableBankDocumentClassification
|
|
589
|
+
);
|
|
590
|
+
const isShadowMode = isFeatureEnabled(FeatureNames.EnableBankDocumentClassificationShadowMode);
|
|
591
|
+
const bankStatementValidationOptions = useMemo(
|
|
1099
592
|
() => ({
|
|
1100
593
|
...defaultFileValidationOptions,
|
|
1101
594
|
isOptional: isBankStatementOptional
|
|
1102
595
|
}),
|
|
1103
596
|
[isBankStatementOptional]
|
|
1104
597
|
);
|
|
1105
|
-
const rules2 = useMemo
|
|
598
|
+
const rules2 = useMemo(
|
|
1106
599
|
() => ({
|
|
1107
600
|
...validators || bankDocumentValidationRules,
|
|
1108
601
|
bankStatementDocument: fileValidationRules(bankStatementValidationOptions)
|
|
@@ -1119,8 +612,19 @@ function BankDocumentClassification(props) {
|
|
|
1119
612
|
});
|
|
1120
613
|
const validateDocumentMutation = useValidateDocument({
|
|
1121
614
|
onSuccess: (response) => {
|
|
615
|
+
userEvents.addEvent("Success", {
|
|
616
|
+
actionType: "upload",
|
|
617
|
+
actionLevel: "journey",
|
|
618
|
+
label: isShadowMode ? "bankDocumentClassificationShadowMode" : "bankDocumentClassification",
|
|
619
|
+
additionalData: {
|
|
620
|
+
documentType: response?.documentType,
|
|
621
|
+
subDocumentType: response?.subDocumentType,
|
|
622
|
+
blurryOrLowQuality: response?.blurryOrLowQuality
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
if (isShadowMode) return;
|
|
1122
626
|
setValidationResponse(response);
|
|
1123
|
-
if (response?.blurryOrLowQuality || response?.documentType
|
|
627
|
+
if (response?.blurryOrLowQuality || response?.documentType !== "bankDocument") {
|
|
1124
628
|
userEvents.addEvent("Opened modal", {
|
|
1125
629
|
actionType: "open",
|
|
1126
630
|
actionLevel: "journey",
|
|
@@ -1129,11 +633,6 @@ function BankDocumentClassification(props) {
|
|
|
1129
633
|
setShowReviewModal(true);
|
|
1130
634
|
} else {
|
|
1131
635
|
setShowEndState(true);
|
|
1132
|
-
userEvents.addEvent("Success", {
|
|
1133
|
-
actionType: "upload",
|
|
1134
|
-
actionLevel: "journey",
|
|
1135
|
-
label: "bankDocumentClassification"
|
|
1136
|
-
});
|
|
1137
636
|
setTimeout(() => {
|
|
1138
637
|
setShowEndState(false);
|
|
1139
638
|
setShowReviewModal(false);
|
|
@@ -1144,8 +643,9 @@ function BankDocumentClassification(props) {
|
|
|
1144
643
|
userEvents.addEvent("Encountered error", {
|
|
1145
644
|
actionType: "upload",
|
|
1146
645
|
actionLevel: "journey",
|
|
1147
|
-
label: "bankDocumentClassification"
|
|
646
|
+
label: isShadowMode ? "bankDocumentClassificationShadowMode" : "bankDocumentClassification"
|
|
1148
647
|
});
|
|
648
|
+
if (isShadowMode) return;
|
|
1149
649
|
logger2.error("Document validation failed:", error);
|
|
1150
650
|
setShowReviewModal(false);
|
|
1151
651
|
setValidationResponse(null);
|
|
@@ -1154,12 +654,13 @@ function BankDocumentClassification(props) {
|
|
|
1154
654
|
const handleDocumentUpload = async (files) => {
|
|
1155
655
|
setData("bankStatementDocument", files);
|
|
1156
656
|
triggerValidation();
|
|
657
|
+
if (!enableBankDocumentClassification && !isShadowMode) return;
|
|
1157
658
|
if (files.length > 0) {
|
|
1158
659
|
const file = files[0];
|
|
1159
660
|
if (file && file instanceof File) {
|
|
1160
661
|
try {
|
|
1161
662
|
const base64Content = await fileToBase64(file);
|
|
1162
|
-
const
|
|
663
|
+
const document = {
|
|
1163
664
|
documentType: "bankStatement",
|
|
1164
665
|
fileName: file.name,
|
|
1165
666
|
sessionId: legalEntity.id,
|
|
@@ -1170,7 +671,7 @@ function BankDocumentClassification(props) {
|
|
|
1170
671
|
}
|
|
1171
672
|
]
|
|
1172
673
|
};
|
|
1173
|
-
validateDocumentMutation.mutate(
|
|
674
|
+
validateDocumentMutation.mutate(document);
|
|
1174
675
|
} catch (error) {
|
|
1175
676
|
logger2.error("Error processing document:", error);
|
|
1176
677
|
}
|
|
@@ -1182,7 +683,7 @@ function BankDocumentClassification(props) {
|
|
|
1182
683
|
triggerValidation();
|
|
1183
684
|
}
|
|
1184
685
|
}, [formIsActive, isBankStatementOptional, triggerValidation]);
|
|
1185
|
-
const alreadyUploadedDocuments = useMemo
|
|
686
|
+
const alreadyUploadedDocuments = useMemo(
|
|
1186
687
|
() => bankData?.bankStatementDocument ?? [],
|
|
1187
688
|
[bankData?.bankStatementDocument]
|
|
1188
689
|
);
|
|
@@ -1206,13 +707,6 @@ function BankDocumentClassification(props) {
|
|
|
1206
707
|
}
|
|
1207
708
|
});
|
|
1208
709
|
}, [data, valid, errors, fieldProblems, id]);
|
|
1209
|
-
const documentsModifiers = useMemo$1(
|
|
1210
|
-
() => ({
|
|
1211
|
-
rootEntityType: legalEntity.type,
|
|
1212
|
-
rootEntityLegalName: getLegalEntityNameBasedOnType(legalEntity)
|
|
1213
|
-
}),
|
|
1214
|
-
[legalEntity]
|
|
1215
|
-
);
|
|
1216
710
|
const handleUploadNewDocument = () => {
|
|
1217
711
|
userEvents.addEvent("Clicked button", {
|
|
1218
712
|
actionType: "next",
|
|
@@ -1236,7 +730,7 @@ function BankDocumentClassification(props) {
|
|
|
1236
730
|
label: "bankDocumentClassificationContinueAnyway"
|
|
1237
731
|
});
|
|
1238
732
|
};
|
|
1239
|
-
const documentPreview = useMemo
|
|
733
|
+
const documentPreview = useMemo(() => {
|
|
1240
734
|
if (!data.bankStatementDocument?.[0] || !showReviewModal) return null;
|
|
1241
735
|
const file = data.bankStatementDocument?.[0];
|
|
1242
736
|
return file.type === "application/pdf" || file.name.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ jsx(
|
|
@@ -1260,8 +754,7 @@ function BankDocumentClassification(props) {
|
|
|
1260
754
|
title: t(
|
|
1261
755
|
($) => $[isBankStatementOptional ? "uploadABankDocumentOptional" : "uploadABankDocument"]
|
|
1262
756
|
),
|
|
1263
|
-
description: t(($) => $["toVerifyYourBankAccountDetails"])
|
|
1264
|
-
children: /* @__PURE__ */ jsx(Button, { slot: "actions", variant: "link", onClick: () => setShowRequirementsModal(true), children: commonT(($) => $["learnMore"]) })
|
|
757
|
+
description: t(($) => $["toVerifyYourBankAccountDetails"])
|
|
1265
758
|
}
|
|
1266
759
|
),
|
|
1267
760
|
/* @__PURE__ */ jsx(
|
|
@@ -1274,13 +767,12 @@ function BankDocumentClassification(props) {
|
|
|
1274
767
|
}
|
|
1275
768
|
),
|
|
1276
769
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1277
|
-
/* @__PURE__ */ jsx("h3", { className: styles$3.requirementsList, children: t(($) => $["
|
|
770
|
+
/* @__PURE__ */ jsx("h3", { className: styles$3.requirementsList, children: t(($) => $["makeSureYourDocumentIncludes"]) }),
|
|
1278
771
|
/* @__PURE__ */ jsxs("ul", { className: styles$3.requirementsList, children: [
|
|
1279
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementNameOrBusiness"],
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["
|
|
1283
|
-
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementBankInfo"]) })
|
|
772
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementNameOrBusiness"]) }),
|
|
773
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $[`documentRequirementAccountNumber${country === "US" ? "Partial" : ""}`]) }),
|
|
774
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementBankInfo"]) }),
|
|
775
|
+
/* @__PURE__ */ jsx("li", { children: t(($) => $["documentRequirementReadableText"]) })
|
|
1284
776
|
] })
|
|
1285
777
|
] }),
|
|
1286
778
|
/* @__PURE__ */ jsx(
|
|
@@ -1289,19 +781,25 @@ function BankDocumentClassification(props) {
|
|
|
1289
781
|
className: cx("adyen-kyc-upload-field"),
|
|
1290
782
|
name: "bankStatementDocument",
|
|
1291
783
|
isValid: valid.bankStatementDocument,
|
|
1292
|
-
children: (childProps) => /* @__PURE__ */ jsx(
|
|
1293
|
-
|
|
784
|
+
children: (childProps) => /* @__PURE__ */ jsx(
|
|
785
|
+
"div",
|
|
1294
786
|
{
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
787
|
+
className: validateDocumentMutation.isPending && !isShadowMode ? styles$3.filePickerDisabled : "",
|
|
788
|
+
children: /* @__PURE__ */ jsx(
|
|
789
|
+
FilePicker,
|
|
790
|
+
{
|
|
791
|
+
...childProps,
|
|
792
|
+
name: "bankStatementDocument",
|
|
793
|
+
files: data.bankStatementDocument ?? [],
|
|
794
|
+
setFiles: handleDocumentUpload,
|
|
795
|
+
isValid: valid.bankStatementDocument ?? isBankStatementOptional,
|
|
796
|
+
errorMessage: errors.bankStatementDocument?.errorMessage,
|
|
797
|
+
loading: validateDocumentMutation.isPending && !isShadowMode,
|
|
798
|
+
...bankStatementValidationOptions
|
|
799
|
+
}
|
|
800
|
+
)
|
|
1303
801
|
}
|
|
1304
|
-
)
|
|
802
|
+
)
|
|
1305
803
|
}
|
|
1306
804
|
),
|
|
1307
805
|
data.bankStatementDocument?.length ? /* @__PURE__ */ jsx(
|
|
@@ -1339,7 +837,6 @@ function BankDocumentClassification(props) {
|
|
|
1339
837
|
/* @__PURE__ */ jsxs("div", { className: styles$3.content, children: [
|
|
1340
838
|
/* @__PURE__ */ jsx("h2", { className: styles$3.title, children: t(($) => $["reviewDocument"]) }),
|
|
1341
839
|
/* @__PURE__ */ jsx("p", { className: styles$3.description, children: t(($) => $["reviewDocumentDescription"]) }),
|
|
1342
|
-
/* @__PURE__ */ jsx(Button, { variant: "link", onClick: () => setShowRequirementsModal(true), children: commonT(($) => $["learnMore"]) }),
|
|
1343
840
|
/* @__PURE__ */ jsx("ul", { className: styles$3.issues, children: validationResponse && getValidationIssuesKeys(validationResponse).map((issue, index) => /* @__PURE__ */ jsx("li", { children: t(($) => $[issue]) }, index)) }),
|
|
1344
841
|
/* @__PURE__ */ jsxs("div", { className: styles$3.actions, children: [
|
|
1345
842
|
/* @__PURE__ */ jsx(
|
|
@@ -1381,13 +878,6 @@ function BankDocumentClassification(props) {
|
|
|
1381
878
|
] })
|
|
1382
879
|
}
|
|
1383
880
|
),
|
|
1384
|
-
/* @__PURE__ */ jsx(
|
|
1385
|
-
BankDocumentRequirementsModal,
|
|
1386
|
-
{
|
|
1387
|
-
isOpen: showRequirementsModal,
|
|
1388
|
-
onClose: () => setShowRequirementsModal(false)
|
|
1389
|
-
}
|
|
1390
|
-
),
|
|
1391
881
|
/* @__PURE__ */ jsx(
|
|
1392
882
|
"input",
|
|
1393
883
|
{
|
|
@@ -1457,7 +947,7 @@ const VerificationWidgetCallbackActions = {
|
|
|
1457
947
|
RETRY_VERIFICATION: "retry_verification",
|
|
1458
948
|
HANDLE_EVENT: "handle_event"
|
|
1459
949
|
};
|
|
1460
|
-
const WIDGET_CONTAINER_CLASS
|
|
950
|
+
const WIDGET_CONTAINER_CLASS = `adyen-kyc-bank-verification-widget-container`;
|
|
1461
951
|
function BankVerificationOverlay({
|
|
1462
952
|
url,
|
|
1463
953
|
setBankVerificationError,
|
|
@@ -1527,7 +1017,7 @@ function BankVerificationOverlay({
|
|
|
1527
1017
|
case VerificationWidgetCallbackActions.HANDLE_EVENT: {
|
|
1528
1018
|
const { name, provider } = payload.event;
|
|
1529
1019
|
if (name === "institution_selected" && provider === "plaid") {
|
|
1530
|
-
widgetContainerRef.current?.classList.add(`${WIDGET_CONTAINER_CLASS
|
|
1020
|
+
widgetContainerRef.current?.classList.add(`${WIDGET_CONTAINER_CLASS}--plaid-modal`);
|
|
1531
1021
|
}
|
|
1532
1022
|
break;
|
|
1533
1023
|
}
|
|
@@ -1594,231 +1084,12 @@ function BankVerificationOverlay({
|
|
|
1594
1084
|
}
|
|
1595
1085
|
});
|
|
1596
1086
|
openBanking.open();
|
|
1597
|
-
container.classList.add(WIDGET_CONTAINER_CLASS
|
|
1087
|
+
container.classList.add(WIDGET_CONTAINER_CLASS);
|
|
1598
1088
|
return () => {
|
|
1599
1089
|
openBanking?.destroy();
|
|
1600
1090
|
};
|
|
1601
1091
|
}, []);
|
|
1602
|
-
return /* @__PURE__ */ jsx("div", { ref: widgetContainerRef });
|
|
1603
|
-
}
|
|
1604
|
-
const WIDGET_IFRAME_CLASS = "adyen-kyc-bank-verification-widget";
|
|
1605
|
-
const WIDGET_CONTAINER_CLASS = `${WIDGET_IFRAME_CLASS}-container`;
|
|
1606
|
-
function BankVerificationWidget({
|
|
1607
|
-
url,
|
|
1608
|
-
vendor,
|
|
1609
|
-
setBankVerificationError,
|
|
1610
|
-
setHideVerificationWidget,
|
|
1611
|
-
onBack,
|
|
1612
|
-
retrieveBankAccountInfo,
|
|
1613
|
-
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
1614
|
-
fullscreen
|
|
1615
|
-
}) {
|
|
1616
|
-
const { t } = useTranslation("banking");
|
|
1617
|
-
const userEvents = useAnalyticsContext();
|
|
1618
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
1619
|
-
const widgetContainerRef = useRef(null);
|
|
1620
|
-
const sdkToken = getSdkToken();
|
|
1621
|
-
const { mutateAsync: handleBankVerificationError2 } = useHandleBankVerificationError();
|
|
1622
|
-
const trackVerificationError = (returnValue) => {
|
|
1623
|
-
userEvents.addPageEvent("Encountered error", {
|
|
1624
|
-
actionType: "add",
|
|
1625
|
-
returnType: "sdk error",
|
|
1626
|
-
returnValue,
|
|
1627
|
-
additionalData: {
|
|
1628
|
-
providerName: vendor
|
|
1629
|
-
}
|
|
1630
|
-
});
|
|
1631
|
-
};
|
|
1632
|
-
const DEFAULT_ERROR = {
|
|
1633
|
-
error: "UNKNOWN_ERROR",
|
|
1634
|
-
message: t(($) => $["weCouldntCompleteTheAccountCheck"])
|
|
1635
|
-
};
|
|
1636
|
-
setBankVerificationError(null);
|
|
1637
|
-
const widgetCallback = useCallback(
|
|
1638
|
-
(payload) => {
|
|
1639
|
-
const errorContent = t(($) => $["tryAgainOrManualAccountDetails"]);
|
|
1640
|
-
switch (payload.action) {
|
|
1641
|
-
case VerificationWidgetCallbackActions.HANDLE_EXCEPTION: {
|
|
1642
|
-
let errorTitle;
|
|
1643
|
-
const { err } = payload;
|
|
1644
|
-
switch (!(err instanceof Error) && err?.error) {
|
|
1645
|
-
case "USER_CANCELLED":
|
|
1646
|
-
errorTitle = "";
|
|
1647
|
-
break;
|
|
1648
|
-
case "CONNECTION_ERROR":
|
|
1649
|
-
errorTitle = t(($) => $["couldNotEstablishBankConnection"]);
|
|
1650
|
-
break;
|
|
1651
|
-
case "GENERIC_ERROR":
|
|
1652
|
-
errorTitle = t(($) => $["ranIntoTechnicalError"]);
|
|
1653
|
-
break;
|
|
1654
|
-
case "UNKNOWN_ERROR":
|
|
1655
|
-
default: {
|
|
1656
|
-
errorTitle = t(($) => $["couldNotCompleteAccountCheck"]);
|
|
1657
|
-
break;
|
|
1658
|
-
}
|
|
1659
|
-
}
|
|
1660
|
-
if (errorTitle) {
|
|
1661
|
-
setBankVerificationError({ title: errorTitle, content: errorContent });
|
|
1662
|
-
}
|
|
1663
|
-
setHideVerificationWidget(true);
|
|
1664
|
-
if (isExperimentEnabled(ExperimentNames.EnablePayoutVerificationMethodPageRedesign)) {
|
|
1665
|
-
showInstantVerificationPayoutModal.value = false;
|
|
1666
|
-
}
|
|
1667
|
-
onBack?.();
|
|
1668
|
-
break;
|
|
1669
|
-
}
|
|
1670
|
-
case VerificationWidgetCallbackActions.RETRY_VERIFICATION:
|
|
1671
|
-
setBankVerificationError({
|
|
1672
|
-
title: t(($) => $["failedInitializeInstantVerification"]),
|
|
1673
|
-
content: errorContent
|
|
1674
|
-
});
|
|
1675
|
-
setHideVerificationWidget(true);
|
|
1676
|
-
onBack?.();
|
|
1677
|
-
break;
|
|
1678
|
-
case VerificationWidgetCallbackActions.HANDLE_EVENT: {
|
|
1679
|
-
const { name, provider } = payload.event;
|
|
1680
|
-
if (name === "institution_selected" && provider === "plaid") {
|
|
1681
|
-
widgetContainerRef.current?.classList.add(`${WIDGET_CONTAINER_CLASS}--plaid-modal`);
|
|
1682
|
-
}
|
|
1683
|
-
break;
|
|
1684
|
-
}
|
|
1685
|
-
case VerificationWidgetCallbackActions.VERIFICATION_SUCCESS: {
|
|
1686
|
-
const { accounts } = payload.result;
|
|
1687
|
-
if (accounts) retrieveBankAccountInfo(accounts[0]);
|
|
1688
|
-
setHideVerificationWidget(true);
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
},
|
|
1692
|
-
[t, retrieveBankAccountInfo, onBack, setBankVerificationError, setHideVerificationWidget]
|
|
1693
|
-
);
|
|
1694
|
-
useEffect(
|
|
1695
|
-
() => {
|
|
1696
|
-
const container = widgetContainerRef.current;
|
|
1697
|
-
if (!container) return;
|
|
1698
|
-
let iFrame;
|
|
1699
|
-
let iFrameWidget;
|
|
1700
|
-
let openBanking;
|
|
1701
|
-
if (createTrustedTransferInstrument2) {
|
|
1702
|
-
openBanking = OpenBankingSDK.create({
|
|
1703
|
-
divElement: container,
|
|
1704
|
-
link: url,
|
|
1705
|
-
successHandler: (code, state) => {
|
|
1706
|
-
createTrustedTransferInstrument2(code, state).then((res) => {
|
|
1707
|
-
userEvents.addPageEvent("Success", {
|
|
1708
|
-
actionType: "add",
|
|
1709
|
-
additionalData: {
|
|
1710
|
-
providerName: vendor
|
|
1711
|
-
}
|
|
1712
|
-
});
|
|
1713
|
-
if (res) {
|
|
1714
|
-
widgetCallback({
|
|
1715
|
-
action: VerificationWidgetCallbackActions.VERIFICATION_SUCCESS,
|
|
1716
|
-
result: res
|
|
1717
|
-
});
|
|
1718
|
-
}
|
|
1719
|
-
}).catch(() => {
|
|
1720
|
-
trackVerificationError(DEFAULT_ERROR.error);
|
|
1721
|
-
widgetCallback({
|
|
1722
|
-
action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
|
|
1723
|
-
err: DEFAULT_ERROR
|
|
1724
|
-
});
|
|
1725
|
-
});
|
|
1726
|
-
},
|
|
1727
|
-
errorHandler: (errorCode, errorMessage, state, metadata) => {
|
|
1728
|
-
trackVerificationError(errorCode);
|
|
1729
|
-
handleBankVerificationError2?.({
|
|
1730
|
-
errorCode,
|
|
1731
|
-
errorMessage,
|
|
1732
|
-
state,
|
|
1733
|
-
metadata: metadata && Object.fromEntries(metadata)
|
|
1734
|
-
}).then(
|
|
1735
|
-
(error) => widgetCallback({
|
|
1736
|
-
action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
|
|
1737
|
-
err: error
|
|
1738
|
-
})
|
|
1739
|
-
).catch(
|
|
1740
|
-
() => widgetCallback({
|
|
1741
|
-
action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
|
|
1742
|
-
err: DEFAULT_ERROR
|
|
1743
|
-
})
|
|
1744
|
-
);
|
|
1745
|
-
},
|
|
1746
|
-
eventHandler: (eventName, provider) => {
|
|
1747
|
-
widgetCallback({
|
|
1748
|
-
action: VerificationWidgetCallbackActions.HANDLE_EVENT,
|
|
1749
|
-
event: { name: eventName, provider }
|
|
1750
|
-
});
|
|
1751
|
-
}
|
|
1752
|
-
});
|
|
1753
|
-
openBanking.open();
|
|
1754
|
-
} else {
|
|
1755
|
-
iFrame = document.createElement("iframe");
|
|
1756
|
-
iFrame.setAttribute("allowFullscreen", "true");
|
|
1757
|
-
iFrame.classList.add(WIDGET_IFRAME_CLASS);
|
|
1758
|
-
container.appendChild(iFrame);
|
|
1759
|
-
requestAnimationFrame(async () => {
|
|
1760
|
-
try {
|
|
1761
|
-
iFrameWidget = new IFrameWidget(iFrame, url, vendor, sdkToken);
|
|
1762
|
-
const result = await iFrameWidget.mountAndWaitForResponse();
|
|
1763
|
-
widgetCallback({
|
|
1764
|
-
action: VerificationWidgetCallbackActions.VERIFICATION_SUCCESS,
|
|
1765
|
-
result
|
|
1766
|
-
});
|
|
1767
|
-
userEvents.addPageEvent("Success", {
|
|
1768
|
-
actionType: "add",
|
|
1769
|
-
additionalData: {
|
|
1770
|
-
providerName: vendor
|
|
1771
|
-
}
|
|
1772
|
-
});
|
|
1773
|
-
} catch (err) {
|
|
1774
|
-
if (err instanceof AdyenKycSdkError) {
|
|
1775
|
-
switch (err.message) {
|
|
1776
|
-
case "WIDGET_ACCOUNT_COMMIT_FAILURE":
|
|
1777
|
-
return widgetCallback({
|
|
1778
|
-
action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
|
|
1779
|
-
err: err.sourceError
|
|
1780
|
-
});
|
|
1781
|
-
case "WIDGET_LAUNCH_FAILED":
|
|
1782
|
-
case "WIDGET_URL_MALFORMED":
|
|
1783
|
-
case "WIDGET_TIMEOUT":
|
|
1784
|
-
return widgetCallback({
|
|
1785
|
-
action: VerificationWidgetCallbackActions.RETRY_VERIFICATION
|
|
1786
|
-
});
|
|
1787
|
-
default:
|
|
1788
|
-
return widgetCallback({
|
|
1789
|
-
action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
|
|
1790
|
-
err: {
|
|
1791
|
-
error: err?.name ?? VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
|
|
1792
|
-
message: err.sourceError?.message ?? VerificationWidgetCallbackActions.HANDLE_EXCEPTION
|
|
1793
|
-
}
|
|
1794
|
-
});
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
trackVerificationError(err instanceof AdyenKycSdkError ? err.message : "sdk error");
|
|
1798
|
-
return widgetCallback({
|
|
1799
|
-
action: VerificationWidgetCallbackActions.HANDLE_EXCEPTION,
|
|
1800
|
-
err
|
|
1801
|
-
});
|
|
1802
|
-
}
|
|
1803
|
-
});
|
|
1804
|
-
}
|
|
1805
|
-
container.classList.add(WIDGET_CONTAINER_CLASS);
|
|
1806
|
-
if (fullscreen) {
|
|
1807
|
-
container.classList.add(`${WIDGET_CONTAINER_CLASS}--fullscreen`);
|
|
1808
|
-
}
|
|
1809
|
-
return () => {
|
|
1810
|
-
iFrameWidget?.unmount();
|
|
1811
|
-
iFrame?.remove();
|
|
1812
|
-
openBanking?.destroy();
|
|
1813
|
-
};
|
|
1814
|
-
},
|
|
1815
|
-
// Effect dependencies have been omitted here, which isn't intended. However, there seems to be
|
|
1816
|
-
// some problematic behaviour in the overall flow with the dependencies present, which requires
|
|
1817
|
-
// further debugging and tracing to resolve (totally out of the scope of this component).
|
|
1818
|
-
// [url, vendor, widgetCallback]
|
|
1819
|
-
[]
|
|
1820
|
-
);
|
|
1821
|
-
return /* @__PURE__ */ jsx("div", { ref: widgetContainerRef });
|
|
1092
|
+
return /* @__PURE__ */ jsx("div", { ref: widgetContainerRef, className: `${WIDGET_CONTAINER_CLASS}-overlay` });
|
|
1822
1093
|
}
|
|
1823
1094
|
const accountVerificationFields = [
|
|
1824
1095
|
"verifiedAccountHolder",
|
|
@@ -1851,13 +1122,11 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
|
|
|
1851
1122
|
};
|
|
1852
1123
|
function BankVerification(props) {
|
|
1853
1124
|
const {
|
|
1854
|
-
heading,
|
|
1855
1125
|
setBankVerificationError,
|
|
1856
1126
|
onBack,
|
|
1857
1127
|
hideSidebar,
|
|
1858
1128
|
setBankInfoValidated,
|
|
1859
1129
|
bankInfoValidated,
|
|
1860
|
-
formIsActive,
|
|
1861
1130
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
1862
1131
|
country,
|
|
1863
1132
|
data: propData,
|
|
@@ -1865,16 +1134,9 @@ function BankVerification(props) {
|
|
|
1865
1134
|
id,
|
|
1866
1135
|
fieldValidationErrors
|
|
1867
1136
|
} = props;
|
|
1868
|
-
const { t } = useTranslation("banking");
|
|
1869
|
-
const { t: commonT } = useTranslation("common");
|
|
1870
|
-
const { isExperimentEnabled } = useExperimentsContext();
|
|
1871
1137
|
const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
|
|
1872
1138
|
const schema = accountVerificationFields;
|
|
1873
1139
|
const stateRef = useRef({ setState: null });
|
|
1874
|
-
const [hideVerificationWidget, setHideVerificationWidget] = useState(false);
|
|
1875
|
-
const isPayoutVerificationMethodPageRedesignEnabled = isExperimentEnabled(
|
|
1876
|
-
ExperimentNames.EnablePayoutVerificationMethodPageRedesign
|
|
1877
|
-
);
|
|
1878
1140
|
const { handleChangeFor, data, valid, errors, isValid, triggerValidation, fieldProblems } = useForm({
|
|
1879
1141
|
...props,
|
|
1880
1142
|
schema,
|
|
@@ -1898,13 +1160,7 @@ function BankVerification(props) {
|
|
|
1898
1160
|
hideSidebar?.(false);
|
|
1899
1161
|
triggerValidation();
|
|
1900
1162
|
await invalidateRootLegalEntity();
|
|
1901
|
-
|
|
1902
|
-
showInstantVerificationPayoutModal.value = false;
|
|
1903
|
-
}
|
|
1904
|
-
};
|
|
1905
|
-
const handleOnBack = () => {
|
|
1906
|
-
setHideVerificationWidget(false);
|
|
1907
|
-
onBack?.();
|
|
1163
|
+
showInstantVerificationPayoutModal.value = false;
|
|
1908
1164
|
};
|
|
1909
1165
|
useEffect(() => {
|
|
1910
1166
|
stateRef.current.setState?.({
|
|
@@ -1919,13 +1175,7 @@ function BankVerification(props) {
|
|
|
1919
1175
|
}
|
|
1920
1176
|
});
|
|
1921
1177
|
}, [data, valid, errors, isValid]);
|
|
1922
|
-
|
|
1923
|
-
if (!isPayoutVerificationMethodPageRedesignEnabled) {
|
|
1924
|
-
hideSidebar?.(formIsActive && !bankInfoValidated);
|
|
1925
|
-
return () => hideSidebar?.(false);
|
|
1926
|
-
}
|
|
1927
|
-
}, [bankInfoValidated, formIsActive]);
|
|
1928
|
-
if (isPayoutVerificationMethodPageRedesignEnabled && provider) {
|
|
1178
|
+
if (provider) {
|
|
1929
1179
|
if (bankInfoValidated || !showInstantVerificationPayoutModal.value) {
|
|
1930
1180
|
return null;
|
|
1931
1181
|
}
|
|
@@ -1936,7 +1186,7 @@ function BankVerification(props) {
|
|
|
1936
1186
|
{
|
|
1937
1187
|
url: provider.redirectUrl,
|
|
1938
1188
|
setBankVerificationError,
|
|
1939
|
-
onBack
|
|
1189
|
+
onBack,
|
|
1940
1190
|
retrieveBankAccountInfo,
|
|
1941
1191
|
createTrustedTransferInstrument: createTrustedTransferInstrument2,
|
|
1942
1192
|
providerName: provider.name
|
|
@@ -1944,28 +1194,6 @@ function BankVerification(props) {
|
|
|
1944
1194
|
)
|
|
1945
1195
|
] });
|
|
1946
1196
|
}
|
|
1947
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1948
|
-
/* @__PURE__ */ jsx(StateContextSetter, { owner: id, stateRef }),
|
|
1949
|
-
bankInfoValidated && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1950
|
-
heading && /* @__PURE__ */ jsx(Header, { title: heading }),
|
|
1951
|
-
/* @__PURE__ */ jsx(Alert, { title: t(($) => $["youSuccessfullyVerifiedAccount"]), variant: "success" })
|
|
1952
|
-
] }),
|
|
1953
|
-
provider && formIsActive && !bankInfoValidated && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-bank-verification-container", children: /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !hideVerificationWidget ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1954
|
-
/* @__PURE__ */ jsx(
|
|
1955
|
-
BankVerificationWidget,
|
|
1956
|
-
{
|
|
1957
|
-
url: provider.redirectUrl,
|
|
1958
|
-
vendor: provider.name,
|
|
1959
|
-
setBankVerificationError,
|
|
1960
|
-
setHideVerificationWidget,
|
|
1961
|
-
onBack: handleOnBack,
|
|
1962
|
-
retrieveBankAccountInfo,
|
|
1963
|
-
createTrustedTransferInstrument: createTrustedTransferInstrument2
|
|
1964
|
-
}
|
|
1965
|
-
),
|
|
1966
|
-
/* @__PURE__ */ jsx(ActionBar, { onBack: handleOnBack, backButtonLabel: commonT(($) => $["goBack"]) })
|
|
1967
|
-
] }) : void 0 }) })
|
|
1968
|
-
] });
|
|
1969
1197
|
}
|
|
1970
1198
|
function BankAccountFormat(props) {
|
|
1971
1199
|
const { t } = useTranslation(["banking"]);
|
|
@@ -3050,9 +2278,9 @@ function PayoutAccount(props) {
|
|
|
3050
2278
|
const { t } = useTranslation("banking");
|
|
3051
2279
|
const { t: commonT } = useTranslation("common");
|
|
3052
2280
|
const [checkAnnotation, setCheckAnnotation] = useState();
|
|
3053
|
-
const {
|
|
3054
|
-
const isCrossBorderPayoutsEnabled = isExperimentEnabled("EnableCrossBorderPayouts");
|
|
2281
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
3055
2282
|
const { isSettingEnabled } = useSettingsContext();
|
|
2283
|
+
const isCrossBorderPayoutsEnabled = isFeatureEnabled(FeatureNames.EnableCrossBorderPayouts) && isSettingEnabled(SettingNames.AllowCrossBorderPayout);
|
|
3056
2284
|
const bankAccountFormatSelectionAllowed = isSettingEnabled(
|
|
3057
2285
|
SettingNames.AllowBankAccountFormatSelection
|
|
3058
2286
|
);
|
|
@@ -3066,7 +2294,8 @@ function PayoutAccount(props) {
|
|
|
3066
2294
|
invalidFieldNames,
|
|
3067
2295
|
formVerificationErrors,
|
|
3068
2296
|
fieldValidationErrors,
|
|
3069
|
-
preferredCurrencyCode
|
|
2297
|
+
preferredCurrencyCode,
|
|
2298
|
+
data
|
|
3070
2299
|
} = props;
|
|
3071
2300
|
const showCheckGuidance = shouldShowCheckGuidance(country);
|
|
3072
2301
|
const formUtils = createFormUtils({ ...props, requiredFields }, commonT);
|
|
@@ -3090,7 +2319,7 @@ function PayoutAccount(props) {
|
|
|
3090
2319
|
const localCurrency = isCrossBorderPayoutsEnabled ? isLocalCurrency(country, preferredCurrencyCode) : true;
|
|
3091
2320
|
const isEUR = preferredCurrencyCode === "EUR";
|
|
3092
2321
|
useEffect(() => {
|
|
3093
|
-
if (!isCrossBorderPayoutsEnabled) {
|
|
2322
|
+
if (!isCrossBorderPayoutsEnabled || data?.transferInstrumentId) {
|
|
3094
2323
|
return;
|
|
3095
2324
|
}
|
|
3096
2325
|
if (isEUR && localCurrency) {
|
|
@@ -3447,15 +2676,9 @@ const tinkLogo = lazy(() => import("./tink-logo-DDyjz5eJ.js"));
|
|
|
3447
2676
|
const plaidLogo = lazy(() => import("./plaid-logo-FsZ7kfL-.js"));
|
|
3448
2677
|
const yapilyLogo = lazy(() => import("./yapily-logo-BduxhNRA.js"));
|
|
3449
2678
|
const instantVerificationImage = lazy(
|
|
3450
|
-
() => import("./instant-verification-UrnuHTYn.js")
|
|
3451
|
-
);
|
|
3452
|
-
const manualVerificationImage = lazy(
|
|
3453
|
-
() => import("./manual-verification-BO8zgAYT.js")
|
|
3454
|
-
);
|
|
3455
|
-
const instantVerificationImageNew = lazy(
|
|
3456
2679
|
() => import("./payout-verification-instant-BzpfOQLD.js")
|
|
3457
2680
|
);
|
|
3458
|
-
const
|
|
2681
|
+
const manualVerificationImage = lazy(
|
|
3459
2682
|
() => import("./payout-verification-manual-gNEoeZkV.js")
|
|
3460
2683
|
);
|
|
3461
2684
|
const getProviderIconName = (providerName) => {
|
|
@@ -3470,11 +2693,11 @@ const getProviderIconName = (providerName) => {
|
|
|
3470
2693
|
return void 0;
|
|
3471
2694
|
}
|
|
3472
2695
|
};
|
|
3473
|
-
const makePayoutVerificationMethodsMetadata = (instantVerificationProviderName
|
|
2696
|
+
const makePayoutVerificationMethodsMetadata = (instantVerificationProviderName) => ({
|
|
3474
2697
|
instantVerification: {
|
|
3475
2698
|
name: "verifyViaMobileBankingAppOrWebsite",
|
|
3476
2699
|
subtitle: "instant",
|
|
3477
|
-
svgImport:
|
|
2700
|
+
svgImport: instantVerificationImage,
|
|
3478
2701
|
description: "instantVerificationDescription",
|
|
3479
2702
|
provider: instantVerificationProviderName ? {
|
|
3480
2703
|
name: instantVerificationProviderName,
|
|
@@ -3485,15 +2708,9 @@ const makePayoutVerificationMethodsMetadata = (instantVerificationProviderName,
|
|
|
3485
2708
|
name: "uploadABankStatement",
|
|
3486
2709
|
subtitle: "mayTakeAFewDays",
|
|
3487
2710
|
description: "manualVerificationDescription",
|
|
3488
|
-
svgImport:
|
|
2711
|
+
svgImport: manualVerificationImage
|
|
3489
2712
|
}
|
|
3490
2713
|
});
|
|
3491
|
-
const payoutVerificationMethods = ["instantVerification", "manualVerification"];
|
|
3492
|
-
const fieldVerificationMethods = "adyen-kyc-field-verification-methods";
|
|
3493
|
-
const fieldVerificationMethodsCard = "adyen-kyc-field-verification-methods-card";
|
|
3494
|
-
const fieldVerificationMethodsFooter = "adyen-kyc-field-verification-methods-footer";
|
|
3495
|
-
const fieldVerificationMethodsLogo = "adyen-kyc-field-verification-methods-logo";
|
|
3496
|
-
const radioGroupCardIllustration = "adyen-kyc-radio-group-card-illustration";
|
|
3497
2714
|
const instantVerificationError = "adyen-kyc-instant-verification-error";
|
|
3498
2715
|
const payoutVerificationMethodCard = "adyen-kyc-payout-verification-method-card";
|
|
3499
2716
|
const payoutVerificationMethodCardImage = "adyen-kyc-payout-verification-method-card-image";
|
|
@@ -3503,11 +2720,6 @@ const payoutVerificationMethodCardSubtitle = "adyen-kyc-payout-verification-meth
|
|
|
3503
2720
|
const payoutVerificationMethodCardBody = "adyen-kyc-payout-verification-method-card-body";
|
|
3504
2721
|
const payoutVerificationMethodCardImageContainer = "adyen-kyc-payout-verification-method-card-image-container";
|
|
3505
2722
|
const styles = {
|
|
3506
|
-
fieldVerificationMethods,
|
|
3507
|
-
fieldVerificationMethodsCard,
|
|
3508
|
-
fieldVerificationMethodsFooter,
|
|
3509
|
-
fieldVerificationMethodsLogo,
|
|
3510
|
-
radioGroupCardIllustration,
|
|
3511
2723
|
instantVerificationError,
|
|
3512
2724
|
payoutVerificationMethodCard,
|
|
3513
2725
|
payoutVerificationMethodCardImage,
|
|
@@ -3606,11 +2818,8 @@ function PayoutVerificationMethod(props) {
|
|
|
3606
2818
|
const { t: commonT } = useTranslation("common");
|
|
3607
2819
|
const instantVerificationError2 = useContext(InstantVerificationErrorContext);
|
|
3608
2820
|
const { isSettingEnabled } = useSettingsContext();
|
|
3609
|
-
const {
|
|
2821
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
3610
2822
|
const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
|
|
3611
|
-
const isPayoutVerificationMethodPageRedesignEnabled = isExperimentEnabled(
|
|
3612
|
-
ExperimentNames.EnablePayoutVerificationMethodPageRedesign
|
|
3613
|
-
);
|
|
3614
2823
|
const intraRegionCrossBorderPayoutsAllowed = isSettingEnabled(
|
|
3615
2824
|
SettingNames.AllowIntraRegionCrossBorderPayout
|
|
3616
2825
|
);
|
|
@@ -3639,27 +2848,7 @@ function PayoutVerificationMethod(props) {
|
|
|
3639
2848
|
() => updateStateSlice({ data: { ...sliceData, ...data }, errors, valid, fieldProblems }),
|
|
3640
2849
|
[data, errors, fieldProblems, valid]
|
|
3641
2850
|
);
|
|
3642
|
-
const methodsMetadata = makePayoutVerificationMethodsMetadata(
|
|
3643
|
-
provider?.name,
|
|
3644
|
-
isPayoutVerificationMethodPageRedesignEnabled
|
|
3645
|
-
);
|
|
3646
|
-
const PayoutVerificationMethodOptionFooter = ({
|
|
3647
|
-
method,
|
|
3648
|
-
methodsMetadata: methodsMetadata2
|
|
3649
|
-
}) => {
|
|
3650
|
-
const { t: t2 } = useTranslation("common");
|
|
3651
|
-
const { provider: provider2 } = methodsMetadata2[method];
|
|
3652
|
-
return provider2 ? /* @__PURE__ */ jsxs(Typography, { el: "div", variant: "caption", className: styles.fieldVerificationMethodsFooter, children: [
|
|
3653
|
-
t2(($) => $["poweredBy"]),
|
|
3654
|
-
provider2.svgImport ? /* @__PURE__ */ jsx(
|
|
3655
|
-
Image,
|
|
3656
|
-
{
|
|
3657
|
-
className: styles.fieldVerificationMethodsLogo,
|
|
3658
|
-
lazyLoadedImage: provider2.svgImport
|
|
3659
|
-
}
|
|
3660
|
-
) : ` ${provider2.name}`
|
|
3661
|
-
] }) : null;
|
|
3662
|
-
};
|
|
2851
|
+
const methodsMetadata = makePayoutVerificationMethodsMetadata(provider?.name);
|
|
3663
2852
|
const selectVerificationMethod = (method) => {
|
|
3664
2853
|
setHasSelectedMethod(true);
|
|
3665
2854
|
handleChangeFor("payoutVerificationMethod")(method);
|
|
@@ -3713,6 +2902,7 @@ function PayoutVerificationMethod(props) {
|
|
|
3713
2902
|
}
|
|
3714
2903
|
)
|
|
3715
2904
|
] });
|
|
2905
|
+
const isCrossBorderPayoutEnabled = isFeatureEnabled(FeatureNames.EnableCrossBorderPayouts) && isSettingEnabled(SettingNames.AllowCrossBorderPayout);
|
|
3716
2906
|
return /* @__PURE__ */ jsxs("form", { className: styles.payoutVerificationMethod, children: [
|
|
3717
2907
|
heading && /* @__PURE__ */ jsx(Header, { title: heading, children: /* @__PURE__ */ jsx("template", { slot: "description", children: description2 }) }),
|
|
3718
2908
|
instantVerificationError2 && /* @__PURE__ */ jsx(
|
|
@@ -3724,7 +2914,7 @@ function PayoutVerificationMethod(props) {
|
|
|
3724
2914
|
children: instantVerificationError2.content && /* @__PURE__ */ jsx("p", { className: "adyen-kyc-u-margin-0", children: instantVerificationError2.content })
|
|
3725
2915
|
}
|
|
3726
2916
|
),
|
|
3727
|
-
!
|
|
2917
|
+
!isCrossBorderPayoutEnabled && countryField,
|
|
3728
2918
|
/* @__PURE__ */ jsx(
|
|
3729
2919
|
Field,
|
|
3730
2920
|
{
|
|
@@ -3735,7 +2925,7 @@ function PayoutVerificationMethod(props) {
|
|
|
3735
2925
|
helper: instantVerificationAvailable ? void 0 : t(($) => $["weDoNotYetSupportInstantVerificationForBankAccountsIn"], {
|
|
3736
2926
|
countryName: bankCountryName
|
|
3737
2927
|
}),
|
|
3738
|
-
children: (
|
|
2928
|
+
children: () => /* @__PURE__ */ jsxs(StackLayout, { gap: "small", children: [
|
|
3739
2929
|
/* @__PURE__ */ jsx(
|
|
3740
2930
|
PayoutVerificationMethodOptionCard,
|
|
3741
2931
|
{
|
|
@@ -3761,40 +2951,7 @@ function PayoutVerificationMethod(props) {
|
|
|
3761
2951
|
payoutVerificationMethod: data.payoutVerificationMethod
|
|
3762
2952
|
}
|
|
3763
2953
|
)
|
|
3764
|
-
] })
|
|
3765
|
-
RadioGroupCard,
|
|
3766
|
-
{
|
|
3767
|
-
...childProps,
|
|
3768
|
-
name: "verificationMethod",
|
|
3769
|
-
options: payoutVerificationMethods,
|
|
3770
|
-
onSelect: selectVerificationMethod,
|
|
3771
|
-
selected: data.payoutVerificationMethod,
|
|
3772
|
-
optionId: (method) => method,
|
|
3773
|
-
optionName: (method) => t(($) => $[methodsMetadata[method].name]),
|
|
3774
|
-
optionDescription: (method) => t(($) => $[methodsMetadata[method].description]),
|
|
3775
|
-
optionSubtitle: (method) => t(($) => $[methodsMetadata[method].subtitle]),
|
|
3776
|
-
className: styles.fieldVerificationMethods,
|
|
3777
|
-
optionClassNames: () => ({
|
|
3778
|
-
label: styles.fieldVerificationMethodsCard
|
|
3779
|
-
}),
|
|
3780
|
-
isOptionDisabled: (option) => bankInfoValidated || option === "instantVerification" && !instantVerificationAvailable,
|
|
3781
|
-
renderOptionIcon: (method) => /* @__PURE__ */ jsx("div", { className: styles.radioGroupCardIllustration, children: /* @__PURE__ */ jsx(
|
|
3782
|
-
PayoutVerificationMethodOptionIcon,
|
|
3783
|
-
{
|
|
3784
|
-
method,
|
|
3785
|
-
methodsMetadata
|
|
3786
|
-
}
|
|
3787
|
-
) }),
|
|
3788
|
-
renderOptionFooter: (method) => /* @__PURE__ */ jsx(
|
|
3789
|
-
PayoutVerificationMethodOptionFooter,
|
|
3790
|
-
{
|
|
3791
|
-
method,
|
|
3792
|
-
methodsMetadata
|
|
3793
|
-
}
|
|
3794
|
-
),
|
|
3795
|
-
floatingRadio: true
|
|
3796
|
-
}
|
|
3797
|
-
)
|
|
2954
|
+
] })
|
|
3798
2955
|
}
|
|
3799
2956
|
),
|
|
3800
2957
|
/* @__PURE__ */ jsx(
|
|
@@ -3850,7 +3007,7 @@ const payoutSteps = {
|
|
|
3850
3007
|
formId: "payoutAccountDocuments",
|
|
3851
3008
|
formName: "bankDocument",
|
|
3852
3009
|
formHeader: "bankDocumentHeader",
|
|
3853
|
-
fields:
|
|
3010
|
+
fields: bankDocumentClassificationFields
|
|
3854
3011
|
},
|
|
3855
3012
|
payoutAccountVerification: {
|
|
3856
3013
|
formId: "payoutAccountVerification",
|
|
@@ -3888,13 +3045,14 @@ function PayoutDetails(props) {
|
|
|
3888
3045
|
const accountVerificationFormProps = getFormProps(props, PayoutAccountVerificationFormID);
|
|
3889
3046
|
const payoutAccountFormProps = getFormProps(props, payoutSteps.payoutAccountDetails.formId);
|
|
3890
3047
|
const bankDocumentFormProps = getFormProps(props, PayoutAccountDocumentsFormID);
|
|
3891
|
-
const {
|
|
3892
|
-
const
|
|
3048
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
3049
|
+
const { isSettingEnabled } = useSettingsContext();
|
|
3050
|
+
const isCrossBorderPayoutsEnabled = isFeatureEnabled(FeatureNames.EnableCrossBorderPayouts) && isSettingEnabled(SettingNames.AllowCrossBorderPayout);
|
|
3893
3051
|
const globalData = useGlobalData();
|
|
3894
3052
|
const data = isEmpty(globalData) || propData?.payoutAccountDetails?.transferInstrumentId ? propData : globalData;
|
|
3895
3053
|
const resetData = useResetGlobalData();
|
|
3896
3054
|
const verifyInstantly = data?.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification";
|
|
3897
|
-
const bankCountry = (
|
|
3055
|
+
const bankCountry = (isCrossBorderPayoutsEnabled ? data?.payoutCountryDetails?.bankCountry : data?.payoutVerificationMethod?.bankCountry) ?? country;
|
|
3898
3056
|
useEffect(() => resetData(), [resetData]);
|
|
3899
3057
|
useEffect(() => {
|
|
3900
3058
|
if (activeForm?.formId === summaryStep.formId && verifyInstantly && trustedTransferInstrumentId) {
|
|
@@ -3904,7 +3062,7 @@ function PayoutDetails(props) {
|
|
|
3904
3062
|
const [bankInfoValidated, setBankInfoValidated] = useState(false);
|
|
3905
3063
|
const [arePayoutAccountDetailsInvalid, setArePayoutAccountDetailsInvalid] = useState(false);
|
|
3906
3064
|
const [invalidFieldNames, setInvalidFieldNames] = useState("");
|
|
3907
|
-
const payload = useMemo(
|
|
3065
|
+
const payload = useMemo$1(
|
|
3908
3066
|
() => bankCountry && accountDetailsFromInput ? getAccountIdentificationFromPayoutAccountSchema(
|
|
3909
3067
|
accountDetailsFromInput,
|
|
3910
3068
|
bankCountry,
|
|
@@ -3969,74 +3127,41 @@ function PayoutDetails(props) {
|
|
|
3969
3127
|
) })
|
|
3970
3128
|
}
|
|
3971
3129
|
),
|
|
3972
|
-
|
|
3130
|
+
/* @__PURE__ */ jsx(
|
|
3973
3131
|
"div",
|
|
3974
3132
|
{
|
|
3975
|
-
className: activeForm?.formId !==
|
|
3133
|
+
className: activeForm?.formId !== payoutSteps.payoutAccountDetails.formId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
3976
3134
|
children: /* @__PURE__ */ jsx(
|
|
3977
|
-
|
|
3135
|
+
PayoutAccount,
|
|
3978
3136
|
{
|
|
3979
|
-
...
|
|
3980
|
-
heading: t(($) => $["
|
|
3981
|
-
id:
|
|
3982
|
-
provider,
|
|
3137
|
+
...payoutAccountFormProps,
|
|
3138
|
+
heading: t(($) => $["addABankAccountForPayouts"]),
|
|
3139
|
+
id: payoutSteps.payoutAccountDetails.formId,
|
|
3983
3140
|
country: bankCountry,
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
setBankInfoValidated,
|
|
3989
|
-
formIsActive: activeForm?.formId === PayoutAccountVerificationFormID,
|
|
3990
|
-
createTrustedTransferInstrument: createTrustedTransferInstrument2
|
|
3141
|
+
legalEntityResponse,
|
|
3142
|
+
arePayoutAccountDetailsInvalid,
|
|
3143
|
+
invalidFieldNames,
|
|
3144
|
+
preferredCurrencyCode: globalData?.payoutCountryDetails?.preferredCurrency
|
|
3991
3145
|
}
|
|
3992
3146
|
)
|
|
3993
3147
|
}
|
|
3994
|
-
)
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
)
|
|
4012
|
-
}
|
|
4013
|
-
),
|
|
4014
|
-
/* @__PURE__ */ jsx(
|
|
4015
|
-
"div",
|
|
4016
|
-
{
|
|
4017
|
-
className: activeForm?.formId !== PayoutAccountDocumentsFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
4018
|
-
children: isExperimentEnabled(ExperimentNames.EnableBankDocumentClassification) ? /* @__PURE__ */ jsx(
|
|
4019
|
-
MemoizedBankDocumentClassification,
|
|
4020
|
-
{
|
|
4021
|
-
...bankDocumentFormProps,
|
|
4022
|
-
id: PayoutAccountDocumentsFormID,
|
|
4023
|
-
legalEntity: legalEntityResponse,
|
|
4024
|
-
country: bankCountry,
|
|
4025
|
-
formIsActive: activeForm?.formId === PayoutAccountDocumentsFormID
|
|
4026
|
-
}
|
|
4027
|
-
) : /* @__PURE__ */ jsx(
|
|
4028
|
-
MemoizedBankDocument,
|
|
4029
|
-
{
|
|
4030
|
-
...bankDocumentFormProps,
|
|
4031
|
-
id: PayoutAccountDocumentsFormID,
|
|
4032
|
-
legalEntity: legalEntityResponse,
|
|
4033
|
-
country: bankCountry,
|
|
4034
|
-
formIsActive: activeForm?.formId === PayoutAccountDocumentsFormID
|
|
4035
|
-
}
|
|
4036
|
-
)
|
|
4037
|
-
}
|
|
4038
|
-
)
|
|
4039
|
-
] }) }),
|
|
3148
|
+
),
|
|
3149
|
+
/* @__PURE__ */ jsx(
|
|
3150
|
+
"div",
|
|
3151
|
+
{
|
|
3152
|
+
className: activeForm?.formId !== PayoutAccountDocumentsFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
3153
|
+
children: /* @__PURE__ */ jsx(
|
|
3154
|
+
MemoizedBankDocumentClassification,
|
|
3155
|
+
{
|
|
3156
|
+
...bankDocumentFormProps,
|
|
3157
|
+
id: PayoutAccountDocumentsFormID,
|
|
3158
|
+
legalEntity: legalEntityResponse,
|
|
3159
|
+
country: bankCountry,
|
|
3160
|
+
formIsActive: activeForm?.formId === PayoutAccountDocumentsFormID
|
|
3161
|
+
}
|
|
3162
|
+
)
|
|
3163
|
+
}
|
|
3164
|
+
),
|
|
4040
3165
|
/* @__PURE__ */ jsx(Show, { when: showInstantVerificationPayoutModal, children: /* @__PURE__ */ jsx(
|
|
4041
3166
|
BankVerification,
|
|
4042
3167
|
{
|
|
@@ -4327,19 +3452,16 @@ function PayoutDetailsDropin({
|
|
|
4327
3452
|
const { t: commonT } = useTranslation("common");
|
|
4328
3453
|
const userEvents = useAnalyticsContext();
|
|
4329
3454
|
const { showToast, clearToasts } = useToastContext();
|
|
4330
|
-
const {
|
|
3455
|
+
const { isFeatureEnabled } = useToggleContext();
|
|
4331
3456
|
const { isSettingEnabled } = useSettingsContext();
|
|
4332
|
-
const enabledCrossBorderPayouts =
|
|
3457
|
+
const enabledCrossBorderPayouts = isFeatureEnabled(FeatureNames.EnableCrossBorderPayouts) && isSettingEnabled(SettingNames.AllowCrossBorderPayout);
|
|
4333
3458
|
const defaultPayoutCountry = getLegalEntityCountry(legalEntityResponse);
|
|
4334
|
-
const existingPayoutDetails = useMemo(
|
|
3459
|
+
const existingPayoutDetails = useMemo$1(
|
|
4335
3460
|
() => transferInstrument ? mapTransferInstrumentToPayoutAccount(transferInstrument, enabledCrossBorderPayouts) : void 0,
|
|
4336
3461
|
[transferInstrument]
|
|
4337
3462
|
);
|
|
4338
3463
|
const [documents, setDocuments] = useState();
|
|
4339
3464
|
const [isCaasCalled, setIsCaasCalled] = useState(false);
|
|
4340
|
-
const isPayoutVerificationMethodPageRedesignEnabled = isExperimentEnabled(
|
|
4341
|
-
ExperimentNames.EnablePayoutVerificationMethodPageRedesign
|
|
4342
|
-
);
|
|
4343
3465
|
const accountHolder = getPayoutAccountHolderName(legalEntityResponse, t);
|
|
4344
3466
|
const fallbackCurrency = currencyByCountry[defaultPayoutCountry]?.[0];
|
|
4345
3467
|
const accountHolderName = accountHolder || getLegalEntityNameBasedOnType(legalEntityResponse);
|
|
@@ -4396,12 +3518,6 @@ function PayoutDetailsDropin({
|
|
|
4396
3518
|
const [hasAsyncValidationError, setHasAsyncValidationError] = useState(false);
|
|
4397
3519
|
const isMaskedBankAccountNumber = data.payoutAccountDetails?.bankAccountNumber?.includes("*") || data.payoutAccountDetails?.iban?.includes("*");
|
|
4398
3520
|
const existingBankAccountFormat = transferInstrument ? transferInstrument?.bankAccount?.accountIdentification?.type === "numberAndBic" ? "numberAndBic" : existingPayoutDetails?.payoutAccountDetails?.iban ? "iban" : "local" : void 0;
|
|
4399
|
-
useEffect(() => {
|
|
4400
|
-
userEvents.updateBaseTrackingPayload({ task: taskType });
|
|
4401
|
-
userEvents.addTaskEvent("Landed on page", {
|
|
4402
|
-
actionType: "start"
|
|
4403
|
-
});
|
|
4404
|
-
}, []);
|
|
4405
3521
|
useEffect(() => {
|
|
4406
3522
|
setData({
|
|
4407
3523
|
...currentState.data,
|
|
@@ -4426,7 +3542,7 @@ function PayoutDetailsDropin({
|
|
|
4426
3542
|
enabled: instantVerificationEnabled
|
|
4427
3543
|
}
|
|
4428
3544
|
);
|
|
4429
|
-
const instantVerificationAvailable = useMemo(
|
|
3545
|
+
const instantVerificationAvailable = useMemo$1(
|
|
4430
3546
|
() => Boolean(instantVerificationEnabled && providers?.[0]?.redirectUrl),
|
|
4431
3547
|
[instantVerificationEnabled, providers]
|
|
4432
3548
|
);
|
|
@@ -4443,14 +3559,14 @@ function PayoutDetailsDropin({
|
|
|
4443
3559
|
country: bankAccountCountry,
|
|
4444
3560
|
existingBankAccountFormat
|
|
4445
3561
|
});
|
|
4446
|
-
const fieldsFromCustomRules = useMemo(
|
|
3562
|
+
const fieldsFromCustomRules = useMemo$1(
|
|
4447
3563
|
() => rules({
|
|
4448
3564
|
data,
|
|
4449
3565
|
requiredFields
|
|
4450
3566
|
}),
|
|
4451
|
-
[bankAccountCountry, data, taskType,
|
|
3567
|
+
[bankAccountCountry, data, taskType, isFeatureEnabled]
|
|
4452
3568
|
);
|
|
4453
|
-
const apiBankAccount = useMemo(() => {
|
|
3569
|
+
const apiBankAccount = useMemo$1(() => {
|
|
4454
3570
|
const payoutAccountDetails = data.payoutAccountDetails ?? { bankAccountNumber: "" };
|
|
4455
3571
|
return mapPayoutAccountSchemaToApiBankAccount(payoutAccountDetails, bankAccountCountry);
|
|
4456
3572
|
}, [data, bankAccountCountry]);
|
|
@@ -4467,7 +3583,7 @@ function PayoutDetailsDropin({
|
|
|
4467
3583
|
const provider = providers?.[0];
|
|
4468
3584
|
const isInstantVerificationFlow = data.payoutVerificationMethod?.payoutVerificationMethod === "instantVerification";
|
|
4469
3585
|
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
4470
|
-
const payoutDetailsSteps = useMemo(() => {
|
|
3586
|
+
const payoutDetailsSteps = useMemo$1(() => {
|
|
4471
3587
|
const appropriatePayoutDetailsSteps = getAppropriatePayoutDetailsSteps(
|
|
4472
3588
|
Boolean(prefilledData?.payoutAccountDetails?.transferInstrumentId),
|
|
4473
3589
|
instantVerificationAvailable,
|
|
@@ -4479,7 +3595,7 @@ function PayoutDetailsDropin({
|
|
|
4479
3595
|
}
|
|
4480
3596
|
return appropriatePayoutDetailsSteps;
|
|
4481
3597
|
}, [providers, checkAsAServiceResultStatus, isCheckAsAServiceError, isMaskedBankAccountNumber]);
|
|
4482
|
-
const derivedProps = useMemo(() => {
|
|
3598
|
+
const derivedProps = useMemo$1(() => {
|
|
4483
3599
|
return getPropsFromConfigurations({
|
|
4484
3600
|
scenarioConfiguration: fieldConfigurations,
|
|
4485
3601
|
forms: payoutDetailsSteps,
|
|
@@ -4504,7 +3620,7 @@ function PayoutDetailsDropin({
|
|
|
4504
3620
|
instantVerificationEnabled ? bankVendorsLoadingStatus : "success",
|
|
4505
3621
|
isSubmitting ? "loading" : "success"
|
|
4506
3622
|
);
|
|
4507
|
-
const forms = useMemo(() => {
|
|
3623
|
+
const forms = useMemo$1(() => {
|
|
4508
3624
|
const requiredForms = getRequiredForms(
|
|
4509
3625
|
payoutDetailsSteps,
|
|
4510
3626
|
derivedProps?.requiredFields,
|
|
@@ -4545,12 +3661,12 @@ function PayoutDetailsDropin({
|
|
|
4545
3661
|
[documentToUpload],
|
|
4546
3662
|
transferInstrument2.id
|
|
4547
3663
|
);
|
|
4548
|
-
documents2.forEach((
|
|
3664
|
+
documents2.forEach((document) => {
|
|
4549
3665
|
userEvents.addTaskEvent("Success", {
|
|
4550
3666
|
actionType: "upload",
|
|
4551
|
-
documentType: dataSubmitted.payoutAccountDocuments?.documentType ??
|
|
3667
|
+
documentType: dataSubmitted.payoutAccountDocuments?.documentType ?? document.type,
|
|
4552
3668
|
// tracks BankDocumentTypes
|
|
4553
|
-
fileExtention:
|
|
3669
|
+
fileExtention: document.attachments?.map((item) => getFileExtention(item.pageName ?? "")).filter((item) => item !== void 0) ?? void 0
|
|
4554
3670
|
});
|
|
4555
3671
|
});
|
|
4556
3672
|
} catch {
|
|
@@ -4702,6 +3818,7 @@ function PayoutDetailsDropin({
|
|
|
4702
3818
|
activeForm,
|
|
4703
3819
|
setShouldValidate,
|
|
4704
3820
|
gotoFormByFormIndex,
|
|
3821
|
+
gotoFormByFormId,
|
|
4705
3822
|
steps
|
|
4706
3823
|
} = useFormComposer({
|
|
4707
3824
|
problems,
|
|
@@ -4742,7 +3859,7 @@ function PayoutDetailsDropin({
|
|
|
4742
3859
|
setIsCaasCalled(false);
|
|
4743
3860
|
}, [forms, checkAsAServiceResultStatus, isCaasCalled]);
|
|
4744
3861
|
const handleFormNextClick = async () => {
|
|
4745
|
-
if (
|
|
3862
|
+
if (activeForm.formId === "payoutVerificationMethod") {
|
|
4746
3863
|
if (isInstantVerificationFlow) {
|
|
4747
3864
|
trackNavigation({
|
|
4748
3865
|
userEvents,
|
|
@@ -4776,7 +3893,7 @@ function PayoutDetailsDropin({
|
|
|
4776
3893
|
handleNextClick();
|
|
4777
3894
|
setPreviousTrustedInstrumentStatus(createTrustedTransferInstrumentStatus);
|
|
4778
3895
|
}
|
|
4779
|
-
if (
|
|
3896
|
+
if (activeForm.formId === "payoutVerificationMethod" && createTrustedTransferInstrumentStatus === "success") {
|
|
4780
3897
|
gotoFormByFormIndex(forms.length - 1);
|
|
4781
3898
|
setPreviousTrustedInstrumentStatus(createTrustedTransferInstrumentStatus);
|
|
4782
3899
|
}
|
|
@@ -4822,7 +3939,7 @@ function PayoutDetailsDropin({
|
|
|
4822
3939
|
summaryEditButton: ["payoutVerificationMethod", "payoutAccountVerification"]
|
|
4823
3940
|
}
|
|
4824
3941
|
},
|
|
4825
|
-
handleBackClick:
|
|
3942
|
+
handleBackClick: activeForm.formId !== "summary" ? handleBackClick : void 0,
|
|
4826
3943
|
handleNextClick: handleFormNextClick,
|
|
4827
3944
|
handleHomeClick,
|
|
4828
3945
|
handleCloseClick,
|
|
@@ -4833,6 +3950,7 @@ function PayoutDetailsDropin({
|
|
|
4833
3950
|
forms,
|
|
4834
3951
|
onSubmit,
|
|
4835
3952
|
gotoFormByFormIndex,
|
|
3953
|
+
gotoFormByFormId,
|
|
4836
3954
|
validateForm: () => setShouldValidate(true),
|
|
4837
3955
|
canSubmit: canSubmit(),
|
|
4838
3956
|
problems,
|