@justifi/webcomponents 5.7.6-rc-21 → 6.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{check-pkg-version-BzCIWkkG.js → check-pkg-version-D_lazhBQ.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout-summary_6.cjs.entry.js +13 -21
- 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-order-terminals.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-payment-transactions-list.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-payout-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/{package-B9ks67gS.js → package-Cp_7Ls2E.js} +1 -1
- package/dist/collection/components/modular-checkout/modular-checkout.js +11 -19
- package/dist/docs.json +1 -1
- package/dist/esm/{check-pkg-version-D3fhoIFS.js → check-pkg-version-Bb69ihTN.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-checkout-summary_6.entry.js +13 -21
- 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-order-terminals.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-payment-transactions-list.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-payout-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-refund-payment.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +2 -2
- package/dist/esm/{package-wutYt_7D.js → package-O3LY2Da6.js} +1 -1
- package/dist/module/modular-checkout.js +11 -19
- package/dist/module/package.js +1 -1
- package/dist/types/components/modular-checkout/modular-checkout.d.ts +1 -1
- package/dist/webcomponents/p-0dcc83ac.entry.js +1 -0
- package/dist/webcomponents/{p-f2149974.entry.js → p-131d799c.entry.js} +1 -1
- package/dist/webcomponents/{p-cb0effeb.entry.js → p-1bdce018.entry.js} +1 -1
- package/dist/webcomponents/{p-2ec9f293.entry.js → p-1d53f0b8.entry.js} +1 -1
- package/dist/webcomponents/{p-b107ad76.entry.js → p-1f8cd44e.entry.js} +1 -1
- package/dist/webcomponents/{p-a357be7d.entry.js → p-2f31a4e5.entry.js} +1 -1
- package/dist/webcomponents/{p-39b79825.entry.js → p-3a4ca4df.entry.js} +1 -1
- package/dist/webcomponents/{p-9bb8bebf.entry.js → p-57802e57.entry.js} +1 -1
- package/dist/webcomponents/{p-7ef0b68d.entry.js → p-6849bf8e.entry.js} +1 -1
- package/dist/webcomponents/{p-2a3d5af2.entry.js → p-7322c86e.entry.js} +1 -1
- package/dist/webcomponents/{p-6f847539.entry.js → p-828a61b9.entry.js} +1 -1
- package/dist/webcomponents/{p-3095775c.entry.js → p-9106fd74.entry.js} +1 -1
- package/dist/webcomponents/{p-CEsXw0Ph.js → p-BNz6wy4f.js} +1 -1
- package/dist/webcomponents/p-O3LY2Da6.js +1 -0
- package/dist/webcomponents/{p-5b09c0d8.entry.js → p-ae4297dd.entry.js} +1 -1
- package/dist/webcomponents/{p-e2174f21.entry.js → p-bea4309d.entry.js} +1 -1
- package/dist/webcomponents/{p-b504a22b.entry.js → p-c3a2c619.entry.js} +1 -1
- package/dist/webcomponents/{p-cfca1837.entry.js → p-cebe360b.entry.js} +1 -1
- package/dist/webcomponents/p-dd257e60.entry.js +1 -0
- package/dist/webcomponents/{p-bdb56836.entry.js → p-dd689b5e.entry.js} +1 -1
- package/dist/webcomponents/{p-596b2653.entry.js → p-dfd7c212.entry.js} +1 -1
- package/dist/webcomponents/{p-b6f55d70.entry.js → p-f01953ea.entry.js} +1 -1
- package/dist/webcomponents/{p-e57263b7.entry.js → p-f3a757b2.entry.js} +1 -1
- package/dist/webcomponents/{p-7d944f7e.entry.js → p-f47095cd.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-7721a457.entry.js +0 -1
- package/dist/webcomponents/p-a3d005dc.entry.js +0 -1
- package/dist/webcomponents/p-wutYt_7D.js +0 -1
|
@@ -7,7 +7,7 @@ import './event-types-CZfYo5-1.js';
|
|
|
7
7
|
import { H as Header1 } from './header-1-E-hEi3wF.js';
|
|
8
8
|
import { H as Header2, b as insuranceValuesOn, h as hasInsuranceValueChanged, i as insuranceValues } from './insurance-state-CB4l8sOv.js';
|
|
9
9
|
import { H as Header3 } from './header-3-Dm7M85kz.js';
|
|
10
|
-
import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-
|
|
10
|
+
import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-Bb69ihTN.js';
|
|
11
11
|
import './config-state-BrllxiM0.js';
|
|
12
12
|
import './dinero-HXpYMWUU.js';
|
|
13
13
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes, b as ComponentErrorMessages } from './ComponentError-Cjcsf8ku.js';
|
|
@@ -19,7 +19,7 @@ import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
|
19
19
|
import { C as CheckoutService } from './checkout.service-XgGFa7H8.js';
|
|
20
20
|
import { C as CardBrandLabels } from './payment-method-option-utils-lUHAQVFl.js';
|
|
21
21
|
import './index-B9me4yN2.js';
|
|
22
|
-
import './package-
|
|
22
|
+
import './package-O3LY2Da6.js';
|
|
23
23
|
import './Api-N_veT2p6.js';
|
|
24
24
|
import './helpers-Mu7LQT-w.js';
|
|
25
25
|
import './state-options-BX8GieXu.js';
|
|
@@ -212,13 +212,13 @@ const ModularCheckout = class {
|
|
|
212
212
|
}
|
|
213
213
|
queryFormRefs() {
|
|
214
214
|
this.paymentMethodFormRef = this.hostEl.querySelector('justifi-card-form, justifi-bank-account-form');
|
|
215
|
-
this.
|
|
215
|
+
this.billingFormRef = this.hostEl.querySelector('justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full');
|
|
216
216
|
this.insuranceFormRef = this.hostEl.querySelector('justifi-season-interruption-insurance');
|
|
217
217
|
this.sezzlePaymentMethodRef = this.hostEl.querySelector('justifi-sezzle-payment-method');
|
|
218
218
|
}
|
|
219
219
|
async tokenizePaymentMethod(tokenizeArgs) {
|
|
220
220
|
var _a, _b, _c;
|
|
221
|
-
const billingInfoValues = (_b = await ((_a = this.
|
|
221
|
+
const billingInfoValues = (_b = await ((_a = this.billingFormRef) === null || _a === void 0 ? void 0 : _a.getValues())) !== null && _b !== void 0 ? _b : {};
|
|
222
222
|
const combinedBillingInfo = Object.assign(Object.assign({}, tokenizeArgs), billingInfoValues);
|
|
223
223
|
const paymentMethodMetadata = Object.assign({ accountId: checkoutStore.accountId, payment_method_group_id: undefined }, combinedBillingInfo);
|
|
224
224
|
if (checkoutStore.savePaymentMethod) {
|
|
@@ -251,28 +251,20 @@ const ModularCheckout = class {
|
|
|
251
251
|
return token;
|
|
252
252
|
}
|
|
253
253
|
async validate() {
|
|
254
|
-
var _a;
|
|
254
|
+
var _a, _b;
|
|
255
|
+
console.log('billing information form', this.billingFormRef);
|
|
256
|
+
console.log('payment method form', this.paymentMethodFormRef);
|
|
257
|
+
console.log('insurance form', this.insuranceFormRef);
|
|
258
|
+
console.log('sezzle payment method', this.sezzlePaymentMethodRef);
|
|
255
259
|
const promises = [
|
|
256
|
-
(_a = this.
|
|
260
|
+
(_a = this.paymentMethodFormRef) === null || _a === void 0 ? void 0 : _a.validate(),
|
|
261
|
+
(_b = this.billingFormRef) === null || _b === void 0 ? void 0 : _b.validate()
|
|
257
262
|
];
|
|
258
|
-
// Only validate payment method form if we don't have a payment token from tokenize-payment-method
|
|
259
|
-
if (!checkoutStore.paymentToken && this.paymentMethodFormRef) {
|
|
260
|
-
promises.push(this.paymentMethodFormRef.validate());
|
|
261
|
-
}
|
|
262
263
|
if (this.insuranceFormRef) {
|
|
263
264
|
promises.push(this.insuranceFormRef.validate());
|
|
264
265
|
}
|
|
265
266
|
const validationResults = await Promise.all(promises);
|
|
266
|
-
return validationResults.every(result =>
|
|
267
|
-
// Handle different return types from different form components
|
|
268
|
-
if (typeof result === 'boolean') {
|
|
269
|
-
return result;
|
|
270
|
-
}
|
|
271
|
-
if (result && typeof result === 'object' && 'isValid' in result) {
|
|
272
|
-
return result.isValid;
|
|
273
|
-
}
|
|
274
|
-
return result !== false;
|
|
275
|
-
});
|
|
267
|
+
return validationResults.every(result => (result === null || result === void 0 ? void 0 : result.isValid) !== false);
|
|
276
268
|
}
|
|
277
269
|
async submitCheckout(submitCheckoutArgs) {
|
|
278
270
|
var _a;
|
|
@@ -340,7 +332,7 @@ const ModularCheckout = class {
|
|
|
340
332
|
checkoutStore.selectedPaymentMethod = paymentMethodId;
|
|
341
333
|
}
|
|
342
334
|
render() {
|
|
343
|
-
return (h(Host, { key: '
|
|
335
|
+
return (h(Host, { key: 'd454d321b1a7a6e3b4097c94fbb05e02ce3e36a9' }));
|
|
344
336
|
}
|
|
345
337
|
get hostEl() { return getElement(this); }
|
|
346
338
|
static get watchers() { return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
|
|
2
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
2
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
3
3
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
4
4
|
import { c as checkoutStore } from './checkout.store-B60siz2l.js';
|
|
5
5
|
import { d as checkoutSummary } from './parts-CfF8KKwx.js';
|
|
6
6
|
import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
7
7
|
import './event-types-CZfYo5-1.js';
|
|
8
|
-
import './package-
|
|
8
|
+
import './package-O3LY2Da6.js';
|
|
9
9
|
import './Api-N_veT2p6.js';
|
|
10
10
|
import './config-state-BrllxiM0.js';
|
|
11
11
|
import './index-B9me4yN2.js';
|
|
@@ -7,7 +7,7 @@ import './Pagination-CLHwhyvu.js';
|
|
|
7
7
|
import './Business-BCoP0TAV.js';
|
|
8
8
|
import './Dispute-BH0Xfn-F.js';
|
|
9
9
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
10
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
10
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
11
11
|
import { C as CheckoutService } from './checkout.service-XgGFa7H8.js';
|
|
12
12
|
import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccounts-BsoVLANw.js';
|
|
13
13
|
import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
@@ -17,7 +17,7 @@ import './index-B9me4yN2.js';
|
|
|
17
17
|
import './utils-lb8p1Exq.js';
|
|
18
18
|
import './helpers-Mu7LQT-w.js';
|
|
19
19
|
import './state-options-BX8GieXu.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-O3LY2Da6.js';
|
|
21
21
|
import './Api-N_veT2p6.js';
|
|
22
22
|
import './badge-D_mzXSCQ.js';
|
|
23
23
|
import './parts-CfF8KKwx.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
|
|
2
2
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
3
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
3
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
4
4
|
import { D as Dispute } from './Dispute-BH0Xfn-F.js';
|
|
5
5
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
6
6
|
import { D as DisputeService } from './dispute.service-CKPcmwhH.js';
|
|
7
|
-
import './package-
|
|
7
|
+
import './package-O3LY2Da6.js';
|
|
8
8
|
import './Api-N_veT2p6.js';
|
|
9
9
|
import './config-state-BrllxiM0.js';
|
|
10
10
|
import './index-B9me4yN2.js';
|
|
@@ -9,7 +9,7 @@ import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './Compone
|
|
|
9
9
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
10
10
|
import { D as DisputeService } from './dispute.service-CKPcmwhH.js';
|
|
11
11
|
import { D as DisputeManagementClickActions } from './event-types-Bg2SZArf.js';
|
|
12
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
12
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
13
13
|
import './dinero-HXpYMWUU.js';
|
|
14
14
|
import './Api-N_veT2p6.js';
|
|
15
15
|
import './config-state-BrllxiM0.js';
|
|
@@ -20,7 +20,7 @@ import './Pagination-CLHwhyvu.js';
|
|
|
20
20
|
import './Business-BCoP0TAV.js';
|
|
21
21
|
import './helpers-Mu7LQT-w.js';
|
|
22
22
|
import './state-options-BX8GieXu.js';
|
|
23
|
-
import './package-
|
|
23
|
+
import './package-O3LY2Da6.js';
|
|
24
24
|
|
|
25
25
|
const makeUpdateDisputeResponse = ({ authToken, disputeId, service }) => async ({ payload, onSuccess, onError, final = () => { } }) => {
|
|
26
26
|
var _a;
|
|
@@ -7,7 +7,7 @@ import './Business-BCoP0TAV.js';
|
|
|
7
7
|
import './Dispute-BH0Xfn-F.js';
|
|
8
8
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
9
9
|
import { E as ErrorState } from './utils-kWaZhFAd.js';
|
|
10
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
10
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
11
11
|
import './config-state-BrllxiM0.js';
|
|
12
12
|
import './index-B9me4yN2.js';
|
|
13
13
|
import './utils-lb8p1Exq.js';
|
|
@@ -15,7 +15,7 @@ import './dinero-HXpYMWUU.js';
|
|
|
15
15
|
import './helpers-Mu7LQT-w.js';
|
|
16
16
|
import './state-options-BX8GieXu.js';
|
|
17
17
|
import './parts-CfF8KKwx.js';
|
|
18
|
-
import './package-
|
|
18
|
+
import './package-O3LY2Da6.js';
|
|
19
19
|
|
|
20
20
|
const api = Api();
|
|
21
21
|
class ReportsService {
|
|
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent } from './index-kpoIU4v_.js'
|
|
|
2
2
|
import { al as heading5, ai as heading4, ae as buttonPrimary, D as text } from './parts-CfF8KKwx.js';
|
|
3
3
|
import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
4
4
|
import './event-types-CZfYo5-1.js';
|
|
5
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
5
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
6
6
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
7
7
|
import { B as BusinessService } from './business.service-Bdvhdc_d.js';
|
|
8
8
|
import { B as Business } from './Business-BCoP0TAV.js';
|
|
@@ -16,7 +16,7 @@ import './Dispute-BH0Xfn-F.js';
|
|
|
16
16
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
17
17
|
import { T as TerminalService } from './terminal.service-DmYCUQcA.js';
|
|
18
18
|
import { j as formatPhoneNumber } from './utils-lb8p1Exq.js';
|
|
19
|
-
import './package-
|
|
19
|
+
import './package-O3LY2Da6.js';
|
|
20
20
|
import './Api-N_veT2p6.js';
|
|
21
21
|
import './helpers-Mu7LQT-w.js';
|
|
22
22
|
import './state-options-BX8GieXu.js';
|
|
@@ -3,7 +3,7 @@ import { P as PaymentService } from './payment.service-BWO84KlP.js';
|
|
|
3
3
|
import { m as makeGetPaymentDetails } from './get-payment-details-Dt-dr16k.js';
|
|
4
4
|
import { E as ErrorState } from './utils-kWaZhFAd.js';
|
|
5
5
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
6
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
6
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
7
7
|
import './Api-N_veT2p6.js';
|
|
8
8
|
import './config-state-BrllxiM0.js';
|
|
9
9
|
import './index-B9me4yN2.js';
|
|
@@ -17,7 +17,7 @@ import './helpers-Mu7LQT-w.js';
|
|
|
17
17
|
import './state-options-BX8GieXu.js';
|
|
18
18
|
import './utils-BeQLScSm.js';
|
|
19
19
|
import './parts-CfF8KKwx.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-O3LY2Da6.js';
|
|
21
21
|
|
|
22
22
|
const PaymentDetails = class {
|
|
23
23
|
constructor(hostRef) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
|
|
2
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
2
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
3
3
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
4
4
|
import { m as makeGetBusiness, a as makePostProvisioning } from './payment-provisioning-actions-ONP8lDnV.js';
|
|
5
5
|
import { B as BusinessService } from './business.service-Bdvhdc_d.js';
|
|
@@ -8,7 +8,7 @@ import './Refund-Di6J0oN2.js';
|
|
|
8
8
|
import './Pagination-CLHwhyvu.js';
|
|
9
9
|
import './Business-BCoP0TAV.js';
|
|
10
10
|
import './Dispute-BH0Xfn-F.js';
|
|
11
|
-
import './package-
|
|
11
|
+
import './package-O3LY2Da6.js';
|
|
12
12
|
import './utils-BeQLScSm.js';
|
|
13
13
|
import './config-state-BrllxiM0.js';
|
|
14
14
|
import './index-B9me4yN2.js';
|
|
@@ -6,7 +6,7 @@ import { f as PaymentBalanceTransaction } from './Refund-Di6J0oN2.js';
|
|
|
6
6
|
import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
|
|
7
7
|
import './Business-BCoP0TAV.js';
|
|
8
8
|
import './Dispute-BH0Xfn-F.js';
|
|
9
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
9
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
11
|
import { P as PaymentService } from './payment.service-BWO84KlP.js';
|
|
12
12
|
import { T as Table, l as TableWrapper, a as TableComponent, b as TableHead, c as TableHeadRow, d as TableBody, e as TableLoadingState, f as TableEmptyState, g as TableErrorState, h as TableRow, i as TableFoot, j as TableFootRow, k as TableFootCell } from './table-qqt2Ew5y.js';
|
|
@@ -17,7 +17,7 @@ import { R as tableHeadCell, S as getAlternateTableCellPart } from './parts-CfF8
|
|
|
17
17
|
import './index-B9me4yN2.js';
|
|
18
18
|
import './helpers-Mu7LQT-w.js';
|
|
19
19
|
import './state-options-BX8GieXu.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-O3LY2Da6.js';
|
|
21
21
|
import './Api-N_veT2p6.js';
|
|
22
22
|
import './spinner-XBq6mVJW.js';
|
|
23
23
|
|
|
@@ -8,7 +8,7 @@ import './Pagination-CLHwhyvu.js';
|
|
|
8
8
|
import './Business-BCoP0TAV.js';
|
|
9
9
|
import './Dispute-BH0Xfn-F.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
11
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
12
12
|
import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
13
13
|
import './event-types-CZfYo5-1.js';
|
|
14
14
|
import { d as defaultColumnsKeys } from './payments-table-Dh4P9mTb.js';
|
|
@@ -17,7 +17,7 @@ import './utils-lb8p1Exq.js';
|
|
|
17
17
|
import './index-B9me4yN2.js';
|
|
18
18
|
import './helpers-Mu7LQT-w.js';
|
|
19
19
|
import './state-options-BX8GieXu.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-O3LY2Da6.js';
|
|
21
21
|
import './payments-status-XoZrlbiZ.js';
|
|
22
22
|
import './badge-D_mzXSCQ.js';
|
|
23
23
|
import './parts-CfF8KKwx.js';
|
|
@@ -9,7 +9,7 @@ import './Business-BCoP0TAV.js';
|
|
|
9
9
|
import './Dispute-BH0Xfn-F.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
11
|
import { E as ErrorState } from './utils-kWaZhFAd.js';
|
|
12
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
12
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
13
13
|
import { m as makeGetPayoutCSV } from './get-payout-csv-D-Lnooki.js';
|
|
14
14
|
import './Api-N_veT2p6.js';
|
|
15
15
|
import './utils-lb8p1Exq.js';
|
|
@@ -17,7 +17,7 @@ import './index-B9me4yN2.js';
|
|
|
17
17
|
import './helpers-Mu7LQT-w.js';
|
|
18
18
|
import './state-options-BX8GieXu.js';
|
|
19
19
|
import './parts-CfF8KKwx.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-O3LY2Da6.js';
|
|
21
21
|
|
|
22
22
|
const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
|
|
23
23
|
var _a;
|
|
@@ -6,7 +6,7 @@ import { g as PayoutBalanceTransaction } from './Refund-Di6J0oN2.js';
|
|
|
6
6
|
import { p as pagingDefaults } from './Pagination-CLHwhyvu.js';
|
|
7
7
|
import './Business-BCoP0TAV.js';
|
|
8
8
|
import './Dispute-BH0Xfn-F.js';
|
|
9
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
9
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
10
10
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
11
11
|
import { P as PayoutService } from './payout.service-Cld6TS5W.js';
|
|
12
12
|
import { T as Table, l as TableWrapper, a as TableComponent, b as TableHead, c as TableHeadRow, d as TableBody, e as TableLoadingState, f as TableEmptyState, g as TableErrorState, h as TableRow, i as TableFoot, j as TableFootRow, k as TableFootCell } from './table-qqt2Ew5y.js';
|
|
@@ -17,7 +17,7 @@ import { R as tableHeadCell, S as getAlternateTableCellPart } from './parts-CfF8
|
|
|
17
17
|
import './index-B9me4yN2.js';
|
|
18
18
|
import './helpers-Mu7LQT-w.js';
|
|
19
19
|
import './state-options-BX8GieXu.js';
|
|
20
|
-
import './package-
|
|
20
|
+
import './package-O3LY2Da6.js';
|
|
21
21
|
import './Api-N_veT2p6.js';
|
|
22
22
|
import './spinner-XBq6mVJW.js';
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
|
|
2
2
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
3
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
3
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
4
4
|
import { P as PayoutService } from './payout.service-Cld6TS5W.js';
|
|
5
5
|
import './config-state-BrllxiM0.js';
|
|
6
6
|
import './dinero-HXpYMWUU.js';
|
|
@@ -14,7 +14,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
|
|
|
14
14
|
import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
15
15
|
import './event-types-CZfYo5-1.js';
|
|
16
16
|
import { d as defaultColumnsKeys } from './payouts-table-DMVAZp-r.js';
|
|
17
|
-
import './package-
|
|
17
|
+
import './package-O3LY2Da6.js';
|
|
18
18
|
import './Api-N_veT2p6.js';
|
|
19
19
|
import './utils-lb8p1Exq.js';
|
|
20
20
|
import './index-B9me4yN2.js';
|
|
@@ -12,7 +12,7 @@ import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
|
12
12
|
import './event-types-CZfYo5-1.js';
|
|
13
13
|
import { P as PaymentService } from './payment.service-BWO84KlP.js';
|
|
14
14
|
import { m as makeGetPaymentDetails } from './get-payment-details-Dt-dr16k.js';
|
|
15
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
15
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
16
16
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
17
17
|
import { A as Api } from './Api-N_veT2p6.js';
|
|
18
18
|
import { S as Skeleton } from './skeleton-DrHwsgs_.js';
|
|
@@ -22,7 +22,7 @@ import './index-B9me4yN2.js';
|
|
|
22
22
|
import './helpers-Mu7LQT-w.js';
|
|
23
23
|
import './state-options-BX8GieXu.js';
|
|
24
24
|
import './parts-CfF8KKwx.js';
|
|
25
|
-
import './package-
|
|
25
|
+
import './package-O3LY2Da6.js';
|
|
26
26
|
|
|
27
27
|
const amountValidation = (maxAmount) => {
|
|
28
28
|
const max = +maxAmount;
|
|
@@ -6,7 +6,7 @@ import './Pagination-CLHwhyvu.js';
|
|
|
6
6
|
import './Business-BCoP0TAV.js';
|
|
7
7
|
import './Dispute-BH0Xfn-F.js';
|
|
8
8
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
9
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
9
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
10
10
|
import { c as checkoutStore } from './checkout.store-B60siz2l.js';
|
|
11
11
|
import { p as processHTML, f as formatCurrency, r as removeAttribute, h as addAttribute } from './utils-lb8p1Exq.js';
|
|
12
12
|
import { v as validateInsuranceValues, i as insuranceValues, a as insuranceErrors, H as Header2 } from './insurance-state-CB4l8sOv.js';
|
|
@@ -18,7 +18,7 @@ import './config-state-BrllxiM0.js';
|
|
|
18
18
|
import './index-B9me4yN2.js';
|
|
19
19
|
import './helpers-Mu7LQT-w.js';
|
|
20
20
|
import './state-options-BX8GieXu.js';
|
|
21
|
-
import './package-
|
|
21
|
+
import './package-O3LY2Da6.js';
|
|
22
22
|
import './dinero-HXpYMWUU.js';
|
|
23
23
|
|
|
24
24
|
const api = Api();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
|
|
2
2
|
import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
3
3
|
import './event-types-CZfYo5-1.js';
|
|
4
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
4
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
5
5
|
import { d as defaultColumnsKeys } from './terminal-orders-table-BN4Co4T8.js';
|
|
6
6
|
import './config-state-BrllxiM0.js';
|
|
7
7
|
import './dinero-HXpYMWUU.js';
|
|
@@ -12,7 +12,7 @@ import './Business-BCoP0TAV.js';
|
|
|
12
12
|
import './Dispute-BH0Xfn-F.js';
|
|
13
13
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
14
14
|
import { A as Api } from './Api-N_veT2p6.js';
|
|
15
|
-
import './package-
|
|
15
|
+
import './package-O3LY2Da6.js';
|
|
16
16
|
import './parts-CfF8KKwx.js';
|
|
17
17
|
import './utils-lb8p1Exq.js';
|
|
18
18
|
import './badge-D_mzXSCQ.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-kpoIU4v_.js';
|
|
2
2
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
3
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
3
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Bb69ihTN.js';
|
|
4
4
|
import { T as TerminalService } from './terminal.service-DmYCUQcA.js';
|
|
5
5
|
import './config-state-BrllxiM0.js';
|
|
6
6
|
import './dinero-HXpYMWUU.js';
|
|
@@ -13,7 +13,7 @@ import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccoun
|
|
|
13
13
|
import { S as StyledHost } from './styled-host-B_XBaM7z.js';
|
|
14
14
|
import './event-types-CZfYo5-1.js';
|
|
15
15
|
import { d as defaultColumnsKeys } from './terminals-table-C8LczeG_.js';
|
|
16
|
-
import './package-
|
|
16
|
+
import './package-O3LY2Da6.js';
|
|
17
17
|
import './Api-N_veT2p6.js';
|
|
18
18
|
import './utils-lb8p1Exq.js';
|
|
19
19
|
import './index-B9me4yN2.js';
|
|
@@ -174,13 +174,13 @@ const ModularCheckout = /*@__PURE__*/ proxyCustomElement(class ModularCheckout e
|
|
|
174
174
|
}
|
|
175
175
|
queryFormRefs() {
|
|
176
176
|
this.paymentMethodFormRef = this.hostEl.querySelector('justifi-card-form, justifi-bank-account-form');
|
|
177
|
-
this.
|
|
177
|
+
this.billingFormRef = this.hostEl.querySelector('justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full');
|
|
178
178
|
this.insuranceFormRef = this.hostEl.querySelector('justifi-season-interruption-insurance');
|
|
179
179
|
this.sezzlePaymentMethodRef = this.hostEl.querySelector('justifi-sezzle-payment-method');
|
|
180
180
|
}
|
|
181
181
|
async tokenizePaymentMethod(tokenizeArgs) {
|
|
182
182
|
var _a, _b, _c;
|
|
183
|
-
const billingInfoValues = (_b = await ((_a = this.
|
|
183
|
+
const billingInfoValues = (_b = await ((_a = this.billingFormRef) === null || _a === void 0 ? void 0 : _a.getValues())) !== null && _b !== void 0 ? _b : {};
|
|
184
184
|
const combinedBillingInfo = Object.assign(Object.assign({}, tokenizeArgs), billingInfoValues);
|
|
185
185
|
const paymentMethodMetadata = Object.assign({ accountId: checkoutStore.accountId, payment_method_group_id: undefined }, combinedBillingInfo);
|
|
186
186
|
if (checkoutStore.savePaymentMethod) {
|
|
@@ -213,28 +213,20 @@ const ModularCheckout = /*@__PURE__*/ proxyCustomElement(class ModularCheckout e
|
|
|
213
213
|
return token;
|
|
214
214
|
}
|
|
215
215
|
async validate() {
|
|
216
|
-
var _a;
|
|
216
|
+
var _a, _b;
|
|
217
|
+
console.log('billing information form', this.billingFormRef);
|
|
218
|
+
console.log('payment method form', this.paymentMethodFormRef);
|
|
219
|
+
console.log('insurance form', this.insuranceFormRef);
|
|
220
|
+
console.log('sezzle payment method', this.sezzlePaymentMethodRef);
|
|
217
221
|
const promises = [
|
|
218
|
-
(_a = this.
|
|
222
|
+
(_a = this.paymentMethodFormRef) === null || _a === void 0 ? void 0 : _a.validate(),
|
|
223
|
+
(_b = this.billingFormRef) === null || _b === void 0 ? void 0 : _b.validate()
|
|
219
224
|
];
|
|
220
|
-
// Only validate payment method form if we don't have a payment token from tokenize-payment-method
|
|
221
|
-
if (!checkoutStore.paymentToken && this.paymentMethodFormRef) {
|
|
222
|
-
promises.push(this.paymentMethodFormRef.validate());
|
|
223
|
-
}
|
|
224
225
|
if (this.insuranceFormRef) {
|
|
225
226
|
promises.push(this.insuranceFormRef.validate());
|
|
226
227
|
}
|
|
227
228
|
const validationResults = await Promise.all(promises);
|
|
228
|
-
return validationResults.every(result =>
|
|
229
|
-
// Handle different return types from different form components
|
|
230
|
-
if (typeof result === 'boolean') {
|
|
231
|
-
return result;
|
|
232
|
-
}
|
|
233
|
-
if (result && typeof result === 'object' && 'isValid' in result) {
|
|
234
|
-
return result.isValid;
|
|
235
|
-
}
|
|
236
|
-
return result !== false;
|
|
237
|
-
});
|
|
229
|
+
return validationResults.every(result => (result === null || result === void 0 ? void 0 : result.isValid) !== false);
|
|
238
230
|
}
|
|
239
231
|
async submitCheckout(submitCheckoutArgs) {
|
|
240
232
|
var _a;
|
|
@@ -302,7 +294,7 @@ const ModularCheckout = /*@__PURE__*/ proxyCustomElement(class ModularCheckout e
|
|
|
302
294
|
checkoutStore.selectedPaymentMethod = paymentMethodId;
|
|
303
295
|
}
|
|
304
296
|
render() {
|
|
305
|
-
return (h(Host, { key: '
|
|
297
|
+
return (h(Host, { key: 'd454d321b1a7a6e3b4097c94fbb05e02ce3e36a9' }));
|
|
306
298
|
}
|
|
307
299
|
get hostEl() { return this; }
|
|
308
300
|
static get watchers() { return {
|
package/dist/module/package.js
CHANGED
|
@@ -5,7 +5,7 @@ export declare class ModularCheckout {
|
|
|
5
5
|
analytics: JustifiAnalytics;
|
|
6
6
|
private observer?;
|
|
7
7
|
private paymentMethodFormRef?;
|
|
8
|
-
private
|
|
8
|
+
private billingFormRef?;
|
|
9
9
|
private insuranceFormRef?;
|
|
10
10
|
private sezzlePaymentMethodRef?;
|
|
11
11
|
private getCheckout;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as e,c as i,H as s,g as o}from"./p-kpoIU4v_.js";import{D as r,r as a}from"./p-CfF8KKwx.js";import{f as n}from"./p-zdIeCUeh.js";import{c as d,o as h}from"./p-CCME-fyU.js";import{S as c}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{H as l}from"./p-zrUQD0Wr.js";import{H as u,b as m,h as p,i as f}from"./p-qMrd7_Gp.js";import{H as v}from"./p-CwZKT93w.js";import{J as y,c as b}from"./p-BNz6wy4f.js";import"./p-9y5MOK55.js";import"./p-HXpYMWUU.js";import{C as k,a as g,b as j}from"./p-Cjcsf8ku.js";import{I as C,k as w}from"./p-WEguiGt1.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as M,a as _}from"./p-D2muobcE.js";import{C as z}from"./p-UD2JhYS2.js";import{C as P}from"./p-ZpPDShvP.js";import"./p-7WIgS5RM.js";import"./p-O3LY2Da6.js";import"./p-I8XpD1TX.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";const S=class{constructor(e){t(this,e)}render(){return e(c,{key:"fccb819d66329424af42e9c53effec29a6c9784d"},e("section",{key:"0ee7a4e0579f7f222a9db82e6b4db6bb92542d9e"},e("div",{key:"bdf74b2bc5db35b96ca75d50783b790bb482a76e"},e("div",{key:"851b481bd6beb1fcaadc106d27d131f8b07d1c9a",part:r},null==d?void 0:d.paymentDescription),e("div",{key:"0b261bc0e2d65cf989778e02df51b3265816f7aa"},e("span",{key:"0eee0017ddf25ae45d6b5c828071098f45e6e19d",part:r},"Total")," ",e("span",{key:"d21576f14c3437f70a4b85b9dfc01107392d663a",part:r},n(+(null==d?void 0:d.totalAmount)))))))}},O=class{constructor(e){t(this,e),this.levels={h1:l,h2:u,h3:v},this.level="h1"}render(){return e(c,{key:"ae04a67a1eaf95d6d093fef23911ac4eb1523cfe"},e(this.levels[this.level],{key:"51b27dd180d113ebe9ac52f7ff10c494926f7cdf",text:this.text,class:this.class}))}},I=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.paymentMethodChangedEvent=i(this,"payment-method-changed"),this.savePaymentMethod=!1}savePaymentMethodChanged(t){d.savePaymentMethod=t}connectedCallback(){this.observer=new MutationObserver((()=>{this.queryFormRefs()})),this.observer.observe(this.hostEl,{childList:!0,subtree:!0}),d.checkoutId=this.checkoutId;const t={authToken:this.authToken,checkoutId:this.checkoutId,service:new z};this.getCheckout=(({authToken:t,checkoutId:e,service:i})=>async({onSuccess:s,onError:o})=>{var r;try{const a=await i.fetchCheckout(t,e);if(a.error)return o({error:_(a.error),code:M(null===(r=a.error)||void 0===r?void 0:r.code),severity:k.ERROR});s({checkout:a.data})}catch(t){const e=M(null==t?void 0:t.code);return o({error:t.message||t,code:e,severity:k.ERROR})}})(t),this.completeCheckout=(({authToken:t,checkoutId:e,service:i})=>async({payment:s,onSuccess:o,onError:r})=>{var a;try{const n=await i.complete(t,e,s);if(n.error)return r({error:_(n.error),code:M(null===(a=n.error)||void 0===a?void 0:a.code),severity:k.ERROR});o({checkout:n.data})}catch(t){const e=M(null==t?void 0:t.code);return r({error:t.message||t,code:e,severity:k.ERROR})}})(t),h("selectedPaymentMethod",(t=>{this.paymentMethodChangedEvent.emit(t)}))}componentWillLoad(){this.authToken&&this.checkoutId?(this.analytics=new y(this),b(),d.authToken=this.authToken,d.savePaymentMethod=this.savePaymentMethod,this.fetchCheckout(),m("set",(t=>{const e=f[t];void 0!==e&&p(t,e)&&this.fetchCheckout()}))):this.errorEvent.emit({message:j.NOT_AUTHENTICATED,errorCode:g.NOT_AUTHENTICATED,severity:k.ERROR})}componentDidLoad(){this.queryFormRefs()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}fetchCheckout(){this.getCheckout&&this.getCheckout({onSuccess:({checkout:t})=>{t.status!==C.completed?t.status!==C.expired?this.updateStore(t):this.errorEvent.emit({message:j.CHECKOUT_EXPIRED,errorCode:g.CHECKOUT_EXPIRED,severity:k.ERROR}):this.errorEvent.emit({message:j.CHECKOUT_ALREADY_COMPLETED,errorCode:g.CHECKOUT_ALREADY_COMPLETED,severity:k.ERROR})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:g.FETCH_ERROR,severity:k.ERROR})}})}updateStore(t){var e,i,s,o;d.accountId=t.account_id,d.paymentMethods=t.payment_methods,d.paymentMethodGroupId=t.payment_method_group_id,d.paymentDescription=t.payment_description,d.totalAmount=t.total_amount,d.paymentAmount=t.payment_amount,d.bnplEnabled=t.payment_settings.bnpl_payments,d.bnplProviderClientId=null===(e=null==t?void 0:t.bnpl)||void 0===e?void 0:e.provider_client_id,d.bnplProviderMode=null===(i=null==t?void 0:t.bnpl)||void 0===i?void 0:i.provider_mode,d.bnplProviderApiVersion=null===(s=null==t?void 0:t.bnpl)||void 0===s?void 0:s.provider_api_version,d.bnplProviderCheckoutUrl=null===(o=null==t?void 0:t.bnpl)||void 0===o?void 0:o.provider_checkout_url}queryFormRefs(){this.paymentMethodFormRef=this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form"),this.billingFormRef=this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full"),this.insuranceFormRef=this.hostEl.querySelector("justifi-season-interruption-insurance"),this.sezzlePaymentMethodRef=this.hostEl.querySelector("justifi-sezzle-payment-method")}async tokenizePaymentMethod(t){var e,i,s;const o=null!==(i=await(null===(e=this.billingFormRef)||void 0===e?void 0:e.getValues()))&&void 0!==i?i:{},r=Object.assign(Object.assign({},t),o),a=Object.assign({accountId:d.accountId,payment_method_group_id:void 0},r);return d.savePaymentMethod&&(a.payment_method_group_id=d.paymentMethodGroupId),null===(s=this.paymentMethodFormRef)||void 0===s?void 0:s.tokenize({clientId:this.authToken,paymentMethodMetadata:a,account:d.accountId})}async getPaymentMethod(t){if(d.paymentToken)return d.paymentToken;if(!this.paymentMethodFormRef)return d.selectedPaymentMethod;const{error:e,id:i}=await this.tokenizePaymentMethod(t);if(!e)return i;this.errorEvent.emit({errorCode:e.code,message:e.message,severity:k.ERROR})}async validate(){var t,e;console.log("billing information form",this.billingFormRef),console.log("payment method form",this.paymentMethodFormRef),console.log("insurance form",this.insuranceFormRef),console.log("sezzle payment method",this.sezzlePaymentMethodRef);const i=[null===(t=this.paymentMethodFormRef)||void 0===t?void 0:t.validate(),null===(e=this.billingFormRef)||void 0===e?void 0:e.validate()];return this.insuranceFormRef&&i.push(this.insuranceFormRef.validate()),(await Promise.all(i)).every((t=>!1!==(null==t?void 0:t.isValid)))}async submitCheckout(t){var e;if(!await this.validate())return void this.errorEvent.emit({message:"Please fill in all required fields.",errorCode:g.VALIDATION_ERROR,severity:k.ERROR});let i;if("sezzle"===d.selectedPaymentMethod){const t=this.insuranceFormRef?await this.insuranceFormRef.validate():{isValid:!0},s=await this.sezzlePaymentMethodRef.resolvePaymentMethod(t);if(s.error)return void this.errorEvent.emit({message:s.error.message,errorCode:g.TOKENIZE_ERROR,severity:k.ERROR});"success"===(null===(e=s.bnpl)||void 0===e?void 0:e.status)&&(i={payment_mode:"bnpl",payment_token:void 0})}else{const e=await this.getPaymentMethod(t);if(!e)return void this.errorEvent.emit({message:"Payment method tokenization failed.",errorCode:g.TOKENIZE_ERROR,severity:k.ERROR});i={payment_mode:"ecom",payment_token:e}}this.completeCheckout({payment:i,onSuccess:({checkout:t})=>{this.submitEvent.emit({checkout:t,message:"Checkout completed successfully"})},onError:t=>{this.errorEvent.emit({message:t.message,errorCode:g.COMPLETE_CHECKOUT_ERROR,severity:k.ERROR})}})}async setSelectedPaymentMethod(t){d.selectedPaymentMethod=t}render(){return e(s,{key:"d454d321b1a7a6e3b4097c94fbb05e02ce3e36a9"})}get hostEl(){return o(this)}static get watchers(){return{savePaymentMethod:["savePaymentMethodChanged"]}}},D=class{constructor(e){t(this,e),this.onPaymentMethodOptionClick=t=>e=>{e.preventDefault(),d.selectedPaymentMethod=t},this.isAllowedPaymentMethod=t=>!("card"===t.type&&d.disableCreditCard||"bank_account"===t.type&&d.disableBankAccount)}componentWillLoad(){d.paymentMethods.length||console.warn("No saved payment methods available."),d.disablePaymentMethodGroup&&console.warn("Payment method group is disabled.")}render(){return d.disablePaymentMethodGroup?null:e(c,null,e("div",{class:"saved-payment-methods"},d.paymentMethods.length?d.paymentMethods.filter(this.isAllowedPaymentMethod).map((t=>e("div",{class:"radio-list-item p-3",part:a,onClick:this.onPaymentMethodOptionClick(null==t?void 0:t.id)},e("form-control-radio",{name:"paymentMethodType",value:null==t?void 0:t.id,checked:d.selectedPaymentMethod===(null==t?void 0:t.id),label:`${P[null==t?void 0:t.brand]||""} *${null==t?void 0:t.acct_last_four}`})))):null))}},T=e("img",{class:"sezzle-smart-button-logo-img",src:"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",alt:"Sezzle",style:{display:"inline",width:"80px",marginLeft:"5px",marginTop:"-5px"}}),E=class{constructor(e){t(this,e),this.paymentMethodOptionSelected=i(this,"paymentMethodOptionSelected"),this.paymentMethodOptionId="sezzle",this.onPaymentMethodOptionClick=t=>{t.preventDefault(),d.selectedPaymentMethod=this.paymentMethodOptionId,this.paymentMethodOptionSelected.emit(this.paymentMethodOptionId)},this.initializeSezzleCheckout=()=>{let t;this.sezzlePromise=new Promise((e=>{t=e}));const e=Number(d.paymentAmount),i=new(0,window.Checkout)({mode:"popup",publicKey:d.bnplProviderClientId,apiMode:d.bnplProviderMode,apiVersion:d.bnplProviderApiVersion});i.sezzleButtonElement=this.sezzleButtonRef,i.init({onClick:function(t){t.preventDefault(),i.startCheckout({checkout_url:d.bnplProviderCheckoutUrl})},onComplete:e=>t({bnpl:e.data}),onCancel:e=>t({bnpl:e.data}),onFailure:e=>t({bnpl:e.data})}),this.sezzleCheckout=i,this.installmentPlan=this.sezzleCheckout.getInstallmentPlan(e)}}componentDidRender(){this.scriptRef&&(this.scriptRef.onload=()=>{this.sezzleButtonRef=document.createElement("button"),this.initializeSezzleCheckout()})}async resolvePaymentMethod(t){return t.isValid?(this.sezzleButtonRef.click(),this.sezzlePromise):{validationError:!0}}render(){var t,i;return!d.bnplEnabled||d.disableBnpl?(console.warn("justifi-sezzle-payment-method: BNPL is not enabled for this account."),null):e(c,{class:"payment-method"},e("script",{src:"https://checkout-sdk.sezzle.com/checkout.min.js",async:!0,ref:t=>this.scriptRef=t}),e("div",{class:"radio-list-item p-3",part:a,onClick:this.onPaymentMethodOptionClick},e("form-control-radio",{name:"paymentMethodType",value:this.paymentMethodOptionId,checked:d.selectedPaymentMethod===this.paymentMethodOptionId,label:e("div",null,e("div",null,"Buy now, pay later with ",T),this.installmentPlan&&e("small",null,e("span",null,null===(t=this.installmentPlan)||void 0===t?void 0:t.installments.length)," ",e("span",null,this.installmentPlan.schedule," payments of")," ",e("span",{class:"fw-bold"},n(null===(i=this.installmentPlan)||void 0===i?void 0:i.installments[0].amountInCents))))})))}},F={[w.bankAccount]:"New bank account",[w.card]:"New credit or debit card"},L="Payment form not ready",B="Validation error",H=class{constructor(e){t(this,e),this.errorEvent=i(this,"error-event"),this.submitEvent=i(this,"submit-event"),this.isLoading=!1,this.computedHideSubmitButton=!1,this.submitButtonText="Submit"}componentWillLoad(){b(),this.analytics=new y(this),this.validateRequiredProps()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}handleRadioClick(t){this.selectedPaymentMethodId=t.detail}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:g.TOKENIZE_ERROR,message:B}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(g.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:g.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:L}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}validateRequiredProps(){this.authToken||d.authToken||this.emitError({errorCode:g.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||d.accountId||this.emitError({errorCode:g.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethodId||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethodId=w.bankAccount):this.selectedPaymentMethodId=w.card)}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(w.card),this.disableBankAccount||t.push(w.bankAccount),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:k.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",L);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||B;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||d.authToken,account:this.accountId||d.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||d.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!d.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const i=this.selectedPaymentMethodId===t;return e("div",{class:"payment-method"},e("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:i,label:F[t],hidden:this.shouldHideRadioInput}),i&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return e("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),e("div",{class:"mt-4"},e("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),e("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID}))}renderPaymentMethodForm(t){return e(t===w.card?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return e(c,{key:"11b857dea77d2f753e400cfaf021db51326ffc36"},e("form",{key:"fd1c625c62b1699157b24834e15c4c6e0bc93b84"},e("fieldset",{key:"febf7db57a5ceda457e21287c20df817b101b45d"},e("div",{key:"1089c358094a3f0cea1c97b807779c7eb6e9e692",class:"row gy-3"},e("div",{key:"f564fbfec389008e352f9de54fdb604be56d8826",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),e("div",{key:"e3e7f46529d1a659f387fb6df0914c168d556e27",class:"col-12"},e("justifi-button",{key:"d729f38c5b55c174de479ab57da56defd327366b",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return o(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}};export{S as justifi_checkout_summary,O as justifi_header,I as justifi_modular_checkout,D as justifi_saved_payment_methods,E as justifi_sezzle_payment_method,H as justifi_tokenize_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as s,r as i,c as t}from"./p-kpoIU4v_.js";import{c as r,F as e}from"./p-CR9D6mKt.js";import{b as o,a}from"./p-DSP8qjHL.js";import{i as p,a as h}from"./p-PgEzcvI6.js";import"./p-9y5MOK55.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-WEguiGt1.js";import"./p-CLHwhyvu.js";import{B as m,b as c}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as d,J as j}from"./p-
|
|
1
|
+
import{h as s,r as i,c as t}from"./p-kpoIU4v_.js";import{c as r,F as e}from"./p-CR9D6mKt.js";import{b as o,a}from"./p-DSP8qjHL.js";import{i as p,a as h}from"./p-PgEzcvI6.js";import"./p-9y5MOK55.js";import"./p-HXpYMWUU.js";import{C as n,a as l}from"./p-Cjcsf8ku.js";import"./p-WEguiGt1.js";import"./p-CLHwhyvu.js";import{B as m,b as c}from"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{c as d,J as j}from"./p-BNz6wy4f.js";import{B as u}from"./p-JgbsbAhz.js";import{S as f}from"./p-CRFzwZW6.js";import{H as v}from"./p-zrUQD0Wr.js";import"./p-CZfYo5-1.js";import{S as b}from"./p-BC8YDY7M.js";import{B as g}from"./p-XYgDHrVL.js";import{m as w,b as C}from"./p-5aA7gjr5.js";import{B as y}from"./p-DD74a16D.js";import"./p-BFTU3MAI.js";import"./p-CYBR4K2p.js";import"./p-BX8GieXu.js";import"./p-yH3TC3ZQ.js";import"./p-7WIgS5RM.js";import"./p-zdIeCUeh.js";import"./p-Dt-vy9Le.js";import"./p-O3LY2Da6.js";import"./p-I8XpD1TX.js";import"./p-CfF8KKwx.js";import"./p-D2muobcE.js";const B=r(Object.assign(Object.assign({},o().fields),{legal_address:h(),additional_questions:a(),representative:p("representative")})),D=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(b,{width:"25%"})),s("div",{class:"col-12"},s(b,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"50%"}),s(b,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(b,{width:"65%"}),s(b,{width:"35%"}))),x=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(b,{width:"40%",height:"40px"})),s(D,null),s(D,null),s(D,null)),I=class{constructor(s){i(this,s),this.submitEvent=t(this,"submit-event"),this.clickEvent=t(this,"click-event"),this.errorEvent=t(this,"error-event"),this.isLoading=!1,this.isSaving=!1,this.hideErrors=!1,this.formTitle="Business Information",this.removeTitle=!1,this.instantiateBusiness=s=>{const i=new m(s);this.formController.setInitialValues(Object.assign({},i))},this.sendData=async()=>{this.isSaving=!0;const s=this.formController.values.getValue(),i=this.formController.getInitialValues(),t=new m(Object.assign(Object.assign({},i),s)).payload;this.patchBusiness({payload:t,onSuccess:s=>{this.handleReponse(s)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isSaving=!1}})},this.validateAndSubmit=s=>{s.preventDefault(),this.formController.validateAndSubmit(this.sendData)}}componentWillLoad(){d(),this.analytics=new j(this),this.formController=new e(B),this.initializeApi()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}get title(){return this.removeTitle?"":this.formTitle}get disabledState(){return this.isSaving}get businessEndpoint(){return`entities/business/${this.businessId}`}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=w({authToken:this.authToken,businessId:this.businessId,service:new y}),this.patchBusiness=C({authToken:this.authToken,businessId:this.businessId,service:new y}),this.getBusiness({onSuccess:s=>{this.instantiateBusiness(s.data)},onError:({error:s,code:i,severity:t})=>{this.errorMessage=s.message,this.errorEvent.emit({errorCode:i,message:s.message,severity:t})},final:()=>{this.isLoading=!1}})):this.errorEvent.emit({message:"auth-token and business-id are required",errorCode:l.MISSING_PROPS,severity:n.ERROR})}handleReponse(s){s.error&&(this.errorMessage=c.patchData),this.submitEvent.emit({response:s}),this.instantiateBusiness(s.data)}render(){return s(f,null,this.isLoading?s(x,null):s("form",{onSubmit:this.validateAndSubmit},s("div",{class:"row gap-3"},s(v,{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(u,{type:"submit",disabled:this.disabledState,variant:"primary",onClick:()=>this.clickEvent.emit({name:g.submit}),isLoading:this.isSaving},"Submit")))))}};export{I as justifi_business_form}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as s,c as i}from"./p-kpoIU4v_.js";import{A as e}from"./p-I8XpD1TX.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import"./p-WEguiGt1.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c,J as h}from"./p-
|
|
1
|
+
import{h as t,r as s,c as i}from"./p-kpoIU4v_.js";import{A as e}from"./p-I8XpD1TX.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import"./p-WEguiGt1.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c,J as h}from"./p-BNz6wy4f.js";import{c as l}from"./p-CCME-fyU.js";import{p as d,f as p,r as u,h as v}from"./p-zdIeCUeh.js";import{v as m,i as y,a as f,H as j}from"./p-qMrd7_Gp.js";import{D as _,E as g}from"./p-CfF8KKwx.js";import{S as C}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{S as w}from"./p-BC8YDY7M.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-O3LY2Da6.js";import"./p-HXpYMWUU.js";const k=e();class b{async fetchQuote(t,s){return k.post({endpoint:"insurance/quotes",body:s,authToken:t})}async toggleCoverage(t,s,i){return k.post({endpoint:`insurance/quotes/${s}/toggle`,body:i,authToken:t})}}const T=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"35%",height:"30px"})),t("div",{class:"col-12"},t(w,{width:"70%"})),t("div",{class:"col-12"},t(w,{width:"40%"})),t("div",{class:"col-12"},t(w,{width:"40%"})),t("div",{class:"col-12"},t(w,{width:"100%"})),t("div",{class:"col-12"},t(w,{width:"80%"}))),M=class{constructor(t){s(this,t),this.insuranceUpdated=i(this,"insurance-updated"),this.errorEvent=i(this,"error-event"),this.isLoading=!0}async validate(){return m()}processHTMLContent(t){return d(t,[t=>u(t,"style"),t=>v(t,"a","part",_),t=>v(t,"p","part",_)])}componentWillLoad(){c(),this.analytics=new h(this),this.initializeServiceMethods(),this.getQuote&&this.fetchData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}initializeServiceMethods(){const t=this.authToken||l.authToken;if(!t)return void this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:"Missing authToken",severity:r.ERROR});const s={authToken:t,service:new b};this.getQuote=(({authToken:t,service:s})=>async({payload:i,onSuccess:e,onError:o})=>{var c;try{const h=await s.fetchQuote(t,i);if(h.error)return o({error:n(h.error),code:a(null===(c=h.error)||void 0===c?void 0:c.code),severity:r.ERROR});e({quote:h.data})}catch(t){const s=a(null==t?void 0:t.code);return o({error:t.message||t,code:s,severity:r.ERROR})}})(s),this.toggleCoverage=(({authToken:t,service:s})=>async({quoteId:i,payload:e,onSuccess:o,onError:c})=>{var h;try{const l=await s.toggleCoverage(t,i,e);if(l.error)return c({error:n(l.error),code:a(null===(h=l.error)||void 0===h?void 0:h.code),severity:r.ERROR});o({quote:l.data})}catch(t){const s=a(null==t?void 0:t.code);return c({error:t.message||t,code:s,severity:r.ERROR})}})(s)}fetchData(){this.isLoading=!0,this.getQuote({payload:{checkout_id:this.checkoutId||l.checkoutId,policy_type:"season_interruption",primary_identity:{state:this.primaryIdentityState,email:this.primaryIdentityEmailAddress,first_name:this.primaryIdentityFirstName,last_name:this.primaryIdentityLastName,postal_code:this.primaryIdentityPostalCode,country:this.primaryIdentityCountry},policy_attributes:{insurable_amount:this.policyAttributesInsurableAmount,start_date:this.policyAttributesStartDate,end_date:this.policyAttributesEndDate,covered_identity:{first_name:this.coveredIdentityFirstName,last_name:this.coveredIdentityLastName}}},onSuccess:({quote:t})=>{this.quote=t,this.quote.product.description=this.processHTMLContent(this.quote.product.description),this.quote.product.legal_disclaimer=this.processHTMLContent(this.quote.product.legal_disclaimer),y[t.policy_type]=t.accepted,this.isLoading=!1},onError:({error:t,code:s,severity:i})=>{this.isLoading=!1,this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}onChangeHandler(t,s){this.accepted=s,f[this.quote.policy_type]=!1,this.toggleCoverage({quoteId:this.quote.id,payload:{accepted:this.accepted},onSuccess:()=>{this.insuranceUpdated.emit(),y[this.quote.policy_type]=this.accepted},onError:({error:t,code:s,severity:i})=>{this.errorEvent.emit({errorCode:s,message:t,severity:i})}})}get error(){var t;return f[null===(t=this.quote)||void 0===t?void 0:t.policy_type]}render(){var s,i,e,r;return t(C,null,this.isLoading?t(T,null):t("div",null,t(j,{text:null===(s=this.quote)||void 0===s?void 0:s.product.title,class:"fs-5 fw-bold pb-3"}),t("small",{part:_,innerHTML:null===(i=this.quote)||void 0===i?void 0:i.product.description}),t("form-control-radio",{label:`Accept coverage for ${p(null===(e=this.quote)||void 0===e?void 0:e.total_cents)}`,name:"opt-in",value:"true",checked:"true"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("form-control-radio",{label:"Decline coverage",name:"opt-in",value:"false",checked:"false"===this.accepted,inputHandler:this.onChangeHandler.bind(this),errorText:this.error?" ":void 0}),t("div",{class:"invalid-feedback",style:{display:this.error?"block":"none"},part:g},"Please select an option"),t("small",{part:_,innerHTML:null===(r=this.quote)||void 0===r?void 0:r.product.legal_disclaimer})))}};export{M as justifi_season_interruption_insurance}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{E as r}from"./p-DO3INvI2.js";import{B as o}from"./p-DD74a16D.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as h,J as n}from"./p-
|
|
1
|
+
import{r as s,c as i,h as t}from"./p-kpoIU4v_.js";import{E as r}from"./p-DO3INvI2.js";import{B as o}from"./p-DD74a16D.js";import{m as p}from"./p-DH8F0bsw.js";import{C as e,a as m}from"./p-Cjcsf8ku.js";import{c as h,J as n}from"./p-BNz6wy4f.js";import"./p-CfF8KKwx.js";import"./p-I8XpD1TX.js";import"./p-9y5MOK55.js";import"./p-7WIgS5RM.js";import"./p-zdIeCUeh.js";import"./p-HXpYMWUU.js";import"./p-WEguiGt1.js";import"./p-BH0Xfn-F.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-D2muobcE.js";import"./p-O3LY2Da6.js";const a=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event"),this.errorMessage=null,this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)}}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetBusiness()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:m.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR});this.getBusiness=p({id:this.businessId,authToken:this.authToken,service:new o})}render(){return this.errorMessage?r(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness,"onError-event":this.handleErrorEvent})}};export{a as justifi_business_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as e,J as
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-kpoIU4v_.js";import{C as r,a as o}from"./p-Cjcsf8ku.js";import{c as e,J as a}from"./p-BNz6wy4f.js";import{T as p}from"./p-DWUnL_zj.js";import"./p-9y5MOK55.js";import"./p-HXpYMWUU.js";import{e as n}from"./p-WEguiGt1.js";import"./p-CLHwhyvu.js";import"./p-BlJnA265.js";import"./p-BH0Xfn-F.js";import{g as c,a as h}from"./p-D2muobcE.js";import{m,S as u}from"./p-Bpcb3SsP.js";import{S as d}from"./p-CRFzwZW6.js";import"./p-CZfYo5-1.js";import{d as j}from"./p-Dvxpy_P1.js";import"./p-O3LY2Da6.js";import"./p-I8XpD1TX.js";import"./p-zdIeCUeh.js";import"./p-7WIgS5RM.js";import"./p-Dt-vy9Le.js";import"./p-BX8GieXu.js";import"./p-vRhNRfmB.js";import"./p-CfF8KKwx.js";const l=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=j,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){e(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:t,authToken:s,service:i})=>async({params:o,onSuccess:e,onError:a})=>{var p,m;try{const u=await i.fetchTerminals(t,s,o);if(u.error)return a({error:h(u.error),code:c(null===(m=u.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const t=Object.assign({},u.page_info);e({terminals:(null===(p=u.data)||void 0===p?void 0:p.map((t=>new n(t))))||[],pagingInfo:t})}}catch(t){const s=c(null==t?void 0:t.code);return a({error:t.message||t,code:s,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new p}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:o.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=m({accountId:this.accountId,authToken:this.authToken,service:new u}))}render(){return i(d,{key:"3e7a05a8497a84bf6b06d9fc95834d9bbb53d954"},i("terminals-list-core",{key:"1653a639b594c93cc08fadb07ff56346d1ae9295",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{l as justifi_terminals_list}
|