@justifi/webcomponents 4.12.2 → 4.13.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Api-a06b996e.js → Api-ab34a402.js} +4 -1
- package/dist/cjs/{Business-21cef37d.js → Business-32a53780.js} +8 -3
- package/dist/cjs/{utils-f8079741.js → ComponentError-8ba0c0e7.js} +0 -25
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
- package/dist/cjs/{business-additional-questions-schema-f5f303fb.js → business-additional-questions-schema-0a35f597.js} +17 -9
- package/dist/cjs/{business-form-types-a3cc374d.js → business-form-options-43366c9a.js} +50 -33
- package/dist/cjs/business-form-types-29b2bad9.js +26 -0
- package/dist/cjs/form-control-date_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-datepart_2.cjs.entry.js +1 -1
- package/dist/cjs/form-control-file.cjs.entry.js +44 -0
- package/dist/cjs/form-control-monetary.cjs.entry.js +7 -12
- package/dist/cjs/form-input-masks-0879c139.js +27 -0
- package/dist/cjs/{index-fc5339a5.js → index-d8e99b54.js} +352 -198
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +10 -9
- package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +6 -6
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +8 -7
- package/dist/cjs/justifi-business-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-business-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +30 -11
- package/dist/cjs/justifi-checkout.cjs.entry.js +36 -9
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +7 -6
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +12 -12
- package/dist/cjs/justifi-owner-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -7
- package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +1 -3
- package/dist/cjs/justifi-payments-list.cjs.entry.js +8 -7
- package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -7
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +7 -6
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +1 -1
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{payload-parsers-74693a97.js → payload-parsers-6c4b5323.js} +61 -6
- package/dist/cjs/{payment.service-9db24ab9.js → payment.service-336189d3.js} +1 -1
- package/dist/cjs/{payout.service-a0efb71a.js → payout.service-6012d576.js} +1 -1
- package/dist/cjs/utils-491248ca.js +28 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Api.js +4 -1
- package/dist/collection/api/Business.js +8 -3
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +2 -2
- package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +4 -2
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +4 -2
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +3 -2
- package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +16 -9
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +3 -1
- package/dist/collection/components/business-forms/schemas/schema-helpers.js +3 -0
- package/dist/collection/components/business-forms/schemas/schema-validations.js +51 -7
- package/dist/collection/components/business-forms/utils/business-form-options.js +119 -0
- package/dist/collection/components/business-forms/utils/business-form-types.js +0 -81
- package/dist/collection/components/checkout/checkout-actions.js +29 -7
- package/dist/collection/components/checkout/checkout-core.js +51 -14
- package/dist/collection/components/checkout/checkout.js +30 -2
- package/dist/collection/components/checkout/new-payment-method.js +11 -11
- package/dist/collection/components/checkout/payment-method-options.js +2 -18
- package/dist/collection/components/checkout/test/checkout-actions.spec.js +124 -0
- package/dist/collection/components/checkout/test/checkout-core.spec.js +127 -0
- package/dist/collection/components/checkout/test/checkout.spec.js +0 -153
- package/dist/collection/components/form/form-control-file.css +1806 -0
- package/dist/collection/components/form/form-control-file.js +169 -0
- package/dist/collection/components/form/form-control-monetary.css +1812 -0
- package/dist/collection/components/form/form-control-monetary.js +24 -11
- package/dist/collection/components/form/test/form-control-file.spec.js +84 -0
- package/dist/collection/components/form/test/form-control-monetary.spec.js +5 -3
- package/dist/collection/components/refund-form/refund-form.js +2 -1
- package/dist/collection/utils/form-input-masks.js +15 -0
- package/dist/docs.json +275 -33
- package/dist/esm/{Api-0e88671c.js → Api-e9d568c7.js} +4 -1
- package/dist/esm/{Business-0e8a9a3a.js → Business-d83fbdb4.js} +8 -3
- package/dist/esm/{utils-4609f32c.js → ComponentError-2a58dbbc.js} +1 -23
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/{business-additional-questions-schema-a84dd641.js → business-additional-questions-schema-e96b0509.js} +18 -10
- package/dist/esm/{business-form-types-7420dc96.js → business-form-options-de11bc46.js} +46 -32
- package/dist/esm/business-form-types-0d76133c.js +26 -0
- package/dist/esm/form-control-date_3.entry.js +1 -1
- package/dist/esm/form-control-datepart_2.entry.js +1 -1
- package/dist/esm/form-control-file.entry.js +40 -0
- package/dist/esm/form-control-monetary.entry.js +7 -12
- package/dist/esm/form-input-masks-0e18300f.js +22 -0
- package/dist/esm/{index-5eb05747.js → index-dc1350b1.js} +352 -198
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +10 -9
- package/dist/esm/justifi-additional-questions_4.entry.js +6 -6
- package/dist/esm/justifi-billing-form_4.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +4 -3
- package/dist/esm/justifi-business-form.entry.js +6 -5
- package/dist/esm/justifi-business-list.entry.js +2 -2
- package/dist/esm/justifi-business-owners.entry.js +1 -1
- package/dist/esm/justifi-checkout-core.entry.js +30 -11
- package/dist/esm/justifi-checkout.entry.js +37 -10
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -2
- package/dist/esm/justifi-new-payment-method_4.entry.js +12 -12
- package/dist/esm/justifi-owner-form.entry.js +6 -5
- package/dist/esm/justifi-payment-balance-transactions.entry.js +1 -1
- package/dist/esm/justifi-payment-details.entry.js +4 -3
- package/dist/esm/justifi-payment-form.entry.js +2 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +1 -3
- package/dist/esm/justifi-payments-list.entry.js +4 -3
- package/dist/esm/justifi-payout-details.entry.js +4 -3
- package/dist/esm/justifi-payouts-list.entry.js +4 -3
- package/dist/esm/justifi-proceeds-list.entry.js +1 -1
- package/dist/esm/justifi-refund-form.entry.js +3 -2
- package/dist/esm/justifi-subaccount-details.entry.js +1 -1
- package/dist/esm/justifi-subaccounts-list.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{payload-parsers-0c4fc2b1.js → payload-parsers-32028700.js} +54 -7
- package/dist/esm/{payment.service-ec28a959.js → payment.service-2fdc5018.js} +1 -1
- package/dist/esm/{payout.service-5fd5986c.js → payout.service-15064bcc.js} +1 -1
- package/dist/esm/utils-f580d6b7.js +25 -0
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Api.js +4 -1
- package/dist/module/Business.js +8 -3
- package/dist/module/ComponentError.js +16 -0
- package/dist/module/additional-questions-details2.js +2 -2
- package/dist/module/additional-questions.js +18 -4
- package/dist/module/business-additional-questions-form-step.js +18 -4
- package/dist/module/business-additional-questions-schema.js +16 -9
- package/dist/module/business-address-schema.js +1 -1
- package/dist/module/business-core-info-form-step.js +10 -3
- package/dist/module/business-core-info-schema.js +3 -1
- package/dist/module/business-core-info.js +9 -3
- package/dist/module/business-form-options.js +122 -0
- package/dist/module/business-form-types.js +153 -82
- package/dist/module/business-identity-schema.js +1 -1
- package/dist/module/business-representative-form-step.js +1 -1
- package/dist/module/checkout-core.js +30 -13
- package/dist/module/form-control-file.d.ts +11 -0
- package/dist/module/form-control-file.js +67 -0
- package/dist/module/form-control-monetary2.js +8 -12
- package/dist/module/form-input-masks.js +16 -1
- package/dist/module/index2.js +352 -198
- package/dist/module/justifi-business-details.js +2 -1
- package/dist/module/justifi-business-form.js +2 -2
- package/dist/module/justifi-checkout.js +37 -11
- package/dist/module/justifi-gross-payment-chart.js +2 -1
- package/dist/module/justifi-payment-details.js +2 -1
- package/dist/module/justifi-payment-form.js +2 -1
- package/dist/module/justifi-payment-provisioning.js +1 -1
- package/dist/module/justifi-payments-list.js +2 -1
- package/dist/module/justifi-payout-details.js +2 -1
- package/dist/module/justifi-payouts-list.js +2 -1
- package/dist/module/justifi-refund-form.js +2 -1
- package/dist/module/legal-address-form-step.js +1 -1
- package/dist/module/new-payment-method.js +11 -11
- package/dist/module/owner-form.js +2 -2
- package/dist/module/payload-parsers.js +1 -107
- package/dist/module/payment-method-form.js +2 -2
- package/dist/module/payment-method-options.js +2 -2
- package/dist/module/utils3.js +2 -15
- package/dist/types/api/Api.d.ts +1 -0
- package/dist/types/api/Business.d.ts +15 -5
- package/dist/types/api/services/checkout.service.d.ts +3 -3
- package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +10 -4
- package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +2 -0
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +12 -4
- package/dist/types/components/business-forms/schemas/schema-helpers.d.ts +3 -0
- package/dist/types/components/business-forms/schemas/schema-validations.d.ts +8 -0
- package/dist/types/components/business-forms/utils/business-form-options.d.ts +21 -0
- package/dist/types/components/business-forms/utils/business-form-types.d.ts +0 -9
- package/dist/types/components/checkout/checkout-core.d.ts +8 -3
- package/dist/types/components/checkout/checkout.d.ts +3 -0
- package/dist/types/components/checkout/payment-method-options.d.ts +1 -1
- package/dist/types/components/checkout/payment-method-payload.d.ts +5 -0
- package/dist/types/components/form/form-control-file.d.ts +17 -0
- package/dist/types/components/form/form-control-monetary.d.ts +1 -0
- package/dist/types/components/payment-method-form/payment-method-responses.d.ts +1 -0
- package/dist/types/components.d.ts +61 -2
- package/dist/types/utils/form-input-masks.d.ts +15 -0
- package/dist/webcomponents/p-00ca94d1.js +1 -0
- package/dist/webcomponents/p-02b18979.entry.js +1 -0
- package/dist/webcomponents/p-0d80748f.js +1 -0
- package/dist/webcomponents/p-101b2648.entry.js +1 -0
- package/dist/webcomponents/p-132ba228.js +1 -0
- package/dist/webcomponents/p-13e2f667.js +1 -0
- package/dist/webcomponents/{p-18cf5a16.entry.js → p-1885c478.entry.js} +1 -1
- package/dist/webcomponents/{p-8abba4c2.entry.js → p-23099f1f.entry.js} +1 -1
- package/dist/webcomponents/p-230b96df.entry.js +1 -0
- package/dist/webcomponents/{p-2fbe8823.entry.js → p-3367225e.entry.js} +1 -1
- package/dist/webcomponents/p-3917edbf.entry.js +1 -0
- package/dist/webcomponents/p-3da23f21.js +1 -0
- package/dist/webcomponents/p-41bdee27.entry.js +1 -0
- package/dist/webcomponents/{p-5ff7826e.entry.js → p-4c84952f.entry.js} +1 -1
- package/dist/webcomponents/p-4ff52695.entry.js +1 -0
- package/dist/webcomponents/p-525db3e8.js +1 -0
- package/dist/webcomponents/p-61fd33c7.js +1 -0
- package/dist/webcomponents/p-64710363.entry.js +1 -0
- package/dist/webcomponents/{p-9245777b.js → p-731085e3.js} +1 -1
- package/dist/webcomponents/p-78b32fb9.entry.js +1 -0
- package/dist/webcomponents/p-7e334dce.entry.js +1 -0
- package/dist/webcomponents/p-7faacb1e.entry.js +1 -0
- package/dist/webcomponents/{p-5f5e730c.entry.js → p-834cba99.entry.js} +1 -1
- package/dist/webcomponents/p-87d646c0.js +1 -0
- package/dist/webcomponents/p-935d6f55.js +1 -0
- package/dist/webcomponents/{p-e3946c2b.js → p-9ada56da.js} +1 -1
- package/dist/webcomponents/p-9ba31a6a.entry.js +1 -0
- package/dist/webcomponents/p-a9af8f40.entry.js +1 -0
- package/dist/webcomponents/p-b81afd51.entry.js +1 -0
- package/dist/webcomponents/{p-c556deda.entry.js → p-bb58e656.entry.js} +1 -1
- package/dist/webcomponents/p-bc12b8b9.js +1 -0
- package/dist/webcomponents/p-bfe7c55c.entry.js +1 -0
- package/dist/webcomponents/p-c1be3378.entry.js +1 -0
- package/dist/webcomponents/p-cb31488b.entry.js +1 -0
- package/dist/webcomponents/p-cf3151a3.entry.js +1 -0
- package/dist/webcomponents/p-d0a8c631.entry.js +1 -0
- package/dist/webcomponents/p-e6ab1f0d.entry.js +1 -0
- package/dist/webcomponents/p-ee68566f.entry.js +1 -0
- package/dist/webcomponents/{p-3adc0688.entry.js → p-efbc8ffc.entry.js} +1 -1
- package/dist/webcomponents/{p-b9f04fb0.entry.js → p-f152d6b8.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/form-input-masks-efd44b8e.js +0 -11
- package/dist/esm/form-input-masks-84875967.js +0 -7
- package/dist/webcomponents/p-01913426.js +0 -1
- package/dist/webcomponents/p-04c7f8f8.js +0 -1
- package/dist/webcomponents/p-0c269feb.entry.js +0 -1
- package/dist/webcomponents/p-0eb77101.entry.js +0 -1
- package/dist/webcomponents/p-19001cc5.entry.js +0 -1
- package/dist/webcomponents/p-2319abaf.entry.js +0 -1
- package/dist/webcomponents/p-2bee72bd.entry.js +0 -1
- package/dist/webcomponents/p-51ee396f.entry.js +0 -1
- package/dist/webcomponents/p-52e4cc27.js +0 -1
- package/dist/webcomponents/p-602a1588.entry.js +0 -1
- package/dist/webcomponents/p-6ec77980.entry.js +0 -1
- package/dist/webcomponents/p-6f294d5d.js +0 -1
- package/dist/webcomponents/p-81c43ba5.entry.js +0 -1
- package/dist/webcomponents/p-927150b4.entry.js +0 -1
- package/dist/webcomponents/p-93579716.js +0 -1
- package/dist/webcomponents/p-9e35b0f6.entry.js +0 -1
- package/dist/webcomponents/p-9e3f9e05.entry.js +0 -1
- package/dist/webcomponents/p-9ec89299.entry.js +0 -1
- package/dist/webcomponents/p-a8caec98.entry.js +0 -1
- package/dist/webcomponents/p-a90f7ca0.js +0 -1
- package/dist/webcomponents/p-abc03d5a.entry.js +0 -1
- package/dist/webcomponents/p-b38baa84.entry.js +0 -1
- package/dist/webcomponents/p-bfc634c6.entry.js +0 -1
- package/dist/webcomponents/p-c1b92cec.entry.js +0 -1
- package/dist/webcomponents/p-cb86b2fd.js +0 -1
- package/dist/webcomponents/p-d2b7beac.js +0 -1
- package/dist/webcomponents/p-d69a485a.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import {
|
|
2
|
+
import { businessStructureOptions, businessTypeOptions } from "../../utils/business-form-options";
|
|
3
3
|
import { PHONE_MASKS, TAX_ID_MASKS } from "../../../../utils/form-input-masks";
|
|
4
4
|
import { CoreBusinessInfo } from "../../../../api/Business";
|
|
5
5
|
/**
|
|
@@ -30,7 +30,7 @@ export class BusinessCoreInfo {
|
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
32
|
const coreInfoDefaultValue = this.formController.getInitialValues();
|
|
33
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "General Info"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options:
|
|
33
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("fieldset", null, h("legend", null, "General Info"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-date", { name: "date_of_incorporation", label: "Date of Incorporation", defaultValue: coreInfoDefaultValue.date_of_incorporation, error: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options: businessTypeOptions, defaultValue: coreInfoDefaultValue.business_type, error: this.errors.business_type, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_structure", label: "Business Structure", options: businessStructureOptions, defaultValue: coreInfoDefaultValue.business_structure, error: this.errors.business_structure, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, error: this.errors.industry, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "tax_id", label: "Tax ID", defaultValue: coreInfoDefaultValue.tax_id, error: this.errors.tax_id, inputHandler: this.inputHandler, mask: TAX_ID_MASKS.US })), h("div", { class: "col-12" }, h("form-control-text", { name: "website_url", label: "Website URL", defaultValue: coreInfoDefaultValue.website_url, error: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: coreInfoDefaultValue.email, error: this.errors.email, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "phone", label: "Phone Number", defaultValue: coreInfoDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US }))))));
|
|
34
34
|
}
|
|
35
35
|
static get is() { return "justifi-business-core-info"; }
|
|
36
36
|
static get originalStyleUrls() {
|
|
@@ -5,6 +5,8 @@ import { Api } from "../../../../api";
|
|
|
5
5
|
import { config } from "../../../../../config";
|
|
6
6
|
import { additionalQuestionsSchema } from "../../schemas/business-additional-questions-schema";
|
|
7
7
|
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
8
|
+
import { CURRENCY_MASK } from "../../../../utils/form-input-masks";
|
|
9
|
+
import { businessServiceReceivedOptions, recurringPaymentsOptions, seasonalBusinessOptions } from "../../utils/business-form-options";
|
|
8
10
|
/**
|
|
9
11
|
* @exportedPart label: Label for inputs
|
|
10
12
|
* @exportedPart input: The input fields
|
|
@@ -82,9 +84,9 @@ export class AdditionalQuestionsFormStep {
|
|
|
82
84
|
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
83
85
|
}
|
|
84
86
|
render() {
|
|
85
|
-
var _a, _b, _c, _d;
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
86
88
|
const additionalQuestionsDefaultValue = this.formController.getInitialValues();
|
|
87
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "Additional Questions"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-monetary", { name: "business_revenue", label: "
|
|
89
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "Additional Questions"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h("form-control-monetary", { name: "business_revenue", label: "What is the business' estimated annual revenue from its primary business activies?", inputHandler: this.inputHandler, error: (_a = this.errors) === null || _a === void 0 ? void 0 : _a.business_revenue, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_revenue, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { class: "col-12 col-md-6" }, h("form-control-monetary", { name: "business_payment_volume", label: "What is the business\u2019 annual credit card & ACH volume anticipated to process?", inputHandler: this.inputHandler, error: (_b = this.errors) === null || _b === void 0 ? void 0 : _b.business_payment_volume, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_payment_volume, maskOptions: CURRENCY_MASK.WHOLE })), h("div", { class: "col-12" }, h("form-control-select", { name: 'business_when_service_received', label: 'On average, how long after paying will your customers typically receive their goods or services?', inputHandler: this.inputHandler, error: (_c = this.errors) === null || _c === void 0 ? void 0 : _c.business_when_service_received, options: businessServiceReceivedOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_when_service_received })), h("div", { class: "col-12" }, h("form-control-select", { name: 'business_recurring_payments', label: 'Does your business offer recurring payments?', inputHandler: this.inputHandler, error: (_d = this.errors) === null || _d === void 0 ? void 0 : _d.business_recurring_payments, options: recurringPaymentsOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_recurring_payments })), h("div", { class: "col-12" }, h("form-control-text", { name: 'business_recurring_payments_percentage', label: 'What percent of revenue is generated from each recurring payment type offered?', inputHandler: this.inputHandler, error: (_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 })), h("div", { class: "col-12" }, h("form-control-select", { name: 'business_seasonal', label: 'Is this business seasonal?', inputHandler: this.inputHandler, error: (_f = this.errors) === null || _f === void 0 ? void 0 : _f.business_seasonal, options: seasonalBusinessOptions, defaultValue: additionalQuestionsDefaultValue === null || additionalQuestionsDefaultValue === void 0 ? void 0 : additionalQuestionsDefaultValue.business_seasonal })), h("div", { class: "col-12" }, h("form-control-text", { name: 'business_other_payment_details', label: 'Is there anything else you would like us to know about how your customers pay the business?', inputHandler: this.inputHandler, error: (_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 })))))));
|
|
88
90
|
}
|
|
89
91
|
static get is() { return "justifi-additional-questions-form-step"; }
|
|
90
92
|
static get properties() {
|
|
@@ -7,7 +7,8 @@ import { businessCoreInfoSchema } from "../../schemas/business-core-info-schema"
|
|
|
7
7
|
import { config } from "../../../../../config";
|
|
8
8
|
import { parseCoreInfo } from "../../utils/payload-parsers";
|
|
9
9
|
import { flattenNestedObject } from "../../../../utils/utils";
|
|
10
|
-
import { BusinessFormServerErrors
|
|
10
|
+
import { BusinessFormServerErrors } from "../../utils/business-form-types";
|
|
11
|
+
import { businessStructureOptions, businessTypeOptions } from "../../utils/business-form-options";
|
|
11
12
|
/**
|
|
12
13
|
*
|
|
13
14
|
* The difference between this component and business-generic-info-details
|
|
@@ -93,7 +94,7 @@ export class BusinessCoreInfoFormStep {
|
|
|
93
94
|
}
|
|
94
95
|
render() {
|
|
95
96
|
const coreInfoDefaultValue = this.formController.getInitialValues();
|
|
96
|
-
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "General Info"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options:
|
|
97
|
+
return (h(Host, { exportparts: "label,input,input-invalid" }, h("form", null, h("fieldset", null, h("legend", null, "General Info"), h("hr", null), h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("form-control-text", { name: "legal_name", label: "Legal Name", defaultValue: coreInfoDefaultValue.legal_name, error: this.errors.legal_name, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-8" }, h("form-control-text", { name: "doing_business_as", label: "Doing Business As (DBA)", defaultValue: coreInfoDefaultValue.doing_business_as, error: this.errors.doing_business_as, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-4" }, h("form-control-date", { name: "date_of_incorporation", label: "Date of Incorporation", defaultValue: coreInfoDefaultValue.date_of_incorporation, error: this.errors.date_of_incorporation, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_type", label: "Business Type", options: businessTypeOptions, defaultValue: coreInfoDefaultValue.business_type, error: this.errors.business_type, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-select", { name: "business_structure", label: "Business Structure", options: businessStructureOptions, defaultValue: coreInfoDefaultValue.business_structure, error: this.errors.business_structure, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "industry", label: "Industry", defaultValue: coreInfoDefaultValue.industry, error: this.errors.industry, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "tax_id", label: "Tax ID", defaultValue: coreInfoDefaultValue.tax_id, error: this.errors.tax_id, inputHandler: this.inputHandler, mask: TAX_ID_MASKS.US })), h("div", { class: "col-12" }, h("form-control-text", { name: "website_url", label: "Website URL", defaultValue: coreInfoDefaultValue.website_url, error: this.errors.website_url, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-text", { name: "email", label: "Email Address", defaultValue: coreInfoDefaultValue.email, error: this.errors.email, inputHandler: this.inputHandler })), h("div", { class: "col-12 col-md-6" }, h("form-control-number-masked", { name: "phone", label: "Phone Number", defaultValue: coreInfoDefaultValue.phone, error: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })))))));
|
|
97
98
|
}
|
|
98
99
|
static get is() { return "justifi-business-core-info-form-step"; }
|
|
99
100
|
static get originalStyleUrls() {
|
package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import { object
|
|
1
|
+
import { object } from "yup";
|
|
2
|
+
import { otherPaymentDetailsValidation, paymentVolumeValidation, recurringPaymentsPercentageValidation, recurringPaymentsValidation, revenueValidation, seasonalBusinessValidation, whenServiceReceivedValidation } from "./schema-validations";
|
|
2
3
|
export const additionalQuestionsSchema = (allowOptionalFields) => {
|
|
3
4
|
const schema = object({
|
|
4
|
-
business_revenue:
|
|
5
|
-
business_payment_volume:
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
business_revenue: revenueValidation.required('Enter business revenue'),
|
|
6
|
+
business_payment_volume: paymentVolumeValidation.required('Enter business payment volume'),
|
|
7
|
+
business_when_service_received: whenServiceReceivedValidation.required('Select when service is received'),
|
|
8
|
+
business_recurring_payments: recurringPaymentsValidation.required('Select recurring payments'),
|
|
9
|
+
business_recurring_payments_percentage: recurringPaymentsPercentageValidation,
|
|
10
|
+
business_seasonal: seasonalBusinessValidation.required('Select business seasonal'),
|
|
11
|
+
business_other_payment_details: otherPaymentDetailsValidation.nullable(),
|
|
8
12
|
});
|
|
9
13
|
const easySchema = object({
|
|
10
|
-
business_revenue:
|
|
11
|
-
business_payment_volume:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
business_revenue: revenueValidation.nullable(),
|
|
15
|
+
business_payment_volume: paymentVolumeValidation.nullable(),
|
|
16
|
+
business_when_service_received: whenServiceReceivedValidation.nullable(),
|
|
17
|
+
business_recurring_payments: recurringPaymentsValidation.nullable(),
|
|
18
|
+
business_recurring_payments_percentage: recurringPaymentsPercentageValidation,
|
|
19
|
+
business_seasonal: seasonalBusinessValidation.nullable(),
|
|
20
|
+
business_other_payment_details: otherPaymentDetailsValidation.nullable(),
|
|
14
21
|
});
|
|
15
22
|
return allowOptionalFields ? easySchema : schema;
|
|
16
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { object } from "yup";
|
|
2
|
-
import { businessTypeValidation, doingBusinessAsValidation, emailValidation, industryValidation, businessNameValidation, phoneValidation, taxIdValidation, websiteUrlValidation, businessStructureValidation } from "./schema-validations";
|
|
2
|
+
import { businessTypeValidation, doingBusinessAsValidation, emailValidation, industryValidation, businessNameValidation, phoneValidation, taxIdValidation, websiteUrlValidation, dateOfIncorporationValidation, businessStructureValidation } from "./schema-validations";
|
|
3
3
|
export const businessCoreInfoSchema = (allowOptionalFields) => {
|
|
4
4
|
const schema = object({
|
|
5
5
|
legal_name: businessNameValidation.required('Enter legal name'),
|
|
@@ -11,6 +11,7 @@ export const businessCoreInfoSchema = (allowOptionalFields) => {
|
|
|
11
11
|
business_structure: businessStructureValidation.required('Select business structure'),
|
|
12
12
|
industry: industryValidation.required('Enter a business industry'),
|
|
13
13
|
tax_id: taxIdValidation.required('Enter tax id'),
|
|
14
|
+
date_of_incorporation: dateOfIncorporationValidation.required('Enter date of incorporation'),
|
|
14
15
|
});
|
|
15
16
|
const easySchema = object({
|
|
16
17
|
legal_name: businessNameValidation.required('Enter legal name'),
|
|
@@ -22,6 +23,7 @@ export const businessCoreInfoSchema = (allowOptionalFields) => {
|
|
|
22
23
|
business_structure: businessStructureValidation.nullable(),
|
|
23
24
|
industry: industryValidation.nullable(),
|
|
24
25
|
tax_id: taxIdValidation.nullable(),
|
|
26
|
+
date_of_incorporation: dateOfIncorporationValidation.nullable(),
|
|
25
27
|
});
|
|
26
28
|
return allowOptionalFields ? easySchema : schema;
|
|
27
29
|
};
|
|
@@ -6,4 +6,7 @@ export const phoneRegex = /^\d{10}$/;
|
|
|
6
6
|
export const urlRegex = /^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
|
|
7
7
|
export const taxIdRegex = /^\d{9}$/;
|
|
8
8
|
export const stringLettersOnlyRegex = /^(?!^\s+$)[a-zA-Z\s]*$/;
|
|
9
|
+
export const numbersOnlyRegex = /^\d+$/;
|
|
9
10
|
export const ssnRegex = /^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/;
|
|
11
|
+
export const streetAddressRegex = /^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/;
|
|
12
|
+
export const poBoxRegex = /P\.?\s?O\.?\s?Box|Postal\sBox/i;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { string } from "yup";
|
|
2
|
-
import { BusinessStructureOptions, BusinessTypeOptions } from "../utils/business-form-types";
|
|
3
2
|
import StateOptions from "../../../utils/state-options";
|
|
4
|
-
import {
|
|
3
|
+
import { businessStructureOptions, businessServiceReceivedOptions, businessTypeOptions, recurringPaymentsOptions, seasonalBusinessOptions } from "../utils/business-form-options";
|
|
4
|
+
import { businessNameRegex, numbersOnlyRegex, phoneRegex, poBoxRegex, ssnRegex, streetAddressRegex, stringLettersOnlyRegex, taxIdRegex, transformEmptyString, urlRegex } from "./schema-helpers";
|
|
5
5
|
// Common Validations
|
|
6
6
|
export const emailValidation = string()
|
|
7
7
|
.email('Enter valid email')
|
|
@@ -24,10 +24,10 @@ export const websiteUrlValidation = string()
|
|
|
24
24
|
.matches(urlRegex, 'Enter valid website url')
|
|
25
25
|
.transform(transformEmptyString);
|
|
26
26
|
export const businessTypeValidation = string()
|
|
27
|
-
.oneOf(
|
|
27
|
+
.oneOf(businessTypeOptions.map((option) => option.value), 'Select business type')
|
|
28
28
|
.transform(transformEmptyString);
|
|
29
29
|
export const businessStructureValidation = string()
|
|
30
|
-
.oneOf(
|
|
30
|
+
.oneOf(businessStructureOptions.map((option) => option.value), 'Select business structure')
|
|
31
31
|
.transform(transformEmptyString);
|
|
32
32
|
export const industryValidation = string()
|
|
33
33
|
.min(2, 'Industry must be at least 2 characters')
|
|
@@ -36,6 +36,19 @@ export const industryValidation = string()
|
|
|
36
36
|
.transform(transformEmptyString);
|
|
37
37
|
export const taxIdValidation = string()
|
|
38
38
|
.matches(taxIdRegex, 'Enter valid tax id')
|
|
39
|
+
.test('not-repeat', 'Enter valid tax id', (value) => {
|
|
40
|
+
return !/^(\d)\1+$/.test(value);
|
|
41
|
+
})
|
|
42
|
+
.test('not-seq', 'Enter valid tax id', (value) => {
|
|
43
|
+
return value !== '123456789';
|
|
44
|
+
})
|
|
45
|
+
.transform(transformEmptyString);
|
|
46
|
+
export const dateOfIncorporationValidation = string()
|
|
47
|
+
.test('not-future', 'Date of incorporation cannot be in the future', (value) => {
|
|
48
|
+
const inputDate = new Date(value);
|
|
49
|
+
const today = new Date();
|
|
50
|
+
return inputDate <= today;
|
|
51
|
+
})
|
|
39
52
|
.transform(transformEmptyString);
|
|
40
53
|
// Identity Validations
|
|
41
54
|
export const identityNameValidation = string()
|
|
@@ -76,16 +89,22 @@ export const ssnValidation = string()
|
|
|
76
89
|
export const lineOneValidation = string()
|
|
77
90
|
.min(5, 'Address must be at least 5 characters')
|
|
78
91
|
.max(100, 'Address must be less than 100 characters')
|
|
79
|
-
.matches(
|
|
92
|
+
.matches(streetAddressRegex, 'Enter valid address line 1')
|
|
93
|
+
.test('not-po-box', 'A PO Box is not a valid address entry', (value) => {
|
|
94
|
+
return !poBoxRegex.test(value);
|
|
95
|
+
})
|
|
80
96
|
.transform(transformEmptyString);
|
|
81
97
|
export const lineTwoValidation = string()
|
|
82
98
|
.max(100, 'Address must be less than 100 characters')
|
|
83
|
-
.matches(
|
|
99
|
+
.matches(streetAddressRegex, 'Enter valid address line 2')
|
|
100
|
+
.test('not-po-box', 'A PO Box is not a valid address entry', (value) => {
|
|
101
|
+
return !poBoxRegex.test(value);
|
|
102
|
+
})
|
|
84
103
|
.transform(transformEmptyString);
|
|
85
104
|
export const cityValidation = string()
|
|
86
105
|
.min(2, 'City must be at least 2 characters')
|
|
87
106
|
.max(50, 'City must be less than 50 characters')
|
|
88
|
-
.matches(
|
|
107
|
+
.matches(stringLettersOnlyRegex, 'Enter valid city')
|
|
89
108
|
.transform(transformEmptyString);
|
|
90
109
|
export const stateValidation = string()
|
|
91
110
|
.oneOf(StateOptions.map((option) => option.value), 'Select state')
|
|
@@ -93,3 +112,28 @@ export const stateValidation = string()
|
|
|
93
112
|
export const postalValidation = string()
|
|
94
113
|
.matches(/^[0-9]{5}$/, 'Enter valid postal code')
|
|
95
114
|
.transform(transformEmptyString);
|
|
115
|
+
// Additional Questions Validations
|
|
116
|
+
export const revenueValidation = string()
|
|
117
|
+
.matches(numbersOnlyRegex, 'Enter valid revenue')
|
|
118
|
+
.transform(transformEmptyString);
|
|
119
|
+
export const paymentVolumeValidation = string()
|
|
120
|
+
.matches(numbersOnlyRegex, 'Enter valid payment volume')
|
|
121
|
+
.transform(transformEmptyString);
|
|
122
|
+
export const whenServiceReceivedValidation = string()
|
|
123
|
+
.oneOf(businessServiceReceivedOptions.map((option) => option.value), 'Select when service is received')
|
|
124
|
+
.transform(transformEmptyString);
|
|
125
|
+
export const recurringPaymentsValidation = string()
|
|
126
|
+
.oneOf(recurringPaymentsOptions.map((option) => option.value), 'Select recurring payments')
|
|
127
|
+
.transform(transformEmptyString);
|
|
128
|
+
export const recurringPaymentsPercentageValidation = string()
|
|
129
|
+
.when('business_recurring_payments', {
|
|
130
|
+
is: (val) => val === 'Yes',
|
|
131
|
+
then: (schema) => schema.required('Enter recurring payments percentage'),
|
|
132
|
+
otherwise: (schema) => schema.nullable(),
|
|
133
|
+
})
|
|
134
|
+
.transform(transformEmptyString);
|
|
135
|
+
export const seasonalBusinessValidation = string()
|
|
136
|
+
.oneOf(seasonalBusinessOptions.map((option) => option.value), 'Select seasonal business')
|
|
137
|
+
.transform(transformEmptyString);
|
|
138
|
+
export const otherPaymentDetailsValidation = string()
|
|
139
|
+
.transform(transformEmptyString);
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { BusinessStructure, BusinessType } from "../../../api/Business";
|
|
2
|
+
export const businessTypeOptions = [
|
|
3
|
+
{
|
|
4
|
+
label: 'Individual',
|
|
5
|
+
value: BusinessType.individual,
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
label: 'For Profit',
|
|
9
|
+
value: BusinessType.for_profit,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: 'Non Profit',
|
|
13
|
+
value: BusinessType.non_profit,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: 'Government Entity',
|
|
17
|
+
value: BusinessType.government_entity,
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
export const businessStructureOptions = [
|
|
21
|
+
{
|
|
22
|
+
label: 'Choose business structure',
|
|
23
|
+
value: '',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'Sole Proprietorship',
|
|
27
|
+
value: BusinessStructure.sole_proprietorship,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: 'LLC (Single)',
|
|
31
|
+
value: BusinessStructure.single_llc,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: 'LLC (Multiple)',
|
|
35
|
+
value: BusinessStructure.multi_llc,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'Private Partnership',
|
|
39
|
+
value: BusinessStructure.private_partnership,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
label: 'Private Corporation',
|
|
43
|
+
value: BusinessStructure.private_corporation,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: 'Unincorporated Association',
|
|
47
|
+
value: BusinessStructure.unincorporated_association,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: 'Public Partnership',
|
|
51
|
+
value: BusinessStructure.public_partnership,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'Public Corporation',
|
|
55
|
+
value: BusinessStructure.public_corporation,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: 'Incorporated',
|
|
59
|
+
value: BusinessStructure.incorporated,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: 'Unincorporated',
|
|
63
|
+
value: BusinessStructure.unincorporated,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: 'Government Unit',
|
|
67
|
+
value: BusinessStructure.government_unit,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: 'Government Instrumentality',
|
|
71
|
+
value: BusinessStructure.government_instrumentality,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
label: 'Tax Exempt Government Instrumentality',
|
|
75
|
+
value: BusinessStructure.tax_exempt_government_instrumentality,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
export const businessServiceReceivedOptions = [
|
|
79
|
+
{
|
|
80
|
+
label: 'Within 7 days',
|
|
81
|
+
value: 'Within 7 days',
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: 'Within 30 days',
|
|
85
|
+
value: 'Within 30 days',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: 'Within 90 days',
|
|
89
|
+
value: 'Within 90 days',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: 'Within 120 days',
|
|
93
|
+
value: 'Within 120 days',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: 'More than 120 days',
|
|
97
|
+
value: 'More than 120 days',
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
export const recurringPaymentsOptions = [
|
|
101
|
+
{
|
|
102
|
+
label: 'Yes',
|
|
103
|
+
value: 'Yes',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: 'No',
|
|
107
|
+
value: 'No',
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
export const seasonalBusinessOptions = [
|
|
111
|
+
{
|
|
112
|
+
label: 'Yes. The majority of the business revenue is generated in 3-6 months.',
|
|
113
|
+
value: 'Yes',
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: 'No. The business revenue is generated evenly throughout the year.',
|
|
117
|
+
value: 'No',
|
|
118
|
+
}
|
|
119
|
+
];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BusinessStructure, BusinessType } from "../../../api/Business";
|
|
2
1
|
export var BusinessFormServerErrors;
|
|
3
2
|
(function (BusinessFormServerErrors) {
|
|
4
3
|
BusinessFormServerErrors["fetchData"] = "Error retrieving business data";
|
|
@@ -23,83 +22,3 @@ export var OwnerFormClickActions;
|
|
|
23
22
|
OwnerFormClickActions["addOwnerForm"] = "addOwnerForm";
|
|
24
23
|
OwnerFormClickActions["updateOwner"] = "updateOwner";
|
|
25
24
|
})(OwnerFormClickActions || (OwnerFormClickActions = {}));
|
|
26
|
-
export const BusinessTypeOptions = [
|
|
27
|
-
{
|
|
28
|
-
label: 'Choose business type',
|
|
29
|
-
value: '',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: 'Individual',
|
|
33
|
-
value: BusinessType.individual,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: 'For Profit',
|
|
37
|
-
value: BusinessType.for_profit,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: 'Non Profit',
|
|
41
|
-
value: BusinessType.non_profit,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: 'Government Entity',
|
|
45
|
-
value: BusinessType.government_entity,
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
export const BusinessStructureOptions = [
|
|
49
|
-
{
|
|
50
|
-
label: 'Choose business structure',
|
|
51
|
-
value: '',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: 'Sole Proprietorship',
|
|
55
|
-
value: BusinessStructure.sole_proprietorship,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: 'LLC (Single)',
|
|
59
|
-
value: BusinessStructure.single_llc,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: 'LLC (Multiple)',
|
|
63
|
-
value: BusinessStructure.multi_llc,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: 'Private Partnership',
|
|
67
|
-
value: BusinessStructure.private_partnership,
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
label: 'Private Corporation',
|
|
71
|
-
value: BusinessStructure.private_corporation,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
label: 'Unincorporated Association',
|
|
75
|
-
value: BusinessStructure.unincorporated_association,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
label: 'Public Partnership',
|
|
79
|
-
value: BusinessStructure.public_partnership,
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
label: 'Public Corporation',
|
|
83
|
-
value: BusinessStructure.public_corporation,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
label: 'Incorporated',
|
|
87
|
-
value: BusinessStructure.incorporated,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
label: 'Unincorporated',
|
|
91
|
-
value: BusinessStructure.unincorporated,
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
label: 'Government Unit',
|
|
95
|
-
value: BusinessStructure.government_unit,
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
label: 'Government Instrumentality',
|
|
99
|
-
value: BusinessStructure.government_instrumentality,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
label: 'Tax Exempt Government Instrumentality',
|
|
103
|
-
value: BusinessStructure.tax_exempt_government_instrumentality,
|
|
104
|
-
},
|
|
105
|
-
];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentErrorSeverity } from "../../api/ComponentError";
|
|
2
|
+
import { getErrorCode, getErrorMessage } from "../../api/services/utils";
|
|
2
3
|
export const makeGetCheckout = ({ authToken, checkoutId, service }) => async ({ onSuccess, onError }) => {
|
|
4
|
+
var _a;
|
|
3
5
|
try {
|
|
4
6
|
const response = await service.fetchCheckout(authToken, checkoutId);
|
|
5
7
|
if (!response.error) {
|
|
@@ -8,26 +10,46 @@ export const makeGetCheckout = ({ authToken, checkoutId, service }) => async ({
|
|
|
8
10
|
}
|
|
9
11
|
else {
|
|
10
12
|
const responseError = getErrorMessage(response.error);
|
|
11
|
-
|
|
13
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
14
|
+
return onError({
|
|
15
|
+
error: responseError,
|
|
16
|
+
code,
|
|
17
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
18
|
+
});
|
|
12
19
|
}
|
|
13
20
|
}
|
|
14
21
|
catch (error) {
|
|
15
|
-
|
|
22
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
23
|
+
return onError({
|
|
24
|
+
error: error.message || error,
|
|
25
|
+
code,
|
|
26
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
27
|
+
});
|
|
16
28
|
}
|
|
17
29
|
};
|
|
18
30
|
export const makeCheckoutComplete = ({ authToken, checkoutId, service }) => async ({ payment, onSuccess, onError }) => {
|
|
31
|
+
var _a;
|
|
19
32
|
try {
|
|
20
33
|
const response = await service.complete(authToken, checkoutId, payment);
|
|
21
34
|
if (!response.error) {
|
|
22
|
-
|
|
23
|
-
onSuccess({ checkout });
|
|
35
|
+
onSuccess(response);
|
|
24
36
|
}
|
|
25
37
|
else {
|
|
26
38
|
const responseError = getErrorMessage(response.error);
|
|
27
|
-
|
|
39
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
40
|
+
return onError({
|
|
41
|
+
error: responseError,
|
|
42
|
+
code,
|
|
43
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
44
|
+
});
|
|
28
45
|
}
|
|
29
46
|
}
|
|
30
47
|
catch (error) {
|
|
31
|
-
|
|
48
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
49
|
+
return onError({
|
|
50
|
+
error: error.message || error,
|
|
51
|
+
code,
|
|
52
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
53
|
+
});
|
|
32
54
|
}
|
|
33
55
|
};
|
|
@@ -2,12 +2,21 @@ import { h, Host } from "@stencil/core";
|
|
|
2
2
|
import { extractComputedFontsToLoad, formatCurrency } from "../../utils/utils";
|
|
3
3
|
import { config } from "../../../config";
|
|
4
4
|
import { Checkout } from "../../api/Checkout";
|
|
5
|
+
import { ComponentErrorSeverity } from "../../api/ComponentError";
|
|
5
6
|
export class CheckoutCore {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.onSubmitted = (data) => {
|
|
8
9
|
this.submitted.emit(data);
|
|
9
10
|
this.isLoading = false;
|
|
10
11
|
};
|
|
12
|
+
this.onError = ({ error, code, severity }) => {
|
|
13
|
+
this.errorEvent.emit({
|
|
14
|
+
errorCode: code,
|
|
15
|
+
message: error,
|
|
16
|
+
severity,
|
|
17
|
+
});
|
|
18
|
+
this.isLoading = false;
|
|
19
|
+
};
|
|
11
20
|
this.loadingSpinner = (h("div", { class: "spinner-border spinner-border-sm", role: "status" }, h("span", { class: "visually-hidden" }, "Loading...")));
|
|
12
21
|
this.iframeOrigin = config.iframeOrigin;
|
|
13
22
|
this.authToken = undefined;
|
|
@@ -18,9 +27,7 @@ export class CheckoutCore {
|
|
|
18
27
|
this.isLoading = false;
|
|
19
28
|
this.checkout = undefined;
|
|
20
29
|
this.serverError = false;
|
|
21
|
-
this.errorMessage = '';
|
|
22
30
|
this.creatingNewPaymentMethod = false;
|
|
23
|
-
this.selectedPaymentMethodToken = undefined;
|
|
24
31
|
}
|
|
25
32
|
componentWillLoad() {
|
|
26
33
|
if (this.getCheckout) {
|
|
@@ -40,10 +47,14 @@ export class CheckoutCore {
|
|
|
40
47
|
this.checkout = new Checkout(checkout);
|
|
41
48
|
this.isLoading = false;
|
|
42
49
|
},
|
|
43
|
-
onError: (
|
|
44
|
-
this.errorMessage = errorMessage;
|
|
50
|
+
onError: ({ error, code, severity }) => {
|
|
45
51
|
this.isLoading = false;
|
|
46
|
-
|
|
52
|
+
this.errorEvent.emit({
|
|
53
|
+
errorCode: code,
|
|
54
|
+
message: error,
|
|
55
|
+
severity,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
47
58
|
});
|
|
48
59
|
}
|
|
49
60
|
;
|
|
@@ -64,23 +75,30 @@ export class CheckoutCore {
|
|
|
64
75
|
event.preventDefault();
|
|
65
76
|
this.isLoading = true;
|
|
66
77
|
const payload = await this.paymentMethodOptionsRef.resolvePaymentMethod();
|
|
67
|
-
if (payload
|
|
78
|
+
if (!payload) {
|
|
79
|
+
this.isLoading = false;
|
|
80
|
+
}
|
|
81
|
+
else if (payload.error) {
|
|
82
|
+
this.onError({
|
|
83
|
+
code: payload.error.code,
|
|
84
|
+
error: payload.error.message,
|
|
85
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else if (payload.token) {
|
|
68
89
|
this.complete({
|
|
69
90
|
payment: { payment_mode: 'ecom', payment_token: payload.token },
|
|
70
91
|
onSuccess: this.onSubmitted,
|
|
71
|
-
onError: this.
|
|
92
|
+
onError: this.onError,
|
|
72
93
|
});
|
|
73
94
|
}
|
|
74
95
|
else if (((_a = payload.bnpl) === null || _a === void 0 ? void 0 : _a.status) === 'success') {
|
|
75
96
|
this.complete({
|
|
76
97
|
payment: { payment_mode: 'bnpl' },
|
|
77
98
|
onSuccess: this.onSubmitted,
|
|
78
|
-
onError: this.
|
|
99
|
+
onError: this.onError,
|
|
79
100
|
});
|
|
80
101
|
}
|
|
81
|
-
else {
|
|
82
|
-
this.isLoading = false;
|
|
83
|
-
}
|
|
84
102
|
}
|
|
85
103
|
render() {
|
|
86
104
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
@@ -200,9 +218,7 @@ export class CheckoutCore {
|
|
|
200
218
|
"isLoading": {},
|
|
201
219
|
"checkout": {},
|
|
202
220
|
"serverError": {},
|
|
203
|
-
"
|
|
204
|
-
"creatingNewPaymentMethod": {},
|
|
205
|
-
"selectedPaymentMethodToken": {}
|
|
221
|
+
"creatingNewPaymentMethod": {}
|
|
206
222
|
};
|
|
207
223
|
}
|
|
208
224
|
static get events() {
|
|
@@ -227,6 +243,27 @@ export class CheckoutCore {
|
|
|
227
243
|
}
|
|
228
244
|
}
|
|
229
245
|
}
|
|
246
|
+
}, {
|
|
247
|
+
"method": "errorEvent",
|
|
248
|
+
"name": "error-event",
|
|
249
|
+
"bubbles": true,
|
|
250
|
+
"cancelable": true,
|
|
251
|
+
"composed": true,
|
|
252
|
+
"docs": {
|
|
253
|
+
"tags": [],
|
|
254
|
+
"text": ""
|
|
255
|
+
},
|
|
256
|
+
"complexType": {
|
|
257
|
+
"original": "ComponentError",
|
|
258
|
+
"resolved": "ComponentError",
|
|
259
|
+
"references": {
|
|
260
|
+
"ComponentError": {
|
|
261
|
+
"location": "import",
|
|
262
|
+
"path": "../../api/ComponentError",
|
|
263
|
+
"id": "src/api/ComponentError.ts::ComponentError"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
230
267
|
}];
|
|
231
268
|
}
|
|
232
269
|
static get methods() {
|