@justifi/webcomponents 5.3.1 → 5.3.2
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/bank-account-form_9.cjs.entry.js +2 -2
- package/dist/cjs/billing-form_3.cjs.entry.js +2 -2
- package/dist/cjs/{business-additional-questions-schema-2f66f025.js → business-additional-questions-schema-2cc0c6f7.js} +1 -1
- package/dist/cjs/{business-identity-schema-be495474.js → business-identity-schema-7d462eb3.js} +1 -1
- package/dist/cjs/{check-pkg-version-526a9ce5.js → check-pkg-version-fe4c6467.js} +1 -1
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +3 -3
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +18 -10
- package/dist/cjs/{package-45874555.js → package-8b04bef0.js} +1 -1
- package/dist/cjs/{schema-validations-cc4e6071.js → schema-validations-f948158d.js} +1 -1
- package/dist/collection/components/business-forms/schemas/schema-validations.js +1 -1
- package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +1 -1
- package/dist/collection/components/checkout/card-form/card-form.js +1 -1
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +24 -18
- package/dist/docs.json +23 -18
- package/dist/esm/bank-account-form_9.entry.js +2 -2
- package/dist/esm/billing-form_3.entry.js +2 -2
- package/dist/esm/{business-additional-questions-schema-212a96ed.js → business-additional-questions-schema-60e9b76a.js} +1 -1
- package/dist/esm/{business-identity-schema-05bd2a5f.js → business-identity-schema-191d85c2.js} +1 -1
- package/dist/esm/{check-pkg-version-f91ed31f.js → check-pkg-version-e2273f4f.js} +1 -1
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +5 -5
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-checkouts-list.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-owner-form_3.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +2 -2
- package/dist/esm/justifi-tokenize-payment-method.entry.js +18 -10
- package/dist/esm/{package-2b7c7bc0.js → package-a8e8f775.js} +1 -1
- package/dist/esm/{schema-validations-ccea6a06.js → schema-validations-38e8bc7b.js} +1 -1
- package/dist/module/bank-account-form2.js +1 -1
- package/dist/module/card-form2.js +1 -1
- package/dist/module/justifi-tokenize-payment-method.js +14 -8
- package/dist/module/package.js +1 -1
- package/dist/module/schema-validations.js +1 -1
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +4 -3
- package/dist/types/components.d.ts +10 -12
- package/dist/webcomponents/p-02d36485.entry.js +1 -0
- package/dist/webcomponents/{p-d07c45e6.entry.js → p-1882d7d6.entry.js} +1 -1
- package/dist/webcomponents/{p-47a3003c.entry.js → p-25c9c88c.entry.js} +1 -1
- package/dist/webcomponents/{p-7542ebd6.entry.js → p-2710884e.entry.js} +1 -1
- package/dist/webcomponents/{p-de13f23c.js → p-27c8ffa2.js} +1 -1
- package/dist/webcomponents/{p-f28ddbe8.entry.js → p-39696abd.entry.js} +1 -1
- package/dist/webcomponents/{p-eae512f0.entry.js → p-40eabfca.entry.js} +1 -1
- package/dist/webcomponents/p-4810f227.entry.js +1 -0
- package/dist/webcomponents/{p-415deed1.entry.js → p-485814d8.entry.js} +1 -1
- package/dist/webcomponents/p-57206dc4.entry.js +1 -0
- package/dist/webcomponents/{p-ca361ef6.entry.js → p-63a8b08f.entry.js} +1 -1
- package/dist/webcomponents/{p-991df3a1.entry.js → p-67b75e01.entry.js} +1 -1
- package/dist/webcomponents/{p-8815bf82.entry.js → p-68bf1a1d.entry.js} +1 -1
- package/dist/webcomponents/{p-0277c1b2.js → p-849c68e5.js} +1 -1
- package/dist/webcomponents/{p-d91c46dc.js → p-933537ca.js} +1 -1
- package/dist/webcomponents/{p-189affee.entry.js → p-a47c14cb.entry.js} +1 -1
- package/dist/webcomponents/p-b01405ab.entry.js +1 -0
- package/dist/webcomponents/{p-c5c03d88.js → p-b0b40bcd.js} +1 -1
- package/dist/webcomponents/{p-4c820f81.js → p-b2edb944.js} +1 -1
- package/dist/webcomponents/{p-74014392.entry.js → p-c75481bf.entry.js} +1 -1
- package/dist/webcomponents/{p-ab254da1.entry.js → p-e22df884.entry.js} +1 -1
- package/dist/webcomponents/{p-31cbc05a.entry.js → p-e8d0f978.entry.js} +1 -1
- package/dist/webcomponents/p-fbe16023.entry.js +1 -0
- package/dist/webcomponents/{p-72ff0d5f.entry.js → p-ff955a18.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-00c32bb9.entry.js +0 -1
- package/dist/webcomponents/p-778e9dd0.entry.js +0 -1
- package/dist/webcomponents/p-85b5eeb6.entry.js +0 -1
- package/dist/webcomponents/p-af66f580.entry.js +0 -1
- package/dist/webcomponents/p-ccd91d8a.entry.js +0 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-29fcfdf5.js';
|
|
2
2
|
import { B as Button } from './button-4b3f3934.js';
|
|
3
3
|
import { S as StyledHost } from './styled-host-32228b45.js';
|
|
4
|
-
import {
|
|
5
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-f91ed31f.js';
|
|
4
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-e2273f4f.js';
|
|
6
5
|
import { c as config } from './Api-97801a4b.js';
|
|
6
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-3ce7f437.js';
|
|
7
|
+
import './Checkout-8325c97a.js';
|
|
8
|
+
import './Pagination-afc8f96d.js';
|
|
9
|
+
import './Payment-82d2f453.js';
|
|
10
|
+
import './SubAccount-a73bf971.js';
|
|
11
|
+
import './Document-1907c0d4.js';
|
|
7
12
|
import './parts-ab2bb4b5.js';
|
|
8
|
-
import './package-
|
|
13
|
+
import './package-a8e8f775.js';
|
|
14
|
+
import './utils-c37124fc.js';
|
|
15
|
+
import './Dispute-5fd28ec9.js';
|
|
9
16
|
|
|
10
17
|
const TokenizePaymentMethod = class {
|
|
11
18
|
constructor(hostRef) {
|
|
@@ -30,8 +37,9 @@ const TokenizePaymentMethod = class {
|
|
|
30
37
|
async tokenizePaymentMethod(event) {
|
|
31
38
|
event && event.preventDefault();
|
|
32
39
|
this.isLoading = true;
|
|
40
|
+
let tokenizeResponse;
|
|
33
41
|
try {
|
|
34
|
-
|
|
42
|
+
tokenizeResponse = await this.paymentMethodOptionsRef.resolvePaymentMethod({ isValid: true });
|
|
35
43
|
if (tokenizeResponse.error) {
|
|
36
44
|
this.errorEvent.emit({
|
|
37
45
|
errorCode: tokenizeResponse.error.code,
|
|
@@ -39,26 +47,26 @@ const TokenizePaymentMethod = class {
|
|
|
39
47
|
severity: ComponentErrorSeverity.ERROR,
|
|
40
48
|
});
|
|
41
49
|
}
|
|
42
|
-
else if (tokenizeResponse.token) {
|
|
43
|
-
this.submitEvent.emit({ response: tokenizeResponse });
|
|
44
|
-
}
|
|
45
50
|
}
|
|
46
51
|
catch (error) {
|
|
47
|
-
|
|
52
|
+
const errorData = {
|
|
48
53
|
errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
|
|
49
54
|
message: error.message,
|
|
50
55
|
severity: ComponentErrorSeverity.ERROR,
|
|
51
|
-
}
|
|
56
|
+
};
|
|
57
|
+
this.errorEvent.emit(errorData);
|
|
52
58
|
}
|
|
53
59
|
finally {
|
|
60
|
+
this.submitEvent.emit({ response: tokenizeResponse });
|
|
54
61
|
this.isLoading = false;
|
|
62
|
+
return tokenizeResponse;
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
async fillBillingForm(fields) {
|
|
58
66
|
this.paymentMethodOptionsRef.fillBillingForm(fields);
|
|
59
67
|
}
|
|
60
68
|
render() {
|
|
61
|
-
return (h(StyledHost, { key: '
|
|
69
|
+
return (h(StyledHost, { key: 'f0efb2ab8f051b0b5dafcb608c9c1b561f6f21bc' }, h("form", { key: 'b511a1af4e15175d7bec45c66dc030e693820563' }, h("fieldset", { key: '53b78e28371b6ed69140774b6b47afcee3cb7edd' }, h("div", { key: 'e37c7cb04912fac8bf24bae88cfd06fb00d22325', class: "row gy-3" }, h("div", { key: '103ef1da7228ab3d74065ca64ea070e1520799ff', class: "col-12" }, h("justifi-payment-method-options", { key: '58d614390f0dce90d1ca85b88ce888b841457753', ref: (el) => (this.paymentMethodOptionsRef = el), "show-card": !this.disableCreditCard, "show-ach": !this.disableBankAccount, "show-bnpl": false, paymentMethodGroupId: this.paymentMethodGroupId, "show-saved-payment-methods": false, hideCardBillingForm: this.hideCardBillingForm, authToken: this.authToken, "account-id": this.accountId, iframeOrigin: this.iframeOrigin })), h("div", { key: '727317ff2fafaace929f6667934a649994fe037d', class: "col-12" }, h(Button, { key: '999ec3e29e37ce5027f6d1c4d75bae31beba6ab1', variant: "primary", type: "submit", onClick: event => this.tokenizePaymentMethod(event), isLoading: this.isLoading, "data-testid": "submit-button", hidden: this.hideSubmitButton }, this.submitButtonText || 'Submit')))))));
|
|
62
70
|
}
|
|
63
71
|
};
|
|
64
72
|
|
|
@@ -167,7 +167,7 @@ const accountTypeValidation = create$6()
|
|
|
167
167
|
.oneOf(bankAccountTypeOptions.map((option) => option.value), 'Select account type')
|
|
168
168
|
.transform(transformEmptyString);
|
|
169
169
|
const accountNumberValidation = create$6()
|
|
170
|
-
.min(
|
|
170
|
+
.min(4, 'Account number must be at least 4 digits')
|
|
171
171
|
.max(17, 'Account number must be less than 17 digits')
|
|
172
172
|
.matches(numbersOnlyRegex, 'Enter valid account number')
|
|
173
173
|
.test('not-repeat', 'Enter valid account number', (value) => {
|
|
@@ -16,7 +16,7 @@ const BankAccountForm = /*@__PURE__*/ proxyCustomElement(class BankAccountForm e
|
|
|
16
16
|
return this.accountNumberIframeElement.tokenize(clientId, paymentMethodMetadata, account);
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: 'e2aa1322935463d5e0c32154ed8af52baad6b241' }, h("div", { key: 'bf528ad389d4a34762c164440cb946b727ddbfdd', class: "container-fluid p-0" }, h("div", { key: 'f2004a7223ebb0f2e54ea8c87a813461acb5449a', class: "row mb-3" }, h("iframe-input", { key: '27390ec2ac66557c2a12a38f1bc88dab0415fe57', inputId: "accountNumber", ref: (el) => (this.accountNumberIframeElement = el), label: "Account Number", iframeOrigin: `${this.iframeOrigin}/v2/accountNumber` })), h("div", { key: '59063a5784405bba8800d1595aecd2748ea9a058', class: "row" }, h("iframe-input", { key: 'fcad3cd545486450882258b86398c2bf84afca74', inputId: "routingNumber", ref: (el) => (this.routingNumberIframeElement = el), label: "Routing Number", iframeOrigin: `${this.iframeOrigin}/v2/routingNumber` })))));
|
|
20
20
|
}
|
|
21
21
|
}, [0, "bank-account-form", {
|
|
22
22
|
"iframeOrigin": [1, "iframe-origin"],
|
|
@@ -18,7 +18,7 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class CardForm extends HTMLEle
|
|
|
18
18
|
return this.cardNumberIframeElement.tokenize(clientId, paymentMethodMetadata, account);
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
return (h(Host, { key: '5dfd2c79d7691744614af89d0919e58db17434b3', class: "container-fluid p-0" }, h("div", { key: '307e9a7acd80285a59369e813bb0172627395cf6', class: "mb-3" }, h("iframe-input", { key: '
|
|
21
|
+
return (h(Host, { key: '5dfd2c79d7691744614af89d0919e58db17434b3', class: "container-fluid p-0" }, h("div", { key: '307e9a7acd80285a59369e813bb0172627395cf6', class: "mb-3" }, h("iframe-input", { key: '42de95d9e8f6b785e0dfd7a9b79b23e8c1aab4ee', inputId: "cardNumber", ref: (el) => (this.cardNumberIframeElement = el), label: "Card Number", iframeOrigin: `${this.iframeOrigin}/v2/cardNumber` })), h("div", { key: '9ab568a45c652478daa2fdd936cb49258b8bdd18', class: "row" }, h("div", { key: 'ee106aa794d4fb0bbcab36f6daada68740bb4262', class: "col-4 align-content-end" }, h("iframe-input", { key: 'c2edb5592c479763a47d399d4d0428d5468f6be5', inputId: "expirationMonth", ref: (el) => (this.expirationMonthIframeElement = el), label: "Expiration", iframeOrigin: `${this.iframeOrigin}/v2/expirationMonth` })), h("div", { key: 'e9577f47e9d3fea9be62fbbde95dc890091c47e0', class: "col-4 align-content-end" }, h("iframe-input", { key: '2f623e190959ed454c3016637f90f38c531d9062', inputId: "expirationYear", ref: (el) => (this.expirationYearIframeElement = el), label: "", iframeOrigin: `${this.iframeOrigin}/v2/expirationYear` })), h("div", { key: '4522288e5e0f1b41dc89a690830bb78063ea4df0', class: "col-4 align-content-end" }, h("iframe-input", { key: '9036d997bcd4f8c73e63daa3997111803bc99a36', inputId: "CVV", ref: (el) => (this.cvvIframeElement = el), label: "CVV", iframeOrigin: `${this.iframeOrigin}/v2/CVV` })))));
|
|
22
22
|
}
|
|
23
23
|
}, [0, "card-form", {
|
|
24
24
|
"iframeOrigin": [1, "iframe-origin"],
|
|
@@ -2,9 +2,14 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
|
|
|
2
2
|
import { B as Button } from './button.js';
|
|
3
3
|
import { S as StyledHost } from './styled-host.js';
|
|
4
4
|
import './details.js';
|
|
5
|
-
import { a as ComponentErrorSeverity, C as ComponentErrorCodes } from './ComponentError.js';
|
|
6
5
|
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version.js';
|
|
7
6
|
import { c as config } from './config.js';
|
|
7
|
+
import { a as ComponentErrorSeverity, C as ComponentErrorCodes } from './ComponentError.js';
|
|
8
|
+
import './Checkout.js';
|
|
9
|
+
import './Pagination.js';
|
|
10
|
+
import './Payment.js';
|
|
11
|
+
import './SubAccount.js';
|
|
12
|
+
import './Document.js';
|
|
8
13
|
import { d as defineCustomElement$k } from './bank-account-form2.js';
|
|
9
14
|
import { d as defineCustomElement$j } from './billing-form2.js';
|
|
10
15
|
import { d as defineCustomElement$i } from './card-form2.js';
|
|
@@ -50,8 +55,9 @@ const TokenizePaymentMethod = /*@__PURE__*/ proxyCustomElement(class TokenizePay
|
|
|
50
55
|
async tokenizePaymentMethod(event) {
|
|
51
56
|
event && event.preventDefault();
|
|
52
57
|
this.isLoading = true;
|
|
58
|
+
let tokenizeResponse;
|
|
53
59
|
try {
|
|
54
|
-
|
|
60
|
+
tokenizeResponse = await this.paymentMethodOptionsRef.resolvePaymentMethod({ isValid: true });
|
|
55
61
|
if (tokenizeResponse.error) {
|
|
56
62
|
this.errorEvent.emit({
|
|
57
63
|
errorCode: tokenizeResponse.error.code,
|
|
@@ -59,26 +65,26 @@ const TokenizePaymentMethod = /*@__PURE__*/ proxyCustomElement(class TokenizePay
|
|
|
59
65
|
severity: ComponentErrorSeverity.ERROR,
|
|
60
66
|
});
|
|
61
67
|
}
|
|
62
|
-
else if (tokenizeResponse.token) {
|
|
63
|
-
this.submitEvent.emit({ response: tokenizeResponse });
|
|
64
|
-
}
|
|
65
68
|
}
|
|
66
69
|
catch (error) {
|
|
67
|
-
|
|
70
|
+
const errorData = {
|
|
68
71
|
errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
|
|
69
72
|
message: error.message,
|
|
70
73
|
severity: ComponentErrorSeverity.ERROR,
|
|
71
|
-
}
|
|
74
|
+
};
|
|
75
|
+
this.errorEvent.emit(errorData);
|
|
72
76
|
}
|
|
73
77
|
finally {
|
|
78
|
+
this.submitEvent.emit({ response: tokenizeResponse });
|
|
74
79
|
this.isLoading = false;
|
|
80
|
+
return tokenizeResponse;
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
async fillBillingForm(fields) {
|
|
78
84
|
this.paymentMethodOptionsRef.fillBillingForm(fields);
|
|
79
85
|
}
|
|
80
86
|
render() {
|
|
81
|
-
return (h(StyledHost, { key: '
|
|
87
|
+
return (h(StyledHost, { key: 'f0efb2ab8f051b0b5dafcb608c9c1b561f6f21bc' }, h("form", { key: 'b511a1af4e15175d7bec45c66dc030e693820563' }, h("fieldset", { key: '53b78e28371b6ed69140774b6b47afcee3cb7edd' }, h("div", { key: 'e37c7cb04912fac8bf24bae88cfd06fb00d22325', class: "row gy-3" }, h("div", { key: '103ef1da7228ab3d74065ca64ea070e1520799ff', class: "col-12" }, h("justifi-payment-method-options", { key: '58d614390f0dce90d1ca85b88ce888b841457753', ref: (el) => (this.paymentMethodOptionsRef = el), "show-card": !this.disableCreditCard, "show-ach": !this.disableBankAccount, "show-bnpl": false, paymentMethodGroupId: this.paymentMethodGroupId, "show-saved-payment-methods": false, hideCardBillingForm: this.hideCardBillingForm, authToken: this.authToken, "account-id": this.accountId, iframeOrigin: this.iframeOrigin })), h("div", { key: '727317ff2fafaace929f6667934a649994fe037d', class: "col-12" }, h(Button, { key: '999ec3e29e37ce5027f6d1c4d75bae31beba6ab1', variant: "primary", type: "submit", onClick: event => this.tokenizePaymentMethod(event), isLoading: this.isLoading, "data-testid": "submit-button", hidden: this.hideSubmitButton }, this.submitButtonText || 'Submit')))))));
|
|
82
88
|
}
|
|
83
89
|
}, [1, "justifi-tokenize-payment-method", {
|
|
84
90
|
"authToken": [1, "auth-token"],
|
package/dist/module/package.js
CHANGED
|
@@ -167,7 +167,7 @@ const accountTypeValidation = create$6()
|
|
|
167
167
|
.oneOf(bankAccountTypeOptions.map((option) => option.value), 'Select account type')
|
|
168
168
|
.transform(transformEmptyString);
|
|
169
169
|
const accountNumberValidation = create$6()
|
|
170
|
-
.min(
|
|
170
|
+
.min(4, 'Account number must be at least 4 digits')
|
|
171
171
|
.max(17, 'Account number must be less than 17 digits')
|
|
172
172
|
.matches(numbersOnlyRegex, 'Enter valid account number')
|
|
173
173
|
.test('not-repeat', 'Enter valid account number', (value) => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import { BillingFormFields } from '../../components';
|
|
3
2
|
import JustifiAnalytics from '../../api/Analytics';
|
|
4
|
-
import {
|
|
3
|
+
import { BillingFormFields } from '../billing-forms/billing-form-schema';
|
|
4
|
+
import { PaymentMethodPayload } from '../checkout/payment-method-payload';
|
|
5
|
+
import { ComponentSubmitEvent, ComponentErrorEvent } from '../../api';
|
|
5
6
|
export declare class TokenizePaymentMethod {
|
|
6
7
|
authToken: string;
|
|
7
8
|
accountId: string;
|
|
@@ -18,7 +19,7 @@ export declare class TokenizePaymentMethod {
|
|
|
18
19
|
private paymentMethodOptionsRef?;
|
|
19
20
|
analytics: JustifiAnalytics;
|
|
20
21
|
componentWillLoad(): void;
|
|
21
|
-
tokenizePaymentMethod(event?: CustomEvent): Promise<
|
|
22
|
+
tokenizePaymentMethod(event?: CustomEvent): Promise<PaymentMethodPayload>;
|
|
22
23
|
fillBillingForm(fields: BillingFormFields): Promise<void>;
|
|
23
24
|
render(): any;
|
|
24
25
|
}
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { IAdditionalQuestions, IAddress, IBusiness } from "./api/Business";
|
|
9
|
-
import { ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
9
|
+
import { ComponentErrorCodes, ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, ComponentSubmitEvent as ComponentSubmitEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
10
10
|
import { BillingFormFields, PostalFormFields } from "./components/billing-forms/billing-form-schema";
|
|
11
11
|
import { ComponentClickEvent, ComponentErrorEvent, ComponentFormStepCompleteEvent, ComponentSubmitEvent } from "./api/ComponentEvents";
|
|
12
12
|
import { Placement, PositioningStrategy } from "@popperjs/core";
|
|
13
13
|
import { EntityDocumentType, FileSelectEvent as FileSelectEvent1 } from "./api/Document";
|
|
14
|
-
import {
|
|
14
|
+
import { FormController } from "./components";
|
|
15
15
|
import { DisputeEvidenceDocument } from "./api/DisputeEvidenceDocument";
|
|
16
16
|
import { DisputeResponseFormStep } from "./components/dispute-management/dispute-response/dispute-response-form-types";
|
|
17
17
|
import { FormController as FormController1 } from "./ui-components/form/form";
|
|
@@ -20,16 +20,15 @@ import { Dispute, IDispute } from "./api/Dispute";
|
|
|
20
20
|
import { PaymentMethodOption } from "./components/checkout/payment-method-option-utils";
|
|
21
21
|
import { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
|
|
22
22
|
import { RefundFormFields } from "./components/refund-form/refund-form-schema";
|
|
23
|
-
import { ComponentErrorCodes } from "./api/ComponentError";
|
|
24
23
|
import { Identity } from "./api/Identity";
|
|
25
24
|
import { PaginationProps } from "./components/pagination-menu/pagination-menu";
|
|
26
25
|
export { IAdditionalQuestions, IAddress, IBusiness } from "./api/Business";
|
|
27
|
-
export { ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
26
|
+
export { ComponentErrorCodes, ComponentErrorEvent as ComponentErrorEvent1, ComponentFormStepCompleteEvent as ComponentFormStepCompleteEvent1, ComponentSubmitEvent as ComponentSubmitEvent1, FileSelectEvent, IApiResponse, IBnpl, ILoadedEventResponse } from "./api";
|
|
28
27
|
export { BillingFormFields, PostalFormFields } from "./components/billing-forms/billing-form-schema";
|
|
29
28
|
export { ComponentClickEvent, ComponentErrorEvent, ComponentFormStepCompleteEvent, ComponentSubmitEvent } from "./api/ComponentEvents";
|
|
30
29
|
export { Placement, PositioningStrategy } from "@popperjs/core";
|
|
31
30
|
export { EntityDocumentType, FileSelectEvent as FileSelectEvent1 } from "./api/Document";
|
|
32
|
-
export {
|
|
31
|
+
export { FormController } from "./components";
|
|
33
32
|
export { DisputeEvidenceDocument } from "./api/DisputeEvidenceDocument";
|
|
34
33
|
export { DisputeResponseFormStep } from "./components/dispute-management/dispute-response/dispute-response-form-types";
|
|
35
34
|
export { FormController as FormController1 } from "./ui-components/form/form";
|
|
@@ -38,7 +37,6 @@ export { Dispute, IDispute } from "./api/Dispute";
|
|
|
38
37
|
export { PaymentMethodOption } from "./components/checkout/payment-method-option-utils";
|
|
39
38
|
export { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
|
|
40
39
|
export { RefundFormFields } from "./components/refund-form/refund-form-schema";
|
|
41
|
-
export { ComponentErrorCodes } from "./api/ComponentError";
|
|
42
40
|
export { Identity } from "./api/Identity";
|
|
43
41
|
export { PaginationProps } from "./components/pagination-menu/pagination-menu";
|
|
44
42
|
export namespace Components {
|
|
@@ -659,13 +657,13 @@ export namespace Components {
|
|
|
659
657
|
"authToken": string;
|
|
660
658
|
"disableBankAccount"?: boolean;
|
|
661
659
|
"disableCreditCard"?: boolean;
|
|
662
|
-
"fillBillingForm": (fields:
|
|
660
|
+
"fillBillingForm": (fields: BillingFormFields) => Promise<void>;
|
|
663
661
|
"hideCardBillingForm"?: boolean;
|
|
664
662
|
"hideSubmitButton"?: boolean;
|
|
665
663
|
"iframeOrigin"?: string;
|
|
666
664
|
"paymentMethodGroupId": string;
|
|
667
665
|
"submitButtonText": string;
|
|
668
|
-
"tokenizePaymentMethod": (event?: CustomEvent) => Promise<
|
|
666
|
+
"tokenizePaymentMethod": (event?: CustomEvent) => Promise<PaymentMethodPayload>;
|
|
669
667
|
}
|
|
670
668
|
interface LegalAddressDetails {
|
|
671
669
|
"legalAddress": IAddress;
|
|
@@ -2163,8 +2161,8 @@ declare global {
|
|
|
2163
2161
|
new (): HTMLJustifiTerminalsListFiltersElement;
|
|
2164
2162
|
};
|
|
2165
2163
|
interface HTMLJustifiTokenizePaymentMethodElementEventMap {
|
|
2166
|
-
"error-event":
|
|
2167
|
-
"submit-event":
|
|
2164
|
+
"error-event": ComponentErrorEvent1;
|
|
2165
|
+
"submit-event": ComponentSubmitEvent1;
|
|
2168
2166
|
}
|
|
2169
2167
|
interface HTMLJustifiTokenizePaymentMethodElement extends Components.JustifiTokenizePaymentMethod, HTMLStencilElement {
|
|
2170
2168
|
addEventListener<K extends keyof HTMLJustifiTokenizePaymentMethodElementEventMap>(type: K, listener: (this: HTMLJustifiTokenizePaymentMethodElement, ev: JustifiTokenizePaymentMethodCustomEvent<HTMLJustifiTokenizePaymentMethodElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -3111,8 +3109,8 @@ declare namespace LocalJSX {
|
|
|
3111
3109
|
"hideCardBillingForm"?: boolean;
|
|
3112
3110
|
"hideSubmitButton"?: boolean;
|
|
3113
3111
|
"iframeOrigin"?: string;
|
|
3114
|
-
"onError-event"?: (event: JustifiTokenizePaymentMethodCustomEvent<
|
|
3115
|
-
"onSubmit-event"?: (event: JustifiTokenizePaymentMethodCustomEvent<
|
|
3112
|
+
"onError-event"?: (event: JustifiTokenizePaymentMethodCustomEvent<ComponentErrorEvent1>) => void;
|
|
3113
|
+
"onSubmit-event"?: (event: JustifiTokenizePaymentMethodCustomEvent<ComponentSubmitEvent1>) => void;
|
|
3116
3114
|
"paymentMethodGroupId"?: string;
|
|
3117
3115
|
"submitButtonText"?: string;
|
|
3118
3116
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-2783e363.js";import{c as o,F as e}from"./p-5844a0f0.js";import{b as r,a}from"./p-b0b40bcd.js";import{a as h,i as n}from"./p-849c68e5.js";import{A as l,c}from"./p-4bad3621.js";import"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{B as p,a as m}from"./p-275f2154.js";import{c as d,J as f}from"./p-933537ca.js";import{B as b}from"./p-298e290e.js";import{S as j}from"./p-bfe9748b.js";import{H as u}from"./p-1603fe4d.js";import{S as v}from"./p-aa02cf71.js";import{B as w}from"./p-73f9be7c.js";import"./p-27c8ffa2.js";import"./p-6078a370.js";import"./p-0ea387a2.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-1ff8810b.js";import"./p-b2edb944.js";import"./p-d8c04275.js";const g=o(Object.assign(Object.assign({},r().fields),{legal_address:h(),additional_questions:a(),representative:n("representative")})),x=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(v,{width:"25%"})),s("div",{class:"col-12"},s(v,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(v,{width:"50%"}),s(v,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(v,{width:"65%"}),s(v,{width:"35%"}))),y=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(v,{width:"40%",height:"40px"})),s(x,null),s(x,null),s(x,null)),C=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event",7),this.clickEvent=t(this,"click-event",7),this.instantiateBusiness=s=>{const i=new p(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;try{const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new p(Object.assign(Object.assign({},i),s)).payload,o=await this.api.patch(this.businessEndpoint,t);this.handleReponse(o)}catch(s){this.errorMessage=m.patchData}finally{this.isSaving=!1}},this.fetchData=async()=>{this.isLoading=!0;try{const s=await this.api.get(this.businessEndpoint);this.instantiateBusiness(s.data)}catch(s){this.errorMessage=m.fetchData}finally{this.isLoading=!1}},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)},this.authToken=void 0,this.businessId=void 0,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.isLoading=!1,this.isSaving=!1,this.errorMessage=void 0}componentWillLoad(){d(),this.analytics=new f(this),this.authToken||console.error("Warning: Missing auth-token. The form will not be functional without it."),this.businessId||console.error("Warning: Missing business-id. The form requires an existing business-id to function."),this.formController=new e(g),this.api=l({authToken:this.authToken,apiOrigin:c.proxyApiOrigin}),this.fetchData()}disconnectedCallback(){this.analytics.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}handleReponse(s){s.error&&(this.errorMessage=m.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(j,null,this.isLoading?s(y,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(u,{text:this.title}),s("form-alert",{text:this.errorMessage,hideAlert:this.hideErrors}),s("div",{class:"col-12 mb-4"},s("justifi-business-core-info",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-legal-address-form",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-additional-questions",{formController:this.formController})),s("div",{class:"col-12 mb-4"},s("justifi-business-representative",{formController:this.formController})),s("div",{class:"col-12 d-flex flex-row-reverse"},s(b,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:w.submit}),isLoading:this.isSaving},"Submit")))))}};export{C as justifi_business_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as t,c as e}from"./p-2783e363.js";import{a as i,b as r}from"./p-c5c03d88.js";import{F as o,c as n}from"./p-5844a0f0.js";import{A as a,C as l,R as h,c}from"./p-275f2154.js";import{C as d,P as u}from"./p-525db3e8.js";import{h as m}from"./p-d8c04275.js";import{S as p}from"./p-aa02cf71.js";import{a as v,r as f,s as b,b as y}from"./p-0ea387a2.js";import{a as g,B as w}from"./p-73f9be7c.js";import{z as _,A as x,u as j,B as S,C as T,D as O,E as k,F as C}from"./p-de13f23c.js";import{a as L,C as H}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import{a as E,b as D}from"./p-61f0a2ce.js";import{n as V}from"./p-e3c22aa9.js";import{B as A}from"./p-298e290e.js";import{i as P,a as B}from"./p-0277c1b2.js";import{S as I}from"./p-6078a370.js";import"./p-1ff8810b.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";class W{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.account_number=s.account_number,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.updated_at}get payload(){return{account_owner_name:this.account_owner_name||"",account_type:this.account_type||"",account_number:this.account_number||"",routing_number:this.routing_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const F=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(p,{width:"25%"})),s("div",{class:"col-12"},s(p,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"50%"}),s(p,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"65%"}),s(p,{width:"35%"}))),N=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(p,{width:"40%",height:"40px"})),s(F,null),s(F,null),s(F,null)),U=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.additional_questions=new a(s.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t})),this.additional_questions=new a(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}recurringPaymentsWatcher(s){this.recurringPayments="Yes"===(null==s?void 0:s.business_recurring_payments)}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{additional_questions:new a(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(i(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n,a;const l=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Additional Questions"),s("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_revenue",label:"What is your business’ estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_revenue,defaultValue:null==l?void 0:l.business_revenue,maskOptions:d.WHOLE})),s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(e=this.errors)||void 0===e?void 0:e.business_payment_volume,defaultValue:null==l?void 0:l.business_payment_volume,maskOptions:d.WHOLE})),s("div",{class:"col-12"},s("form-control-select",{name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_when_service_received,options:v,defaultValue:null==l?void 0:l.business_when_service_received})),s("div",{class:"col-12"},s("form-control-select",{name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(r=this.errors)||void 0===r?void 0:r.business_recurring_payments,options:f,defaultValue:null==l?void 0:l.business_recurring_payments})),s("div",{class:"col-12",hidden:!this.recurringPayments},s("form-control-text",{name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(o=this.errors)||void 0===o?void 0:o.business_recurring_payments_percentage,defaultValue:null==l?void 0:l.business_recurring_payments_percentage,helpText:"For example: 50% monthly, 50% annual."})),s("div",{class:"col-12"},s("form-control-select",{name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(n=this.errors)||void 0===n?void 0:n.business_seasonal,options:b,defaultValue:null==l?void 0:l.business_seasonal})),s("div",{class:"col-12"},s("form-control-text",{name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business? (optional)",inputHandler:this.inputHandler,errorText:null===(a=this.errors)||void 0===a?void 0:a.business_other_payment_details,defaultValue:null==l?void 0:l.business_other_payment_details})))))}static get watchers(){return{additional_questions:["recurringPaymentsWatcher"]}}},q=(s,t)=>{const e=n({bank_name:_.required("Enter bank name"),nickname:x.required("Enter nickname"),account_owner_name:j.required("Enter account owner name"),account_type:S.required("Select account type"),account_number:T.required("Enter account number"),routing_number:O.required("Enter routing number"),voided_check:k(s,t),bank_statement:C(s,t)}),i=n({bank_name:_.nullable(),nickname:x.nullable(),account_owner_name:j.nullable(),account_type:S.nullable(),account_number:T.nullable(),routing_number:O.nullable(),voided_check:k(s,t),bank_statement:C(s,t)});return t?i:e},R=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.initializeFormController=()=>{this.formController=new o(q(this.existingDocuments,this.allowOptionalFields)),this.formController.setInitialValues(Object.assign({},this.bankAccount)),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new E({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.bank_accounts.length>0?this.bankAccount=new W(s.data.bank_accounts[0]):(this.bankAccount=new W({}),this.bankAccount.business_id=this.businessId),this.existingDocuments=s.data.documents},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.postDocumentRecordData=async s=>{this.isLoading=!0;const t=s.record_data;return new Promise((e=>{this.postDocumentRecord({payload:t,onSuccess:t=>{e(this.handleDocRecordResponse(s,t))},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({message:s,errorCode:t,severity:i}),e(!1)}})}))},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:L.POST_ERROR,message:t.error.message,severity:H.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await fetch(s.presigned_url,{method:"PUT",body:s.fileString});return this.handleUploadResponse(t)},this.handleUploadResponse=s=>!s.error||(this.errorEvent.emit({errorCode:L.POST_ERROR,message:s.error.message,severity:H.ERROR,data:s.error}),!1),this.formController=void 0,this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new D,this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.postBankAccount=void 0,this.postDocumentRecord=void 0,this.allowOptionalFields=void 0}watchHandler(s){this.formLoading.emit(s)}async validateAndSubmit({onSuccess:s}){this.existingBankAccount?this.sendData(s):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(q(this.existingDocuments,this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get postPayload(){return new W(this.formController.values.getValue()).payload}get existingBankAccount(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}async sendData(s){try{if(!this.existingBankAccount&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;s()}catch(s){this.errorEvent.emit({message:s,errorCode:L.POST_ERROR,severity:H.ERROR})}}async postBankAccountData(){let s;return this.isLoading=!0,new Promise((t=>{let e=!1;this.postBankAccount({payload:this.postPayload,onSuccess:t=>{s=t,e=!0},onError:({error:s,code:t,severity:i})=>{e=!1,this.errorEvent.emit({message:s,errorCode:t,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:s,formStep:g.bankAccount}),this.isLoading=!1,t(e)}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const s=Object.values(this.documentData).flat();return!s.length||!(await Promise.all(s.map((s=>this.postDocumentRecordData(s))))).includes(!1)&&!(await Promise.all(s.map((s=>this.uploadDocument(s))))).includes(!1)}finally{this.isLoading=!1}}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",{class:"mb-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Bank Account Info"),s("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),s("hr",{class:"mt-2"}),s("bank-account-form-inputs",{defaultValue:t,errors:this.errors,inputHandler:this.inputHandler,formDisabled:this.existingBankAccount})),s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Document Uploads"),s("form-control-tooltip",{helpText:"These documents are required for underwriting purposes. Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."})),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),s("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles})))}static get watchers(){return{isLoading:["watchHandler"]}}},Y=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.coreInfo=new l(s.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.coreInfo={},this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return new l(this.formController.values.getValue()).payload}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(r(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Business Information")),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:t.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)."})),s("div",{class:"col-12"},s("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:t.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)"})),s("div",{class:"col-12 col-md-8"},s("form-control-select",{name:"classification",label:"Business Classification",options:y,defaultValue:t.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-4"},s("form-control-date",{name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:t.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"industry",label:"Industry",defaultValue:t.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"tax_id",label:"Tax ID (EIN or SSN)",defaultValue:t.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,keyDownHandler:V,maxLength:9,helpText:"Employer Identification Numbers (EINs) are nine digits. The federal tax identification number/EIN issued to you by the IRS. It can be found on your tax returns."})),s("div",{class:"col-12"},s("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:t.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler,helpText:"Don't have a live website? You can use your social media business page, app store link, or staging site URL."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"email",label:"Business Email Address",defaultValue:t.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:t.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:u.US})))))}},z=class{constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.matchRef=(s,t)=>{const e=this.refs.findIndex((s=>s===t));-1!==e&&(this.refs[e]=s)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.owners.length?this.ownersPayload=s.data.owners.map((s=>({id:s.id}))):this.addOwnerForm()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=s=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],s&&this.clickEvent.emit({name:w.addOwnerForm})},this.removeOwnerForm=s=>{this.ownersPayload=this.ownersPayload.filter((t=>t.id!==s)),this.newFormOpen&&(this.newFormOpen=!1)},this.ownersPayload=[],this.refs=[],this.newFormOpen=void 0,this.isLoading=!1,this.authToken=void 0,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}get showAddOwnerButton(){return this.ownersPayload.length<4&&!this.newFormOpen}manageRefs(){this.refs=this.ownersPayload.map((s=>s.id))}async validateAndSubmit({onSuccess:s}){const t=this.refs.map((s=>s.validate()));if(!(await Promise.all(t)).every((s=>s)))return;const e=this.refs.map((s=>s.submit()));(await Promise.all(e)).every((s=>s))&&this.sendData(s)}componentWillLoad(){this.getBusiness&&this.getData()}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(s){const t=s.detail,e=this.ownersPayload.map((s=>s.id===t.id?t:s));e.includes(t)||(e[this.ownersPayload.findIndex((s=>!s.id))]=t,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=e}render(){return this.isLoading?s(N,null):s("div",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Owners"),s("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},this.ownersPayload.map((t=>s("justifi-owner-form",{key:t.id,authToken:this.authToken,businessId:this.businessId,ownerId:t.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,allowOptionalFields:this.allowOptionalFields,ref:s=>this.matchRef(s,t.id)})))),s("div",{class:"d-flex justify-content-start"},s("div",{class:"gap-2"},s(A,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner"))))}static get watchers(){return{ownersPayload:["ownersWatcher"]}}},G=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new h(s.data.representative||{}),this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.representative}),this.formLoading.emit(!1)}})},this.formController=void 0,this.errors={},this.representative={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{representative:new h(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(P("representative",this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){return this.isLoading?s(N,null):s("justifi-business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController})}},J=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.legal_address=new c(s.data.legal_address||{}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.legal_address={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{legal_address:new c(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(B(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n;const a=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Legal Address of your Business"),s("form-control-tooltip",{helpText:"No PO Boxes."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line1,errorText:null===(t=this.errors)||void 0===t?void 0:t.line1})),s("div",{class:"col-12"},s("form-control-text",{name:"line2",label:"Address Line 2 (optional)",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line2,errorText:null===(e=this.errors)||void 0===e?void 0:e.line2})),s("div",{class:"col-12"},s("form-control-text",{name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.city,errorText:null===(i=this.errors)||void 0===i?void 0:i.city})),s("div",{class:"col-12"},s("form-control-select",{name:"state",label:"State",options:I,inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.state,errorText:null===(r=this.errors)||void 0===r?void 0:r.state})),s("div",{class:"col-12"},s("form-control-text",{name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.postal_code,errorText:null===(o=this.errors)||void 0===o?void 0:o.postal_code,maxLength:5,keyDownHandler:V})),s("div",{class:"col-12"},s("form-control-select",{name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.country,errorText:null===(n=this.errors)||void 0===n?void 0:n.country,disabled:!0})))))}};export{U as justifi_additional_questions_form_step_core,R as justifi_business_bank_account_form_step_core,Y as justifi_business_core_info_form_step_core,z as justifi_business_owners_form_step_core,G as justifi_business_representative_form_step_core,J as justifi_legal_address_form_step_core}
|
|
1
|
+
import{h as s,r as t,c as e}from"./p-2783e363.js";import{a as i,b as r}from"./p-b0b40bcd.js";import{F as o,c as n}from"./p-5844a0f0.js";import{A as a,C as l,R as h,c}from"./p-275f2154.js";import{C as d,P as u}from"./p-525db3e8.js";import{h as m}from"./p-d8c04275.js";import{S as p}from"./p-aa02cf71.js";import{a as v,r as f,s as b,b as y}from"./p-0ea387a2.js";import{a as g,B as w}from"./p-73f9be7c.js";import{z as _,A as x,u as j,B as S,C as T,D as O,E as k,F as C}from"./p-27c8ffa2.js";import{a as L,C as H}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import"./p-01d4e35a.js";import{a as E,b as D}from"./p-61f0a2ce.js";import{n as V}from"./p-e3c22aa9.js";import{B as A}from"./p-298e290e.js";import{i as P,a as B}from"./p-849c68e5.js";import{S as I}from"./p-6078a370.js";import"./p-1ff8810b.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";class W{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.account_number=s.account_number,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.updated_at}get payload(){return{account_owner_name:this.account_owner_name||"",account_type:this.account_type||"",account_number:this.account_number||"",routing_number:this.routing_number||"",bank_name:this.bank_name||"",nickname:this.nickname||"",business_id:this.business_id||""}}}const F=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(p,{width:"25%"})),s("div",{class:"col-12"},s(p,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"50%"}),s(p,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(p,{width:"65%"}),s(p,{width:"35%"}))),N=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(p,{width:"40%",height:"40px"})),s(F,null),s(F,null),s(F,null)),U=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.additional_questions=new a(s.data.additional_questions||{}),this.formController.setInitialValues(Object.assign({},this.additional_questions))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.additionalQuestions}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t})),this.additional_questions=new a(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.additional_questions={},this.recurringPayments=!1,this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}recurringPaymentsWatcher(s){this.recurringPayments="Yes"===(null==s?void 0:s.business_recurring_payments)}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{additional_questions:new a(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(i(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n,a;const l=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Additional Questions"),s("form-control-tooltip",{helpText:"This information helps us understand the business and identify and monitor trends to safeguard you and your customers."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_revenue",label:"What is your business’ estimated annual revenue from its primary business activities?",inputHandler:this.inputHandler,errorText:null===(t=this.errors)||void 0===t?void 0:t.business_revenue,defaultValue:null==l?void 0:l.business_revenue,maskOptions:d.WHOLE})),s("div",{class:"col-12 col-md-6"},s("form-control-monetary",{name:"business_payment_volume",label:"What is your business' annual credit card & ACH volume anticipated to process?",inputHandler:this.inputHandler,errorText:null===(e=this.errors)||void 0===e?void 0:e.business_payment_volume,defaultValue:null==l?void 0:l.business_payment_volume,maskOptions:d.WHOLE})),s("div",{class:"col-12"},s("form-control-select",{name:"business_when_service_received",label:"On average, how long after paying will your customers typically receive their goods or services?",inputHandler:this.inputHandler,errorText:null===(i=this.errors)||void 0===i?void 0:i.business_when_service_received,options:v,defaultValue:null==l?void 0:l.business_when_service_received})),s("div",{class:"col-12"},s("form-control-select",{name:"business_recurring_payments",label:"Does your business offer recurring payments?",inputHandler:this.inputHandler,errorText:null===(r=this.errors)||void 0===r?void 0:r.business_recurring_payments,options:f,defaultValue:null==l?void 0:l.business_recurring_payments})),s("div",{class:"col-12",hidden:!this.recurringPayments},s("form-control-text",{name:"business_recurring_payments_percentage",label:"What percent of revenue is generated from each recurring payment type offered?",inputHandler:this.inputHandler,errorText:null===(o=this.errors)||void 0===o?void 0:o.business_recurring_payments_percentage,defaultValue:null==l?void 0:l.business_recurring_payments_percentage,helpText:"For example: 50% monthly, 50% annual."})),s("div",{class:"col-12"},s("form-control-select",{name:"business_seasonal",label:"Is this business seasonal?",inputHandler:this.inputHandler,errorText:null===(n=this.errors)||void 0===n?void 0:n.business_seasonal,options:b,defaultValue:null==l?void 0:l.business_seasonal})),s("div",{class:"col-12"},s("form-control-text",{name:"business_other_payment_details",label:"Is there anything else you would like us to know about how your customers pay the business? (optional)",inputHandler:this.inputHandler,errorText:null===(a=this.errors)||void 0===a?void 0:a.business_other_payment_details,defaultValue:null==l?void 0:l.business_other_payment_details})))))}static get watchers(){return{additional_questions:["recurringPaymentsWatcher"]}}},q=(s,t)=>{const e=n({bank_name:_.required("Enter bank name"),nickname:x.required("Enter nickname"),account_owner_name:j.required("Enter account owner name"),account_type:S.required("Select account type"),account_number:T.required("Enter account number"),routing_number:O.required("Enter routing number"),voided_check:k(s,t),bank_statement:C(s,t)}),i=n({bank_name:_.nullable(),nickname:x.nullable(),account_owner_name:j.nullable(),account_type:S.nullable(),account_number:T.nullable(),routing_number:O.nullable(),voided_check:k(s,t),bank_statement:C(s,t)});return t?i:e},R=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.initializeFormController=()=>{this.formController=new o(q(this.existingDocuments,this.allowOptionalFields)),this.formController.setInitialValues(Object.assign({},this.bankAccount)),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new E({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.getData=()=>{this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.bank_accounts.length>0?this.bankAccount=new W(s.data.bank_accounts[0]):(this.bankAccount=new W({}),this.bankAccount.business_id=this.businessId),this.existingDocuments=s.data.documents},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.initializeFormController(),this.isLoading=!1}})},this.postDocumentRecordData=async s=>{this.isLoading=!0;const t=s.record_data;return new Promise((e=>{this.postDocumentRecord({payload:t,onSuccess:t=>{e(this.handleDocRecordResponse(s,t))},onError:({error:s,code:t,severity:i})=>{this.errorEvent.emit({message:s,errorCode:t,severity:i}),e(!1)}})}))},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:L.POST_ERROR,message:t.error.message,severity:H.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await fetch(s.presigned_url,{method:"PUT",body:s.fileString});return this.handleUploadResponse(t)},this.handleUploadResponse=s=>!s.error||(this.errorEvent.emit({errorCode:L.POST_ERROR,message:s.error.message,severity:H.ERROR,data:s.error}),!1),this.formController=void 0,this.errors={},this.bankAccount={},this.existingDocuments=[],this.documentData=new D,this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.postBankAccount=void 0,this.postDocumentRecord=void 0,this.allowOptionalFields=void 0}watchHandler(s){this.formLoading.emit(s)}async validateAndSubmit({onSuccess:s}){this.existingBankAccount?this.sendData(s):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(q(this.existingDocuments,this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}get postPayload(){return new W(this.formController.values.getValue()).payload}get existingBankAccount(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}async sendData(s){try{if(!this.existingBankAccount&&!await this.postBankAccountData())return;if(!await this.postBusinessDocuments())return;s()}catch(s){this.errorEvent.emit({message:s,errorCode:L.POST_ERROR,severity:H.ERROR})}}async postBankAccountData(){let s;return this.isLoading=!0,new Promise((t=>{let e=!1;this.postBankAccount({payload:this.postPayload,onSuccess:t=>{s=t,e=!0},onError:({error:s,code:t,severity:i})=>{e=!1,this.errorEvent.emit({message:s,errorCode:t,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:s,formStep:g.bankAccount}),this.isLoading=!1,t(e)}})}))}async postBusinessDocuments(){this.isLoading=!0;try{const s=Object.values(this.documentData).flat();return!s.length||!(await Promise.all(s.map((s=>this.postDocumentRecordData(s))))).includes(!1)&&!(await Promise.all(s.map((s=>this.uploadDocument(s))))).includes(!1)}finally{this.isLoading=!1}}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",{class:"mb-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Bank Account Info"),s("form-control-tooltip",{helpText:"This direct deposit account is the designated bank account where incoming funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),s("hr",{class:"mt-2"}),s("bank-account-form-inputs",{defaultValue:t,errors:this.errors,inputHandler:this.inputHandler,formDisabled:this.existingBankAccount})),s("fieldset",{class:"mt-4"},s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Document Uploads"),s("form-control-tooltip",{helpText:"These documents are required for underwriting purposes. Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."})),s("hr",{class:"mt-2"}),s("business-documents-on-file",{documents:this.existingDocuments,isLoading:this.isLoading}),s("bank-account-document-form-inputs",{inputHandler:this.inputHandler,errors:this.errors,storeFiles:this.storeFiles})))}static get watchers(){return{isLoading:["watchHandler"]}}},Y=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.coreInfo=new l(s.data),this.formController.setInitialValues(Object.assign({},this.coreInfo))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.businessInfo}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.coreInfo={},this.isLoading=!1,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return new l(this.formController.values.getValue()).payload}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(r(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){const t=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Business Information")),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"legal_name",label:"Business Name",defaultValue:t.legal_name,errorText:this.errors.legal_name,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (don't use acronyms or abbreviations unless you registered that way)."})),s("div",{class:"col-12"},s("form-control-text",{name:"doing_business_as",label:"Doing Business As (DBA)",defaultValue:t.doing_business_as,errorText:this.errors.doing_business_as,inputHandler:this.inputHandler,helpText:"Enter this exactly as it appears on your tax records (leave blank if you don't have a registered DBA/trade name)"})),s("div",{class:"col-12 col-md-8"},s("form-control-select",{name:"classification",label:"Business Classification",options:y,defaultValue:t.classification,errorText:this.errors.classification,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-4"},s("form-control-date",{name:"date_of_incorporation",label:"Date of Incorporation",defaultValue:t.date_of_incorporation,errorText:this.errors.date_of_incorporation,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"industry",label:"Industry",defaultValue:t.industry,errorText:this.errors.industry,inputHandler:this.inputHandler,helpText:"Describe what you sell"})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"tax_id",label:"Tax ID (EIN or SSN)",defaultValue:t.tax_id,errorText:this.errors.tax_id,inputHandler:this.inputHandler,keyDownHandler:V,maxLength:9,helpText:"Employer Identification Numbers (EINs) are nine digits. The federal tax identification number/EIN issued to you by the IRS. It can be found on your tax returns."})),s("div",{class:"col-12"},s("form-control-text",{name:"website_url",label:"Business Website URL",defaultValue:t.website_url,errorText:this.errors.website_url,inputHandler:this.inputHandler,helpText:"Don't have a live website? You can use your social media business page, app store link, or staging site URL."})),s("div",{class:"col-12 col-md-6"},s("form-control-text",{name:"email",label:"Business Email Address",defaultValue:t.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{class:"col-12 col-md-6"},s("form-control-number-masked",{name:"phone",label:"Business Phone Number",defaultValue:t.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:u.US})))))}},z=class{constructor(s){t(this,s),this.clickEvent=e(this,"click-event",7),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.matchRef=(s,t)=>{const e=this.refs.findIndex((s=>s===t));-1!==e&&(this.refs[e]=s)},this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{s.data.owners.length?this.ownersPayload=s.data.owners.map((s=>({id:s.id}))):this.addOwnerForm()},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1,this.manageRefs()}})},this.sendData=async s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:{owners:this.ownersPayload},onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.owners}),this.formLoading.emit(!1)}})},this.addOwnerForm=s=>{this.newFormOpen=!0,this.ownersPayload=[...this.ownersPayload,{id:""}],s&&this.clickEvent.emit({name:w.addOwnerForm})},this.removeOwnerForm=s=>{this.ownersPayload=this.ownersPayload.filter((t=>t.id!==s)),this.newFormOpen&&(this.newFormOpen=!1)},this.ownersPayload=[],this.refs=[],this.newFormOpen=void 0,this.isLoading=!1,this.authToken=void 0,this.businessId=void 0,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}get showAddOwnerButton(){return this.ownersPayload.length<4&&!this.newFormOpen}manageRefs(){this.refs=this.ownersPayload.map((s=>s.id))}async validateAndSubmit({onSuccess:s}){const t=this.refs.map((s=>s.validate()));if(!(await Promise.all(t)).every((s=>s)))return;const e=this.refs.map((s=>s.submit()));(await Promise.all(e)).every((s=>s))&&this.sendData(s)}componentWillLoad(){this.getBusiness&&this.getData()}ownersWatcher(){this.manageRefs()}handleOwnerSubmit(s){const t=s.detail,e=this.ownersPayload.map((s=>s.id===t.id?t:s));e.includes(t)||(e[this.ownersPayload.findIndex((s=>!s.id))]=t,this.newFormOpen&&(this.newFormOpen=!1)),this.ownersPayload=e}render(){return this.isLoading?s(N,null):s("div",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Owners"),s("form-control-tooltip",{helpText:"For partnerships, LLCs or privately held corporations, the business is required to apply with all individuals with 25% or more ownership to the application. For charities and registered non-profits, the business is required to apply with 1 individual with substantial control over the entity, such as a board member or director."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},this.ownersPayload.map((t=>s("justifi-owner-form",{key:t.id,authToken:this.authToken,businessId:this.businessId,ownerId:t.id,removeOwner:this.removeOwnerForm,newFormOpen:this.newFormOpen,ownersLength:this.ownersPayload.length,allowOptionalFields:this.allowOptionalFields,ref:s=>this.matchRef(s,t.id)})))),s("div",{class:"d-flex justify-content-start"},s("div",{class:"gap-2"},s(A,{variant:"primary",onClick:()=>this.addOwnerForm(!0),hidden:!this.showAddOwnerButton},"Add Owner"))))}static get watchers(){return{ownersPayload:["ownersWatcher"]}}},G=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.representative=new h(s.data.representative||{}),this.formController.setInitialValues(Object.assign({},this.representative))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.representative}),this.formLoading.emit(!1)}})},this.formController=void 0,this.errors={},this.representative={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{representative:new h(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(P("representative",this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){return this.isLoading?s(N,null):s("justifi-business-representative-form-inputs",{representativeDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController})}},J=class{constructor(s){t(this,s),this.stepCompleteEvent=e(this,"complete-form-step-event",7),this.errorEvent=e(this,"error-event",7),this.formLoading=e(this,"formLoading",7),this.getData=()=>{this.formLoading.emit(!0),this.isLoading=!0,this.getBusiness({onSuccess:s=>{this.legal_address=new c(s.data.legal_address||{}),this.formController.setInitialValues(Object.assign({},this.legal_address))},onError:({error:s,code:t,severity:e})=>{this.errorEvent.emit({message:s,errorCode:t,severity:e})},final:()=>{this.formLoading.emit(!1),this.isLoading=!1}})},this.sendData=s=>{let t;this.formLoading.emit(!0),this.patchBusiness({payload:this.patchPayload,onSuccess:e=>{t=e,s()},onError:({error:s,code:e,severity:i})=>{t=s,this.errorEvent.emit({message:s,errorCode:e,severity:i})},final:()=>{this.stepCompleteEvent.emit({response:t,formStep:g.legalAddress}),this.formLoading.emit(!1)}})},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.legal_address={},this.isLoading=!1,this.getBusiness=void 0,this.patchBusiness=void 0,this.allowOptionalFields=void 0}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get patchPayload(){return{legal_address:new c(this.formController.values.getValue()).payload}}componentWillLoad(){this.getBusiness&&this.getData(),this.formController=new o(B(this.allowOptionalFields))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){var t,e,i,r,o,n;const a=this.formController.getInitialValues();return this.isLoading?s(N,null):s("form",null,s("fieldset",null,s("div",{class:"d-flex align-items-center gap-2"},s("legend",{class:"mb-0",part:m},"Legal Address of your Business"),s("form-control-tooltip",{helpText:"No PO Boxes."})),s("hr",{class:"mt-2"}),s("div",{class:"row gy-3"},s("div",{class:"col-12"},s("form-control-text",{name:"line1",label:"Legal Address",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line1,errorText:null===(t=this.errors)||void 0===t?void 0:t.line1})),s("div",{class:"col-12"},s("form-control-text",{name:"line2",label:"Address Line 2 (optional)",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.line2,errorText:null===(e=this.errors)||void 0===e?void 0:e.line2})),s("div",{class:"col-12"},s("form-control-text",{name:"city",label:"City",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.city,errorText:null===(i=this.errors)||void 0===i?void 0:i.city})),s("div",{class:"col-12"},s("form-control-select",{name:"state",label:"State",options:I,inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.state,errorText:null===(r=this.errors)||void 0===r?void 0:r.state})),s("div",{class:"col-12"},s("form-control-text",{name:"postal_code",label:"Postal Code",inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.postal_code,errorText:null===(o=this.errors)||void 0===o?void 0:o.postal_code,maxLength:5,keyDownHandler:V})),s("div",{class:"col-12"},s("form-control-select",{name:"country",label:"Country",options:[{label:"United States",value:"USA"}],inputHandler:this.inputHandler,defaultValue:null==a?void 0:a.country,errorText:null===(n=this.errors)||void 0===n?void 0:n.country,disabled:!0})))))}};export{U as justifi_additional_questions_form_step_core,R as justifi_business_bank_account_form_step_core,Y as justifi_business_core_info_form_step_core,z as justifi_business_owners_form_step_core,G as justifi_business_representative_form_step_core,J as justifi_legal_address_form_step_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as t,h as r}from"./p-2783e363.js";import{A as o,c as
|
|
1
|
+
import{r as s,c as t,h as r}from"./p-2783e363.js";import{A as o,c as e}from"./p-4bad3621.js";import{C as i,a}from"./p-14c91ffd.js";import{g as n,a as h}from"./p-8115b2f4.js";import{E as c}from"./p-8f25f016.js";import{c as p,J as d}from"./p-933537ca.js";import"./p-d8c04275.js";import"./p-b2edb944.js";class m{async fetchGrossVolumeChartData(s,t){return o({authToken:t,apiOrigin:e.proxyApiOrigin}).get(`account/${s}/reports/gross_volume`)}}const u=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.accountId=void 0,this.authToken=void 0,this.getGrossPayment=void 0,this.errorMessage=null}componentWillLoad(){p(),this.analytics=new d(this),this.initializeGetGrossPayment()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:e})=>{var a;try{const c=await r.fetchGrossVolumeChartData(s,t);c.error?e({error:n(c.error),code:h(null===(a=c.error)||void 0===a?void 0:a.code),severity:i.ERROR}):o(c.data)}catch(s){const t=h(null==s?void 0:s.code);e({error:n(s),code:t,severity:i.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new m}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}render(){return this.errorMessage?c(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_gross_payment_chart}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as s}from"./p-2783e363.js";import{e as i,f as r,g as a}from"./p-f2f2e20e.js";import{I as o}from"./p-35b00a0d.js";import{F as d}from"./p-5844a0f0.js";import{O as h}from"./p-275f2154.js";import{i as c}from"./p-
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-2783e363.js";import{e as i,f as r,g as a}from"./p-f2f2e20e.js";import{I as o}from"./p-35b00a0d.js";import{F as d}from"./p-5844a0f0.js";import{O as h}from"./p-275f2154.js";import{i as c}from"./p-849c68e5.js";import{B as n}from"./p-298e290e.js";import{L as f}from"./p-d8c04275.js";import{B as l}from"./p-73f9be7c.js";import{S as b,P as m}from"./p-525db3e8.js";import{u,a as p,b as y}from"./p-7d85af5c.js";import"./p-14c91ffd.js";import"./p-8115b2f4.js";import"./p-4bad3621.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-27c8ffa2.js";import"./p-0ea387a2.js";import"./p-61f0a2ce.js";const v=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.getOwner=void 0,this.patchOwner=void 0,this.postOwner=void 0,this.authToken=void 0,this.ownerId=void 0,this.businessId=void 0,this.allowOptionalFields=void 0,this.removeOwner=void 0,this.newFormOpen=void 0,this.ownersLength=void 0}async validate(){return this.coreComponent.validate()}async submit(){return this.coreComponent.submit()}async validateAndSubmit({onSuccess:e}){this.coreComponent.validateAndSubmit({onSuccess:e})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&(this.getOwner=i({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.patchOwner=r({authToken:this.authToken,identityId:this.ownerId,service:new o}),this.postOwner=a({authToken:this.authToken,service:new o}))}render(){return s("owner-form-core",{key:"9d1b43ef74d1e2d33cc3145c152564eb297b3cee",ownerId:this.ownerId,businessId:this.businessId,getOwner:this.getOwner,patchOwner:this.patchOwner,postOwner:this.postOwner,allowOptionalFields:this.allowOptionalFields,removeOwner:this.removeOwner,newFormOpen:this.newFormOpen,ownersLength:this.ownersLength,ref:e=>this.coreComponent=e})}},k=class{loadingWatcher(){this.formLoading.emit(this.isLoading)}constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.formLoading=t(this,"formLoading",7),this.ownerSubmitted=t(this,"ownerSubmitted",7),this.getData=()=>{this.isLoading=!0,this.getOwner({onSuccess:e=>{this.instantiateOwner(e.data)},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({message:e,errorCode:t,severity:s})},final:()=>this.isLoading=!1})},this.sendData=()=>(this.isLoading=!0,new Promise((e=>{this.ownerId?this.patchOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1}):this.postOwner({payload:this.payload,onSuccess:t=>{this.ownerSubmitted.emit({id:t.data.id}),this.instantiateOwner(t.data),e(!0)},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({message:t,errorCode:s,severity:i}),e(!1)},final:()=>this.isLoading=!1})}))),this.instantiateOwner=async e=>{this.owner=Object.assign({},new h(e)),await this.formController.setInitialValues(this.owner)},this.handleAddOwner=()=>{this.clickEvent.emit({name:this.ownerId?l.updateOwner:l.addOwner})},this.handleRemoveOwner=()=>{this.removeOwner(this.ownerId),this.clickEvent.emit({name:l.removeOwner})},this.isLoading=!1,this.formController=void 0,this.errors={},this.owner={},this.ownerId=void 0,this.businessId=void 0,this.getOwner=void 0,this.patchOwner=void 0,this.postOwner=void 0,this.allowOptionalFields=void 0,this.removeOwner=void 0,this.newFormOpen=void 0,this.ownersLength=void 0,this.validate=this.validate.bind(this),this.submit=this.submit.bind(this),this.validateAndSubmit=this.validateAndSubmit.bind(this)}async returnOwnerData(){return this.ownerId}async validate(){return this.formController.validate()}async submit(){if(await this.validate())return this.sendData()}async validateAndSubmit(e){e.preventDefault(),await this.validate()&&this.submit()}get payload(){let e=new h(this.formController.values.getValue()).payload;return this.ownerId?e:Object.assign(Object.assign({},e),{business_id:this.businessId})}get formTitle(){return this.ownerId?"Edit Business Owner":"Add Business Owner"}get submitButtonText(){return this.ownerId?"Update":"Add"}get showRemoveButton(){return!(this.ownersLength<=1)&&(!(this.ownerId||!this.newFormOpen)||!(!this.ownerId||this.newFormOpen)||void 0)}componentWillLoad(){this.formController=new d(c("owner",this.allowOptionalFields)),this.ownerId?this.getData():this.instantiateOwner({})}componentDidLoad(){this.formController.errors.subscribe((e=>this.errors=Object.assign({},e)))}render(){return s("form",{key:"b7fc4c0d0fdf3a5aab0a246daffa59022255e6ae",onSubmit:this.validateAndSubmit},s("fieldset",{key:"eee56a5e2e26184086c1301576695b627a1f2ef4"},s("legend",{key:"b3f75638a502cca01da0ed54ec07660554dcd416",class:"fw-semibold fs-5",part:f},this.formTitle),s("br",{key:"0bc020cc7290615db3d3e1ec2b84d5af99ec86f0"}),s("div",{key:"2e7a09c9f4dffac21f2b3e1efe118542f18d89e8",class:"row gy-3"},s("owner-form-inputs",{key:"78ffd296d4ecf0d5f2e50a06fb392cbefb1c9dc7",ownerDefaultValue:this.formController.getInitialValues(),errors:this.errors,formController:this.formController}),s("div",{key:"73256017645b6987cd96006e5fe080402b0602d2",class:"d-flex gap-2 justify-content-start"},s(n,{key:"e2c288cf27ebc2d4dd9c29b2a2ed8e409d0c7564",variant:"secondary",type:"button",onClick:this.handleRemoveOwner,hidden:!this.showRemoveButton},"Remove"),s(n,{key:"d3d604b4416c8196181ec4fd34b254a0909b2aff",variant:"primary",type:"submit",onClick:this.handleAddOwner,disabled:this.isLoading},this.submitButtonText))),s("hr",{key:"4ad0047c67825990c1e4c02d377901d11a7937fa"})))}static get watchers(){return{isLoading:["loadingWatcher"]}}},w=class{constructor(t){e(this,t),this.inputHandler=(e,t)=>{u(this.formController,{[e]:t})},this.onAddressFormUpdate=e=>{p(this.formController,Object.assign(Object.assign({},this.formController.values.getValue().address),e))},this.ownerDefaultValue=void 0,this.errors=void 0,this.formController=void 0}render(){return s("div",{key:"f54192149ae925bcd08b8408816fc41295ef00f4",class:"row gy-3"},s("div",{key:"1f70faf2c08ebf277b465cb1532276f7525aa47f",class:"col-12 col-md-8"},s("form-control-text",{key:"7bae6e4b330cbea14e0be40d1b35e804d62f5323",name:"name",label:"Full Name",defaultValue:this.ownerDefaultValue.name,errorText:this.errors.name,inputHandler:this.inputHandler})),s("div",{key:"84cbbbf7cfb0e3c41c37b1194292dcb1f191298e",class:"col-12 col-md-4"},s("form-control-text",{key:"c106ea1b06e69d4b4fe3647cd2d0289185fae2e9",name:"title",label:"Title",defaultValue:this.ownerDefaultValue.title,errorText:this.errors.title,inputHandler:this.inputHandler,helpText:"Role at your business, e.g. President, CEO, Treasurer."})),s("div",{key:"8040bd2c6f6d67763578117c9a46e8e82aa18abf",class:"col-12 col-md-6"},s("form-control-text",{key:"48aea09125f010bc799dc8d0e909f83c33972c3a",name:"email",label:"Email Address",defaultValue:this.ownerDefaultValue.email,errorText:this.errors.email,inputHandler:this.inputHandler})),s("div",{key:"00195bf163c16d8052c97de866bda7ac610cb959",class:"col-12 col-md-6"},s("form-control-number-masked",{key:"d02770dcabfc707691ce4262cbca00d30b78a211",name:"phone",label:"Phone Number",defaultValue:this.ownerDefaultValue.phone,errorText:this.errors.phone,inputHandler:this.inputHandler,mask:m.US})),s("div",{key:"c86d87082365b5daebce40e69f98a8813198eefd",class:"col-12 col-md-4"},s("form-control-date",{key:"cd2cfaf3c8a6fbb28719cb85ad4b3954ac2ff059",name:"dob_full",label:"Birth Date",defaultValue:this.ownerDefaultValue.dob_full,errorText:this.errors.dob_full,inputHandler:this.inputHandler,onFormControlInput:e=>y(e,this.formController),helpText:"Must be 18 or older."})),s("div",{key:"f77e5943b8e04dc20cf9c126f6ad8ee67e27ac12",class:"col-12 col-md-8"},s("form-control-number-masked",{key:"3828035484d53d7267c7ce1686658eaba2495147",name:"identification_number",label:"SSN",defaultValue:this.ownerDefaultValue.identification_number,errorText:this.errors.identification_number,inputHandler:this.inputHandler,mask:b,helpText:"Enter your full Social Security Number. It is required for Federal OFAC check."})),s("div",{key:"4a67ced4d2a6f2be7f437e59a119ab97ec8c3ffc",class:"col-12"},s("justifi-identity-address-form",{key:"e4fbe8bbd642d623f306236b83be7800db619506",errors:this.errors.address,defaultValues:this.ownerDefaultValue.address,handleFormUpdate:this.onAddressFormUpdate})))}};export{v as justifi_owner_form,k as owner_form_core,w as owner_form_inputs}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as a}from"./p-5844a0f0.js";import{S as t}from"./p-6078a370.js";import{b as s,a as r,r as n,s as c,c as i}from"./p-0ea387a2.js";import{E as l}from"./p-61f0a2ce.js";const o=e=>""===e?null:e,u=/^\d+$/,m=/P\.?\s?O\.?\s?Box|Postal\sBox/i,d=e().email("Enter valid email").transform(o),b=e().matches(/^\d{10}$/,"Enter valid phone number").transform(o),h=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),p=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),v=e().matches(/^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/,"Enter valid website url").transform(o),E=e().oneOf(s.map((e=>e.value)),"Select business classification").transform(o),S=e().min(2,"Industry must be at least 2 characters").max(50,"Industry must be less than 50 characters").transform(o),N=e().matches(u,"Enter valid tax id, SSN, or EIN").test("not-repeat","Enter valid tax id, SSN, or EIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid tax id, SSN, or EIN",(e=>"123456789"!==e)).transform(o),f=e().test("not-future","Date of incorporation cannot be in the future",(e=>new Date(e)<=new Date)).transform(o),g=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),w=e().min(2,"Title must be at least 2 characters").max(50,"Title must be less than 50 characters").transform(o),y=a=>e().test("min","Enter a valid date",(e=>new Date(e)>=new Date("1902-01-01"))).test("age",`${a} must be at least 18 years old`,(e=>{const a=new Date(e),t=new Date;return t.setFullYear(t.getFullYear()-18),a<=t})).transform(o),x=e().matches(/^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/,"Enter valid SSN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SSN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SSN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SSN",(e=>"123456789"!==e)).transform(o),A=e().min(5,"Address must be at least 5 characters").max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),$=e().max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),D=e().min(2,"City must be at least 2 characters").max(50,"City must be less than 50 characters").transform(o),P=e().oneOf(t.map((e=>e.value)),"Select state").transform(o),j=e().matches(/^[0-9]{5}$/,"Enter valid postal code").transform(o),B=e().matches(u,"Enter valid revenue").transform(o),I=e().matches(u,"Enter valid payment volume").transform(o),_=e().oneOf(r.map((e=>e.value)),"Select when service is received").transform(o),z=e().oneOf(n.map((e=>e.value)),"Select recurring payments").transform(o),q=e().when("business_recurring_payments",{is:e=>"Yes"===e,then:e=>e.required("Enter recurring payments percentage"),otherwise:e=>e.nullable()}).transform(o),C=e().oneOf(c.map((e=>e.value)),"Select seasonal business").transform(o),O=e().transform(o),T=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),Z=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),k=e().oneOf(i.map((e=>e.value)),"Select account type").transform(o),F=e().min(
|
|
1
|
+
import{a as e,b as a}from"./p-5844a0f0.js";import{S as t}from"./p-6078a370.js";import{b as s,a as r,r as n,s as c,c as i}from"./p-0ea387a2.js";import{E as l}from"./p-61f0a2ce.js";const o=e=>""===e?null:e,u=/^\d+$/,m=/P\.?\s?O\.?\s?Box|Postal\sBox/i,d=e().email("Enter valid email").transform(o),b=e().matches(/^\d{10}$/,"Enter valid phone number").transform(o),h=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),p=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),v=e().matches(/^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/,"Enter valid website url").transform(o),E=e().oneOf(s.map((e=>e.value)),"Select business classification").transform(o),S=e().min(2,"Industry must be at least 2 characters").max(50,"Industry must be less than 50 characters").transform(o),N=e().matches(u,"Enter valid tax id, SSN, or EIN").test("not-repeat","Enter valid tax id, SSN, or EIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid tax id, SSN, or EIN",(e=>"123456789"!==e)).transform(o),f=e().test("not-future","Date of incorporation cannot be in the future",(e=>new Date(e)<=new Date)).transform(o),g=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").transform(o),w=e().min(2,"Title must be at least 2 characters").max(50,"Title must be less than 50 characters").transform(o),y=a=>e().test("min","Enter a valid date",(e=>new Date(e)>=new Date("1902-01-01"))).test("age",`${a} must be at least 18 years old`,(e=>{const a=new Date(e),t=new Date;return t.setFullYear(t.getFullYear()-18),a<=t})).transform(o),x=e().matches(/^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/,"Enter valid SSN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SSN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SSN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SSN",(e=>"123456789"!==e)).transform(o),A=e().min(5,"Address must be at least 5 characters").max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),$=e().max(100,"Address must be less than 100 characters").test("not-po-box","A PO Box is not a valid address entry",(e=>!m.test(e))).transform(o),D=e().min(2,"City must be at least 2 characters").max(50,"City must be less than 50 characters").transform(o),P=e().oneOf(t.map((e=>e.value)),"Select state").transform(o),j=e().matches(/^[0-9]{5}$/,"Enter valid postal code").transform(o),B=e().matches(u,"Enter valid revenue").transform(o),I=e().matches(u,"Enter valid payment volume").transform(o),_=e().oneOf(r.map((e=>e.value)),"Select when service is received").transform(o),z=e().oneOf(n.map((e=>e.value)),"Select recurring payments").transform(o),q=e().when("business_recurring_payments",{is:e=>"Yes"===e,then:e=>e.required("Enter recurring payments percentage"),otherwise:e=>e.nullable()}).transform(o),C=e().oneOf(c.map((e=>e.value)),"Select seasonal business").transform(o),O=e().transform(o),T=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),Z=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").transform(o),k=e().oneOf(i.map((e=>e.value)),"Select account type").transform(o),F=e().min(4,"Account number must be at least 4 digits").max(17,"Account number must be less than 17 digits").matches(u,"Enter valid account number").test("not-repeat","Enter valid account number",(e=>!/^(\d)\1+$/.test(e))).transform(o),R=e().length(9,"Routing number must be 9 digits").matches(u,"Enter valid routing number").test("not-repeat","Enter valid routing number",(e=>!/^(\d)\1+$/.test(e))).test("valid","Enter valid routing number",(e=>(e=>{if(!e)return!1;const a=Array.from(String(e),Number);return 9===a.length&&0==(3*(a[0]+a[3]+a[6])+7*(a[1]+a[4]+a[7])+(a[2]+a[5]+a[8]))%10})(e))).transform(o),Y=a(),G=(e,a)=>e.some((e=>e.document_type===l.voidedCheck))||a?Y.nullable():Y.required("Please select one or more files"),H=(e,a)=>e.some((e=>e.document_type===l.bankStatement))||a?Y.nullable():Y.required("Please select one or more files");export{Z as A,k as B,F as C,R as D,G as E,H as F,E as a,h as b,f as c,p as d,d as e,I as f,_ as g,z as h,S as i,q as j,$ as k,A as l,D as m,P as n,O as o,b as p,j as q,B as r,C as s,N as t,g as u,w as v,v as w,y as x,x as y,T as z}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-2783e363.js";import{m as o,P as
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-2783e363.js";import{m as o,P as e}from"./p-dd867d1f.js";import{C as r,a}from"./p-14c91ffd.js";import"./p-7c31ec70.js";import"./p-56f6ce4c.js";import"./p-9894484a.js";import{P as p}from"./p-01d4e35a.js";import"./p-61f0a2ce.js";import{g as h,a as d}from"./p-8115b2f4.js";import{E as c}from"./p-8f25f016.js";import{c as n,J as m}from"./p-933537ca.js";import"./p-4bad3621.js";import"./p-2ca5b5e4.js";import"./p-abdbcd8e.js";import"./p-d8c04275.js";import"./p-b2edb944.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.payoutId=void 0,this.authToken=void 0,this.getPayout=void 0,this.getPayoutCSV=void 0,this.errorMessage=null}componentWillLoad(){n(),this.analytics=new m(this),this.initializeServices()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:o,onError:e})=>{var a;try{const c=await i.fetchPayout(t,s);c.error?e({error:h(c.error),code:d(null===(a=c.error)||void 0===a?void 0:a.code),severity:r.ERROR}):o(new p(c.data))}catch(t){e({error:h(t),code:d(null==t?void 0:t.code),severity:r.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new e}),this.getPayoutCSV=o({authToken:this.authToken,service:new e})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?c(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payout_details}
|