@justifi/webcomponents 6.12.6-rc.1 → 6.12.6
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/LICENSE +21 -0
- package/dist/cjs/{Analytics-CexlbLRl.js → Analytics-CuYtRPw5.js} +2 -2
- package/dist/cjs/{Plaid-KasiL5mp.js → Plaid-BRSyOOuw.js} +19 -14
- package/dist/cjs/{additional-questions-form-step_15.cjs.entry.js → additional-questions-form-step_14.cjs.entry.js} +169 -378
- package/dist/cjs/additional-questions_5.cjs.entry.js +7 -7
- package/dist/cjs/additional-statement_8.cjs.entry.js +1 -1
- package/dist/cjs/bank-account-billing-form-simple_4.cjs.entry.js +4 -4
- package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/{business-form-options-CnlrfbQ6.js → business-form-options-D_nM7NDk.js} +0 -51
- package/dist/cjs/{business-identity-schema-CC1wOwXd.js → business-identity-schema-DuFGX6_i.js} +7 -11
- package/dist/cjs/{business.service-BBovho58.js → business.service-Z9OACEQL.js} +1 -1
- package/dist/cjs/card-form.cjs.entry.js +2 -2
- package/dist/cjs/{check-pkg-version-jeIQGJ8A.js → check-pkg-version-CPWLIT6P.js} +1 -1
- package/dist/cjs/{checkout.service-C0M9hmsL.js → checkout.service-BZOyqXgW.js} +1 -1
- package/dist/cjs/{country-config-Ck-eEeZZ.js → country-config-aJp8ScEs.js} +0 -2
- package/dist/cjs/dispute-notification_2.cjs.entry.js +6 -6
- package/dist/cjs/{event-types-DDNVjmfR.js → event-types-AU1B76Vm.js} +1 -1
- package/dist/cjs/form-address-fields_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-number_2.cjs.entry.js +4 -5
- package/dist/cjs/{get-business-Ggw-UjXj.js → get-business-aR-C83KX.js} +2 -2
- package/dist/cjs/{get-payment-details-BVKRwME1.js → get-payment-details-dwhA02Zl.js} +2 -2
- package/dist/cjs/{get-subaccounts-RRmcS9xU.js → get-subaccounts-B1jmSa2d.js} +2 -2
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/{index.esm-BNETBIV_.js → index.esm-C1ZPG85l.js} +18 -0
- package/dist/cjs/justifi-apple-pay_11.cjs.entry.js +11 -10
- package/dist/cjs/justifi-bank-account-billing-form-simple.cjs.entry.js +5 -5
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-billing-form-full.cjs.entry.js +1 -1
- package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +8 -8
- package/dist/cjs/justifi-business-form.cjs.entry.js +13 -13
- package/dist/cjs/justifi-card-billing-form-simple.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkout.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +8 -8
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +7 -7
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +6 -6
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +9 -9
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +7 -7
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +7 -7
- package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -8
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +7 -7
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +9 -9
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +9 -9
- package/dist/cjs/justifi-save-new-payment-method.cjs.entry.js +1 -1
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +6 -6
- package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{lodash-CxSkBibc.js → lodash-C4mGy21w.js} +38 -27
- package/dist/cjs/{package-CDegPd7E.js → package-Dxjq_cJI.js} +1 -1
- package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
- package/dist/cjs/{payment-provisioning-actions-Cn8bgHKu.js → payment-provisioning-actions-BiSpysjW.js} +2 -2
- package/dist/cjs/payment-provisioning-form-buttons_2.cjs.entry.js +2 -3
- package/dist/cjs/{payment.service-CbIxt30x.js → payment.service-ByrgA_QZ.js} +1 -1
- package/dist/cjs/{payout.service-DVMvsdAf.js → payout.service-CnQm_BpU.js} +1 -1
- package/dist/cjs/{payouts-status-CzS2CLGW.js → payouts-status-AuS3Mp0V.js} +2 -2
- package/dist/cjs/{plaid.service-DNT_DX6z.js → plaid.service-Dlb8EUR8.js} +1 -1
- package/dist/cjs/{schema-validations-DackMxv7.js → schema-validations-DNPcvDh5.js} +8 -11
- package/dist/cjs/styled-host-DAi5SuFa.js +11 -0
- package/dist/cjs/{terminal.service-BBHixg-d.js → terminal.service-BdwHQ3Vv.js} +1 -1
- package/dist/cjs/{utils-kDsk4nqH.js → utils-FVGp6se3.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Document.js +7 -14
- package/dist/collection/collection-manifest.json +0 -2
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +3 -5
- package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +2 -4
- package/dist/collection/components/business-forms/owner-form/owner-form.js +1 -46
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/additional-questions-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +114 -6
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +0 -8
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +2 -4
- package/dist/collection/components/business-forms/payment-provisioning/justifi-payment-provisioning.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +2 -3
- package/dist/collection/components/business-forms/schemas/business-bank-account-schema.js +38 -10
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +1 -1
- package/dist/collection/components/business-forms/schemas/business-identity-schema.js +3 -7
- package/dist/collection/components/business-forms/schemas/schema-validations.js +5 -8
- package/dist/collection/components/business-forms/utils/business-form-options.js +0 -50
- package/dist/collection/components/business-forms/utils/country-config.js +0 -2
- package/dist/collection/components/modular-checkout/sub-components/justifi-google-pay.js +8 -6
- package/dist/collection/ui-components/form/form-control-file.js +1 -1
- package/dist/docs.json +76 -502
- package/dist/esm/{Analytics-5J6H0ALl.js → Analytics-CwckfiSK.js} +2 -2
- package/dist/esm/{Plaid-BM3JUIG5.js → Plaid-l6nNIjab.js} +19 -15
- package/dist/esm/{additional-questions-form-step_15.entry.js → additional-questions-form-step_14.entry.js} +169 -377
- package/dist/esm/additional-questions_5.entry.js +8 -8
- package/dist/esm/additional-statement_8.entry.js +1 -1
- package/dist/esm/bank-account-billing-form-simple_4.entry.js +4 -4
- package/dist/esm/bank-account-form.entry.js +2 -2
- package/dist/esm/{business-form-options-DXjZp4Rl.js → business-form-options-DRalxlqN.js} +1 -51
- package/dist/esm/{business-identity-schema-D8L_UfWl.js → business-identity-schema-0Q3kck3C.js} +7 -11
- package/dist/esm/{business.service-C4BD3pf7.js → business.service-C31wbMVs.js} +1 -1
- package/dist/esm/card-form.entry.js +2 -2
- package/dist/esm/{check-pkg-version-C7cHTIM0.js → check-pkg-version-Dy2NK3Nn.js} +1 -1
- package/dist/esm/{checkout.service-DmWeKNQs.js → checkout.service-cVdOGDuI.js} +1 -1
- package/dist/esm/{country-config-BW2dUoTJ.js → country-config-CdvhLcnT.js} +0 -2
- package/dist/esm/dispute-notification_2.entry.js +6 -6
- package/dist/esm/{event-types-eIqsrwmW.js → event-types-DalU_6SB.js} +1 -1
- package/dist/esm/form-address-fields_3.entry.js +1 -1
- package/dist/esm/form-control-number_2.entry.js +4 -5
- package/dist/esm/{get-business-DtFHdc37.js → get-business-Gg6qn5on.js} +2 -2
- package/dist/esm/{get-payment-details-26GxiYgv.js → get-payment-details-BiWgSJau.js} +2 -2
- package/dist/esm/{get-subaccounts-xkGMPstt.js → get-subaccounts-CkjZeR9U.js} +2 -2
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/{index.esm-KCSohgHx.js → index.esm-BHdVU4hV.js} +18 -1
- package/dist/esm/justifi-apple-pay_11.entry.js +11 -10
- package/dist/esm/justifi-bank-account-billing-form-simple.entry.js +5 -5
- package/dist/esm/justifi-bank-account-form.entry.js +5 -5
- package/dist/esm/justifi-billing-form-full.entry.js +1 -1
- package/dist/esm/justifi-billing-form.entry.js +1 -1
- package/dist/esm/justifi-business-details.entry.js +8 -8
- package/dist/esm/justifi-business-form.entry.js +13 -13
- package/dist/esm/justifi-card-billing-form-simple.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +5 -5
- package/dist/esm/justifi-checkout.entry.js +5 -5
- package/dist/esm/justifi-checkouts-list-filters.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list.entry.js +8 -8
- package/dist/esm/justifi-dispute-management.entry.js +7 -7
- package/dist/esm/justifi-gross-payment-chart.entry.js +6 -6
- package/dist/esm/justifi-order-terminals.entry.js +9 -9
- package/dist/esm/justifi-payment-details.entry.js +8 -8
- package/dist/esm/justifi-payment-provisioning.entry.js +9 -9
- package/dist/esm/justifi-payment-transactions-list.entry.js +7 -7
- package/dist/esm/justifi-payments-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +7 -7
- package/dist/esm/justifi-payout-details.entry.js +8 -8
- package/dist/esm/justifi-payout-transactions-list.entry.js +7 -7
- package/dist/esm/justifi-payouts-list-filters.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +9 -9
- package/dist/esm/justifi-refund-payment.entry.js +9 -9
- package/dist/esm/justifi-save-new-payment-method.entry.js +1 -1
- package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
- package/dist/esm/justifi-skeleton.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
- package/dist/esm/justifi-terminals-list-filters.entry.js +3 -3
- package/dist/esm/justifi-terminals-list.entry.js +8 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{lodash-CrGKVSPp.js → lodash-BF_QgjtL.js} +38 -27
- package/dist/esm/{package-8R9xLun-.js → package-DAZd_gFd.js} +1 -1
- package/dist/esm/payment-method-option.entry.js +1 -1
- package/dist/esm/{payment-provisioning-actions-fWdNDUdq.js → payment-provisioning-actions-cl5xIYnF.js} +2 -2
- package/dist/esm/payment-provisioning-form-buttons_2.entry.js +2 -3
- package/dist/esm/{payment.service-CWR7jF-K.js → payment.service-5_u-UzTY.js} +1 -1
- package/dist/esm/{payout.service-CFU362cH.js → payout.service-D2zS5y8N.js} +1 -1
- package/dist/esm/{payouts-status-D2G7FKu1.js → payouts-status-DCjCGTaa.js} +2 -2
- package/dist/esm/{plaid.service-0hd1i5Ga.js → plaid.service-BiJ65YG8.js} +1 -1
- package/dist/esm/{schema-validations-CjqWFLKt.js → schema-validations-A1o1biOB.js} +8 -11
- package/dist/esm/styled-host-D6byRazK.js +9 -0
- package/dist/esm/{terminal.service-Dr6dERcJ.js → terminal.service-CIxDfM7V.js} +1 -1
- package/dist/esm/{utils-q7KOrlSX.js → utils-C1B2hVAB.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Plaid.js +19 -15
- package/dist/module/additional-questions-form-step2.js +5 -11
- package/dist/module/bank-account-document-form-inputs.js +1 -55
- package/dist/module/bank-account-document-form-inputs2.js +57 -0
- package/dist/module/business-bank-account-form-step2.js +177 -24
- package/dist/module/business-core-info-form-step2.js +2 -2
- package/dist/module/business-core-info-schema.js +1 -1
- package/dist/module/business-core-info2.js +3 -3
- package/dist/module/business-documents-on-file2.js +1 -1
- package/dist/module/business-form-options.js +1 -51
- package/dist/module/business-identity-schema.js +3 -7
- package/dist/module/business-owners-form-step2.js +0 -8
- package/dist/module/business-representative-form-inputs2.js +3 -5
- package/dist/module/business-representative2.js +5 -6
- package/dist/module/button.js +1 -1
- package/dist/module/country-config.js +0 -2
- package/dist/module/form-control-number2.js +1 -1
- package/dist/module/form-control-textarea2.js +1 -1
- package/dist/module/form.js +18 -1
- package/dist/module/hidden-input2.js +1 -1
- package/dist/module/iframe-input2.js +1 -1
- package/dist/module/justifi-checkouts-list-filters.js +1 -1
- package/dist/module/justifi-checkouts-list.js +2 -2
- package/dist/module/justifi-dispute-management.js +1 -1
- package/dist/module/justifi-google-pay2.js +4 -3
- package/dist/module/justifi-modular-checkout2.js +1 -1
- package/dist/module/justifi-order-terminals.js +2 -2
- package/dist/module/justifi-payment-details.js +1 -1
- package/dist/module/justifi-payment-provisioning.js +27 -33
- package/dist/module/justifi-payment-transactions-list.js +2 -2
- package/dist/module/justifi-payments-list.js +1 -1
- package/dist/module/justifi-payout-details.js +1 -1
- package/dist/module/justifi-payout-transactions-list.js +2 -2
- package/dist/module/justifi-payouts-list-filters.js +1 -1
- package/dist/module/justifi-payouts-list.js +2 -2
- package/dist/module/justifi-refund-payment.js +1 -1
- package/dist/module/justifi-terminal-orders-list-filters.js +1 -1
- package/dist/module/justifi-terminal-orders-list.js +2 -2
- package/dist/module/justifi-terminals-list-filters.js +1 -1
- package/dist/module/justifi-terminals-list.js +2 -2
- package/dist/module/lodash.js +38 -27
- package/dist/module/owner-form-inputs2.js +3 -5
- package/dist/module/owner-form2.js +1 -10
- package/dist/module/package.js +1 -1
- package/dist/module/parts.js +1 -1
- package/dist/module/payment-provisioning-actions.js +1 -1
- package/dist/module/payment-provisioning-form-steps2.js +28 -35
- package/dist/module/plaid-verification2.js +1 -1
- package/dist/module/schema-validations.js +5 -8
- package/dist/module/skeleton.js +1 -1
- package/dist/module/styled-host.js +1 -1
- package/dist/module/table.js +1 -1
- package/dist/module/terminal-quantity-selector2.js +1 -1
- package/dist/types/api/Document.d.ts +2 -15
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +0 -2
- package/dist/types/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.d.ts +12 -1
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-form-steps.d.ts +0 -1
- package/dist/types/components/business-forms/schemas/business-bank-account-schema.d.ts +4 -4
- package/dist/types/components/business-forms/utils/business-form-options.d.ts +0 -1
- package/dist/types/components/modular-checkout/sub-components/justifi-google-pay.d.ts +1 -1
- package/dist/types/components.d.ts +10 -71
- package/dist/webcomponents/p-034fa691.entry.js +1 -0
- package/dist/webcomponents/{p-086f7eea.entry.js → p-07eaee91.entry.js} +1 -1
- package/dist/webcomponents/{p-2e063c5d.entry.js → p-08ab97ce.entry.js} +1 -1
- package/dist/webcomponents/{p-80fdd013.entry.js → p-1f34b2f7.entry.js} +1 -1
- package/dist/webcomponents/{p-3bcac405.entry.js → p-279c17ac.entry.js} +1 -1
- package/dist/webcomponents/{p-29b82954.entry.js → p-2a5ee558.entry.js} +1 -1
- package/dist/webcomponents/p-2aac2ab6.entry.js +1 -0
- package/dist/webcomponents/p-37254105.entry.js +1 -0
- package/dist/webcomponents/{p-a7e0ab9b.entry.js → p-38209a25.entry.js} +1 -1
- package/dist/webcomponents/{p-4b14b7e7.entry.js → p-3cefb032.entry.js} +1 -1
- package/dist/webcomponents/{p-8ed1bc07.entry.js → p-3ef07f42.entry.js} +1 -1
- package/dist/webcomponents/{p-a5ad9183.entry.js → p-41637e4a.entry.js} +1 -1
- package/dist/webcomponents/{p-92d8a14b.entry.js → p-4b39a470.entry.js} +1 -1
- package/dist/webcomponents/{p-6b21947c.entry.js → p-4ee55e7d.entry.js} +1 -1
- package/dist/webcomponents/p-5G1OMxZz.js +1 -0
- package/dist/webcomponents/p-6904c62c.entry.js +1 -0
- package/dist/webcomponents/{p-5f071ee0.entry.js → p-7377f7d1.entry.js} +1 -1
- package/dist/webcomponents/{p-48a866ae.entry.js → p-78c4668b.entry.js} +1 -1
- package/dist/webcomponents/{p-c2e09203.entry.js → p-8e56430a.entry.js} +1 -1
- package/dist/webcomponents/{p-947950cc.entry.js → p-9153c121.entry.js} +1 -1
- package/dist/webcomponents/p-9b5ca32c.entry.js +1 -0
- package/dist/webcomponents/{p-04d6d725.entry.js → p-9d676f54.entry.js} +1 -1
- package/dist/webcomponents/{p-BrFax4_P.js → p-APOabprT.js} +1 -1
- package/dist/webcomponents/p-Aacb4jqT.js +1 -0
- package/dist/webcomponents/{p-CeW0EPHy.js → p-Axa3cgnH.js} +1 -1
- package/dist/webcomponents/{p-CL8LyqRI.js → p-BJu1-9kE.js} +1 -1
- package/dist/webcomponents/{p-czJ2qSU1.js → p-BXyADlAH.js} +1 -1
- package/dist/webcomponents/{p-xWuaNtJy.js → p-Ba8jdOkX.js} +1 -1
- package/dist/webcomponents/{p-DvnFba1A.js → p-BdpSLMs7.js} +1 -1
- package/dist/webcomponents/p-BqNNwq6C.js +1 -0
- package/dist/webcomponents/{p-BBSnDYJw.js → p-Bt4GjEWL.js} +1 -1
- package/dist/webcomponents/{p-C-zuQNNP.js → p-BxKbnILQ.js} +1 -1
- package/dist/webcomponents/{p-D9sqTVmd.js → p-CKiAlBsU.js} +1 -1
- package/dist/webcomponents/{p-CDu7TeCZ.js → p-Cm9f5fyh.js} +1 -1
- package/dist/webcomponents/p-D8ytux5N.js +1 -0
- package/dist/webcomponents/p-DAZd_gFd.js +1 -0
- package/dist/webcomponents/{p-DdeBubpX.js → p-Dk26hk5T.js} +1 -1
- package/dist/webcomponents/p-DrMJliVY.js +1 -0
- package/dist/webcomponents/{p-Dzv0P2Ly.js → p-NZS8uCtH.js} +1 -1
- package/dist/webcomponents/p-OeJ-3w3l.js +9 -0
- package/dist/webcomponents/p-XIWgia4J.js +1 -0
- package/dist/webcomponents/{p-8db8d7e7.entry.js → p-a2c25cc4.entry.js} +1 -1
- package/dist/webcomponents/{p-de1ccbea.entry.js → p-a56e43a1.entry.js} +1 -1
- package/dist/webcomponents/{p-a3b48ba3.entry.js → p-a7a1b168.entry.js} +1 -1
- package/dist/webcomponents/{p-85c0abdb.entry.js → p-a9e82502.entry.js} +1 -1
- package/dist/webcomponents/{p-BSyTbuZy.js → p-av6jyzyC.js} +1 -1
- package/dist/webcomponents/{p-0b169fac.entry.js → p-b0b6083f.entry.js} +1 -1
- package/dist/webcomponents/{p-86eb32d8.entry.js → p-b21010cb.entry.js} +1 -1
- package/dist/webcomponents/{p-1e34c488.entry.js → p-b62ff001.entry.js} +1 -1
- package/dist/webcomponents/{p-c1b48216.entry.js → p-b8351983.entry.js} +1 -1
- package/dist/webcomponents/{p-3960e6b7.entry.js → p-bc2dddf3.entry.js} +1 -1
- package/dist/webcomponents/{p-3e10a0de.entry.js → p-c4767c7b.entry.js} +1 -1
- package/dist/webcomponents/p-c8bc235f.entry.js +1 -0
- package/dist/webcomponents/{p-0a4fcb15.entry.js → p-ca87c609.entry.js} +1 -1
- package/dist/webcomponents/{p-ba2ab989.entry.js → p-cf3e3394.entry.js} +1 -1
- package/dist/webcomponents/{p-e0e6c2df.entry.js → p-d01a1076.entry.js} +1 -1
- package/dist/webcomponents/{p-a4520dba.entry.js → p-d5edbea3.entry.js} +1 -1
- package/dist/webcomponents/{p-b17ce21d.entry.js → p-d79c5ee4.entry.js} +1 -1
- package/dist/webcomponents/{p-562447ad.entry.js → p-e02d7751.entry.js} +4 -4
- package/dist/webcomponents/{p-c3cc4ad6.entry.js → p-e07506b7.entry.js} +1 -1
- package/dist/webcomponents/{p-cc558e25.entry.js → p-e17b92ec.entry.js} +1 -1
- package/dist/webcomponents/p-ea254f14.entry.js +1 -0
- package/dist/webcomponents/{p-ca1c2048.entry.js → p-ebb7b693.entry.js} +1 -1
- package/dist/webcomponents/{p-0e4cda77.entry.js → p-f1b9cbf0.entry.js} +1 -1
- package/dist/webcomponents/{p-Cz0yhyYu.js → p-fE5A37L5.js} +1 -1
- package/dist/webcomponents/p-ff8cf16c.entry.js +1 -0
- package/dist/webcomponents/p-nb_LhbJq.js +1 -0
- package/dist/webcomponents/{p--RbNhyet.js → p-oTtn8xDw.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +14 -14
- package/dist/cjs/bank-account-document-form-inputs.cjs.entry.js +0 -21
- package/dist/cjs/styled-host-Ch0-dxF-.js +0 -11
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.js +0 -435
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-list.js +0 -52
- package/dist/collection/components/business-forms/payment-provisioning/document-upload/document-upload-options.js +0 -72
- package/dist/esm/bank-account-document-form-inputs.entry.js +0 -19
- package/dist/esm/styled-host-D84RBv1W.js +0 -9
- package/dist/module/document-upload-form-step.d.ts +0 -11
- package/dist/module/document-upload-form-step.js +0 -6
- package/dist/module/document-upload-form-step2.js +0 -397
- package/dist/module/document-upload-list.d.ts +0 -11
- package/dist/module/document-upload-list.js +0 -6
- package/dist/module/document-upload-list2.js +0 -46
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-form-step.d.ts +0 -44
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-list.d.ts +0 -6
- package/dist/types/components/business-forms/payment-provisioning/document-upload/document-upload-options.d.ts +0 -44
- package/dist/webcomponents/p-37676092.entry.js +0 -1
- package/dist/webcomponents/p-54ee2a30.entry.js +0 -1
- package/dist/webcomponents/p-58adef16.entry.js +0 -1
- package/dist/webcomponents/p-8R9xLun-.js +0 -1
- package/dist/webcomponents/p-92e7ce54.entry.js +0 -1
- package/dist/webcomponents/p-9ce2a98a.entry.js +0 -1
- package/dist/webcomponents/p-B1yVkh15.js +0 -1
- package/dist/webcomponents/p-BzXQDB0t.js +0 -1
- package/dist/webcomponents/p-C_ifLmT1.js +0 -9
- package/dist/webcomponents/p-D9ZHVy-j.js +0 -1
- package/dist/webcomponents/p-DV4n8kZd.js +0 -1
- package/dist/webcomponents/p-DzEdYT8R.js +0 -1
- package/dist/webcomponents/p-a2ed63df.entry.js +0 -1
- package/dist/webcomponents/p-a9976353.entry.js +0 -1
- package/dist/webcomponents/p-c9599fc7.entry.js +0 -1
- package/dist/webcomponents/p-cab840bd.entry.js +0 -1
- package/dist/webcomponents/p-n_pmf4AT.js +0 -1
- package/dist/webcomponents/p-vUN_uvAi.js +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-CV0Pyo1O.js';
|
|
2
|
-
import { C as ComponentErrorSeverity, e as ComponentErrorCodes, z as EntityDocument, w as PLAID_ERROR_SEVERITY, x as PLAID_ERROR_MESSAGES, y as PlaidErrorCodes } from './Plaid-
|
|
3
|
-
import { m as makeGetBusiness, a as makePatchBusiness, c as makePostBankAccount, d as makePostDocumentRecord, e as makeGetIdentity, f as makePatchIdentity, g as makePostIdentity } from './payment-provisioning-actions-
|
|
4
|
-
import { B as BusinessService, a as BusinessBankAccountService, D as DocumentRecordService, I as IdentityService } from './business.service-
|
|
5
|
-
import { a as additionalQuestionsSchema, d as businessCoreInfoSchemaCAN, b as businessCoreInfoSchemaUSA, g as identitySchemaByCountry, h as addressSchemaByCountry } from './business-identity-schema-
|
|
6
|
-
import { F as FormController, c as create$3, a as create$6, b as create$7 } from './index.esm-
|
|
2
|
+
import { C as ComponentErrorSeverity, e as ComponentErrorCodes, E as EntityDocumentType, z as EntityDocumentStorage, B as EntityDocument, w as PLAID_ERROR_SEVERITY, x as PLAID_ERROR_MESSAGES, y as PlaidErrorCodes } from './Plaid-l6nNIjab.js';
|
|
3
|
+
import { m as makeGetBusiness, a as makePatchBusiness, c as makePostBankAccount, d as makePostDocumentRecord, e as makeGetIdentity, f as makePatchIdentity, g as makePostIdentity } from './payment-provisioning-actions-cl5xIYnF.js';
|
|
4
|
+
import { B as BusinessService, a as BusinessBankAccountService, D as DocumentRecordService, I as IdentityService } from './business.service-C31wbMVs.js';
|
|
5
|
+
import { a as additionalQuestionsSchema, d as businessCoreInfoSchemaCAN, b as businessCoreInfoSchemaUSA, g as identitySchemaByCountry, h as addressSchemaByCountry } from './business-identity-schema-0Q3kck3C.js';
|
|
6
|
+
import { F as FormController, c as create$3, a as create$6, b as create$8, d as create$7 } from './index.esm-BHdVU4hV.js';
|
|
7
7
|
import { A as AdditionalQuestions, C as CountryCode, e as CoreBusinessInfo, R as Representative, f as Address, O as Owner } from './Business-BcNb9bVO.js';
|
|
8
8
|
import { C as CURRENCY_MASK, P as PHONE_MASKS, I as IDENTITY_MASKS } from './form-input-masks-CVaOFfrI.js';
|
|
9
9
|
import { b as heading2, a0 as buttonSecondary, C as buttonLink, x as label, u as inputDisabled, D as card, aa as table, a6 as tableHeadCell, aj as tableCell, am as alert, A as heading3, a1 as buttonPrimary } from './parts-CPKMvyV_.js';
|
|
10
10
|
import { P as PaymentProvisioningLoading } from './payment-provisioning-loading-Dve2xQA4.js';
|
|
11
|
-
import {
|
|
11
|
+
import { b as businessServiceReceivedOptions, a as bankAccountTypeOptions, c as businessClassificationOptions } from './business-form-options-DRalxlqN.js';
|
|
12
12
|
import { a as BusinessFormStep, B as BusinessFormClickActions } from './event-types-XYgDHrVL.js';
|
|
13
|
-
import { n as numberOnlyHandler } from './utils-BnjCmwMr.js';
|
|
14
13
|
import './config-state-kKn89dp1.js';
|
|
15
14
|
import './dinero-HXpYMWUU.js';
|
|
16
15
|
import './Pagination-CLHwhyvu.js';
|
|
17
|
-
import {
|
|
16
|
+
import { n as numberOnlyHandler } from './utils-BnjCmwMr.js';
|
|
17
|
+
import { B as accountNumberValidation, C as accountTypeValidation, v as identityNameValidation, D as nicknameValidation, E as bankNameValidation, F as numbersOnlyRegex, G as routingNumberValidation } from './schema-validations-A1o1biOB.js';
|
|
18
18
|
import { B as Button } from './button-BvzOzV4l.js';
|
|
19
19
|
import './event-types-CZfYo5-1.js';
|
|
20
|
-
import { c as countryLabels } from './country-config-
|
|
20
|
+
import { c as countryLabels } from './country-config-CdvhLcnT.js';
|
|
21
21
|
import { s as snakeCaseToHumanReadable, b as formatDate, d as formatTime } from './utils-BTtxWI2r.js';
|
|
22
22
|
import { S as Skeleton } from './skeleton-BEHo2ypu.js';
|
|
23
23
|
import { u as updateFormValues, a as updateAddressFormValues, b as updateDateOfBirthFormValues } from './input-handlers-1lVyzImK.js';
|
|
24
24
|
import { A as Api } from './Api-DMd8hTI-.js';
|
|
25
|
-
import { S as StyledHost } from './styled-host-
|
|
26
|
-
import { P as PlaidService } from './plaid.service-
|
|
27
|
-
import './utils-
|
|
25
|
+
import { S as StyledHost } from './styled-host-D6byRazK.js';
|
|
26
|
+
import { P as PlaidService } from './plaid.service-BiJ65YG8.js';
|
|
27
|
+
import './utils-C1B2hVAB.js';
|
|
28
28
|
import './_commonjsHelpers-BFTU3MAI.js';
|
|
29
29
|
import './index-cDVGjRkU.js';
|
|
30
30
|
|
|
@@ -179,7 +179,7 @@ const AdditionalQuestionsFormStep = class {
|
|
|
179
179
|
if (this.isLoading) {
|
|
180
180
|
return h(PaymentProvisioningLoading, null);
|
|
181
181
|
}
|
|
182
|
-
return (h("form", null, h("fieldset", null, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Additional Questions"), h("form-control-tooltip", { helpText: "This information helps us understand the business and identify and monitor trends to safeguard you and your customers." })), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-monetary-provisioning", { name: "business_revenue", label: "What is your business' estimated annual revenue from its primary business activities?", inputHandler: this.inputHandler, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { class: "col-12 col-md-6" }, h("form-control-monetary-provisioning", { name: "business_payment_volume", label: "What is your business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { class: "col-12" }, h("form-control-
|
|
182
|
+
return (h("form", null, h("fieldset", null, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Additional Questions"), h("form-control-tooltip", { helpText: "This information helps us understand the business and identify and monitor trends to safeguard you and your customers." })), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-monetary-provisioning", { name: "business_revenue", label: "What is your business' estimated annual revenue from its primary business activities?", inputHandler: this.inputHandler, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { class: "col-12 col-md-6" }, h("form-control-monetary-provisioning", { name: "business_payment_volume", label: "What is your business' annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { class: "col-12" }, h("form-control-text", { name: "business_average_transaction_amount", label: "What is your average transaction size?", inputHandler: this.inputHandler, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_average_transaction_amount, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_average_transaction_amount })), h("div", { class: "col-12" }, h("form-control-select", { name: "business_when_service_received", label: "On average, how long after paying will your customers typically receive their goods or services?", inputHandler: this.inputHandler, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_when_service_received, options: businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), h("div", { class: "col-12" }, h("form-control-text", { name: "business_other_payment_details", label: "Is there anything else you would like us to know about how your customers pay the business? (optional)", inputHandler: this.inputHandler, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details }))))));
|
|
183
183
|
}
|
|
184
184
|
static get watchers() { return {
|
|
185
185
|
"authToken": ["propChanged"],
|
|
@@ -188,6 +188,15 @@ const AdditionalQuestionsFormStep = class {
|
|
|
188
188
|
}; }
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
+
const BankAccountDocumentFormInputs = class {
|
|
192
|
+
constructor(hostRef) {
|
|
193
|
+
registerInstance(this, hostRef);
|
|
194
|
+
}
|
|
195
|
+
render() {
|
|
196
|
+
return (h("div", { key: 'd0dacb95d07d3e4ca9bc2c9f23b6c490871da4e9', class: "row gy-3" }, h("div", { key: '02ed406f38558badf9f591e076b120d09c71f83b', class: "col-12" }, h("form-control-file", { key: '11ff1dc68264b9e5aa561ffe19b423abc1a00c78', name: "voided_check", label: "Voided Check", documentType: EntityDocumentType.voidedCheck, inputHandler: this.inputHandler, onFileSelected: this.storeFiles, errorText: this.errors["voided_check"], multiple: true })), h("div", { key: '71d26407522a75a54489155566c18af1a64c1417', class: "col-12" }, h("form-control-file", { key: '7ea42e03a44c223a5fedc273e94e635e70d54f4b', name: "bank_statement", label: "Bank Statement", documentType: EntityDocumentType.bankStatement, inputHandler: this.inputHandler, onFileSelected: this.storeFiles, errorText: this.errors["bank_statement"], multiple: true }))));
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
191
200
|
const BankAccountFormInputs = class {
|
|
192
201
|
constructor(hostRef) {
|
|
193
202
|
registerInstance(this, hostRef);
|
|
@@ -208,6 +217,9 @@ const BankAccountFormInputsCanada = class {
|
|
|
208
217
|
}
|
|
209
218
|
};
|
|
210
219
|
|
|
220
|
+
const checkExistingDocs = (documents, documentType) => {
|
|
221
|
+
return documents.some((doc) => doc.document_type === documentType);
|
|
222
|
+
};
|
|
211
223
|
const buildCommonFieldRules = (allowOptionalFields) => {
|
|
212
224
|
if (allowOptionalFields) {
|
|
213
225
|
return {
|
|
@@ -226,6 +238,30 @@ const buildCommonFieldRules = (allowOptionalFields) => {
|
|
|
226
238
|
account_number: accountNumberValidation.required('Enter account number'),
|
|
227
239
|
};
|
|
228
240
|
};
|
|
241
|
+
const buildDocumentRules = (documents, allowOptionalFields) => {
|
|
242
|
+
if (allowOptionalFields) {
|
|
243
|
+
return {
|
|
244
|
+
voided_check: create$8().nullable(),
|
|
245
|
+
bank_statement: create$8().nullable(),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
const existingVoidedCheck = checkExistingDocs(documents, EntityDocumentType.voidedCheck);
|
|
249
|
+
const existingBankStatement = checkExistingDocs(documents, EntityDocumentType.bankStatement);
|
|
250
|
+
const existingDocument = existingVoidedCheck || existingBankStatement;
|
|
251
|
+
const documentErrorText = 'Please upload either a voided check or a bank statement. Only one is required.';
|
|
252
|
+
return {
|
|
253
|
+
voided_check: create$8().when('bank_statement', {
|
|
254
|
+
is: (val) => !val && !existingDocument,
|
|
255
|
+
then: (schema) => schema.required(documentErrorText),
|
|
256
|
+
otherwise: (schema) => schema.notRequired(),
|
|
257
|
+
}),
|
|
258
|
+
bank_statement: create$8().when('voided_check', {
|
|
259
|
+
is: (val) => !val && !existingDocument,
|
|
260
|
+
then: (schema) => schema.required(documentErrorText),
|
|
261
|
+
otherwise: (schema) => schema.notRequired(),
|
|
262
|
+
}),
|
|
263
|
+
};
|
|
264
|
+
};
|
|
229
265
|
const buildUSARules = (allowOptionalFields) => {
|
|
230
266
|
if (allowOptionalFields) {
|
|
231
267
|
return { routing_number: routingNumberValidation.nullable() };
|
|
@@ -250,17 +286,17 @@ const buildCANRules = (allowOptionalFields) => {
|
|
|
250
286
|
transit_number: transitNumberValidation.required('Enter transit number'),
|
|
251
287
|
};
|
|
252
288
|
};
|
|
253
|
-
const businessBankAccountSchemaUSA = (allowOptionalFields) => {
|
|
254
|
-
const shape = Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildUSARules(allowOptionalFields));
|
|
255
|
-
return create$3().shape(shape);
|
|
289
|
+
const businessBankAccountSchemaUSA = (documents, allowOptionalFields) => {
|
|
290
|
+
const shape = Object.assign(Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildUSARules(allowOptionalFields)), buildDocumentRules(documents, allowOptionalFields));
|
|
291
|
+
return create$3().shape(shape, [['voided_check', 'bank_statement']]);
|
|
256
292
|
};
|
|
257
|
-
const businessBankAccountSchemaCAN = (allowOptionalFields) => {
|
|
258
|
-
const shape = Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildCANRules(allowOptionalFields));
|
|
259
|
-
return create$3().shape(shape);
|
|
293
|
+
const businessBankAccountSchemaCAN = (documents, allowOptionalFields) => {
|
|
294
|
+
const shape = Object.assign(Object.assign(Object.assign({}, buildCommonFieldRules(allowOptionalFields)), buildCANRules(allowOptionalFields)), buildDocumentRules(documents, allowOptionalFields));
|
|
295
|
+
return create$3().shape(shape, [['voided_check', 'bank_statement']]);
|
|
260
296
|
};
|
|
261
297
|
const bankAccountSchemaByCountry = {
|
|
262
|
-
[CountryCode.USA]: (allowOptionalFields) => businessBankAccountSchemaUSA(allowOptionalFields),
|
|
263
|
-
[CountryCode.CAN]: (allowOptionalFields) => businessBankAccountSchemaCAN(allowOptionalFields),
|
|
298
|
+
[CountryCode.USA]: (allowOptionalFields, documents = []) => businessBankAccountSchemaUSA(documents, allowOptionalFields),
|
|
299
|
+
[CountryCode.CAN]: (allowOptionalFields, documents = []) => businessBankAccountSchemaCAN(documents, allowOptionalFields),
|
|
264
300
|
};
|
|
265
301
|
|
|
266
302
|
const BusinessBankAccountFormStep = class {
|
|
@@ -271,13 +307,15 @@ const BusinessBankAccountFormStep = class {
|
|
|
271
307
|
this.formLoading = createEvent(this, "formLoading", 7);
|
|
272
308
|
this.errors = {};
|
|
273
309
|
this.bankAccount = {};
|
|
310
|
+
this.existingDocuments = [];
|
|
311
|
+
this.documentData = new EntityDocumentStorage();
|
|
274
312
|
this.isLoading = false;
|
|
275
313
|
this.viewMode = 'manual';
|
|
276
314
|
this.bankAccountVerification = false;
|
|
277
315
|
this.platformAccountId = null;
|
|
278
316
|
this.getSchema = () => {
|
|
279
317
|
const schema = bankAccountSchemaByCountry[this.country];
|
|
280
|
-
return schema(this.allowOptionalFields);
|
|
318
|
+
return schema(this.allowOptionalFields, this.existingDocuments);
|
|
281
319
|
};
|
|
282
320
|
this.initializeFormController = () => {
|
|
283
321
|
this.formController = new FormController(this.getSchema());
|
|
@@ -294,6 +332,12 @@ const BusinessBankAccountFormStep = class {
|
|
|
294
332
|
this.inputHandler = (name, value) => {
|
|
295
333
|
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
296
334
|
};
|
|
335
|
+
this.storeFiles = (e) => {
|
|
336
|
+
const fileList = Array.from(e.detail.fileList);
|
|
337
|
+
const docType = e.detail.document_type;
|
|
338
|
+
const documentList = fileList.map(file => new EntityDocument({ file, document_type: docType }, this.businessId));
|
|
339
|
+
this.documentData[docType] = documentList;
|
|
340
|
+
};
|
|
297
341
|
this.getData = () => {
|
|
298
342
|
this.isLoading = true;
|
|
299
343
|
this.getBusiness({
|
|
@@ -316,10 +360,12 @@ const BusinessBankAccountFormStep = class {
|
|
|
316
360
|
};
|
|
317
361
|
this.handleChangeBankAccount = () => {
|
|
318
362
|
this.viewMode = this.plaidAvailable ? 'plaid' : 'manual';
|
|
363
|
+
this.documentData = new EntityDocumentStorage();
|
|
319
364
|
this.initializeFormController();
|
|
320
365
|
};
|
|
321
366
|
this.handleCancel = () => {
|
|
322
367
|
this.viewMode = this.existingBankAccount ? 'readonly' : 'plaid';
|
|
368
|
+
this.documentData = new EntityDocumentStorage();
|
|
323
369
|
this.initializeFormController();
|
|
324
370
|
};
|
|
325
371
|
this.handleToggleToManualEntry = () => {
|
|
@@ -335,6 +381,66 @@ const BusinessBankAccountFormStep = class {
|
|
|
335
381
|
});
|
|
336
382
|
});
|
|
337
383
|
};
|
|
384
|
+
this.postDocumentRecordData = async (docData) => {
|
|
385
|
+
this.isLoading = true;
|
|
386
|
+
const payload = docData.record_data;
|
|
387
|
+
return new Promise((resolve) => {
|
|
388
|
+
this.postDocumentRecord({
|
|
389
|
+
payload,
|
|
390
|
+
onSuccess: (response) => {
|
|
391
|
+
resolve(this.handleDocRecordResponse(docData, response));
|
|
392
|
+
},
|
|
393
|
+
onError: ({ error, code, severity }) => {
|
|
394
|
+
this.errorEvent.emit({
|
|
395
|
+
message: error,
|
|
396
|
+
errorCode: code,
|
|
397
|
+
severity: severity
|
|
398
|
+
});
|
|
399
|
+
resolve(false);
|
|
400
|
+
},
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
this.handleDocRecordResponse = (docData, response) => {
|
|
405
|
+
if (response.error) {
|
|
406
|
+
this.errorEvent.emit({
|
|
407
|
+
errorCode: ComponentErrorCodes.POST_ERROR,
|
|
408
|
+
message: response.error.message,
|
|
409
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
410
|
+
data: response.error,
|
|
411
|
+
});
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
docData.setPresignedUrl(response.data.presigned_url);
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
this.uploadDocument = async (docData) => {
|
|
420
|
+
if (!docData.presigned_url) {
|
|
421
|
+
throw new Error('Presigned URL is not set');
|
|
422
|
+
}
|
|
423
|
+
const fileData = await docData.getFileData();
|
|
424
|
+
const response = await fetch(docData.presigned_url, {
|
|
425
|
+
method: 'PUT',
|
|
426
|
+
body: fileData
|
|
427
|
+
});
|
|
428
|
+
return this.handleUploadResponse(response);
|
|
429
|
+
};
|
|
430
|
+
this.handleUploadResponse = (response) => {
|
|
431
|
+
if (response.error) {
|
|
432
|
+
this.errorEvent.emit({
|
|
433
|
+
errorCode: ComponentErrorCodes.POST_ERROR,
|
|
434
|
+
message: response.error.message,
|
|
435
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
436
|
+
data: response.error,
|
|
437
|
+
});
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
return true;
|
|
442
|
+
}
|
|
443
|
+
};
|
|
338
444
|
}
|
|
339
445
|
propChanged() {
|
|
340
446
|
this.initializeApi();
|
|
@@ -373,6 +479,10 @@ const BusinessBankAccountFormStep = class {
|
|
|
373
479
|
authToken: this.authToken,
|
|
374
480
|
service: new BusinessBankAccountService()
|
|
375
481
|
});
|
|
482
|
+
this.postDocumentRecord = makePostDocumentRecord({
|
|
483
|
+
authToken: this.authToken,
|
|
484
|
+
service: new DocumentRecordService()
|
|
485
|
+
});
|
|
376
486
|
}
|
|
377
487
|
else {
|
|
378
488
|
this.errorEvent.emit({
|
|
@@ -398,7 +508,7 @@ const BusinessBankAccountFormStep = class {
|
|
|
398
508
|
return this.bankAccountVerification || this.existingBankAccount;
|
|
399
509
|
}
|
|
400
510
|
processBusinessResponse(data) {
|
|
401
|
-
const { bank_accounts, settings, platform_account_id } = data;
|
|
511
|
+
const { bank_accounts, documents, settings, platform_account_id } = data;
|
|
402
512
|
if (bank_accounts.length > 0) {
|
|
403
513
|
this.bankAccount = new BankAccount(bank_accounts[bank_accounts.length - 1]);
|
|
404
514
|
}
|
|
@@ -406,6 +516,7 @@ const BusinessBankAccountFormStep = class {
|
|
|
406
516
|
this.bankAccount = new BankAccount({});
|
|
407
517
|
this.bankAccount.business_id = this.businessId;
|
|
408
518
|
}
|
|
519
|
+
this.existingDocuments = documents;
|
|
409
520
|
this.bankAccountVerification = settings.bank_account_verification === true;
|
|
410
521
|
this.platformAccountId = platform_account_id;
|
|
411
522
|
}
|
|
@@ -426,6 +537,11 @@ const BusinessBankAccountFormStep = class {
|
|
|
426
537
|
const bankAccountPosted = await this.postBankAccountData();
|
|
427
538
|
if (!bankAccountPosted)
|
|
428
539
|
return;
|
|
540
|
+
}
|
|
541
|
+
const documentsUploaded = await this.postBusinessDocuments();
|
|
542
|
+
if (!documentsUploaded)
|
|
543
|
+
return;
|
|
544
|
+
if (this.viewMode === 'manual') {
|
|
429
545
|
this.viewMode = 'readonly';
|
|
430
546
|
await this.refreshBankAccountData();
|
|
431
547
|
}
|
|
@@ -489,6 +605,27 @@ const BusinessBankAccountFormStep = class {
|
|
|
489
605
|
});
|
|
490
606
|
});
|
|
491
607
|
}
|
|
608
|
+
async postBusinessDocuments() {
|
|
609
|
+
this.isLoading = true;
|
|
610
|
+
try {
|
|
611
|
+
const docArray = Object.values(this.documentData).flat();
|
|
612
|
+
if (!docArray.length) {
|
|
613
|
+
return true;
|
|
614
|
+
}
|
|
615
|
+
const recordsCreated = await Promise.all(docArray.map((docData) => this.postDocumentRecordData(docData))); // Create document records
|
|
616
|
+
if (recordsCreated.includes(false)) {
|
|
617
|
+
return false;
|
|
618
|
+
} // Exit if document record creation fails
|
|
619
|
+
const uploadsCompleted = await Promise.all(docArray.map((docData) => this.uploadDocument(docData))); // Upload documents to AWS presigned URLs
|
|
620
|
+
if (uploadsCompleted.includes(false)) {
|
|
621
|
+
return false;
|
|
622
|
+
} // Exit if any upload fails
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
625
|
+
finally {
|
|
626
|
+
this.isLoading = false;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
492
629
|
renderBankAccountInputs(disabled) {
|
|
493
630
|
const defaultValue = this.formController.getInitialValues();
|
|
494
631
|
return this.country === CountryCode.CAN ? (h("bank-account-form-inputs-canada", { defaultValue: defaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: disabled })) : (h("bank-account-form-inputs", { defaultValue: defaultValue, errors: this.errors, inputHandler: this.inputHandler, formDisabled: disabled }));
|
|
@@ -505,11 +642,14 @@ const BusinessBankAccountFormStep = class {
|
|
|
505
642
|
renderManualEntryView() {
|
|
506
643
|
return (h("div", null, this.plaidAvailable && (h("div", { class: "mb-3" }, h(Button, { type: "button", variant: "secondary", onClick: this.handleToggleToPlaidVerification, disabled: this.isLoading, part: buttonSecondary }, "Link bank account with Plaid instead"))), this.renderBankAccountInputs(false), h("div", { class: "mt-3 d-flex gap-2" }, this.showCancel && (h(Button, { variant: "secondary", type: "button", onClick: this.handleCancel, disabled: this.isLoading, part: buttonSecondary }, "Cancel")), h(Button, { variant: "primary", type: "button", onClick: this.handleSaveBankAccount, disabled: this.isLoading, isLoading: this.isLoading }, "Save Bank Account"))));
|
|
507
644
|
}
|
|
645
|
+
renderDocumentUploads() {
|
|
646
|
+
return (h("fieldset", { class: "mt-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Document Uploads"), h("form-control-tooltip", { helpText: "One document (voided check or bank statement) is required for underwriting purposes. It needs to visibly show the name tied to the account and the account number. Various file formats such as PDF, DOC, DOCX, JPEG are accepted. Multiple files can be uploaded for each document category." })), h("hr", { class: "mt-2" }), h("business-documents-on-file", { documents: this.existingDocuments, isLoading: this.isLoading }), h("bank-account-document-form-inputs", { inputHandler: this.inputHandler, errors: this.errors, storeFiles: this.storeFiles })));
|
|
647
|
+
}
|
|
508
648
|
render() {
|
|
509
649
|
if (this.isLoading) {
|
|
510
650
|
return h(PaymentProvisioningLoading, null);
|
|
511
651
|
}
|
|
512
|
-
return (h("form", null, h("fieldset", { class: "mb-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Bank Account Info"), h("form-control-tooltip", { helpText: "This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship." })), h("hr", { class: "mt-2" }), this.viewMode === 'readonly' && this.renderReadonlyView(), this.viewMode === 'plaid' && this.renderPlaidView(), this.viewMode === 'manual' && this.renderManualEntryView())));
|
|
652
|
+
return (h("form", null, h("fieldset", { class: "mb-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Bank Account Info"), h("form-control-tooltip", { helpText: "This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship." })), h("hr", { class: "mt-2" }), this.viewMode === 'readonly' && this.renderReadonlyView(), this.viewMode === 'plaid' && this.renderPlaidView(), this.viewMode === 'manual' && this.renderManualEntryView()), this.viewMode !== 'plaid' && this.renderDocumentUploads()));
|
|
513
653
|
}
|
|
514
654
|
static get watchers() { return {
|
|
515
655
|
"authToken": ["propChanged"],
|
|
@@ -639,7 +779,7 @@ const BusinessCoreInfoFormStep = class {
|
|
|
639
779
|
if (this.isLoading) {
|
|
640
780
|
return h(PaymentProvisioningLoading, null);
|
|
641
781
|
}
|
|
642
|
-
return (h("form", null, h("fieldset", null, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Business Information")), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "legal_name", label: "Business Name", defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)." })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)" })), h("div", { class: "col-12 col-md-8" }, h("form-control-select", { name: "classification", label: "Business Classification", options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-date", { name: "date_of_incorporation", label: "Date of Registration", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler, helpText: "Describe what you sell" })), h("div", { class: "col-12 col-md-6" }, (!((_a = this.coreInfo) === null || _a === void 0 ? void 0 : _a.tax_id_last4) || this.isEditingTaxId) ? (h("form-control-number-masked", { name: "tax_id", label: countryLabels[this.country].
|
|
782
|
+
return (h("form", null, h("fieldset", null, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Business Information")), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "legal_name", label: "Business Name", defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)." })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler, helpText: "Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)" })), h("div", { class: "col-12 col-md-8" }, h("form-control-select", { name: "classification", label: "Business Classification", options: businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-date", { name: "date_of_incorporation", label: "Date of Registration", defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler, helpText: "Describe what you sell" })), h("div", { class: "col-12 col-md-6" }, (!((_a = this.coreInfo) === null || _a === void 0 ? void 0 : _a.tax_id_last4) || this.isEditingTaxId) ? (h("form-control-number-masked", { name: "tax_id", label: countryLabels[this.country].taxIdLabel, defaultValue: this.isEditingTaxId ? '' : coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, mask: '000000000', helpText: countryLabels[this.country].taxIdHelpText })) : (h("div", null, h("label", { class: "form-label", part: label }, countryLabels[this.country].taxIdLabel), h("div", { class: "input-group mb-3" }, h("input", { type: "text", class: "form-control", part: inputDisabled, value: `****${(_b = this.coreInfo) === null || _b === void 0 ? void 0 : _b.tax_id_last4}`, disabled: true }), h("button", { class: "btn btn-secondary", type: "button", part: buttonSecondary, onClick: () => {
|
|
643
783
|
this.isEditingTaxId = true;
|
|
644
784
|
// Clear last4-equivalent and current value if any future conditional validation depends on it
|
|
645
785
|
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { tax_id: '', tax_id_last4: null }));
|
|
@@ -791,14 +931,6 @@ const BusinessOwnersFormStep = class {
|
|
|
791
931
|
if (!formsValid) {
|
|
792
932
|
return;
|
|
793
933
|
}
|
|
794
|
-
if (!this.allowOptionalFields) {
|
|
795
|
-
const percentages = await Promise.all(this.refs.map(ref => ref.getOwnershipPercentage()));
|
|
796
|
-
const total = percentages.reduce((sum, p) => sum + (parseFloat(p) || 0), 0);
|
|
797
|
-
if (total !== 100) {
|
|
798
|
-
await Promise.all(this.refs.map(ref => ref.setOwnershipPercentageError('Ownership percentages must total 100%')));
|
|
799
|
-
return;
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
934
|
const formSubmissions = this.refs.map(ref => ref.submit());
|
|
803
935
|
const submissionsValid = (await Promise.all(formSubmissions)).every(result => result);
|
|
804
936
|
if (!submissionsValid) {
|
|
@@ -876,14 +1008,14 @@ const BusinessRepresentativeFormInputs = class {
|
|
|
876
1008
|
}
|
|
877
1009
|
render() {
|
|
878
1010
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
879
|
-
return (h("form", { key: '
|
|
1011
|
+
return (h("form", { key: 'ef49167cc726b3d4efa128503553a77a7627ebee' }, h("fieldset", { key: '3714ce7eab6e9cee062911564d1c2635b68dfc8b' }, h("div", { key: '4f27236b0438e29d7449bf5e9f71c00c7245effa', class: "d-flex align-items-center gap-2" }, h("legend", { key: 'adc144da314549264571b245c5388ab56c1dbbf1', class: "mb-0", part: heading2 }, "Representative"), h("form-control-tooltip", { key: 'bcc76add04febe984427103a594aa63cab17bd27', helpText: "The representative for your business needs to be someone who has significant control over managing your business's finance. You will have an opportunity to add owners later in the form." })), h("hr", { key: '98bfed19989ee57e451a7005f3e60af16cc5d3b5', class: "mt-2" }), h("div", { key: '8f5e0e3deed2627ecf9f77290f268c0e2ee68bfa', class: "row gy-3" }, h("div", { key: 'b1205284a54a608b9c3b6be386e134849c9c6b25', class: "col-12 col-md-8" }, h("form-control-text", { key: '36fcd91ca263adfd9fb69dc88f15404f93a8bc13', name: "name", label: "Full Name", defaultValue: (_a = this.representativeDefaultValue) === null || _a === void 0 ? void 0 : _a.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: '879337d3c6a120f5dc9de3cd3364b34b9c4689df', class: "col-12 col-md-4" }, h("form-control-text", { key: 'ff2e4d29e76b93693735b35cbaca4416f0cd28a0', name: "title", label: "Title", defaultValue: (_b = this.representativeDefaultValue) === null || _b === void 0 ? void 0 : _b.title, errorText: this.errors.title, inputHandler: this.inputHandler, helpText: "Role at your business, e.g. President, CEO, Treasurer." })), h("div", { key: '2a011b74b4c203ae4a309d7d76ea8fd0631a5f2c', class: "col-12 col-md-6" }, h("form-control-text", { key: '1ef20c59829ed3abe81cc53355bbafd5d4894360', name: "email", label: "Email Address", defaultValue: (_c = this.representativeDefaultValue) === null || _c === void 0 ? void 0 : _c.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '460dad175238fdfea8c79666343943a95aac0fd5', class: "col-12 col-md-6" }, h("form-control-number-masked", { key: '7bd3ad79f6da1d33e38c2246d9c0378c2ef8b7d7', name: "phone", label: "Phone Number", defaultValue: (_d = this.representativeDefaultValue) === null || _d === void 0 ? void 0 : _d.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { key: 'cda84bfc9f88a35177a42b7f9ec4c58292600c0b', class: "col-12 col-md-4" }, h("form-control-date", { key: '5ed66fabc97afc94a5839135add25dbcb5237900', name: "dob_full", label: "Birth Date", defaultValue: (_e = this.representativeDefaultValue) === null || _e === void 0 ? void 0 : _e.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: (e) => updateDateOfBirthFormValues(e, this.formController), helpText: "Must be 18 or older." })), h("div", { key: '0e19619fd081ea9dacd0eb25388a4c7b2c993312', class: "col-12 col-md-8" }, (!((_f = this.representativeDefaultValue) === null || _f === void 0 ? void 0 : _f.ssn_last4) || this.isEditingIdentification) ? (h("form-control-number-masked", { name: "identification_number", label: countryLabels[this.country].idNumberLabel, defaultValue: this.isEditingIdentification ? '' : (_g = this.representativeDefaultValue) === null || _g === void 0 ? void 0 : _g.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: IDENTITY_MASKS[this.country], helpText: countryLabels[this.country].identityHelpText })) : (h("div", null, h("label", { class: "form-label", part: label }, countryLabels[this.country].idNumberLabel), h("div", { class: "input-group mb-3" }, h("input", { type: "text", class: "form-control", part: inputDisabled, value: `****${(_h = this.representativeDefaultValue) === null || _h === void 0 ? void 0 : _h.ssn_last4}`, disabled: true }), h("button", { class: "btn btn-secondary", type: "button", part: buttonSecondary, onClick: () => {
|
|
880
1012
|
this.isEditingIdentification = true;
|
|
881
1013
|
// Clear current value to force validation
|
|
882
1014
|
updateFormValues(this.formController, {
|
|
883
1015
|
identification_number: '',
|
|
884
1016
|
ssn_last4: null
|
|
885
1017
|
});
|
|
886
|
-
} }, "Change"))))), h("div", { key: '
|
|
1018
|
+
} }, "Change"))))), h("div", { key: '6647390b209f5a630bf60e8952a7b0e70c92ca8a', class: "col-12" }, h("identity-address-form", { key: '9755d0450fc8d83ba0a98a304455df346ff33e7f', errors: this.errors.address, defaultValues: (_j = this.representativeDefaultValue) === null || _j === void 0 ? void 0 : _j.address, handleFormUpdate: this.onAddressFormUpdate, country: this.country }))))));
|
|
887
1019
|
}
|
|
888
1020
|
};
|
|
889
1021
|
|
|
@@ -1136,339 +1268,6 @@ const BusinessTermsConditionsFormStep = class {
|
|
|
1136
1268
|
}
|
|
1137
1269
|
};
|
|
1138
1270
|
|
|
1139
|
-
const businessDocumentOptions = [
|
|
1140
|
-
{ label: 'Select a document type', value: '' },
|
|
1141
|
-
{ label: 'Articles of Incorporation', value: 'articles_of_incorporation' },
|
|
1142
|
-
{ label: 'Business Registration', value: 'business_registration' },
|
|
1143
|
-
];
|
|
1144
|
-
const financialDocumentOptions = [
|
|
1145
|
-
{ label: 'Select a document type', value: '' },
|
|
1146
|
-
{ label: 'Voided Check', value: 'voided_check' },
|
|
1147
|
-
{ label: 'Bank Statement', value: 'bank_statement' },
|
|
1148
|
-
];
|
|
1149
|
-
const personalDocGroup1Options = [
|
|
1150
|
-
{ label: 'Select a document type', value: '' },
|
|
1151
|
-
{ label: 'Canadian Passport', value: 'passport' },
|
|
1152
|
-
{ label: 'Canadian Driver\'s License', value: 'driver_license' },
|
|
1153
|
-
{ label: 'Canadian Government Issued ID Card', value: 'government_id' },
|
|
1154
|
-
{ label: 'Permanent Resident Card', value: 'resident_card' },
|
|
1155
|
-
{ label: 'Certificate of Indian Status', value: 'status_card' },
|
|
1156
|
-
{ label: 'US State Issued Driver\'s License', value: 'driver_license' },
|
|
1157
|
-
];
|
|
1158
|
-
const personalDocGroup2Options = [
|
|
1159
|
-
{ label: 'Select a document type', value: '' },
|
|
1160
|
-
{ label: 'Nexus Card (Photo ID)', value: 'nexus_card' },
|
|
1161
|
-
{ label: 'Canadian Citizenship/Naturalization Card or Certificate', value: 'citizenship_card' },
|
|
1162
|
-
{ label: 'Foreign Passport', value: 'foreign_passport' },
|
|
1163
|
-
{ label: 'Canadian Birth Certificate', value: 'birth_certificate' },
|
|
1164
|
-
{ label: 'Social Insurance Number (SIN) Card', value: 'sin_card' },
|
|
1165
|
-
{ label: 'Social Security Number (SSN) Card', value: 'ssn_card' },
|
|
1166
|
-
];
|
|
1167
|
-
const staticCategories = [
|
|
1168
|
-
{
|
|
1169
|
-
label: 'Business Document',
|
|
1170
|
-
value: 'business_document',
|
|
1171
|
-
docTypeOptions: businessDocumentOptions,
|
|
1172
|
-
},
|
|
1173
|
-
{
|
|
1174
|
-
label: 'Financial Document',
|
|
1175
|
-
value: 'financial_document',
|
|
1176
|
-
docTypeOptions: financialDocumentOptions,
|
|
1177
|
-
},
|
|
1178
|
-
];
|
|
1179
|
-
function buildOwnerCategories(owners) {
|
|
1180
|
-
const group1Opts = personalDocGroup1Options.filter(o => o.value !== '');
|
|
1181
|
-
const group2Opts = personalDocGroup2Options.filter(o => o.value !== '');
|
|
1182
|
-
return owners.map(owner => ({
|
|
1183
|
-
label: `${owner.name} - Identity Document`,
|
|
1184
|
-
value: `personal_${owner.id}`,
|
|
1185
|
-
identityId: owner.id,
|
|
1186
|
-
docTypeOptions: [
|
|
1187
|
-
{ label: 'Select a document type', value: '' },
|
|
1188
|
-
{ label: '── Group 1 ──', value: '_group1_header' },
|
|
1189
|
-
...group1Opts,
|
|
1190
|
-
{ label: '── Group 2 ──', value: '_group2_header' },
|
|
1191
|
-
...group2Opts,
|
|
1192
|
-
],
|
|
1193
|
-
}));
|
|
1194
|
-
}
|
|
1195
|
-
const financialOnlyCategories = [
|
|
1196
|
-
{
|
|
1197
|
-
label: 'Financial Document',
|
|
1198
|
-
value: 'financial_document',
|
|
1199
|
-
docTypeOptions: financialDocumentOptions,
|
|
1200
|
-
},
|
|
1201
|
-
];
|
|
1202
|
-
function buildAllCategories(owners, country) {
|
|
1203
|
-
if (country === CountryCode.USA) {
|
|
1204
|
-
return financialOnlyCategories;
|
|
1205
|
-
}
|
|
1206
|
-
return [...staticCategories, ...buildOwnerCategories(owners)];
|
|
1207
|
-
}
|
|
1208
|
-
const personalDocGroup1Types = new Set(personalDocGroup1Options.filter(o => o.value).map(o => o.value));
|
|
1209
|
-
const personalDocGroup2Types = new Set(personalDocGroup2Options.filter(o => o.value).map(o => o.value));
|
|
1210
|
-
|
|
1211
|
-
const DocumentUploadFormStep = class {
|
|
1212
|
-
constructor(hostRef) {
|
|
1213
|
-
registerInstance(this, hostRef);
|
|
1214
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
1215
|
-
this.stepCompleteEvent = createEvent(this, "complete-form-step-event", 7);
|
|
1216
|
-
this.formLoading = createEvent(this, "formLoading", 7);
|
|
1217
|
-
this.owners = [];
|
|
1218
|
-
this.existingDocuments = [];
|
|
1219
|
-
this.selectedCategory = '';
|
|
1220
|
-
this.selectedDocType = '';
|
|
1221
|
-
this.uploadQueue = [];
|
|
1222
|
-
this.isLoading = false;
|
|
1223
|
-
this.errors = {};
|
|
1224
|
-
this.fileInputKey = 0;
|
|
1225
|
-
this.categories = [];
|
|
1226
|
-
this.getData = () => {
|
|
1227
|
-
this.isLoading = true;
|
|
1228
|
-
this.getBusiness({
|
|
1229
|
-
onSuccess: (response) => {
|
|
1230
|
-
const { owners, documents } = response.data;
|
|
1231
|
-
this.owners = owners || [];
|
|
1232
|
-
this.existingDocuments = documents || [];
|
|
1233
|
-
this.categories = buildAllCategories(this.owners, this.country);
|
|
1234
|
-
},
|
|
1235
|
-
onError: ({ error, code, severity }) => {
|
|
1236
|
-
this.errorEvent.emit({
|
|
1237
|
-
message: error,
|
|
1238
|
-
errorCode: code,
|
|
1239
|
-
severity: severity,
|
|
1240
|
-
});
|
|
1241
|
-
},
|
|
1242
|
-
final: () => {
|
|
1243
|
-
this.isLoading = false;
|
|
1244
|
-
}
|
|
1245
|
-
});
|
|
1246
|
-
};
|
|
1247
|
-
this.handleCategoryChange = (_name, value) => {
|
|
1248
|
-
this.selectedCategory = value;
|
|
1249
|
-
this.selectedDocType = '';
|
|
1250
|
-
};
|
|
1251
|
-
this.handleDocTypeChange = (_name, value) => {
|
|
1252
|
-
if (value.startsWith('_') && value.endsWith('_header'))
|
|
1253
|
-
return;
|
|
1254
|
-
this.selectedDocType = value;
|
|
1255
|
-
};
|
|
1256
|
-
this.handleFileSelected = async (e) => {
|
|
1257
|
-
const fileList = Array.from(e.detail.fileList);
|
|
1258
|
-
const category = this.categories.find(c => c.value === this.selectedCategory);
|
|
1259
|
-
if (!category)
|
|
1260
|
-
return;
|
|
1261
|
-
const docTypeOption = category.docTypeOptions.find(o => o.value === this.selectedDocType);
|
|
1262
|
-
const docTypeLabel = (docTypeOption === null || docTypeOption === void 0 ? void 0 : docTypeOption.label) || this.selectedDocType;
|
|
1263
|
-
const newEntries = fileList.map(file => ({
|
|
1264
|
-
categoryLabel: category.label,
|
|
1265
|
-
categoryValue: category.value,
|
|
1266
|
-
docTypeLabel,
|
|
1267
|
-
docTypeValue: this.selectedDocType,
|
|
1268
|
-
fileName: file.name,
|
|
1269
|
-
file,
|
|
1270
|
-
identityId: category.identityId,
|
|
1271
|
-
status: 'uploading',
|
|
1272
|
-
}));
|
|
1273
|
-
const startIndex = this.uploadQueue.length;
|
|
1274
|
-
this.uploadQueue = [...this.uploadQueue, ...newEntries];
|
|
1275
|
-
this.selectedCategory = '';
|
|
1276
|
-
this.selectedDocType = '';
|
|
1277
|
-
this.fileInputKey++;
|
|
1278
|
-
await Promise.all(newEntries.map(async (entry, i) => {
|
|
1279
|
-
const index = startIndex + i;
|
|
1280
|
-
try {
|
|
1281
|
-
const docData = new EntityDocument({ file: entry.file, document_type: entry.docTypeValue }, this.businessId, entry.identityId);
|
|
1282
|
-
const recordCreated = await this.postDocumentRecordData(docData);
|
|
1283
|
-
if (!recordCreated) {
|
|
1284
|
-
this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: 'error' }) : e);
|
|
1285
|
-
return;
|
|
1286
|
-
}
|
|
1287
|
-
const uploaded = await this.uploadDocument(docData);
|
|
1288
|
-
this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: uploaded ? 'uploaded' : 'error' }) : e);
|
|
1289
|
-
}
|
|
1290
|
-
catch (_a) {
|
|
1291
|
-
this.uploadQueue = this.uploadQueue.map((e, j) => j === index ? Object.assign(Object.assign({}, e), { status: 'error' }) : e);
|
|
1292
|
-
}
|
|
1293
|
-
}));
|
|
1294
|
-
};
|
|
1295
|
-
this.postDocumentRecordData = async (docData) => {
|
|
1296
|
-
const payload = docData.record_data;
|
|
1297
|
-
return new Promise((resolve) => {
|
|
1298
|
-
this.postDocumentRecord({
|
|
1299
|
-
payload,
|
|
1300
|
-
onSuccess: (response) => {
|
|
1301
|
-
resolve(this.handleDocRecordResponse(docData, response));
|
|
1302
|
-
},
|
|
1303
|
-
onError: ({ error, code, severity }) => {
|
|
1304
|
-
this.errorEvent.emit({
|
|
1305
|
-
message: error,
|
|
1306
|
-
errorCode: code,
|
|
1307
|
-
severity: severity,
|
|
1308
|
-
});
|
|
1309
|
-
resolve(false);
|
|
1310
|
-
},
|
|
1311
|
-
});
|
|
1312
|
-
});
|
|
1313
|
-
};
|
|
1314
|
-
this.handleDocRecordResponse = (docData, response) => {
|
|
1315
|
-
if (response.error) {
|
|
1316
|
-
this.errorEvent.emit({
|
|
1317
|
-
errorCode: ComponentErrorCodes.POST_ERROR,
|
|
1318
|
-
message: response.error.message,
|
|
1319
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
1320
|
-
data: response.error,
|
|
1321
|
-
});
|
|
1322
|
-
return false;
|
|
1323
|
-
}
|
|
1324
|
-
else {
|
|
1325
|
-
docData.setPresignedUrl(response.data.presigned_url);
|
|
1326
|
-
return true;
|
|
1327
|
-
}
|
|
1328
|
-
};
|
|
1329
|
-
this.uploadDocument = async (docData) => {
|
|
1330
|
-
if (!docData.presigned_url) {
|
|
1331
|
-
throw new Error('Presigned URL is not set');
|
|
1332
|
-
}
|
|
1333
|
-
const fileData = await docData.getFileData();
|
|
1334
|
-
const response = await fetch(docData.presigned_url, {
|
|
1335
|
-
method: 'PUT',
|
|
1336
|
-
body: fileData,
|
|
1337
|
-
});
|
|
1338
|
-
if (!response.ok) {
|
|
1339
|
-
this.errorEvent.emit({
|
|
1340
|
-
errorCode: ComponentErrorCodes.POST_ERROR,
|
|
1341
|
-
message: 'Failed to upload document',
|
|
1342
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
1343
|
-
});
|
|
1344
|
-
return false;
|
|
1345
|
-
}
|
|
1346
|
-
return true;
|
|
1347
|
-
};
|
|
1348
|
-
}
|
|
1349
|
-
propChanged() {
|
|
1350
|
-
this.initializeApi();
|
|
1351
|
-
}
|
|
1352
|
-
watchHandler(newValue) {
|
|
1353
|
-
this.formLoading.emit(newValue);
|
|
1354
|
-
}
|
|
1355
|
-
async validateAndSubmit({ onSuccess }) {
|
|
1356
|
-
const validationErrors = this.validate();
|
|
1357
|
-
if (Object.keys(validationErrors).length > 0) {
|
|
1358
|
-
this.errors = validationErrors;
|
|
1359
|
-
return;
|
|
1360
|
-
}
|
|
1361
|
-
this.errors = {};
|
|
1362
|
-
this.stepCompleteEvent.emit({ response: null, formStep: BusinessFormStep.documentUpload });
|
|
1363
|
-
onSuccess();
|
|
1364
|
-
}
|
|
1365
|
-
componentWillLoad() {
|
|
1366
|
-
this.initializeApi();
|
|
1367
|
-
if (this.getBusiness) {
|
|
1368
|
-
this.getData();
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
initializeApi() {
|
|
1372
|
-
if (this.authToken && this.businessId) {
|
|
1373
|
-
this.getBusiness = makeGetBusiness({
|
|
1374
|
-
authToken: this.authToken,
|
|
1375
|
-
businessId: this.businessId,
|
|
1376
|
-
service: new BusinessService()
|
|
1377
|
-
});
|
|
1378
|
-
this.postDocumentRecord = makePostDocumentRecord({
|
|
1379
|
-
authToken: this.authToken,
|
|
1380
|
-
service: new DocumentRecordService()
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
else {
|
|
1384
|
-
this.errorEvent.emit({
|
|
1385
|
-
message: 'Missing required props',
|
|
1386
|
-
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
1387
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
1388
|
-
});
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
get categoryOptions() {
|
|
1392
|
-
return [
|
|
1393
|
-
{ label: 'Select a category', value: '' },
|
|
1394
|
-
...this.categories.map(c => ({ label: c.label, value: c.value })),
|
|
1395
|
-
];
|
|
1396
|
-
}
|
|
1397
|
-
get docTypeOptions() {
|
|
1398
|
-
if (!this.selectedCategory) {
|
|
1399
|
-
return [{ label: 'Select a category first', value: '' }];
|
|
1400
|
-
}
|
|
1401
|
-
const category = this.categories.find(c => c.value === this.selectedCategory);
|
|
1402
|
-
return (category === null || category === void 0 ? void 0 : category.docTypeOptions) || [{ label: 'Select a category first', value: '' }];
|
|
1403
|
-
}
|
|
1404
|
-
validate() {
|
|
1405
|
-
if (this.allowOptionalFields)
|
|
1406
|
-
return {};
|
|
1407
|
-
const errors = {};
|
|
1408
|
-
const financialDocTypes = ['voided_check', 'bank_statement'];
|
|
1409
|
-
const hasExistingDoc = (types) => this.existingDocuments.some(doc => types.includes(doc.document_type));
|
|
1410
|
-
const hasUploadedDoc = (categoryValue) => this.uploadQueue.some(entry => entry.categoryValue === categoryValue && entry.status === 'uploaded');
|
|
1411
|
-
if (!hasUploadedDoc('financial_document') && !hasExistingDoc(financialDocTypes)) {
|
|
1412
|
-
errors['financial_document'] = 'Please upload a financial document';
|
|
1413
|
-
}
|
|
1414
|
-
if (this.country === CountryCode.CAN) {
|
|
1415
|
-
const businessDocTypes = ['articles_of_incorporation', 'business_registration'];
|
|
1416
|
-
if (!hasUploadedDoc('business_document') && !hasExistingDoc(businessDocTypes)) {
|
|
1417
|
-
errors['business_document'] = 'Please upload a business document';
|
|
1418
|
-
}
|
|
1419
|
-
for (const owner of this.owners) {
|
|
1420
|
-
const ownerCategoryValue = `personal_${owner.id}`;
|
|
1421
|
-
const ownerDocs = this.uploadQueue.filter(entry => entry.categoryValue === ownerCategoryValue && entry.status === 'uploaded');
|
|
1422
|
-
const hasGroup1 = ownerDocs.some(d => personalDocGroup1Types.has(d.docTypeValue));
|
|
1423
|
-
const hasGroup2 = ownerDocs.some(d => personalDocGroup2Types.has(d.docTypeValue));
|
|
1424
|
-
if (!hasGroup1) {
|
|
1425
|
-
errors[`personal_group1_${owner.id}`] =
|
|
1426
|
-
`Please upload a Group 1 identity document for ${owner.name}`;
|
|
1427
|
-
}
|
|
1428
|
-
if (!hasGroup2) {
|
|
1429
|
-
errors[`personal_group2_${owner.id}`] =
|
|
1430
|
-
`Please upload a Group 2 identity document for ${owner.name}`;
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
return errors;
|
|
1435
|
-
}
|
|
1436
|
-
render() {
|
|
1437
|
-
if (this.isLoading) {
|
|
1438
|
-
return h(PaymentProvisioningLoading, null);
|
|
1439
|
-
}
|
|
1440
|
-
return (h("form", null, h("fieldset", null, h("legend", { class: "mb-0", part: heading2 }, "Document Uploads"), h("hr", { class: "mt-2" }), h("business-documents-on-file", { documents: this.existingDocuments, isLoading: this.isLoading })), h("fieldset", { class: "mt-4" }, h("div", { class: "d-flex align-items-center gap-2" }, h("legend", { class: "mb-0", part: heading2 }, "Add Document"), h("form-control-tooltip", { helpText: "Upload documents one at a time. Select the category and type, then choose a file. For identity documents, two documents from different groups are required per owner." })), h("hr", { class: "mt-2" }), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "document_category", label: "Document Category", options: this.categoryOptions, defaultValue: this.selectedCategory, inputHandler: this.handleCategoryChange })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "document_type", label: "Document Type", options: this.docTypeOptions, defaultValue: this.selectedDocType, inputHandler: this.handleDocTypeChange, disabled: !this.selectedCategory })), h("div", { class: "col-12" }, h("form-control-file", { key: this.fileInputKey, name: "document_file", label: "Upload Document", documentType: this.selectedDocType, onFileSelected: this.handleFileSelected, disabled: !this.selectedDocType, multiple: false })))), h("document-upload-list", { documents: this.uploadQueue }), Object.keys(this.errors).length > 0 && (h("div", { class: "alert alert-danger mt-3" }, h("ul", { class: "mb-0" }, Object.values(this.errors).map(err => h("li", null, err)))))));
|
|
1441
|
-
}
|
|
1442
|
-
static get watchers() { return {
|
|
1443
|
-
"authToken": ["propChanged"],
|
|
1444
|
-
"businessId": ["propChanged"],
|
|
1445
|
-
"isLoading": ["watchHandler"]
|
|
1446
|
-
}; }
|
|
1447
|
-
};
|
|
1448
|
-
|
|
1449
|
-
const DocumentUploadList = class {
|
|
1450
|
-
constructor(hostRef) {
|
|
1451
|
-
registerInstance(this, hostRef);
|
|
1452
|
-
this.documents = [];
|
|
1453
|
-
}
|
|
1454
|
-
renderStatus(status) {
|
|
1455
|
-
switch (status) {
|
|
1456
|
-
case 'uploading':
|
|
1457
|
-
return h("span", { class: "badge bg-info" }, "Uploading...");
|
|
1458
|
-
case 'uploaded':
|
|
1459
|
-
return h("span", { class: "badge bg-success" }, "Uploaded");
|
|
1460
|
-
case 'error':
|
|
1461
|
-
return h("span", { class: "badge bg-danger" }, "Error");
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
render() {
|
|
1465
|
-
if (!this.documents.length) {
|
|
1466
|
-
return null;
|
|
1467
|
-
}
|
|
1468
|
-
return (h("div", { class: "mt-4" }, h("div", { class: "card", part: card }, h("div", { class: "card-body" }, h("h5", { class: "card-title", part: heading2 }, "Uploaded Documents"), h("div", { class: "table-responsive" }, h("table", { class: "table table-sm table-borderless", part: table }, h("thead", null, h("tr", null, h("th", { style: { width: '25%' }, part: tableHeadCell, scope: "col" }, "Category"), h("th", { style: { width: '25%' }, part: tableHeadCell, scope: "col" }, "Document Type"), h("th", { style: { width: '30%' }, part: tableHeadCell, scope: "col" }, "File Name"), h("th", { style: { width: '20%' }, part: tableHeadCell, scope: "col" }, "Status"))), h("tbody", null, this.documents.map((doc, index) => (h("tr", { class: index === 0 ? 'border-bottom border-top' : 'border-bottom' }, h("td", { part: tableCell }, doc.categoryLabel), h("td", { part: tableCell }, doc.docTypeLabel), h("td", { part: tableCell }, doc.fileName), h("td", { part: tableCell }, this.renderStatus(doc.status))))))))))));
|
|
1469
|
-
}
|
|
1470
|
-
};
|
|
1471
|
-
|
|
1472
1271
|
const LegalAddressFormStep = class {
|
|
1473
1272
|
constructor(hostRef) {
|
|
1474
1273
|
registerInstance(this, hostRef);
|
|
@@ -1680,13 +1479,6 @@ const OwnerForm = class {
|
|
|
1680
1479
|
async returnOwnerData() {
|
|
1681
1480
|
return this.ownerId;
|
|
1682
1481
|
}
|
|
1683
|
-
async getOwnershipPercentage() {
|
|
1684
|
-
var _a;
|
|
1685
|
-
return ((_a = this.formController.values.getValue()) === null || _a === void 0 ? void 0 : _a.ownership_percentage) || null;
|
|
1686
|
-
}
|
|
1687
|
-
async setOwnershipPercentageError(message) {
|
|
1688
|
-
this.formController.setFieldError('ownership_percentage', message);
|
|
1689
|
-
}
|
|
1690
1482
|
async validate() {
|
|
1691
1483
|
return this.formController.validate();
|
|
1692
1484
|
}
|
|
@@ -1761,7 +1553,7 @@ const OwnerForm = class {
|
|
|
1761
1553
|
});
|
|
1762
1554
|
}
|
|
1763
1555
|
render() {
|
|
1764
|
-
return (h(Host, { key: '
|
|
1556
|
+
return (h(Host, { key: '1661676befd63f9308edcb02be179db71b7c9d99', style: { display: 'block' } }, h("form", { key: '4961f358ca8953156477d455cacb19e4dec3cc29', onSubmit: this.validateAndSubmit }, h("fieldset", { key: '27ecfec87ae93a1bdec94f3cc925558dc8f0ff23' }, h("legend", { key: '4c194cf9e08e6fab9982b95a4b12c3c3a8cecdc3', class: "fw-semibold fs-5", part: heading3 }, this.formTitle), h("br", { key: 'ef1f9b184dac866d27cfa245106d90db0954fa51' }), h("div", { key: '2936ecc396220f8b80e5d8454bc6f6f70cb3ae73', class: "row gy-3" }, h("owner-form-inputs", { key: 'f34d38b718ed7fde67102aa1034b5e6377e001f8', ownerDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController, country: this.country }), h("div", { key: '2d5266bc1a7f4aeb12cab8a494107f2668b2fb0e', class: "d-flex gap-2 justify-content-start" }, h(Button, { key: '39631fd0364221ac2a274d8aa794a1f3c8d28780', variant: "secondary", type: "button", onClick: this.handleRemoveOwner, hidden: !this.showRemoveButton }, "Remove"), h(Button, { key: '120fbae294f8f67bd14fe0be5dc1bcf881ffd489', variant: "primary", type: "submit", onClick: this.handleAddOwner, disabled: this.isLoading }, this.submitButtonText))), h("hr", { key: '73eccba19a595b67f64139769a495d5a27e02b2f' })))));
|
|
1765
1557
|
}
|
|
1766
1558
|
static get watchers() { return {
|
|
1767
1559
|
"isLoading": ["loadingWatcher"]
|
|
@@ -2080,4 +1872,4 @@ const PlaidVerification = class {
|
|
|
2080
1872
|
}
|
|
2081
1873
|
};
|
|
2082
1874
|
|
|
2083
|
-
export { AdditionalQuestionsFormStep as additional_questions_form_step, BankAccountFormInputs as bank_account_form_inputs, BankAccountFormInputsCanada as bank_account_form_inputs_canada, BusinessBankAccountFormStep as business_bank_account_form_step, BusinessCoreInfoFormStep as business_core_info_form_step, BusinessDocumentsOnFile as business_documents_on_file, BusinessOwnersFormStep as business_owners_form_step, BusinessRepresentativeFormInputs as business_representative_form_inputs, BusinessRepresentativeFormStep as business_representative_form_step, BusinessTermsConditionsFormStep as business_terms_conditions_form_step,
|
|
1875
|
+
export { AdditionalQuestionsFormStep as additional_questions_form_step, BankAccountDocumentFormInputs as bank_account_document_form_inputs, BankAccountFormInputs as bank_account_form_inputs, BankAccountFormInputsCanada as bank_account_form_inputs_canada, BusinessBankAccountFormStep as business_bank_account_form_step, BusinessCoreInfoFormStep as business_core_info_form_step, BusinessDocumentsOnFile as business_documents_on_file, BusinessOwnersFormStep as business_owners_form_step, BusinessRepresentativeFormInputs as business_representative_form_inputs, BusinessRepresentativeFormStep as business_representative_form_step, BusinessTermsConditionsFormStep as business_terms_conditions_form_step, LegalAddressFormStep as legal_address_form_step, OwnerForm as owner_form, PlaidVerification as plaid_verification };
|