@justifi/webcomponents 4.18.0 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-d4aa8c07.js → Analytics-ff013cbc.js} +1 -1
- package/dist/cjs/{Payment-24f22eca.js → Payment-1a8a8ca6.js} +0 -21
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +1 -1
- package/dist/cjs/business-details-core.cjs.entry.js +1 -1
- package/dist/cjs/{business-form-types-11130bab.js → business-form-types-6e1fcda3.js} +4 -7
- package/dist/cjs/business.service-f63650f5.js +32 -0
- package/dist/cjs/button-3f400a66.js +26 -0
- package/dist/cjs/form-alert_5.cjs.entry.js +5 -5
- package/dist/cjs/{form-control-checkbox_5.cjs.entry.js → form-control-checkbox_9.cjs.entry.js} +434 -169
- package/dist/cjs/{form-control-number-masked_2.cjs.entry.js → form-control-date_3.cjs.entry.js} +50 -7
- package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-error-text_4.cjs.entry.js} +32 -2
- package/dist/cjs/form-control-file.cjs.entry.js +1 -1
- package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
- package/dist/cjs/form-control-number.cjs.entry.js +1 -1
- package/dist/cjs/{get-payout-csv-e4e4771a.js → get-payout-csv-f3aee6d0.js} +1 -1
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +2 -2
- package/dist/cjs/input-handlers-cff032bb.js +20 -0
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +196 -481
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +4 -4
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +30 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +7 -6
- package/dist/cjs/justifi-checkout.cjs.entry.js +5 -5
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +6 -6
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +268 -0
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js +9 -10
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-method-selector.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +8 -12
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +8 -60
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +4 -4
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +8 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-5fee1ffb.js → package-cb0f8cb1.js} +1 -1
- package/dist/cjs/pagination-menu.cjs.entry.js +25 -0
- package/dist/cjs/payment-details-core.cjs.entry.js +9 -9
- package/dist/cjs/payment-provisioning-actions-06466dda.js +185 -0
- package/dist/cjs/{payment.service-35298e95.js → payment.service-0a64f9cd.js} +1 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +69 -40
- package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
- package/dist/cjs/payouts-list-core.cjs.entry.js +90 -74
- package/dist/cjs/skeleton-748c5dde.js +43 -0
- package/dist/cjs/styled-host-cc053016.js +14 -0
- package/dist/cjs/table-loading-state-8b406852.js +38 -0
- package/dist/cjs/{utils-80191fbe.js → utils-89d86e29.js} +0 -33
- package/dist/cjs/{utils-8c3bf659.js → utils-ddacfc44.js} +0 -5
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Payment.js +0 -20
- package/dist/collection/api/services/business.service.js +18 -0
- package/dist/collection/collection-manifest.json +9 -14
- package/dist/collection/components/bank-account-form/bank-account-form.js +1 -1
- package/dist/collection/components/billing-form/billing-form.js +2 -2
- package/dist/collection/components/business-details/business-details-core.js +1 -1
- package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +1 -1
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +1 -1
- package/dist/collection/components/business-forms/business-form/business-form.js +2 -2
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +1 -1
- package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +1 -1
- package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +1 -1
- package/dist/collection/components/business-forms/owner-form/owner-form-core.js +520 -0
- package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +80 -0
- package/dist/collection/components/business-forms/owner-form/owner-form.js +55 -225
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +235 -0
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +41 -121
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +255 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +42 -131
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +342 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +34 -189
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +81 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +229 -0
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +42 -133
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +23 -18
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-input-group.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-documents-on-file.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +238 -0
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +41 -124
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-actions.js +122 -1
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +17 -18
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +6 -6
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +1 -1
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-text.js +1 -1
- package/dist/collection/components/business-forms/utils/business-form-types.js +4 -7
- package/dist/collection/components/business-forms/utils/input-handlers.js +13 -0
- package/dist/collection/components/card-form/card-form.js +1 -1
- package/dist/collection/components/checkout/checkout-core.js +4 -5
- package/dist/collection/components/checkout/checkout.js +2 -2
- package/dist/collection/components/checkout/new-payment-method.js +1 -1
- package/dist/collection/components/checkout/payment-method-options.js +1 -1
- package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
- package/dist/collection/components/checkout/saved-payment-method.js +1 -1
- package/dist/collection/components/checkout/sezzle-payment-method.js +1 -1
- package/dist/collection/components/details/details.js +2 -2
- package/dist/collection/components/form/form-control-checkbox.js +1 -1
- package/dist/collection/components/form/form-control-date.js +1 -1
- package/dist/collection/components/form/form-control-file.js +1 -1
- package/dist/collection/components/form/form-control-monetary.js +1 -1
- package/dist/collection/components/form/form-control-number-masked.js +11 -5
- package/dist/collection/components/form/form-control-number.js +1 -1
- package/dist/collection/components/form/form-control-select.js +1 -1
- package/dist/collection/components/form/form-control-text.js +1 -1
- package/dist/collection/components/form/utils.js +0 -2
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +1 -1
- package/dist/collection/components/insurance/season-interruption/season-interruption-insurance-core.js +3 -3
- package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +6 -1
- package/dist/collection/components/pagination-menu/pagination-menu.js +3 -3
- package/dist/collection/components/payment-details/payment-details-core.js +8 -8
- package/dist/collection/components/payment-form/payment-form.js +4 -6
- package/dist/collection/components/payment-form/payment-method-selector.js +1 -1
- package/dist/collection/components/payment-method-form/payment-method-form.js +2 -2
- package/dist/collection/components/payments-list/payments-list-core.js +66 -38
- package/dist/collection/components/payout-details/payout-details-core.js +2 -2
- package/dist/collection/components/payouts-list/payouts-list-core.js +88 -73
- package/dist/collection/components/refund-form/refund-form.js +2 -2
- package/dist/collection/ui-components/button-spinner.js +2 -0
- package/dist/collection/ui-components/button.js +19 -0
- package/dist/collection/ui-components/index.js +7 -0
- package/dist/collection/ui-components/skeleton.js +39 -0
- package/dist/collection/ui-components/styled-host/styled-host.js +5 -0
- package/dist/collection/ui-components/table-empty-state.js +8 -0
- package/dist/collection/ui-components/table-error-state.js +8 -0
- package/dist/collection/ui-components/table-loading-state.js +8 -0
- package/dist/collection/utils/utils.js +0 -21
- package/dist/docs.json +2080 -1746
- package/dist/esm/{Analytics-29fac206.js → Analytics-33b8fa8d.js} +1 -1
- package/dist/esm/{Payment-3e94da9c.js → Payment-6bf26fe2.js} +1 -21
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/business-details-core.entry.js +2 -2
- package/dist/esm/{business-form-types-60f50b98.js → business-form-types-1bc5fe08.js} +5 -8
- package/dist/esm/business.service-74bd1212.js +29 -0
- package/dist/esm/button-34e75e0f.js +24 -0
- package/dist/esm/form-alert_5.entry.js +5 -5
- package/dist/esm/{form-control-checkbox_5.entry.js → form-control-checkbox_9.entry.js} +432 -171
- package/dist/esm/form-control-date_3.entry.js +130 -0
- package/dist/esm/{form-control-select_2.entry.js → form-control-error-text_4.entry.js} +32 -4
- package/dist/esm/form-control-file.entry.js +1 -1
- package/dist/esm/form-control-monetary.entry.js +1 -1
- package/dist/esm/form-control-number.entry.js +1 -1
- package/dist/esm/{get-payout-csv-9b4aaada.js → get-payout-csv-b494abfe.js} +1 -1
- package/dist/esm/gross-payment-chart-core.entry.js +3 -3
- package/dist/esm/input-handlers-270ac806.js +16 -0
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +197 -482
- package/dist/esm/justifi-bank-account-form.entry.js +3 -3
- package/dist/esm/justifi-billing-form_2.entry.js +4 -4
- package/dist/esm/justifi-business-details.entry.js +4 -4
- package/dist/esm/justifi-business-form.entry.js +6 -6
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +26 -0
- package/dist/esm/justifi-card-form.entry.js +3 -3
- package/dist/esm/justifi-checkout-core.entry.js +7 -6
- package/dist/esm/justifi-checkout.entry.js +5 -5
- package/dist/esm/justifi-details.entry.js +3 -3
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-new-payment-method_4.entry.js +6 -6
- package/dist/esm/justifi-owner-form_3.entry.js +262 -0
- package/dist/esm/justifi-payment-details.entry.js +5 -5
- package/dist/esm/justifi-payment-form.entry.js +9 -10
- package/dist/esm/justifi-payment-method-form.entry.js +4 -4
- package/dist/esm/justifi-payment-method-selector.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning-core.entry.js +8 -12
- package/dist/esm/justifi-payment-provisioning.entry.js +7 -59
- package/dist/esm/justifi-payments-list.entry.js +5 -5
- package/dist/esm/justifi-payout-details.entry.js +5 -5
- package/dist/esm/justifi-payouts-list.entry.js +5 -5
- package/dist/esm/justifi-refund-form.entry.js +3 -3
- package/dist/esm/justifi-season-interruption-insurance-core.entry.js +4 -4
- package/dist/esm/justifi-season-interruption-insurance.entry.js +8 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-1123f528.js → package-3e407c6d.js} +1 -1
- package/dist/esm/pagination-menu.entry.js +21 -0
- package/dist/esm/payment-details-core.entry.js +10 -10
- package/dist/esm/payment-provisioning-actions-0635eff7.js +178 -0
- package/dist/esm/{payment.service-c62d82d3.js → payment.service-3ca4a492.js} +1 -1
- package/dist/esm/payments-list-core.entry.js +69 -40
- package/dist/esm/payout-details-core.entry.js +4 -4
- package/dist/esm/payouts-list-core.entry.js +90 -74
- package/dist/esm/skeleton-145a80d4.js +41 -0
- package/dist/esm/styled-host-ab9da520.js +12 -0
- package/dist/esm/table-loading-state-356c7215.js +34 -0
- package/dist/esm/{utils-56719d07.js → utils-01413a95.js} +1 -1
- package/dist/esm/{utils-f4c4ba7d.js → utils-3bb6347a.js} +1 -5
- package/dist/esm/{utils-5f4c4faa.js → utils-3c1dd2fa.js} +1 -31
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Payment.js +1 -21
- package/dist/module/additional-questions.js +1 -1
- package/dist/module/billing-form.js +3 -3
- package/dist/module/business-additional-questions-form-step-core.js +141 -0
- package/dist/module/business-additional-questions-form-step.js +55 -100
- package/dist/module/business-additional-questions-schema.js +1 -1
- package/dist/module/business-address-schema.js +1 -1
- package/dist/module/business-bank-account-form-step.js +4 -4
- package/dist/module/business-core-info-form-step-core.js +151 -0
- package/dist/module/business-core-info-form-step.js +57 -106
- package/dist/module/business-core-info-schema.js +1 -1
- package/dist/module/business-core-info.js +1 -1
- package/dist/module/business-document-upload-form-step.js +34 -35
- package/dist/module/business-document-upload-input-group.js +2 -2
- package/dist/module/business-documents-on-file.js +1 -1
- package/dist/module/business-form-types.js +5 -8
- package/dist/module/business-identity-schema.js +1 -1
- package/dist/module/business-owners-form-step-core.js +216 -0
- package/dist/module/business-owners-form-step.js +67 -154
- package/dist/module/business-representative-form-inputs.js +85 -0
- package/dist/module/business-representative-form-step-core.js +152 -0
- package/dist/module/business-representative-form-step.js +63 -111
- package/dist/module/business-representative.js +1 -1
- package/dist/module/business-terms-conditions-form-step.js +3 -3
- package/dist/module/business-terms-conditions-text.js +1 -1
- package/dist/module/business.service.js +19 -1
- package/dist/module/button.js +24 -0
- package/dist/module/checkout-core.js +27 -32
- package/dist/module/details.js +1 -1
- package/dist/module/exported-parts.js +40 -0
- package/dist/module/form-control-checkbox2.js +1 -1
- package/dist/module/form-control-date2.js +1 -1
- package/dist/module/form-control-file2.js +1 -1
- package/dist/module/form-control-monetary2.js +1 -1
- package/dist/module/form-control-number-masked2.js +11 -5
- package/dist/module/form-control-number.js +1 -1
- package/dist/module/form-control-select2.js +1 -1
- package/dist/module/form-control-text2.js +1 -1
- package/dist/module/get-payout-csv.js +1 -1
- package/dist/module/gross-payment-chart-core2.js +1 -1
- package/dist/module/identity-address-form.js +2 -2
- package/dist/module/input-handlers.js +16 -0
- package/dist/module/justifi-additional-questions-form-step-core.d.ts +11 -0
- package/dist/module/justifi-additional-questions-form-step-core.js +6 -0
- package/dist/module/justifi-bank-account-form.js +1 -1
- package/dist/module/justifi-business-core-info-form-step-core.d.ts +11 -0
- package/dist/module/justifi-business-core-info-form-step-core.js +6 -0
- package/dist/module/justifi-business-details.js +1 -1
- package/dist/module/justifi-business-form.js +2 -2
- package/dist/module/justifi-business-owners-form-step-core.d.ts +11 -0
- package/dist/module/justifi-business-owners-form-step-core.js +6 -0
- package/dist/module/justifi-business-representative-form-inputs.d.ts +11 -0
- package/dist/module/justifi-business-representative-form-inputs.js +6 -0
- package/dist/module/justifi-business-representative-form-step-core.d.ts +11 -0
- package/dist/module/justifi-business-representative-form-step-core.js +6 -0
- package/dist/module/justifi-card-form.js +1 -1
- package/dist/module/justifi-checkout.js +27 -33
- package/dist/module/justifi-gross-payment-chart.js +1 -1
- package/dist/module/justifi-legal-address-form-step-core.d.ts +11 -0
- package/dist/module/justifi-legal-address-form-step-core.js +6 -0
- package/dist/module/justifi-payment-details.js +2 -2
- package/dist/module/justifi-payment-form.js +5 -6
- package/dist/module/justifi-payment-provisioning.js +97 -108
- package/dist/module/justifi-payments-list.js +8 -14
- package/dist/module/justifi-payout-details.js +1 -1
- package/dist/module/justifi-payouts-list.js +8 -13
- package/dist/module/justifi-refund-form.js +2 -2
- package/dist/module/justifi-season-interruption-insurance.js +7 -2
- package/dist/module/legal-address-form-step-core.js +138 -0
- package/dist/module/legal-address-form-step.js +53 -98
- package/dist/module/legal-address-form.js +2 -2
- package/dist/module/new-payment-method.js +1 -1
- package/dist/module/{justifi-table.d.ts → owner-form-core.d.ts} +4 -4
- package/dist/module/owner-form-core.js +6 -0
- package/dist/module/owner-form-core2.js +264 -0
- package/dist/module/{justifi-skeleton.d.ts → owner-form-inputs.d.ts} +4 -4
- package/dist/module/owner-form-inputs.js +6 -0
- package/dist/module/owner-form-inputs2.js +85 -0
- package/dist/module/owner-form.js +62 -188
- package/dist/module/package.js +1 -1
- package/dist/module/pagination-menu2.js +3 -3
- package/dist/module/payment-details-core2.js +7 -7
- package/dist/module/payment-method-form.js +2 -2
- package/dist/module/payment-method-options.js +1 -1
- package/dist/module/payment-method-selector.js +1 -1
- package/dist/module/payment-provisioning-actions.js +178 -0
- package/dist/module/payment-provisioning-core.js +100 -62
- package/dist/module/payment-provisioning-form-buttons.js +2 -2
- package/dist/module/payment-provisioning-form-steps.js +94 -52
- package/dist/module/payments-list-core2.js +71 -49
- package/dist/module/payout-details-core2.js +1 -1
- package/dist/module/payouts-list-core2.js +92 -82
- package/dist/module/save-new-payment-method.js +1 -1
- package/dist/module/saved-payment-method.js +1 -1
- package/dist/module/schema-validations.js +1 -1
- package/dist/module/season-interruption-insurance-core.js +2 -2
- package/dist/module/sezzle-payment-method.js +1 -1
- package/dist/module/skeleton.js +18 -50
- package/dist/module/styled-host.js +4 -4
- package/dist/module/utils2.js +1 -31
- package/dist/module/utils3.js +23 -26
- package/dist/module/utils4.js +23 -24
- package/dist/types/api/Payment.d.ts +0 -28
- package/dist/types/api/services/business.service.d.ts +10 -0
- package/dist/types/components/business-forms/owner-form/owner-form-core.d.ts +43 -0
- package/dist/types/components/business-forms/owner-form/owner-form-inputs.d.ts +9 -0
- package/dist/types/components/business-forms/owner-form/owner-form.d.ts +9 -28
- package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.d.ts +26 -0
- package/dist/types/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.d.ts +5 -15
- package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.d.ts +27 -0
- package/dist/types/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.d.ts +6 -21
- package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.d.ts +35 -0
- package/dist/types/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.d.ts +5 -21
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.d.ts +9 -0
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.d.ts +25 -0
- package/dist/types/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.d.ts +5 -17
- package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.d.ts +26 -0
- package/dist/types/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.d.ts +5 -15
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-actions.d.ts +40 -1
- package/dist/types/components/business-forms/payment-provisioning/payment-provisioning-core.d.ts +2 -2
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +1 -1
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +6 -11
- package/dist/types/components/business-forms/utils/input-handlers.d.ts +4 -0
- package/dist/types/components/checkout/checkout-core.d.ts +0 -1
- package/dist/types/components/form/utils.d.ts +0 -1
- package/dist/types/components/insurance/season-interruption/season-interruption-insurance.d.ts +3 -0
- package/dist/types/components/payments-list/payments-list-core.d.ts +12 -2
- package/dist/types/components/payouts-list/payouts-list-core.d.ts +11 -4
- package/dist/types/components.d.ts +309 -482
- package/dist/types/ui-components/button-spinner.d.ts +1 -0
- package/dist/types/ui-components/button.d.ts +10 -0
- package/dist/types/ui-components/index.d.ts +7 -0
- package/dist/types/ui-components/skeleton.d.ts +13 -0
- package/dist/types/ui-components/styled-host/styled-host.d.ts +2 -0
- package/dist/types/ui-components/table-empty-state.d.ts +6 -0
- package/dist/types/ui-components/table-error-state.d.ts +6 -0
- package/dist/types/ui-components/table-loading-state.d.ts +6 -0
- package/dist/types/utils/utils.d.ts +0 -3
- package/dist/webcomponents/p-07109641.entry.js +1 -0
- package/dist/webcomponents/p-08b0fb31.js +1 -0
- package/dist/webcomponents/p-0f7b9555.entry.js +1 -0
- package/dist/webcomponents/p-17e4246f.entry.js +1 -0
- package/dist/webcomponents/{p-e85ef4af.entry.js → p-195f92e9.entry.js} +1 -1
- package/dist/webcomponents/{p-959b478a.entry.js → p-1a43e355.entry.js} +2 -2
- package/dist/webcomponents/p-23014988.entry.js +1 -0
- package/dist/webcomponents/p-25dba252.entry.js +1 -0
- package/dist/webcomponents/{p-0dca0770.entry.js → p-27981600.entry.js} +1 -1
- package/dist/webcomponents/{p-66758365.entry.js → p-301e0493.entry.js} +1 -1
- package/dist/webcomponents/p-304dd644.entry.js +1 -0
- package/dist/webcomponents/p-30a493cd.entry.js +1 -0
- package/dist/webcomponents/p-462dc522.entry.js +1 -0
- package/dist/webcomponents/{p-09affce4.entry.js → p-487b72a8.entry.js} +1 -1
- package/dist/webcomponents/{p-571d7f1a.entry.js → p-4abc17f0.entry.js} +1 -1
- package/dist/webcomponents/{p-667a5aa8.js → p-4b4580dd.js} +1 -1
- package/dist/webcomponents/p-52021fa1.entry.js +1 -0
- package/dist/webcomponents/p-53e64f15.entry.js +1 -0
- package/dist/webcomponents/p-5968ff8a.js +1 -0
- package/dist/webcomponents/p-60a370fc.entry.js +1 -0
- package/dist/webcomponents/{p-e0bcfdb5.entry.js → p-623a4479.entry.js} +1 -1
- package/dist/webcomponents/{p-3294856b.entry.js → p-62b32c4c.entry.js} +1 -1
- package/dist/webcomponents/{p-092e080c.js → p-63acf322.js} +1 -1
- package/dist/webcomponents/p-6f03b35a.entry.js +1 -0
- package/dist/webcomponents/p-75b4daef.js +1 -0
- package/dist/webcomponents/p-7d85af5c.js +1 -0
- package/dist/webcomponents/{p-e8c651b8.js → p-83125497.js} +1 -1
- package/dist/webcomponents/{p-49b8e112.js → p-8603348a.js} +1 -1
- package/dist/webcomponents/{p-7a346c0b.entry.js → p-8c1e981b.entry.js} +1 -1
- package/dist/webcomponents/p-8df7bde8.js +1 -0
- package/dist/webcomponents/{p-f3555f0b.entry.js → p-8e541a32.entry.js} +1 -1
- package/dist/webcomponents/p-9279aa49.entry.js +1 -0
- package/dist/webcomponents/{p-0e4a54c8.entry.js → p-96b42e7d.entry.js} +1 -1
- package/dist/webcomponents/{p-9631b768.entry.js → p-99022846.entry.js} +1 -1
- package/dist/webcomponents/p-9c9c7dac.js +1 -0
- package/dist/webcomponents/p-b16dfd5d.entry.js +1 -0
- package/dist/webcomponents/p-ba4bae6f.js +1 -0
- package/dist/webcomponents/p-bbed6107.entry.js +1 -0
- package/dist/webcomponents/{p-67e497aa.entry.js → p-bc92235c.entry.js} +1 -1
- package/dist/webcomponents/p-be39c802.entry.js +1 -0
- package/dist/webcomponents/{p-3514b616.entry.js → p-c4b87db2.entry.js} +1 -1
- package/dist/webcomponents/p-c9f8f7ec.entry.js +1 -0
- package/dist/webcomponents/{p-bb32b91c.entry.js → p-cd7105dd.entry.js} +1 -1
- package/dist/webcomponents/p-d101c5db.js +1 -0
- package/dist/webcomponents/{p-d5612f35.entry.js → p-d1fbeae5.entry.js} +1 -1
- package/dist/webcomponents/p-d8355f91.entry.js +1 -0
- package/dist/webcomponents/p-d89bad72.js +1 -0
- package/dist/webcomponents/{p-e1651130.js → p-dce846bf.js} +1 -1
- package/dist/webcomponents/{p-e8706cc4.js → p-df21aaad.js} +1 -1
- package/dist/webcomponents/{p-531d873a.entry.js → p-e2c88817.entry.js} +1 -1
- package/dist/webcomponents/{p-df38dd21.entry.js → p-e31f0f3e.entry.js} +1 -1
- package/dist/webcomponents/p-e333620e.js +1 -0
- package/dist/webcomponents/{p-464e4dfe.entry.js → p-e7067ef2.entry.js} +1 -1
- package/dist/webcomponents/{p-2244e679.entry.js → p-f0866375.entry.js} +1 -1
- package/dist/webcomponents/{p-debeefbb.entry.js → p-fb58feb5.entry.js} +1 -1
- package/dist/webcomponents/p-fe33151d.entry.js +1 -0
- package/dist/webcomponents/webcomponents.css +6 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/SubAccount-135ff8c8.js +0 -107
- package/dist/cjs/business.service-9214509a.js +0 -13
- package/dist/cjs/form-control-date.cjs.entry.js +0 -43
- package/dist/cjs/form-control-error-text_2.cjs.entry.js +0 -36
- package/dist/cjs/justifi-business-list.cjs.entry.js +0 -110
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +0 -86
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +0 -159
- package/dist/cjs/justifi-skeleton.cjs.entry.js +0 -54
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +0 -77
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +0 -105
- package/dist/cjs/justifi-table_2.cjs.entry.js +0 -80
- package/dist/cjs/styled-host-b8bed12a.js +0 -14
- package/dist/cjs/subaccount-account-details_4.cjs.entry.js +0 -58
- package/dist/cjs/subaccount-bank-details.cjs.entry.js +0 -19
- package/dist/cjs/subaccount-terms-details.cjs.entry.js +0 -19
- package/dist/collection/api/Proceed.js +0 -41
- package/dist/collection/api/SubAccount.js +0 -103
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.css +0 -60
- package/dist/collection/components/business-list/business-list.js +0 -185
- package/dist/collection/components/business-list/business-list.stories.js +0 -68
- package/dist/collection/components/business-list/example.js +0 -12
- package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.js +0 -143
- package/dist/collection/components/payment-balance-transactions/payment-balance-transactions.stories.js +0 -32
- package/dist/collection/components/proceeds-list/example.js +0 -12
- package/dist/collection/components/proceeds-list/proceeds-list.js +0 -205
- package/dist/collection/components/proceeds-list/proceeds-list.stories.js +0 -69
- package/dist/collection/components/skeleton/skeleton.css +0 -11
- package/dist/collection/components/skeleton/skeleton.js +0 -160
- package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.js +0 -59
- package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.js +0 -37
- package/dist/collection/components/subaccount-details/subaccount-details.js +0 -136
- package/dist/collection/components/subaccount-details/subaccount-details.stories.js +0 -25
- package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +0 -38
- package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.js +0 -38
- package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.js +0 -38
- package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.js +0 -37
- package/dist/collection/components/subaccounts-list/subaccounts-list.css +0 -3
- package/dist/collection/components/subaccounts-list/subaccounts-list.js +0 -179
- package/dist/collection/components/subaccounts-list/subaccounts-list.stories.js +0 -69
- package/dist/collection/components/table/table.css +0 -7
- package/dist/collection/components/table/table.js +0 -222
- package/dist/collection/components/table/utils.js +0 -4
- package/dist/collection/utils/styled-host/styled-host.js +0 -6
- package/dist/esm/SubAccount-7fcb1450.js +0 -105
- package/dist/esm/business.service-19a0c8d3.js +0 -11
- package/dist/esm/form-control-date.entry.js +0 -39
- package/dist/esm/form-control-error-text_2.entry.js +0 -31
- package/dist/esm/form-control-number-masked_2.entry.js +0 -88
- package/dist/esm/justifi-business-list.entry.js +0 -106
- package/dist/esm/justifi-payment-balance-transactions.entry.js +0 -82
- package/dist/esm/justifi-proceeds-list.entry.js +0 -155
- package/dist/esm/justifi-skeleton.entry.js +0 -50
- package/dist/esm/justifi-subaccount-details.entry.js +0 -73
- package/dist/esm/justifi-subaccounts-list.entry.js +0 -101
- package/dist/esm/justifi-table_2.entry.js +0 -75
- package/dist/esm/styled-host-57aae7fa.js +0 -12
- package/dist/esm/subaccount-account-details_4.entry.js +0 -51
- package/dist/esm/subaccount-bank-details.entry.js +0 -15
- package/dist/esm/subaccount-terms-details.entry.js +0 -15
- package/dist/module/SubAccount.js +0 -105
- package/dist/module/justifi-business-list.d.ts +0 -11
- package/dist/module/justifi-business-list.js +0 -147
- package/dist/module/justifi-payment-balance-transactions.d.ts +0 -11
- package/dist/module/justifi-payment-balance-transactions.js +0 -123
- package/dist/module/justifi-proceeds-list.d.ts +0 -11
- package/dist/module/justifi-proceeds-list.js +0 -198
- package/dist/module/justifi-skeleton.js +0 -6
- package/dist/module/justifi-subaccount-details.d.ts +0 -11
- package/dist/module/justifi-subaccount-details.js +0 -133
- package/dist/module/justifi-subaccounts-list.d.ts +0 -11
- package/dist/module/justifi-subaccounts-list.js +0 -144
- package/dist/module/justifi-table.js +0 -6
- package/dist/module/subaccount-account-details.d.ts +0 -11
- package/dist/module/subaccount-account-details.js +0 -6
- package/dist/module/subaccount-account-details2.js +0 -34
- package/dist/module/subaccount-bank-details.d.ts +0 -11
- package/dist/module/subaccount-bank-details.js +0 -35
- package/dist/module/subaccount-merchant-details.d.ts +0 -11
- package/dist/module/subaccount-merchant-details.js +0 -6
- package/dist/module/subaccount-merchant-details2.js +0 -33
- package/dist/module/subaccount-owners-details.d.ts +0 -11
- package/dist/module/subaccount-owners-details.js +0 -6
- package/dist/module/subaccount-owners-details2.js +0 -33
- package/dist/module/subaccount-representative-details.d.ts +0 -11
- package/dist/module/subaccount-representative-details.js +0 -6
- package/dist/module/subaccount-representative-details2.js +0 -33
- package/dist/module/subaccount-terms-details.d.ts +0 -11
- package/dist/module/subaccount-terms-details.js +0 -35
- package/dist/module/table.js +0 -93
- package/dist/types/api/Proceed.d.ts +0 -60
- package/dist/types/api/SubAccount.d.ts +0 -163
- package/dist/types/components/business-list/business-list.d.ts +0 -48
- package/dist/types/components/business-list/business-list.stories.d.ts +0 -9
- package/dist/types/components/payment-balance-transactions/payment-balance-transactions.d.ts +0 -17
- package/dist/types/components/payment-balance-transactions/payment-balance-transactions.stories.d.ts +0 -8
- package/dist/types/components/proceeds-list/proceeds-list.d.ts +0 -39
- package/dist/types/components/proceeds-list/proceeds-list.stories.d.ts +0 -9
- package/dist/types/components/skeleton/skeleton.d.ts +0 -12
- package/dist/types/components/subaccount-details/subaccount-account-details/subaccount-account-details.d.ts +0 -6
- package/dist/types/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.d.ts +0 -5
- package/dist/types/components/subaccount-details/subaccount-details.d.ts +0 -16
- package/dist/types/components/subaccount-details/subaccount-details.stories.d.ts +0 -7
- package/dist/types/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.d.ts +0 -5
- package/dist/types/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.d.ts +0 -5
- package/dist/types/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.d.ts +0 -5
- package/dist/types/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.d.ts +0 -5
- package/dist/types/components/subaccounts-list/subaccounts-list.d.ts +0 -19
- package/dist/types/components/subaccounts-list/subaccounts-list.stories.d.ts +0 -9
- package/dist/types/components/table/table.d.ts +0 -23
- package/dist/types/components/table/utils.d.ts +0 -3
- package/dist/types/utils/styled-host/styled-host.d.ts +0 -3
- package/dist/webcomponents/p-0a4a9ccd.entry.js +0 -1
- package/dist/webcomponents/p-0ed3c1d2.entry.js +0 -1
- package/dist/webcomponents/p-10b57ac6.entry.js +0 -1
- package/dist/webcomponents/p-1737f6bf.entry.js +0 -1
- package/dist/webcomponents/p-2306d44d.entry.js +0 -1
- package/dist/webcomponents/p-2af3672b.entry.js +0 -1
- package/dist/webcomponents/p-390157c9.entry.js +0 -1
- package/dist/webcomponents/p-412c7a22.entry.js +0 -1
- package/dist/webcomponents/p-4b9587ec.entry.js +0 -1
- package/dist/webcomponents/p-54287db6.entry.js +0 -1
- package/dist/webcomponents/p-547a2cd0.entry.js +0 -1
- package/dist/webcomponents/p-5963bcdc.entry.js +0 -1
- package/dist/webcomponents/p-5b1451e7.entry.js +0 -1
- package/dist/webcomponents/p-6700ac49.js +0 -1
- package/dist/webcomponents/p-68fd8283.js +0 -1
- package/dist/webcomponents/p-6bcf621a.entry.js +0 -1
- package/dist/webcomponents/p-6bd5d569.entry.js +0 -1
- package/dist/webcomponents/p-76180bb4.entry.js +0 -1
- package/dist/webcomponents/p-77dc159c.entry.js +0 -1
- package/dist/webcomponents/p-7d6aba64.entry.js +0 -1
- package/dist/webcomponents/p-81d3eda6.entry.js +0 -1
- package/dist/webcomponents/p-87932e16.js +0 -1
- package/dist/webcomponents/p-88c7ef46.entry.js +0 -1
- package/dist/webcomponents/p-8cc7a418.entry.js +0 -1
- package/dist/webcomponents/p-8dd22c8d.entry.js +0 -1
- package/dist/webcomponents/p-9e7c3231.entry.js +0 -1
- package/dist/webcomponents/p-b53d7b7f.js +0 -1
- package/dist/webcomponents/p-bbc18b9f.entry.js +0 -1
- package/dist/webcomponents/p-c4264aaf.js +0 -1
- package/dist/webcomponents/p-cb9ee476.entry.js +0 -1
- package/dist/webcomponents/p-d083a342.entry.js +0 -1
- package/dist/webcomponents/p-e46929a1.entry.js +0 -1
- package/dist/webcomponents/p-ea7c77a3.entry.js +0 -1
- package/dist/webcomponents/p-ed844504.js +0 -1
- package/dist/module/{index.esm.js → form.js} +2733 -2733
|
@@ -3,116 +3,73 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-fb499e95.js');
|
|
6
|
+
const ComponentError = require('./ComponentError-233ac749.js');
|
|
7
|
+
const paymentProvisioningActions = require('./payment-provisioning-actions-06466dda.js');
|
|
8
|
+
const business_service = require('./business.service-f63650f5.js');
|
|
6
9
|
const index_esm = require('./index.esm-52757963.js');
|
|
7
|
-
const
|
|
10
|
+
const businessFormTypes = require('./business-form-types-6e1fcda3.js');
|
|
11
|
+
const schemaValidations = require('./schema-validations-2733de42.js');
|
|
12
|
+
const businessFormOptions = require('./business-form-options-582467fe.js');
|
|
8
13
|
const Api = require('./Api-3bc6e43f.js');
|
|
9
14
|
require('./Pagination-0da8f095.js');
|
|
10
|
-
require('./Payment-
|
|
15
|
+
require('./Payment-1a8a8ca6.js');
|
|
11
16
|
require('./Payout-a2dd7b01.js');
|
|
12
17
|
const config = require('./config-ff2dda66.js');
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const payloadParsers = require('./payload-parsers-1cbc3b57.js');
|
|
21
|
-
const utils$1 = require('./utils-80191fbe.js');
|
|
22
|
-
const helpers = require('./helpers-602962eb.js');
|
|
23
|
-
const stateOptions = require('./state-options-4fbcb48a.js');
|
|
18
|
+
const utils = require('./utils-ddacfc44.js');
|
|
19
|
+
const Business = require('./Business-aacbe893.js');
|
|
20
|
+
const skeleton = require('./skeleton-748c5dde.js');
|
|
21
|
+
const button = require('./button-3f400a66.js');
|
|
22
|
+
require('./utils-7a478c37.js');
|
|
23
|
+
require('./state-options-4fbcb48a.js');
|
|
24
|
+
require('./helpers-602962eb.js');
|
|
24
25
|
|
|
25
26
|
const AdditionalQuestionsFormStep = class {
|
|
26
27
|
constructor(hostRef) {
|
|
27
28
|
index.registerInstance(this, hostRef);
|
|
28
|
-
this.submitted = index.createEvent(this, "submitted", 7);
|
|
29
|
-
this.formLoading = index.createEvent(this, "formLoading", 7);
|
|
30
29
|
this.errorEvent = index.createEvent(this, "error-event", 7);
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
try {
|
|
34
|
-
const response = await this.api.get(this.businessEndpoint);
|
|
35
|
-
this.additional_questions = new Business.AdditionalQuestions(response.data.additional_questions || {});
|
|
36
|
-
this.formController.setInitialValues(Object.assign({}, this.additional_questions));
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
this.errorEvent.emit({
|
|
40
|
-
errorCode: ComponentError.ComponentErrorCodes.FETCH_ERROR,
|
|
41
|
-
message: error.message,
|
|
42
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
43
|
-
data: error,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
finally {
|
|
47
|
-
this.formLoading.emit(false);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
this.sendData = async (onSuccess) => {
|
|
51
|
-
this.formLoading.emit(true);
|
|
52
|
-
try {
|
|
53
|
-
const payload = this.formController.values.getValue();
|
|
54
|
-
const response = await this.api.patch(this.businessEndpoint, JSON.stringify({ additional_questions: payload }));
|
|
55
|
-
this.handleResponse(response, onSuccess);
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
this.errorEvent.emit({
|
|
59
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
60
|
-
message: error.message,
|
|
61
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
62
|
-
data: error,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
finally {
|
|
66
|
-
this.formLoading.emit(false);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
this.inputHandler = (name, value) => {
|
|
70
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
71
|
-
};
|
|
72
|
-
this.formController = undefined;
|
|
73
|
-
this.errors = {};
|
|
74
|
-
this.additional_questions = {};
|
|
30
|
+
this.getBusiness = undefined;
|
|
31
|
+
this.patchBusiness = undefined;
|
|
75
32
|
this.authToken = undefined;
|
|
76
33
|
this.businessId = undefined;
|
|
77
34
|
this.allowOptionalFields = undefined;
|
|
78
35
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
handleResponse(response, onSuccess) {
|
|
83
|
-
if (response.error) {
|
|
84
|
-
this.errorEvent.emit({
|
|
85
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
86
|
-
message: response.error.message,
|
|
87
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
88
|
-
data: response.error,
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
onSuccess();
|
|
93
|
-
}
|
|
94
|
-
this.submitted.emit({ data: response, metadata: { completedStep: businessFormTypes.BusinessFormStep.additionalQuestions } });
|
|
36
|
+
propChanged() {
|
|
37
|
+
this.initializeApi();
|
|
95
38
|
}
|
|
96
39
|
async validateAndSubmit({ onSuccess }) {
|
|
97
|
-
this.
|
|
40
|
+
this.coreComponent.validateAndSubmit({ onSuccess });
|
|
98
41
|
}
|
|
99
|
-
;
|
|
100
42
|
componentWillLoad() {
|
|
101
|
-
this.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
43
|
+
this.initializeApi();
|
|
44
|
+
}
|
|
45
|
+
initializeApi() {
|
|
46
|
+
if (this.authToken && this.businessId) {
|
|
47
|
+
this.getBusiness = paymentProvisioningActions.makeGetBusiness({
|
|
48
|
+
authToken: this.authToken,
|
|
49
|
+
businessId: this.businessId,
|
|
50
|
+
service: new business_service.BusinessService()
|
|
51
|
+
});
|
|
52
|
+
this.patchBusiness = paymentProvisioningActions.makePatchBusiness({
|
|
53
|
+
authToken: this.authToken,
|
|
54
|
+
businessId: this.businessId,
|
|
55
|
+
service: new business_service.BusinessService()
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.errorEvent.emit({
|
|
60
|
+
message: 'Missing required props',
|
|
61
|
+
errorCode: ComponentError.ComponentErrorCodes.MISSING_PROPS,
|
|
62
|
+
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
63
|
+
});
|
|
105
64
|
}
|
|
106
|
-
}
|
|
107
|
-
componentDidLoad() {
|
|
108
|
-
this.formController.values.subscribe(values => this.additional_questions = Object.assign({}, values));
|
|
109
|
-
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
110
65
|
}
|
|
111
66
|
render() {
|
|
112
|
-
|
|
113
|
-
const additionalQuestionsDefaultValue = this.formController.getInitialValues();
|
|
114
|
-
return (index.h(index.Host, { key: 'a6c4f79702b3ebeb087c7e0beb1353e243c26bb2', exportparts: "label,input,input-invalid" }, index.h("form", { key: 'e4f918d7b7a84b8a2332f14d79dcb8bc7c50da73' }, index.h("fieldset", { key: '921f14f225be38b665780a5640bc38302497a5b4' }, index.h("legend", { key: '01fa03c8134995cb23a67766febb6d4522e3d41a' }, "Additional Questions"), index.h("hr", { key: '61131730389e979b6aa7d68ca5f58a070aa2534e' }), index.h("div", { key: '54b3af3d2fe06b20463fa548a60ab986f246a3d7', class: "row gy-3" }, index.h("div", { key: '55c113e9d5f4746cc78de3f91cbf0a069d7a8e41', class: "col-12 col-md-6" }, index.h("form-control-monetary", { key: '86a6cacf09105f5c4415a01738ba77b7eeb7622c', name: "business_revenue", label: "What is the 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: formInputMasks.CURRENCY_MASK.WHOLE })), index.h("div", { key: 'ae68b9c006ea41e1f214226efdb4e14098d5e800', class: "col-12 col-md-6" }, index.h("form-control-monetary", { key: 'ddbff877fc74121bbf84eb7f4ee278558f35d853', name: "business_payment_volume", label: "What is the 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: formInputMasks.CURRENCY_MASK.WHOLE })), index.h("div", { key: '80fa2c11d3cadd1a1ab07ad79b7ff736a15a38d3', class: "col-12" }, index.h("form-control-select", { key: '7fca901a87105b9a401309d5841279bac7a6f5cd', 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: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_when_service_received, options: businessFormOptions.businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), index.h("div", { key: 'a20763d9518cd84b062f81fdce325be2a8dfb40e', class: "col-12" }, index.h("form-control-select", { key: 'cfec3aab19c544b16f8a0fab7541433130c3b749', name: 'business_recurring_payments', label: 'Does your business offer recurring payments?', inputHandler: this.inputHandler, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_recurring_payments, options: businessFormOptions.recurringPaymentsOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments })), index.h("div", { key: '0ef1a0473a5870428a741be696e08c881ebee524', class: "col-12" }, index.h("form-control-text", { key: '512a4924c14b7c2da661b5ffe966d8d1497cb706', name: 'business_recurring_payments_percentage', label: 'What percent of revenue is generated from each recurring payment type offered?', inputHandler: this.inputHandler, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.business_recurring_payments_percentage, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments_percentage })), index.h("div", { key: '75a7b0adfde53443a53ca4e4143f1ff060291837', class: "col-12" }, index.h("form-control-select", { key: '1474ce5f608be57a36486ad46c7a7bd68fc44fc7', name: 'business_seasonal', label: 'Is this business seasonal?', inputHandler: this.inputHandler, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.business_seasonal, options: businessFormOptions.seasonalBusinessOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_seasonal })), index.h("div", { key: '7de2fd399754cc0c77e2b08b7d1a4d0082903f61', class: "col-12" }, index.h("form-control-text", { key: '5de14ae950223e353dd6d58430a4493ffd26da4e', name: 'business_other_payment_details', label: 'Is there anything else you would like us to know about how your customers pay the business?', inputHandler: this.inputHandler, errorText: (_g = this.errors) === null || _g === void 0 ? void 0 : _g.business_other_payment_details, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_other_payment_details })))))));
|
|
67
|
+
return (index.h("justifi-additional-questions-form-step-core", { key: 'ede8f1336c69d47c651a5b4b95ee2746aae3aa52', getBusiness: this.getBusiness, patchBusiness: this.patchBusiness, allowOptionalFields: this.allowOptionalFields, ref: el => this.coreComponent = el }));
|
|
115
68
|
}
|
|
69
|
+
static get watchers() { return {
|
|
70
|
+
"authToken": ["propChanged"],
|
|
71
|
+
"businessId": ["propChanged"]
|
|
72
|
+
}; }
|
|
116
73
|
};
|
|
117
74
|
|
|
118
75
|
const businessBankAccountSchema = (allowOptionalFields) => {
|
|
@@ -260,102 +217,57 @@ const BusinessBankAccountFormStep = class {
|
|
|
260
217
|
}
|
|
261
218
|
render() {
|
|
262
219
|
const bankAccountDefaultValue = this.formController.getInitialValues();
|
|
263
|
-
return (index.h(
|
|
220
|
+
return (index.h("form", { key: 'b2e106437693b667376fb8091117bc04899cce13' }, index.h("fieldset", { key: 'c6fc0e5b39278a4618abe0aeba8593b4800f23fa' }, index.h("legend", { key: 'f07c520e32491dd506f7ac16b03b0eb82a451035' }, "Bank Account Info"), index.h("hr", { key: '43845af4ec6f143653154e301a49c870c688e8cb' }), index.h("div", { key: '911f450a0e81a7fcf6afb8b54be910da36b068d6', class: "row gy-3" }, index.h("div", { key: 'afe5dd40139f1098e69736cd08f00792916657b1', class: "col-12" }, index.h("form-control-text", { key: 'c590065940b5ef4ab5a125962e114d3bb99161e8', name: "bank_name", label: "Bank Name", defaultValue: bankAccountDefaultValue.bank_name, errorText: this.errors.bank_name, inputHandler: this.inputHandler, disabled: this.formDisabled })), index.h("div", { key: 'ad7ac99fdae7bb0108675cf4ea522ae7b0c7b340', class: "col-12" }, index.h("form-control-text", { key: '4e69debe8b184272c788f0ba206b7e983bb6bba5', name: "nickname", label: "Nickname", defaultValue: bankAccountDefaultValue.nickname, errorText: this.errors.nickname, inputHandler: this.inputHandler, disabled: this.formDisabled })), index.h("div", { key: 'a478bb2330e48935b65d22a42287ab89f94b4808', class: "col-12" }, index.h("form-control-text", { key: 'c20531fb2c5e903eefeeb62fca5a831cf2542867', name: "account_owner_name", label: "Account Owner Name", defaultValue: bankAccountDefaultValue.account_owner_name, errorText: this.errors.account_owner_name, inputHandler: this.inputHandler, disabled: this.formDisabled })), index.h("div", { key: '63325c985d0341888ad9ce34fec48c623e275f55', class: "col-12" }, index.h("form-control-select", { key: 'b9fc86477dada5413e4a6e18b10e77de620996d9', name: "account_type", label: "Account Type", options: businessFormOptions.bankAccountTypeOptions, defaultValue: bankAccountDefaultValue.account_type, errorText: this.errors.account_type, inputHandler: this.inputHandler, disabled: this.formDisabled })), index.h("div", { key: '7d2849185532bb21c85cf8227749469e28fdc102', class: "col-12" }, index.h("form-control-text", { key: '466a38e94ed054788596ec63bed4b4ffe646dc63', name: "account_number", label: "Account Number", defaultValue: bankAccountDefaultValue.account_number, maxLength: 17, errorText: this.errors.account_number, inputHandler: this.inputHandler, keyDownHandler: utils.numberOnlyHandler, disabled: this.formDisabled })), index.h("div", { key: '1162fae41dfc767cd038a37d7a7581b54dee1a1d', class: "col-12" }, index.h("form-control-text", { key: '47ffb34b6523d34df02739231b5764418f162fe6', name: "routing_number", label: "Routing Number", defaultValue: bankAccountDefaultValue.routing_number, maxLength: 9, errorText: this.errors.routing_number, inputHandler: this.inputHandler, keyDownHandler: utils.numberOnlyHandler, disabled: this.formDisabled }))))));
|
|
264
221
|
}
|
|
265
222
|
};
|
|
266
223
|
|
|
267
224
|
const BusinessCoreInfoFormStep = class {
|
|
268
225
|
constructor(hostRef) {
|
|
269
226
|
index.registerInstance(this, hostRef);
|
|
270
|
-
this.submitted = index.createEvent(this, "submitted", 7);
|
|
271
|
-
this.formLoading = index.createEvent(this, "formLoading", 7);
|
|
272
227
|
this.errorEvent = index.createEvent(this, "error-event", 7);
|
|
273
|
-
this.
|
|
274
|
-
|
|
275
|
-
try {
|
|
276
|
-
const response = await this.api.get(this.businessEndpoint);
|
|
277
|
-
this.coreInfo = new Business.CoreBusinessInfo(response.data);
|
|
278
|
-
this.formController.setInitialValues(Object.assign({}, this.coreInfo));
|
|
279
|
-
}
|
|
280
|
-
catch (error) {
|
|
281
|
-
this.errorEvent.emit({
|
|
282
|
-
errorCode: ComponentError.ComponentErrorCodes.FETCH_ERROR,
|
|
283
|
-
message: error.message,
|
|
284
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
285
|
-
data: error,
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
finally {
|
|
289
|
-
this.formLoading.emit(false);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
this.sendData = async (onSuccess) => {
|
|
293
|
-
this.formLoading.emit(true);
|
|
294
|
-
try {
|
|
295
|
-
const payload = payloadParsers.parseCoreInfo(utils$1.flattenNestedObject(this.formController.values.getValue()));
|
|
296
|
-
const response = await this.api.patch(this.businessEndpoint, JSON.stringify(payload));
|
|
297
|
-
this.handleResponse(response, onSuccess);
|
|
298
|
-
}
|
|
299
|
-
catch (error) {
|
|
300
|
-
this.errorEvent.emit({
|
|
301
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
302
|
-
message: error.message,
|
|
303
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
304
|
-
data: error,
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
finally {
|
|
308
|
-
this.formLoading.emit(false);
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
this.inputHandler = (name, value) => {
|
|
312
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
313
|
-
};
|
|
314
|
-
this.formController = undefined;
|
|
315
|
-
this.errors = {};
|
|
316
|
-
this.coreInfo = {};
|
|
228
|
+
this.getBusiness = undefined;
|
|
229
|
+
this.patchBusiness = undefined;
|
|
317
230
|
this.authToken = undefined;
|
|
318
231
|
this.businessId = undefined;
|
|
319
232
|
this.allowOptionalFields = undefined;
|
|
320
233
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
handleResponse(response, onSuccess) {
|
|
325
|
-
if (response.error) {
|
|
326
|
-
this.errorEvent.emit({
|
|
327
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
328
|
-
message: response.error.message,
|
|
329
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
330
|
-
data: response.error,
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
onSuccess();
|
|
335
|
-
}
|
|
336
|
-
this.submitted.emit({ data: response, metadata: { completedStep: businessFormTypes.BusinessFormStep.coreInfo } });
|
|
234
|
+
propChanged() {
|
|
235
|
+
this.initializeApi();
|
|
337
236
|
}
|
|
338
237
|
async validateAndSubmit({ onSuccess }) {
|
|
339
|
-
this.
|
|
238
|
+
this.coreComponent.validateAndSubmit({ onSuccess });
|
|
340
239
|
}
|
|
341
|
-
;
|
|
342
240
|
componentWillLoad() {
|
|
343
|
-
this.
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
241
|
+
this.initializeApi();
|
|
242
|
+
}
|
|
243
|
+
initializeApi() {
|
|
244
|
+
if (this.authToken && this.businessId) {
|
|
245
|
+
this.getBusiness = paymentProvisioningActions.makeGetBusiness({
|
|
246
|
+
authToken: this.authToken,
|
|
247
|
+
businessId: this.businessId,
|
|
248
|
+
service: new business_service.BusinessService()
|
|
249
|
+
});
|
|
250
|
+
this.patchBusiness = paymentProvisioningActions.makePatchBusiness({
|
|
251
|
+
authToken: this.authToken,
|
|
252
|
+
businessId: this.businessId,
|
|
253
|
+
service: new business_service.BusinessService()
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
this.errorEvent.emit({
|
|
258
|
+
message: 'Missing required props',
|
|
259
|
+
errorCode: ComponentError.ComponentErrorCodes.MISSING_PROPS,
|
|
260
|
+
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
261
|
+
});
|
|
347
262
|
}
|
|
348
|
-
}
|
|
349
|
-
componentDidLoad() {
|
|
350
|
-
this.formController.values.subscribe(values => this.coreInfo = Object.assign({}, values));
|
|
351
|
-
this.formController.errors.subscribe(errors => {
|
|
352
|
-
this.errors = Object.assign({}, errors);
|
|
353
|
-
});
|
|
354
263
|
}
|
|
355
264
|
render() {
|
|
356
|
-
|
|
357
|
-
return (index.h(index.Host, { key: '4ea42b813bdd6e5c59a62ae4ae869e86dfddd7ce', exportparts: 'label,input,input-invalid' }, index.h("form", { key: 'f5ec3be342eda82dee8a51fe2ee5a6da1ee8902e' }, index.h("fieldset", { key: 'e07041577f53badc6c172a2c6dc20b1066c03f4c' }, index.h("legend", { key: '2bcc8cc013eeee4e27c874d0bed4471515b68610' }, "General Info"), index.h("hr", { key: '6dc6f73cf851b9244c8d797bc5cefdfda848c7bc' }), index.h("div", { key: 'b2bfad85255ddfa76d405e45df3d668ad02a6fea', class: 'row gy-3' }, index.h("div", { key: 'a9a65df07f40621513ce4881dd203e90142d7670', class: 'col-12' }, index.h("form-control-text", { key: '7fe7ac765902c7cd9ed60004dc7be687d43b2e49', name: 'legal_name', label: 'Legal Name', defaultValue: coreInfoDefaultValue.legal_name, errorText: this.errors.legal_name, inputHandler: this.inputHandler })), index.h("div", { key: '6fe2e395e4391480f4d6dafcfc57619176efc45c', class: 'col-12' }, index.h("form-control-text", { key: 'd19870345d79e4c44c3e667e2751ff6f344e1d58', name: 'doing_business_as', label: 'Doing Business As (DBA)', defaultValue: coreInfoDefaultValue.doing_business_as, errorText: this.errors.doing_business_as, inputHandler: this.inputHandler })), index.h("div", { key: '39acda8180c70f7684aa2d73ef31bc199233c358', class: 'col-12 col-md-8' }, index.h("form-control-select", { key: '67f98ac21a69a851bb9489df198e06c8b517d45e', name: 'classification', label: 'Business Classification', options: businessFormOptions.businessClassificationOptions, defaultValue: coreInfoDefaultValue.classification, errorText: this.errors.classification, inputHandler: this.inputHandler })), index.h("div", { key: 'd54631f13e8998170de1f175d52d89d90035e688', class: 'col-12 col-md-4' }, index.h("form-control-date", { key: '8038e4f909c9bb2e5f3a8dd577f7b7f75e3d4f41', name: 'date_of_incorporation', label: 'Date of Incorporation', defaultValue: coreInfoDefaultValue.date_of_incorporation, errorText: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), index.h("div", { key: 'ca43f206b14494ddaa55c625a2c408426ebcf529', class: 'col-12 col-md-6' }, index.h("form-control-text", { key: '7ccf50e04dad1a7e001c37074925f27f53ec831c', name: 'industry', label: 'Industry', defaultValue: coreInfoDefaultValue.industry, errorText: this.errors.industry, inputHandler: this.inputHandler })), index.h("div", { key: '76136df0a434b7fce1b0307e962e4ea387a063d3', class: 'col-12 col-md-6' }, index.h("form-control-text", { key: 'ddfd853ed46b3995484dff54d47af0c0d6c93b0c', name: 'tax_id', label: 'Tax ID (EIN or SSN)', defaultValue: coreInfoDefaultValue.tax_id, errorText: this.errors.tax_id, inputHandler: this.inputHandler, keyDownHandler: utils.numberOnlyHandler, maxLength: 9 })), index.h("div", { key: '1084c4d7a261b8fc0a9ceacc16b5823f09cfb807', class: 'col-12' }, index.h("form-control-text", { key: 'c9ca186a6f2cc10f43966de56e6a224103ddd1f3', name: 'website_url', label: 'Website URL', defaultValue: coreInfoDefaultValue.website_url, errorText: this.errors.website_url, inputHandler: this.inputHandler })), index.h("div", { key: '55bc2f83a170fc1bec20c208460cc63b8f42a566', class: 'col-12 col-md-6' }, index.h("form-control-text", { key: '5c35db62f1d7d56e01a839df29b39aa55e569d5c', name: 'email', label: 'Email Address', defaultValue: coreInfoDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), index.h("div", { key: 'f74aadc2ea606365918f29091a6f6bb08841bf00', class: 'col-12 col-md-6' }, index.h("form-control-number-masked", { key: 'ef54ee012cbc30464bcdc7e887d5eb0523e30057', name: 'phone', label: 'Phone Number', defaultValue: coreInfoDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: formInputMasks.PHONE_MASKS.US })))))));
|
|
265
|
+
return (index.h("justifi-business-core-info-form-step-core", { key: '4ee53046d16fd42df4e09b10c338a740c22184ef', businessId: this.businessId, getBusiness: this.getBusiness, patchBusiness: this.patchBusiness, allowOptionalFields: this.allowOptionalFields, ref: el => this.coreComponent = el }));
|
|
358
266
|
}
|
|
267
|
+
static get watchers() { return {
|
|
268
|
+
"authToken": ["propChanged"],
|
|
269
|
+
"businessId": ["propChanged"]
|
|
270
|
+
}; }
|
|
359
271
|
};
|
|
360
272
|
|
|
361
273
|
const businessDocumentSchema = (volume, documents, allowOptionalFields) => {
|
|
@@ -483,22 +395,26 @@ const BusinessDocumentFormStep = class {
|
|
|
483
395
|
this.documentData[docType] = documentList;
|
|
484
396
|
};
|
|
485
397
|
this.sendData = async (onSuccess) => {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
398
|
+
try {
|
|
399
|
+
const docArray = Object.values(this.documentData).flat();
|
|
400
|
+
if (!docArray.length) {
|
|
401
|
+
return onSuccess();
|
|
402
|
+
}
|
|
403
|
+
const documentRecords = docArray.map(docData => this.createDocumentRecord(docData));
|
|
404
|
+
const recordsCreated = await Promise.all(documentRecords);
|
|
405
|
+
if (!recordsCreated) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
const uploads = docArray.map(docData => this.uploadDocument(docData));
|
|
409
|
+
const uploadsCompleted = await Promise.all(uploads);
|
|
410
|
+
if (!uploadsCompleted) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
await onSuccess();
|
|
494
414
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
if (!uploadsCompleted) {
|
|
498
|
-
return;
|
|
415
|
+
finally {
|
|
416
|
+
this.formLoading.emit(false);
|
|
499
417
|
}
|
|
500
|
-
uploadsCompleted && this.formLoading.emit(false);
|
|
501
|
-
await onSuccess();
|
|
502
418
|
};
|
|
503
419
|
this.formController = undefined;
|
|
504
420
|
this.errors = {};
|
|
@@ -537,7 +453,7 @@ const BusinessDocumentFormStep = class {
|
|
|
537
453
|
return null;
|
|
538
454
|
}
|
|
539
455
|
if (this.isLoading) {
|
|
540
|
-
return index.h(
|
|
456
|
+
return index.h(skeleton.Skeleton, { variant: 'rounded', height: '50px' });
|
|
541
457
|
}
|
|
542
458
|
return index.h("justifi-business-documents-on-file", { documents: this.existingDocuments });
|
|
543
459
|
}
|
|
@@ -546,266 +462,111 @@ const BusinessDocumentFormStep = class {
|
|
|
546
462
|
return null;
|
|
547
463
|
}
|
|
548
464
|
if (this.isLoading) {
|
|
549
|
-
return index.h(
|
|
465
|
+
return index.h(skeleton.Skeleton, { variant: 'rounded', height: '350px' });
|
|
550
466
|
}
|
|
551
467
|
return (index.h("justifi-business-document-upload-input-group", { paymentVolume: this.paymentVolume, inputHandler: this.inputHandler, storeFiles: this.storeFiles, errors: this.errors }));
|
|
552
468
|
}
|
|
553
469
|
render() {
|
|
554
|
-
return (index.h(
|
|
470
|
+
return (index.h("form", { key: '8f2e1d262cd5050b315019a1947b1474eaf995de' }, index.h("fieldset", { key: 'd022b1c294835e456a9067fcfdbf2b93a33c8ca8' }, index.h("legend", { key: '522ecbab0489efa6d4294f38f792a28770010f1e' }, "Document Uploads"), index.h("p", { key: 'b49a6b3a4a7c79b368b20455b4ed4a943f08ec51' }, "Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."), index.h("hr", { key: '3d8c2f7f5b128b99ceaa501166ae60c490b12378' }), this.documentsOnFile, index.h("div", { key: 'd2627185483e1be43c0b34d80b1fcfa850decd28', class: "d-flex flex-column" }, this.formInputs))));
|
|
555
471
|
}
|
|
556
472
|
};
|
|
557
473
|
|
|
558
474
|
const BusinessOwnersFormStep = class {
|
|
559
475
|
constructor(hostRef) {
|
|
560
476
|
index.registerInstance(this, hostRef);
|
|
561
|
-
this.submitted = index.createEvent(this, "submitted", 7);
|
|
562
|
-
this.clickEvent = index.createEvent(this, "click-event", 7);
|
|
563
|
-
this.formLoading = index.createEvent(this, "formLoading", 7);
|
|
564
477
|
this.errorEvent = index.createEvent(this, "error-event", 7);
|
|
565
|
-
this.
|
|
566
|
-
|
|
567
|
-
return { id: owner.id };
|
|
568
|
-
});
|
|
569
|
-
return payload;
|
|
570
|
-
};
|
|
571
|
-
this.matchRef = (ref, ownerId) => {
|
|
572
|
-
const ownerIndex = this.refs.findIndex(ref => ref === ownerId);
|
|
573
|
-
if (ownerIndex !== -1) {
|
|
574
|
-
this.refs[ownerIndex] = ref;
|
|
575
|
-
}
|
|
576
|
-
};
|
|
577
|
-
this.fetchData = async () => {
|
|
578
|
-
this.formLoading.emit(true);
|
|
579
|
-
try {
|
|
580
|
-
const response = await this.api.get(this.businessEndpoint);
|
|
581
|
-
if (response.data.owners.length) {
|
|
582
|
-
this.owners = response.data.owners.map(owner => owner);
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
this.addOwnerForm();
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
catch (error) {
|
|
589
|
-
this.errorEvent.emit({
|
|
590
|
-
errorCode: ComponentError.ComponentErrorCodes.FETCH_ERROR,
|
|
591
|
-
message: error.message,
|
|
592
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
593
|
-
data: error,
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
finally {
|
|
597
|
-
this.formLoading.emit(false);
|
|
598
|
-
this.manageRefs();
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
this.sendData = async (onSuccess) => {
|
|
602
|
-
this.formLoading.emit(true);
|
|
603
|
-
try {
|
|
604
|
-
const payload = await this.managePayload();
|
|
605
|
-
const response = await this.api.patch(this.businessEndpoint, JSON.stringify({ owners: payload }));
|
|
606
|
-
this.handleResponse(response, onSuccess);
|
|
607
|
-
}
|
|
608
|
-
catch (error) {
|
|
609
|
-
this.errorEvent.emit({
|
|
610
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
611
|
-
message: error.message,
|
|
612
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
613
|
-
data: error,
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
finally {
|
|
617
|
-
this.formLoading.emit(false);
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
this.addOwnerForm = (fireClick) => {
|
|
621
|
-
this.newFormOpen = true;
|
|
622
|
-
const newOwner = Object.assign({}, new Business.Owner({}));
|
|
623
|
-
this.owners = [...this.owners, newOwner];
|
|
624
|
-
fireClick && this.clickEvent.emit({ name: businessFormTypes.OwnerFormClickActions.addOwnerForm });
|
|
625
|
-
};
|
|
626
|
-
this.removeOwnerForm = (id) => {
|
|
627
|
-
this.owners = this.owners.filter(owner => owner.id !== id);
|
|
628
|
-
this.newFormOpen ? this.newFormOpen = false : null;
|
|
629
|
-
};
|
|
630
|
-
this.handleOwnerSubmit = (event) => {
|
|
631
|
-
const ownerData = event.detail.data.data;
|
|
632
|
-
const currentIndex = this.owners.findIndex(owner => owner.id === ownerData.id);
|
|
633
|
-
if (currentIndex !== -1) {
|
|
634
|
-
this.owners[currentIndex] = ownerData;
|
|
635
|
-
}
|
|
636
|
-
else {
|
|
637
|
-
const newOwnerIndex = this.owners.findIndex(owner => !owner.id);
|
|
638
|
-
this.owners[newOwnerIndex] = ownerData;
|
|
639
|
-
this.newFormOpen ? this.newFormOpen = false : null;
|
|
640
|
-
}
|
|
641
|
-
};
|
|
642
|
-
this.owners = [];
|
|
643
|
-
this.newFormOpen = undefined;
|
|
644
|
-
this.refs = [];
|
|
478
|
+
this.getBusiness = undefined;
|
|
479
|
+
this.patchBusiness = undefined;
|
|
645
480
|
this.authToken = undefined;
|
|
646
481
|
this.businessId = undefined;
|
|
647
482
|
this.allowOptionalFields = undefined;
|
|
648
483
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}
|
|
652
|
-
get showAddOwnerButton() {
|
|
653
|
-
return this.owners.length < 4 && !this.newFormOpen;
|
|
484
|
+
propChanged() {
|
|
485
|
+
this.initializeApi();
|
|
654
486
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
this.refs = ownerRefs;
|
|
487
|
+
async validateAndSubmit({ onSuccess }) {
|
|
488
|
+
this.coreComponent.validateAndSubmit({ onSuccess });
|
|
658
489
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
490
|
+
componentWillLoad() {
|
|
491
|
+
this.initializeApi();
|
|
492
|
+
}
|
|
493
|
+
initializeApi() {
|
|
494
|
+
if (this.authToken && this.businessId) {
|
|
495
|
+
this.getBusiness = paymentProvisioningActions.makeGetBusiness({
|
|
496
|
+
authToken: this.authToken,
|
|
497
|
+
businessId: this.businessId,
|
|
498
|
+
service: new business_service.BusinessService()
|
|
499
|
+
});
|
|
500
|
+
this.patchBusiness = paymentProvisioningActions.makePatchBusiness({
|
|
501
|
+
authToken: this.authToken,
|
|
502
|
+
businessId: this.businessId,
|
|
503
|
+
service: new business_service.BusinessService()
|
|
666
504
|
});
|
|
667
505
|
}
|
|
668
506
|
else {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const formValidations = this.refs.map(ref => ref.validate());
|
|
675
|
-
const formsValid = (await Promise.all(formValidations)).every(result => result);
|
|
676
|
-
if (!formsValid) {
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
const formSubmissions = this.refs.map(ref => ref.submit());
|
|
680
|
-
const submissionsValid = (await Promise.all(formSubmissions)).every(result => result);
|
|
681
|
-
if (!submissionsValid) {
|
|
682
|
-
return;
|
|
683
|
-
}
|
|
684
|
-
await this.sendData(onSuccess);
|
|
685
|
-
}
|
|
686
|
-
;
|
|
687
|
-
componentWillLoad() {
|
|
688
|
-
this.api = Api.Api({ authToken: this.authToken, apiOrigin: config.config.proxyApiOrigin });
|
|
689
|
-
if (this.businessId && this.authToken) {
|
|
690
|
-
this.fetchData();
|
|
507
|
+
this.errorEvent.emit({
|
|
508
|
+
message: 'Missing required props',
|
|
509
|
+
errorCode: ComponentError.ComponentErrorCodes.MISSING_PROPS,
|
|
510
|
+
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
511
|
+
});
|
|
691
512
|
}
|
|
692
513
|
}
|
|
693
|
-
onOwnersUpdated() {
|
|
694
|
-
this.manageRefs();
|
|
695
|
-
}
|
|
696
514
|
render() {
|
|
697
|
-
return (index.h(index.Host, { key: '
|
|
698
|
-
return (index.h("justifi-owner-form", { key: owner.id, authToken: this.authToken, businessId: this.businessId, ownerId: owner.id, removeOwner: this.removeOwnerForm, newFormOpen: this.newFormOpen, ownersLength: this.owners.length, onSubmitted: (e) => this.handleOwnerSubmit(e), onFormLoading: (e) => this.formLoading.emit(e.detail), allowOptionalFields: this.allowOptionalFields, ref: (ref) => { this.matchRef(ref, owner.id); } }));
|
|
699
|
-
})), this.showAddOwnerButton &&
|
|
700
|
-
index.h("div", { key: '3d3293f26ca3f9214d34ceee9f31974d127088b3', class: 'col-12' }, index.h("button", { key: '4dbcbf90018343c8c8b13e32cfc9121b2087c40d', class: 'btn btn-primary', onClick: () => this.addOwnerForm(true) }, "Add Owner"))));
|
|
515
|
+
return (index.h(index.Host, { key: '213a68fd3543eb912c6fed376128ba877ba75871' }, index.h("justifi-business-owners-form-step-core", { key: '5acee797bd35f5b60cadc5ddd50f560532dfe8b1', authToken: this.authToken, businessId: this.businessId, getBusiness: this.getBusiness, patchBusiness: this.patchBusiness, allowOptionalFields: this.allowOptionalFields, ref: (el) => this.coreComponent = el })));
|
|
701
516
|
}
|
|
702
517
|
static get watchers() { return {
|
|
703
|
-
"
|
|
518
|
+
"authToken": ["propChanged"],
|
|
519
|
+
"businessId": ["propChanged"]
|
|
704
520
|
}; }
|
|
705
521
|
};
|
|
706
522
|
|
|
707
523
|
const BusinessRepresentativeFormStep = class {
|
|
708
524
|
constructor(hostRef) {
|
|
709
525
|
index.registerInstance(this, hostRef);
|
|
710
|
-
this.submitted = index.createEvent(this, "submitted", 7);
|
|
711
|
-
this.formLoading = index.createEvent(this, "formLoading", 7);
|
|
712
526
|
this.errorEvent = index.createEvent(this, "error-event", 7);
|
|
713
|
-
this.
|
|
714
|
-
|
|
715
|
-
try {
|
|
716
|
-
const response = await this.api.get(this.businessEndpoint);
|
|
717
|
-
this.representative = new Business.Representative(response.data.representative || {});
|
|
718
|
-
this.formController.setInitialValues(Object.assign({}, this.representative));
|
|
719
|
-
}
|
|
720
|
-
catch (error) {
|
|
721
|
-
this.errorEvent.emit({
|
|
722
|
-
errorCode: ComponentError.ComponentErrorCodes.FETCH_ERROR,
|
|
723
|
-
message: error.message,
|
|
724
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
725
|
-
data: error,
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
finally {
|
|
729
|
-
this.formLoading.emit(false);
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
this.sendData = async (onSuccess) => {
|
|
733
|
-
this.formLoading.emit(true);
|
|
734
|
-
try {
|
|
735
|
-
const payload = payloadParsers.parseIdentityInfo(this.formController.values.getValue());
|
|
736
|
-
const response = await this.api.patch(this.businessEndpoint, JSON.stringify({ representative: payload }));
|
|
737
|
-
this.handleResponse(response, onSuccess);
|
|
738
|
-
}
|
|
739
|
-
catch (error) {
|
|
740
|
-
this.errorEvent.emit({
|
|
741
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
742
|
-
message: error.message,
|
|
743
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
744
|
-
data: error,
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
finally {
|
|
748
|
-
this.formLoading.emit(false);
|
|
749
|
-
}
|
|
750
|
-
};
|
|
751
|
-
this.inputHandler = (name, value) => {
|
|
752
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
753
|
-
};
|
|
754
|
-
this.onAddressFormUpdate = (values) => {
|
|
755
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { address: Object.assign(Object.assign({}, this.formController.values.getValue().address), values) }));
|
|
756
|
-
};
|
|
757
|
-
this.onDateOfBirthUpdate = (event) => {
|
|
758
|
-
if (event.detail === '') {
|
|
759
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { dob_day: null, dob_month: null, dob_year: null }));
|
|
760
|
-
}
|
|
761
|
-
else {
|
|
762
|
-
const dob_values = helpers.deconstructDate(event.detail);
|
|
763
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { dob_day: dob_values.dob_day, dob_month: dob_values.dob_month, dob_year: dob_values.dob_year }));
|
|
764
|
-
}
|
|
765
|
-
};
|
|
766
|
-
this.formController = undefined;
|
|
767
|
-
this.errors = {};
|
|
768
|
-
this.representative = {};
|
|
527
|
+
this.getBusiness = undefined;
|
|
528
|
+
this.patchBusiness = undefined;
|
|
769
529
|
this.authToken = undefined;
|
|
770
530
|
this.businessId = undefined;
|
|
771
531
|
this.allowOptionalFields = undefined;
|
|
772
532
|
}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
}
|
|
776
|
-
handleResponse(response, onSuccess) {
|
|
777
|
-
if (response.error) {
|
|
778
|
-
this.errorEvent.emit({
|
|
779
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
780
|
-
message: response.error.message,
|
|
781
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
782
|
-
data: response.error,
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
else {
|
|
786
|
-
onSuccess();
|
|
787
|
-
}
|
|
788
|
-
this.submitted.emit({ data: response, metadata: { completedStep: businessFormTypes.BusinessFormStep.representative } });
|
|
533
|
+
propChanged() {
|
|
534
|
+
this.initializeApi();
|
|
789
535
|
}
|
|
790
536
|
async validateAndSubmit({ onSuccess }) {
|
|
791
|
-
this.
|
|
537
|
+
this.coreComponent.validateAndSubmit({ onSuccess });
|
|
792
538
|
}
|
|
793
|
-
;
|
|
794
539
|
componentWillLoad() {
|
|
795
|
-
this.
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
540
|
+
this.initializeApi();
|
|
541
|
+
}
|
|
542
|
+
initializeApi() {
|
|
543
|
+
if (this.authToken && this.businessId) {
|
|
544
|
+
this.getBusiness = paymentProvisioningActions.makeGetBusiness({
|
|
545
|
+
authToken: this.authToken,
|
|
546
|
+
businessId: this.businessId,
|
|
547
|
+
service: new business_service.BusinessService()
|
|
548
|
+
});
|
|
549
|
+
this.patchBusiness = paymentProvisioningActions.makePatchBusiness({
|
|
550
|
+
authToken: this.authToken,
|
|
551
|
+
businessId: this.businessId,
|
|
552
|
+
service: new business_service.BusinessService()
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
this.errorEvent.emit({
|
|
557
|
+
message: 'Missing required props',
|
|
558
|
+
errorCode: ComponentError.ComponentErrorCodes.MISSING_PROPS,
|
|
559
|
+
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
560
|
+
});
|
|
799
561
|
}
|
|
800
|
-
}
|
|
801
|
-
componentDidLoad() {
|
|
802
|
-
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
803
|
-
this.formController.values.subscribe(values => (this.representative = Object.assign({}, values)));
|
|
804
562
|
}
|
|
805
563
|
render() {
|
|
806
|
-
|
|
807
|
-
return (index.h(index.Host, { key: 'd2c9bc0dd40d85403688d4c0ff482d7b0c3c35ab', exportparts: 'label,input,input-invalid' }, index.h("form", { key: '99a6b23b13b893f760e322dfe2e6f603e86e718c' }, index.h("fieldset", { key: '7c3b1897a7fe0fa672fa2d8d1a35ba4c81e9c256' }, index.h("legend", { key: 'f0fe4c93f757167e631d6e21bda5b559556550ad' }, "Representative"), index.h("hr", { key: '1dd5db7898b510bcdae492460f2ce57d7871c282' }), index.h("div", { key: '33d1935e5b6cc441bd0193e35aaaedcecfc2bc95', class: 'row gy-3' }, index.h("div", { key: 'c872b5a20469e3609178106b019fe1d0aecb2a24', class: 'col-12 col-md-8' }, index.h("form-control-text", { key: '31f37067b3c46bb4f7120169878dae88c1d4e918', name: 'name', label: 'Full Name', defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), index.h("div", { key: '9bdc8c1756a693f48bf060ee66f6fcf44cabc025', class: 'col-12 col-md-4' }, index.h("form-control-text", { key: '1686ff4c8e7b2e2fb74cc104966bf56d2754f8a8', name: 'title', label: 'Title', defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.title, errorText: this.errors.title, inputHandler: this.inputHandler })), index.h("div", { key: '789443ed50f9f0957e6bd8b4f6dea8d6ba7421a9', class: 'col-12 col-md-6' }, index.h("form-control-text", { key: 'fcf1bd082368ee1adcc6b661ec75e3693fcc30dd', name: 'email', label: 'Email Address', defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), index.h("div", { key: '163d3f6e3ea1d2b7833b7a232e4726e56fda6416', class: 'col-12 col-md-6' }, index.h("form-control-number-masked", { key: '3eba7a3ab6a7e8631cb9f100bfd7e5e5566efecc', name: 'phone', label: 'Phone Number', defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: formInputMasks.PHONE_MASKS.US })), index.h("div", { key: '42fc6d656c069f073b08e77398a266e367e771ad', class: 'col-12 col-md-4' }, index.h("form-control-date", { key: 'f627ff9478974305c83a8947b6c7f60d46189104', name: 'dob_full', label: 'Birth Date', defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: this.onDateOfBirthUpdate })), index.h("div", { key: 'ffded118a7a2d1c5889c46ac879cdadc289f1c1e', class: 'col-12 col-md-8' }, index.h("form-control-number-masked", { key: 'bf9cda57b1b7579a38d4f1f276c5cbc7b1723e2d', name: 'identification_number', label: 'SSN', defaultValue: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: formInputMasks.SSN_MASK })), index.h("div", { key: 'b033205960692dc7b3cea5ce59e12a13c58d5243', class: 'col-12' }, index.h("justifi-identity-address-form", { key: 'f243060451c630da18d175a93f55bb1fcabd0cec', errors: this.errors.address, defaultValues: representativeDefaultValue === null || representativeDefaultValue === void 0 ? void 0 : representativeDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate })))))));
|
|
564
|
+
return (index.h("justifi-business-representative-form-step-core", { key: '866d8cf33d53eff562dac1d36898b4c5695bf39b', getBusiness: this.getBusiness, patchBusiness: this.patchBusiness, allowOptionalFields: this.allowOptionalFields, ref: el => this.coreComponent = el }));
|
|
808
565
|
}
|
|
566
|
+
static get watchers() { return {
|
|
567
|
+
"authToken": ["propChanged"],
|
|
568
|
+
"businessId": ["propChanged"]
|
|
569
|
+
}; }
|
|
809
570
|
};
|
|
810
571
|
|
|
811
572
|
const businessTermsConditionsSchema = (allowOptionalFields) => {
|
|
@@ -926,103 +687,57 @@ const BusinessTermsConditionsFormStep = class {
|
|
|
926
687
|
});
|
|
927
688
|
}
|
|
928
689
|
render() {
|
|
929
|
-
return (index.h(
|
|
690
|
+
return (index.h("form", { key: '29b946b553d7a8011bee8f1997888f04b51897b3' }, index.h("fieldset", { key: 'c6e6c2577a66e58de8aabaac572cd7dab0a609b2' }, index.h("legend", { key: '4cf7e19049ee60807ffc5cbecbc8b87e9725590a' }, "Terms and Conditions"), index.h("hr", { key: 'b0d0bb46987a864a20a419eb0b2338fd57d07765' }), index.h("justifi-business-terms-conditions-text", { key: 'c936f2205bf123266d8eed2f12194eb2d8feb056' }), index.h("br", { key: 'e4f38ba5341c5fcf5938c3637905612e02bc7077' }), index.h("div", { key: '163401aaaee6e037d94182e5005625055bda66c5', class: "row-gy-3" }, index.h("div", { key: '3925d9b802f62e16cc41407170593b4b9a676bd9', class: "col-12" }, index.h("form-control-checkbox", { key: 'd86e00bfebe915d84a41486be34cec3555598d92', name: "accepted", label: "I agree to the terms and conditions", inputHandler: this.inputHandler, errorText: this.errors.accepted, disabled: this.acceptedTermsBefore, helpText: this.formHelperText }))))));
|
|
930
691
|
}
|
|
931
692
|
};
|
|
932
693
|
|
|
933
694
|
const LegalAddressFormStep = class {
|
|
934
695
|
constructor(hostRef) {
|
|
935
696
|
index.registerInstance(this, hostRef);
|
|
936
|
-
this.submitted = index.createEvent(this, "submitted", 7);
|
|
937
|
-
this.formLoading = index.createEvent(this, "formLoading", 7);
|
|
938
697
|
this.errorEvent = index.createEvent(this, "error-event", 7);
|
|
939
|
-
this.
|
|
940
|
-
|
|
941
|
-
try {
|
|
942
|
-
const response = await this.api.get(this.businessEndpoint);
|
|
943
|
-
this.legal_address = new Business.Address(response.data.legal_address || {});
|
|
944
|
-
this.formController.setInitialValues(Object.assign({}, this.legal_address));
|
|
945
|
-
}
|
|
946
|
-
catch (error) {
|
|
947
|
-
this.errorEvent.emit({
|
|
948
|
-
errorCode: ComponentError.ComponentErrorCodes.FETCH_ERROR,
|
|
949
|
-
message: error.message,
|
|
950
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
951
|
-
data: error,
|
|
952
|
-
});
|
|
953
|
-
}
|
|
954
|
-
finally {
|
|
955
|
-
this.formLoading.emit(false);
|
|
956
|
-
}
|
|
957
|
-
};
|
|
958
|
-
this.sendData = async (onSuccess) => {
|
|
959
|
-
this.formLoading.emit(true);
|
|
960
|
-
try {
|
|
961
|
-
const payload = payloadParsers.parseAddressInfo(this.formController.values.getValue());
|
|
962
|
-
const response = await this.api.patch(this.businessEndpoint, JSON.stringify({ legal_address: payload }));
|
|
963
|
-
this.handleResponse(response, onSuccess);
|
|
964
|
-
}
|
|
965
|
-
catch (error) {
|
|
966
|
-
this.errorEvent.emit({
|
|
967
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
968
|
-
message: error.message,
|
|
969
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
970
|
-
data: error,
|
|
971
|
-
});
|
|
972
|
-
}
|
|
973
|
-
finally {
|
|
974
|
-
this.formLoading.emit(false);
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
this.inputHandler = (name, value) => {
|
|
978
|
-
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
979
|
-
};
|
|
980
|
-
this.formController = undefined;
|
|
981
|
-
this.errors = {};
|
|
982
|
-
this.legal_address = {};
|
|
698
|
+
this.getBusiness = undefined;
|
|
699
|
+
this.patchBusiness = undefined;
|
|
983
700
|
this.authToken = undefined;
|
|
984
701
|
this.businessId = undefined;
|
|
985
702
|
this.allowOptionalFields = undefined;
|
|
986
703
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
}
|
|
990
|
-
handleResponse(response, onSuccess) {
|
|
991
|
-
if (response.error) {
|
|
992
|
-
this.errorEvent.emit({
|
|
993
|
-
errorCode: ComponentError.ComponentErrorCodes.PATCH_ERROR,
|
|
994
|
-
message: response.error.message,
|
|
995
|
-
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
996
|
-
data: response.error,
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
else {
|
|
1000
|
-
onSuccess();
|
|
1001
|
-
}
|
|
1002
|
-
this.submitted.emit({ data: response, metadata: { completedStep: businessFormTypes.BusinessFormStep.legalAddress } });
|
|
704
|
+
propChanged() {
|
|
705
|
+
this.initializeApi();
|
|
1003
706
|
}
|
|
1004
707
|
async validateAndSubmit({ onSuccess }) {
|
|
1005
|
-
this.
|
|
708
|
+
this.coreComponent.validateAndSubmit({ onSuccess });
|
|
1006
709
|
}
|
|
1007
|
-
;
|
|
1008
710
|
componentWillLoad() {
|
|
1009
|
-
this.
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
711
|
+
this.initializeApi();
|
|
712
|
+
}
|
|
713
|
+
initializeApi() {
|
|
714
|
+
if (this.authToken && this.businessId) {
|
|
715
|
+
this.getBusiness = paymentProvisioningActions.makeGetBusiness({
|
|
716
|
+
authToken: this.authToken,
|
|
717
|
+
businessId: this.businessId,
|
|
718
|
+
service: new business_service.BusinessService()
|
|
719
|
+
});
|
|
720
|
+
this.patchBusiness = paymentProvisioningActions.makePatchBusiness({
|
|
721
|
+
authToken: this.authToken,
|
|
722
|
+
businessId: this.businessId,
|
|
723
|
+
service: new business_service.BusinessService()
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
else {
|
|
727
|
+
this.errorEvent.emit({
|
|
728
|
+
message: 'Missing required props',
|
|
729
|
+
errorCode: ComponentError.ComponentErrorCodes.MISSING_PROPS,
|
|
730
|
+
severity: ComponentError.ComponentErrorSeverity.ERROR,
|
|
731
|
+
});
|
|
1013
732
|
}
|
|
1014
|
-
}
|
|
1015
|
-
componentDidLoad() {
|
|
1016
|
-
this.formController.values.subscribe(values => this.legal_address = Object.assign({}, values));
|
|
1017
|
-
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
1018
733
|
}
|
|
1019
734
|
render() {
|
|
1020
|
-
|
|
1021
|
-
const legalAddressDefaultValue = this.formController.getInitialValues();
|
|
1022
|
-
return (index.h(index.Host, { key: '9c05125bf246a2b70a726daf13e670a97e980f47', exportparts: "label,input,input-invalid" }, index.h("form", { key: '2ade7edf832b33a7ba6a48e7132675b1d10a56d4' }, index.h("fieldset", { key: 'c1de166455f7fe99af58a296a096235fdecb2133' }, index.h("legend", { key: '6a91fd07f78aa2cff56db73c59b8310b17b7d901' }, "Business Legal Address"), index.h("hr", { key: '3c2ebc5996de57610af531da0d314ce991bbe305' }), index.h("div", { key: 'fd1d4ab21f866fd76801c4c8c2e1d0419ac6addb', class: "row gy-3" }, index.h("div", { key: 'c3aaf2e8445067227f66a6faf8487b84275b109d', class: "col-12" }, index.h("form-control-text", { key: '2e9958c7829e1647c3512d65b0a068c5ffd192dc', name: "line1", label: "Legal Address", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line1, errorText: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.line1 })), index.h("div", { key: '551458e16164b6fab6393d4e0bd5e36bd79e706d', class: "col-12" }, index.h("form-control-text", { key: '97f9ca68b48c6b73d46eb112f52df1eba0113c11', name: "line2", label: "Address Line 2", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.line2, errorText: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.line2 })), index.h("div", { key: 'e914778ba7da8279ee60fbbf96a0ce573ed33925', class: "col-12" }, index.h("form-control-text", { key: '1028149f43063b7eb2359dac64880f41c4b706c4', name: "city", label: "City", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.city, errorText: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.city })), index.h("div", { key: 'a4c0f576008523ec0abb18bf39e8a1441b404b37', class: "col-12" }, index.h("form-control-select", { key: 'af5d60c67367c9e5d6d531e199a4b1f60e994c3c', name: "state", label: "State", options: stateOptions.StateOptions, inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.state, errorText: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.state })), index.h("div", { key: 'e5f0a9da1269c6c2e71ee7775a59c5f03eb5010e', class: "col-12" }, index.h("form-control-text", { key: '262bf5740f67f1788d5eff08236de25b48ad3cbf', name: "postal_code", label: "Postal Code", inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.postal_code, errorText: (_e = this.errors) === null || _e === void 0 ? void 0 : _e.postal_code, maxLength: 5, keyDownHandler: utils.numberOnlyHandler })), index.h("div", { key: '6ba0e162cfeaff5c891b51a32e32fefe28db66ce', class: "col-12" }, index.h("form-control-select", { key: '5f9ad2922f6cf3ad9f89cb1c0f387f2a615b1474', name: "country", label: "Country", options: [{ label: 'United States', value: 'USA' }], inputHandler: this.inputHandler, defaultValue: legalAddressDefaultValue === null || legalAddressDefaultValue === void 0 ? void 0 : legalAddressDefaultValue.country, errorText: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.country,
|
|
1023
|
-
// just for now so we skip handling country specificities
|
|
1024
|
-
disabled: true })))))));
|
|
735
|
+
return (index.h("justifi-legal-address-form-step-core", { key: '7455b4950e2ca1121004943ad81537c583438738', getBusiness: this.getBusiness, patchBusiness: this.patchBusiness, allowOptionalFields: this.allowOptionalFields, ref: el => this.coreComponent = el }));
|
|
1025
736
|
}
|
|
737
|
+
static get watchers() { return {
|
|
738
|
+
"authToken": ["propChanged"],
|
|
739
|
+
"businessId": ["propChanged"]
|
|
740
|
+
}; }
|
|
1026
741
|
};
|
|
1027
742
|
|
|
1028
743
|
const PaymentProvisioningFormButtons = class {
|
|
@@ -1045,7 +760,7 @@ const PaymentProvisioningFormButtons = class {
|
|
|
1045
760
|
return this.currentStep === this.totalSteps;
|
|
1046
761
|
}
|
|
1047
762
|
render() {
|
|
1048
|
-
return (index.h("div", { key: '
|
|
763
|
+
return (index.h("div", { key: '3df3796f2bb35819373564c0002e35d14c85e360', class: 'd-flex gap-2' }, index.h(button.Button, { key: '3f8fd4e288b2eed6776c77b44dda816e8a0580cd', variant: "secondary", type: "button", onClick: () => this.previousStepButtonOnClick(), disabled: this.formDisabled, hidden: !this.showPreviousStepButton }, "Previous"), index.h(button.Button, { key: '83c7d2405d6e4f88f721a95250aa847a6999a211', variant: "primary", type: "button", onClick: (e) => this.nextStepButtonOnClick(e, businessFormTypes.BusinessFormClickActions.nextStep), disabled: this.formDisabled, isLoading: this.formLoading, hidden: !this.showNextStepButton }, "Next"), index.h(button.Button, { key: 'd87bcdc9bea52b11307e31bd1d99636be05d7156', variant: "primary", type: "submit", onClick: (e) => this.nextStepButtonOnClick(e, businessFormTypes.BusinessFormClickActions.submit), disabled: this.formDisabled, isLoading: this.formLoading, hidden: !this.showSubmitButton }, "Submit")));
|
|
1049
764
|
}
|
|
1050
765
|
};
|
|
1051
766
|
|
|
@@ -1054,11 +769,11 @@ const PaymentProvisioningFormSteps = class {
|
|
|
1054
769
|
index.registerInstance(this, hostRef);
|
|
1055
770
|
this.formCompleted = index.createEvent(this, "formCompleted", 7);
|
|
1056
771
|
this.componentStepMapping = {
|
|
1057
|
-
0: () => index.h("justifi-business-core-info-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[0] = el,
|
|
1058
|
-
1: () => index.h("justifi-legal-address-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[1] = el,
|
|
1059
|
-
2: () => index.h("justifi-additional-questions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[2] = el,
|
|
1060
|
-
3: () => index.h("justifi-business-representative-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[3] = el,
|
|
1061
|
-
4: () => index.h("justifi-business-owners-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[4] = el,
|
|
772
|
+
0: () => index.h("justifi-business-core-info-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[0] = el, allowOptionalFields: this.allowOptionalFields }),
|
|
773
|
+
1: () => index.h("justifi-legal-address-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[1] = el, allowOptionalFields: this.allowOptionalFields }),
|
|
774
|
+
2: () => index.h("justifi-additional-questions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[2] = el, allowOptionalFields: this.allowOptionalFields }),
|
|
775
|
+
3: () => index.h("justifi-business-representative-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[3] = el, allowOptionalFields: this.allowOptionalFields }),
|
|
776
|
+
4: () => index.h("justifi-business-owners-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[4] = el, allowOptionalFields: this.allowOptionalFields }),
|
|
1062
777
|
5: () => index.h("justifi-business-bank-account-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[5] = el, onFormLoading: this.handleFormLoading, allowOptionalFields: this.allowOptionalFields }),
|
|
1063
778
|
6: () => index.h("justifi-business-document-upload-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[6] = el, onFormLoading: this.handleFormLoading, allowOptionalFields: this.allowOptionalFields }),
|
|
1064
779
|
7: () => index.h("justifi-business-terms-conditions-form-step", { businessId: this.businessId, authToken: this.authToken, ref: (el) => this.refs[7] = el, onFormLoading: this.handleFormLoading, allowOptionalFields: this.allowOptionalFields, onSubmitted: () => this.formCompleted.emit() }),
|
|
@@ -1074,7 +789,7 @@ const PaymentProvisioningFormSteps = class {
|
|
|
1074
789
|
return this.componentStepMapping[this.currentStep]();
|
|
1075
790
|
}
|
|
1076
791
|
render() {
|
|
1077
|
-
return (index.h("div", { key: '
|
|
792
|
+
return (index.h("div", { key: '8f02aa3223e38cda70319c127f60e5d2f3c5abe5', class: 'col-12 mb-4' }, this.currentStepComponent));
|
|
1078
793
|
}
|
|
1079
794
|
};
|
|
1080
795
|
|