@justifi/webcomponents 4.19.0 → 4.19.1-rc-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Analytics-ff013cbc.js → Analytics-1ca4e47e.js} +2 -3
- package/dist/cjs/{business.service-f63650f5.js → business.service-6bb7ac82.js} +5 -6
- package/dist/cjs/{get-payout-csv-f3aee6d0.js → get-payout-csv-1391ff3e.js} +3 -4
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +7 -8
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-card-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -4
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +11 -9
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +1 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -3
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -5
- package/dist/cjs/{package-cb0f8cb1.js → package-bc2632e4.js} +2 -4
- package/dist/cjs/{payment.service-0a64f9cd.js → payment.service-dfcfa19b.js} +2 -3
- package/dist/collection/api/services/analytics.service.js +1 -2
- package/dist/collection/api/services/business.service.js +5 -6
- package/dist/collection/api/services/checkout.service.js +2 -3
- package/dist/collection/api/services/insurance.service.js +2 -3
- package/dist/collection/api/services/payment.service.js +2 -3
- package/dist/collection/api/services/payout.service.js +3 -4
- package/dist/collection/api/services/provision.service.js +2 -4
- package/dist/collection/api/services/reports.service.js +1 -2
- package/dist/collection/components/bank-account-form/bank-account-form.js +3 -4
- package/dist/collection/components/business-forms/business-form/business-form.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -3
- package/dist/collection/components/card-form/card-form.js +3 -4
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- package/dist/collection/components/checkout/new-payment-method.js +6 -4
- package/dist/collection/components/checkout/payment-method-options.js +3 -4
- package/dist/collection/components/checkout/saved-payment-method.js +3 -4
- package/dist/collection/components/checkout/sezzle-payment-method.js +3 -4
- package/dist/collection/components/payment-form/payment-form.js +3 -4
- package/dist/collection/components/refund-form/refund-form.js +2 -3
- package/dist/docs.json +8 -8
- package/dist/esm/{Analytics-33b8fa8d.js → Analytics-c51439be.js} +2 -3
- package/dist/esm/{business.service-74bd1212.js → business.service-f45decfc.js} +5 -6
- package/dist/esm/{get-payout-csv-b494abfe.js → get-payout-csv-e784a2ab.js} +3 -4
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +7 -8
- package/dist/esm/justifi-bank-account-form.entry.js +4 -5
- package/dist/esm/justifi-business-details.entry.js +3 -4
- package/dist/esm/justifi-business-form.entry.js +4 -5
- package/dist/esm/justifi-card-form.entry.js +4 -5
- package/dist/esm/justifi-checkout-core.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +4 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -4
- package/dist/esm/justifi-new-payment-method_4.entry.js +11 -9
- package/dist/esm/justifi-owner-form_3.entry.js +1 -2
- package/dist/esm/justifi-payment-details.entry.js +3 -4
- package/dist/esm/justifi-payment-form.entry.js +5 -6
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +5 -6
- package/dist/esm/justifi-payments-list.entry.js +3 -4
- package/dist/esm/justifi-payout-details.entry.js +3 -4
- package/dist/esm/justifi-payouts-list.entry.js +3 -4
- package/dist/esm/justifi-refund-form.entry.js +2 -3
- package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
- package/dist/esm/{package-3e407c6d.js → package-09a354e0.js} +2 -4
- package/dist/esm/{payment.service-3ca4a492.js → payment.service-dad5153b.js} +2 -3
- package/dist/globals.d.ts +2 -0
- package/dist/module/Analytics.js +1 -2
- package/dist/module/business-bank-account-form-step.js +2 -3
- package/dist/module/business-document-upload-form-step.js +2 -3
- package/dist/module/business-terms-conditions-form-step.js +2 -3
- package/dist/module/business.service.js +5 -6
- package/dist/module/checkout-core.js +3 -3
- package/dist/module/get-payout-csv.js +3 -4
- package/dist/module/justifi-bank-account-form.js +2 -3
- package/dist/module/justifi-business-form.js +2 -3
- package/dist/module/justifi-card-form.js +2 -3
- package/dist/module/justifi-checkout.js +2 -3
- package/dist/module/justifi-gross-payment-chart.js +1 -2
- package/dist/module/justifi-payment-form.js +3 -4
- package/dist/module/justifi-payment-provisioning.js +2 -3
- package/dist/module/justifi-refund-form.js +2 -3
- package/dist/module/justifi-season-interruption-insurance.js +2 -3
- package/dist/module/new-payment-method.js +5 -3
- package/dist/module/package.js +2 -4
- package/dist/module/payment-method-options.js +2 -3
- package/dist/module/payment.service.js +2 -3
- package/dist/module/saved-payment-method.js +2 -3
- package/dist/module/sezzle-payment-method.js +2 -3
- package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
- package/dist/webcomponents/index.esm.js +1 -0
- package/dist/webcomponents/p-01a404ca.entry.js +44 -0
- package/dist/webcomponents/p-03d35880.entry.js +130 -0
- package/dist/webcomponents/p-06ff0429.entry.js +65 -0
- package/dist/webcomponents/p-08b0fb31.js +41 -1
- package/dist/webcomponents/p-14c91ffd.js +20 -1
- package/dist/webcomponents/p-1a17ea7d.entry.js +1684 -0
- package/dist/webcomponents/p-1ad5995e.js +3599 -1
- package/dist/webcomponents/p-1ff8810b.js +29 -1
- package/dist/webcomponents/p-21aeb013.entry.js +80 -0
- package/dist/webcomponents/p-2338affa.js +213 -1
- package/dist/webcomponents/p-258b1ee2.entry.js +149 -0
- package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
- package/dist/webcomponents/p-29c0b182.js +114 -1
- package/dist/webcomponents/p-2b6c9c4f.js +7 -1
- package/dist/webcomponents/p-2dabeb5a.js +79 -0
- package/dist/webcomponents/p-2eab3c90.js +3052 -1
- package/dist/webcomponents/p-33272d05.entry.js +94 -0
- package/dist/webcomponents/p-3642ad71.entry.js +145 -0
- package/dist/webcomponents/p-387450f6.js +77 -0
- package/dist/webcomponents/p-3e9ef4a8.js +28 -0
- package/dist/webcomponents/p-3fd13ca3.js +52 -1
- package/dist/webcomponents/p-41bc7c5c.entry.js +97 -0
- package/dist/webcomponents/p-4d8b45c6.entry.js +98 -0
- package/dist/webcomponents/p-525db3e8.js +22 -1
- package/dist/webcomponents/p-5482d030.entry.js +21 -0
- package/dist/webcomponents/p-56f6ce4c.js +10 -1
- package/dist/webcomponents/p-576826b1.entry.js +43 -0
- package/dist/webcomponents/p-5968ff8a.js +178 -1
- package/dist/webcomponents/p-5bd7b204.entry.js +75 -0
- package/dist/webcomponents/p-5cb3f0b2.entry.js +261 -0
- package/dist/webcomponents/p-5e70442b.entry.js +74 -0
- package/dist/webcomponents/p-5f835b89.entry.js +606 -0
- package/dist/webcomponents/p-6078a370.js +244 -1
- package/dist/webcomponents/p-68843186.entry.js +73 -0
- package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
- package/dist/webcomponents/p-7582b554.entry.js +18 -0
- package/dist/webcomponents/p-79646550.entry.js +61 -0
- package/dist/webcomponents/p-7c76e67c.entry.js +117 -0
- package/dist/webcomponents/p-7d85af5c.js +16 -1
- package/dist/webcomponents/p-800d31fe.entry.js +162 -0
- package/dist/webcomponents/p-8115b2f4.js +28 -1
- package/dist/webcomponents/p-83125497.js +4027 -1
- package/dist/webcomponents/p-85fc69e5.js +90 -1
- package/dist/webcomponents/p-890088fc.entry.js +298 -0
- package/dist/webcomponents/p-89887332.js +301 -1
- package/dist/webcomponents/p-8df7bde8.js +27 -1
- package/dist/webcomponents/p-8eb774df.entry.js +54 -0
- package/dist/webcomponents/p-9c9c7dac.js +24 -1
- package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
- package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
- package/dist/webcomponents/p-a5c5821e.entry.js +101 -0
- package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
- package/dist/webcomponents/p-a6d04afc.js +44 -0
- package/dist/webcomponents/p-ac086069.entry.js +58 -0
- package/dist/webcomponents/p-af244664.js +126 -1
- package/dist/webcomponents/p-b82c146f.entry.js +111 -0
- package/dist/webcomponents/p-b8a03a4b.entry.js +131 -0
- package/dist/webcomponents/p-ba4bae6f.js +12 -1
- package/dist/webcomponents/p-ba5fae28.js +90 -1
- package/dist/webcomponents/p-c636f563.entry.js +791 -0
- package/dist/webcomponents/p-c86c24d2.entry.js +94 -0
- package/dist/webcomponents/p-cb26f708.js +18 -0
- package/dist/webcomponents/p-ce733539.entry.js +99 -0
- package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
- package/dist/webcomponents/p-d5095f6c.entry.js +133 -0
- package/dist/webcomponents/p-d89bad72.js +39 -1
- package/dist/webcomponents/p-dce846bf.js +27 -1
- package/dist/webcomponents/p-df21aaad.js +120 -1
- package/dist/webcomponents/p-e1255160.js +3 -1
- package/dist/webcomponents/p-e333620e.js +34 -1
- package/dist/webcomponents/p-e356f280.entry.js +29 -0
- package/dist/webcomponents/p-e3fab0e2.js +43 -1
- package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
- package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
- package/dist/webcomponents/p-fad19d75.js +1638 -2
- package/dist/webcomponents/webcomponents.css +362 -4
- package/dist/webcomponents/webcomponents.esm.js +20 -1
- package/package.json +2 -4
- package/dist/cjs/config-ff2dda66.js +0 -15
- package/dist/config.js +0 -11
- package/dist/esm/config-476c7241.js +0 -13
- package/dist/module/config.js +0 -13
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +0 -11
- package/dist/webcomponents/p-07109641.entry.js +0 -1
- package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
- package/dist/webcomponents/p-17e4246f.entry.js +0 -1
- package/dist/webcomponents/p-195f92e9.entry.js +0 -1
- package/dist/webcomponents/p-1a43e355.entry.js +0 -19
- package/dist/webcomponents/p-23014988.entry.js +0 -1
- package/dist/webcomponents/p-25dba252.entry.js +0 -1
- package/dist/webcomponents/p-27981600.entry.js +0 -1
- package/dist/webcomponents/p-301e0493.entry.js +0 -1
- package/dist/webcomponents/p-304dd644.entry.js +0 -1
- package/dist/webcomponents/p-30a493cd.entry.js +0 -1
- package/dist/webcomponents/p-462dc522.entry.js +0 -1
- package/dist/webcomponents/p-487b72a8.entry.js +0 -1
- package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
- package/dist/webcomponents/p-4b4580dd.js +0 -1
- package/dist/webcomponents/p-52021fa1.entry.js +0 -1
- package/dist/webcomponents/p-53e64f15.entry.js +0 -1
- package/dist/webcomponents/p-60a370fc.entry.js +0 -1
- package/dist/webcomponents/p-623a4479.entry.js +0 -1
- package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
- package/dist/webcomponents/p-63acf322.js +0 -1
- package/dist/webcomponents/p-6f03b35a.entry.js +0 -1
- package/dist/webcomponents/p-75b4daef.js +0 -1
- package/dist/webcomponents/p-8603348a.js +0 -1
- package/dist/webcomponents/p-8c1e981b.entry.js +0 -1
- package/dist/webcomponents/p-8e541a32.entry.js +0 -1
- package/dist/webcomponents/p-9279aa49.entry.js +0 -1
- package/dist/webcomponents/p-96b42e7d.entry.js +0 -1
- package/dist/webcomponents/p-99022846.entry.js +0 -1
- package/dist/webcomponents/p-ae263544.js +0 -1
- package/dist/webcomponents/p-b16dfd5d.entry.js +0 -1
- package/dist/webcomponents/p-bbed6107.entry.js +0 -1
- package/dist/webcomponents/p-bc92235c.entry.js +0 -1
- package/dist/webcomponents/p-be39c802.entry.js +0 -1
- package/dist/webcomponents/p-c4b87db2.entry.js +0 -1
- package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
- package/dist/webcomponents/p-cd7105dd.entry.js +0 -1
- package/dist/webcomponents/p-d101c5db.js +0 -1
- package/dist/webcomponents/p-d1fbeae5.entry.js +0 -1
- package/dist/webcomponents/p-d8355f91.entry.js +0 -1
- package/dist/webcomponents/p-e2c88817.entry.js +0 -1
- package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
- package/dist/webcomponents/p-e7067ef2.entry.js +0 -1
- package/dist/webcomponents/p-f0866375.entry.js +0 -1
- package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
- package/dist/webcomponents/p-fe33151d.entry.js +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { P as PaymentService } from './p-cb26f708.js';
|
|
3
|
+
import './p-56f6ce4c.js';
|
|
4
|
+
import { P as Payment } from './p-df21aaad.js';
|
|
5
|
+
import './p-e3fab0e2.js';
|
|
6
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
7
|
+
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
8
|
+
import { E as ErrorState } from './p-dce846bf.js';
|
|
9
|
+
import { J as JustifiAnalytics } from './p-387450f6.js';
|
|
10
|
+
import './p-29c0b182.js';
|
|
11
|
+
import './p-2dabeb5a.js';
|
|
12
|
+
|
|
13
|
+
const makeGetPaymentDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
const response = await service.fetchPayment(id, authToken);
|
|
17
|
+
if (!response.error) {
|
|
18
|
+
onSuccess({ payment: new Payment(response.data) });
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const responseError = getErrorMessage(response.error);
|
|
22
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
23
|
+
onError({
|
|
24
|
+
error: responseError,
|
|
25
|
+
code,
|
|
26
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
32
|
+
onError({
|
|
33
|
+
error: getErrorMessage(error),
|
|
34
|
+
code,
|
|
35
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const PaymentDetails = class {
|
|
41
|
+
constructor(hostRef) {
|
|
42
|
+
registerInstance(this, hostRef);
|
|
43
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
44
|
+
this.paymentService = new PaymentService();
|
|
45
|
+
this.handleErrorEvent = event => {
|
|
46
|
+
this.errorMessage = event.detail.message;
|
|
47
|
+
this.errorEvent.emit(event.detail);
|
|
48
|
+
};
|
|
49
|
+
this.paymentId = undefined;
|
|
50
|
+
this.authToken = undefined;
|
|
51
|
+
this.getPaymentDetails = undefined;
|
|
52
|
+
this.errorMessage = null;
|
|
53
|
+
}
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
this.analytics = new JustifiAnalytics(this);
|
|
56
|
+
this.initializeGetPaymentDetails();
|
|
57
|
+
}
|
|
58
|
+
disconnectedCallback() {
|
|
59
|
+
this.analytics.cleanup();
|
|
60
|
+
}
|
|
61
|
+
;
|
|
62
|
+
propChanged() {
|
|
63
|
+
this.initializeGetPaymentDetails();
|
|
64
|
+
}
|
|
65
|
+
initializeGetPaymentDetails() {
|
|
66
|
+
if (this.paymentId && this.authToken) {
|
|
67
|
+
this.getPaymentDetails = makeGetPaymentDetails({
|
|
68
|
+
id: this.paymentId,
|
|
69
|
+
authToken: this.authToken,
|
|
70
|
+
service: new PaymentService(),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.errorMessage = 'Payment ID and Auth Token are required';
|
|
75
|
+
this.errorEvent.emit({
|
|
76
|
+
message: this.errorMessage,
|
|
77
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
78
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
if (this.errorMessage) {
|
|
84
|
+
return ErrorState(this.errorMessage);
|
|
85
|
+
}
|
|
86
|
+
return (h("payment-details-core", { getPaymentDetails: this.getPaymentDetails, "onError-event": this.handleErrorEvent }));
|
|
87
|
+
}
|
|
88
|
+
static get watchers() { return {
|
|
89
|
+
"paymentId": ["propChanged"],
|
|
90
|
+
"authToken": ["propChanged"]
|
|
91
|
+
}; }
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export { PaymentDetails as justifi_payment_details };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { A as Api } from './p-29c0b182.js';
|
|
2
|
+
import './p-56f6ce4c.js';
|
|
3
|
+
import './p-df21aaad.js';
|
|
4
|
+
import './p-e3fab0e2.js';
|
|
5
|
+
|
|
6
|
+
class PaymentService {
|
|
7
|
+
async fetchPayments(accountId, authToken, params) {
|
|
8
|
+
const api = Api({ authToken, apiOrigin: undefined });
|
|
9
|
+
const endpoint = `account/${accountId}/payments`;
|
|
10
|
+
return api.get(endpoint, params);
|
|
11
|
+
}
|
|
12
|
+
async fetchPayment(paymentId, authToken) {
|
|
13
|
+
const endpoint = `payments/${paymentId}`;
|
|
14
|
+
return Api({ authToken, apiOrigin: undefined }).get(endpoint);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { PaymentService as P };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { m as makeGetPayoutCSV, P as PayoutService } from './p-a6d04afc.js';
|
|
3
|
+
import './p-56f6ce4c.js';
|
|
4
|
+
import './p-df21aaad.js';
|
|
5
|
+
import { P as Payout } from './p-e3fab0e2.js';
|
|
6
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
7
|
+
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
8
|
+
import { E as ErrorState } from './p-dce846bf.js';
|
|
9
|
+
import { J as JustifiAnalytics } from './p-387450f6.js';
|
|
10
|
+
import './p-29c0b182.js';
|
|
11
|
+
import './p-2dabeb5a.js';
|
|
12
|
+
|
|
13
|
+
const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
const response = await service.fetchPayout(id, authToken);
|
|
17
|
+
if (!response.error) {
|
|
18
|
+
const payout = new Payout(response.data);
|
|
19
|
+
onSuccess(payout);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const errorMessage = getErrorMessage(response.error);
|
|
23
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
24
|
+
onError({
|
|
25
|
+
error: errorMessage,
|
|
26
|
+
code,
|
|
27
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
const errorMessage = getErrorMessage(error);
|
|
33
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
34
|
+
onError({
|
|
35
|
+
error: errorMessage,
|
|
36
|
+
code,
|
|
37
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const PayoutDetails = class {
|
|
43
|
+
constructor(hostRef) {
|
|
44
|
+
registerInstance(this, hostRef);
|
|
45
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
46
|
+
this.handleErrorEvent = (event) => {
|
|
47
|
+
this.errorMessage = event.detail.message;
|
|
48
|
+
this.errorEvent.emit(event.detail);
|
|
49
|
+
};
|
|
50
|
+
this.payoutId = undefined;
|
|
51
|
+
this.authToken = undefined;
|
|
52
|
+
this.getPayout = undefined;
|
|
53
|
+
this.getPayoutCSV = undefined;
|
|
54
|
+
this.errorMessage = null;
|
|
55
|
+
}
|
|
56
|
+
componentWillLoad() {
|
|
57
|
+
this.analytics = new JustifiAnalytics(this);
|
|
58
|
+
this.initializeServices();
|
|
59
|
+
}
|
|
60
|
+
disconnectedCallback() {
|
|
61
|
+
this.analytics.cleanup();
|
|
62
|
+
}
|
|
63
|
+
propChanged() {
|
|
64
|
+
this.initializeServices();
|
|
65
|
+
}
|
|
66
|
+
initializeServices() {
|
|
67
|
+
if (this.payoutId && this.authToken) {
|
|
68
|
+
this.getPayout = makeGetPayoutDetails({
|
|
69
|
+
id: this.payoutId,
|
|
70
|
+
authToken: this.authToken,
|
|
71
|
+
service: new PayoutService()
|
|
72
|
+
});
|
|
73
|
+
this.getPayoutCSV = makeGetPayoutCSV({
|
|
74
|
+
authToken: this.authToken,
|
|
75
|
+
service: new PayoutService()
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.errorMessage = 'Failed to load payout details. payoutId or authToken is not provided.';
|
|
80
|
+
this.errorEvent.emit({
|
|
81
|
+
message: this.errorMessage,
|
|
82
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
83
|
+
severity: ComponentErrorSeverity.ERROR
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
if (this.errorMessage) {
|
|
89
|
+
return ErrorState(this.errorMessage);
|
|
90
|
+
}
|
|
91
|
+
return (h("payout-details-core", { getPayout: this.getPayout, getPayoutCSV: this.getPayoutCSV, "onError-event": this.handleErrorEvent }));
|
|
92
|
+
}
|
|
93
|
+
static get watchers() { return {
|
|
94
|
+
"payoutId": ["propChanged"],
|
|
95
|
+
"authToken": ["propChanged"]
|
|
96
|
+
}; }
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export { PayoutDetails as justifi_payout_details };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './p-fad19d75.js';
|
|
2
|
+
import { u as updateFormValues, a as updateAddressFormValues, b as updateDateOfBirthFormValues } from './p-7d85af5c.js';
|
|
3
|
+
import { P as PHONE_MASKS, S as SSN_MASK } from './p-525db3e8.js';
|
|
4
|
+
import './p-1ff8810b.js';
|
|
5
|
+
import './p-6078a370.js';
|
|
6
|
+
|
|
7
|
+
const RepresentativeFormInputs = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.inputHandler = (name, value) => {
|
|
11
|
+
updateFormValues(this.formController, { [name]: value });
|
|
12
|
+
};
|
|
13
|
+
this.onAddressFormUpdate = (values) => {
|
|
14
|
+
updateAddressFormValues(this.formController, Object.assign(Object.assign({}, this.formController.values.getValue().address), values));
|
|
15
|
+
};
|
|
16
|
+
this.representativeDefaultValue = undefined;
|
|
17
|
+
this.errors = undefined;
|
|
18
|
+
this.formController = undefined;
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
22
|
+
return (h("form", { key: '8b46b3b30681c7e7f30395a2cac575a7bd7ac998' }, h("fieldset", { key: 'e6b8f2ebca22c295fd6897c0e8862200171c2b4d' }, h("legend", { key: '8f8f52240f5ccc3f5d43507681dc970b4260bb1b' }, "Representative"), h("hr", { key: '8b07c69a514534ab731e7c01b6ee4c7a0e59e06e' }), h("div", { key: '79f44ba9dcbcf9d010aed92e332f686ca7127285', class: 'row gy-3' }, h("div", { key: '2a1aeb5ddee1dafc40e108cfb2e9ed6f4d8bc183', class: 'col-12 col-md-8' }, h("form-control-text", { key: '6e089f2d4f734da266e94b38ec1435dc3f461d5f', name: 'name', label: 'Full Name', defaultValue: (_a = this.representativeDefaultValue) === null || _a === void 0 ? void 0 : _a.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: 'c86421e524752e017180aef58e01229bf751e941', class: 'col-12 col-md-4' }, h("form-control-text", { key: 'ad8105f6d9a46397eb481666c19468376716544c', name: 'title', label: 'Title', defaultValue: (_b = this.representativeDefaultValue) === null || _b === void 0 ? void 0 : _b.title, errorText: this.errors.title, inputHandler: this.inputHandler })), h("div", { key: '7775905e46c00337a98ab668c8453e14d27bfc4d', class: 'col-12 col-md-6' }, h("form-control-text", { key: 'e810f2395101a1e48d8d3ff66617ac82d0ec90b3', name: 'email', label: 'Email Address', defaultValue: (_c = this.representativeDefaultValue) === null || _c === void 0 ? void 0 : _c.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: '66a91e85d1902e32668407e684774820c02dce67', class: 'col-12 col-md-6' }, h("form-control-number-masked", { key: 'aad97ca95c5b2ec728ea00916a46ff4b84661b96', name: 'phone', label: 'Phone Number', defaultValue: (_d = this.representativeDefaultValue) === null || _d === void 0 ? void 0 : _d.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { key: '3cd56ea0ac1e472e905c8113f6335868c39882f1', class: 'col-12 col-md-4' }, h("form-control-date", { key: '2f6d505220cacc08a80029ada089370f3841d9ed', name: 'dob_full', label: 'Birth Date', defaultValue: (_e = this.representativeDefaultValue) === null || _e === void 0 ? void 0 : _e.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: (e) => updateDateOfBirthFormValues(e, this.formController) })), h("div", { key: 'cf2df0af006a50d3533b798607025b4d6ee82ca0', class: 'col-12 col-md-8' }, h("form-control-number-masked", { key: '033e4264a1466d300891b2328c0bfaced7acb04d', name: 'identification_number', label: 'SSN', defaultValue: (_f = this.representativeDefaultValue) === null || _f === void 0 ? void 0 : _f.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: SSN_MASK })), h("div", { key: '2dc7be12d65203da4d4e0bdd995256a7bdc5bf37', class: 'col-12' }, h("justifi-identity-address-form", { key: '47916ab24bf990be3541b72bfa2dc46cccca5a31', errors: this.errors.address, defaultValues: (_g = this.representativeDefaultValue) === null || _g === void 0 ? void 0 : _g.address, handleFormUpdate: this.onAddressFormUpdate }))))));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { RepresentativeFormInputs as justifi_business_representative_form_inputs };
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import './p-56f6ce4c.js';
|
|
3
|
+
import { a as PaymentMethodTypes } from './p-df21aaad.js';
|
|
4
|
+
import './p-e3fab0e2.js';
|
|
5
|
+
import { l as loadFontsOnParent } from './p-83125497.js';
|
|
6
|
+
import { a as ComponentErrorCodes, C as ComponentErrorSeverity } from './p-14c91ffd.js';
|
|
7
|
+
import { g as getErrorMessage } from './p-8115b2f4.js';
|
|
8
|
+
import { J as JustifiAnalytics } from './p-387450f6.js';
|
|
9
|
+
import { B as Button } from './p-9c9c7dac.js';
|
|
10
|
+
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
11
|
+
import './p-2dabeb5a.js';
|
|
12
|
+
import './p-29c0b182.js';
|
|
13
|
+
|
|
14
|
+
const paymentFormCss = ":host{display:block}justifi-payment-method-form{display:block;margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}.jfi-submit-button{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow)}.jfi-submit-button:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.jfi-submit-button:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn.jfi-submit-button:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}.btn.jfi-submit-button-loading{min-width:75px;color:var(--jfi-submit-button-color-loading);background-color:var(--jfi-submit-button-background-color-loading);border-color:var(--jfi-submit-button-border-color-loading)}.btn.jfi-submit-button-loading .spinner-border{border-top-color:var(--jfi-submit-button-color-loading);border-bottom-color:var(--jfi-submit-button-color-loading);border-left-color:var(--jfi-submit-button-color-loading)}";
|
|
15
|
+
const JustifiPaymentFormStyle0 = paymentFormCss;
|
|
16
|
+
|
|
17
|
+
const PaymentForm = class {
|
|
18
|
+
constructor(hostRef) {
|
|
19
|
+
registerInstance(this, hostRef);
|
|
20
|
+
this.submitted = createEvent(this, "submitted", 7);
|
|
21
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
22
|
+
this.bankAccount = undefined;
|
|
23
|
+
this.card = undefined;
|
|
24
|
+
this.email = undefined;
|
|
25
|
+
this.clientId = undefined;
|
|
26
|
+
this.authToken = undefined;
|
|
27
|
+
this.accountId = undefined;
|
|
28
|
+
this.submitButtonText = undefined;
|
|
29
|
+
this.submitButtonEnabled = true;
|
|
30
|
+
this.isLoading = false;
|
|
31
|
+
this.selectedPaymentMethodType = PaymentMethodTypes.card;
|
|
32
|
+
}
|
|
33
|
+
componentWillLoad() {
|
|
34
|
+
this.analytics = new JustifiAnalytics(this);
|
|
35
|
+
if (!this.validateProps()) {
|
|
36
|
+
this.errorEvent.emit({
|
|
37
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
38
|
+
message: 'clientId or authToken is required',
|
|
39
|
+
severity: ComponentErrorSeverity.ERROR
|
|
40
|
+
});
|
|
41
|
+
this.submitButtonEnabled = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
connectedCallback() {
|
|
45
|
+
loadFontsOnParent();
|
|
46
|
+
}
|
|
47
|
+
disconnectedCallback() {
|
|
48
|
+
this.analytics.cleanup();
|
|
49
|
+
}
|
|
50
|
+
async fillBillingForm(fields) {
|
|
51
|
+
this.billingFormRef.fill(fields);
|
|
52
|
+
}
|
|
53
|
+
async enableSubmitButton() {
|
|
54
|
+
this.submitButtonEnabled = true;
|
|
55
|
+
}
|
|
56
|
+
async disableSubmitButton() {
|
|
57
|
+
this.submitButtonEnabled = false;
|
|
58
|
+
}
|
|
59
|
+
showPaymentMethodTypeSelector() {
|
|
60
|
+
return this.card && this.bankAccount;
|
|
61
|
+
}
|
|
62
|
+
getSelectedPaymentMethodType() {
|
|
63
|
+
if (this.showPaymentMethodTypeSelector()) {
|
|
64
|
+
return this.selectedPaymentMethodType;
|
|
65
|
+
}
|
|
66
|
+
else if (this.card) {
|
|
67
|
+
return PaymentMethodTypes.card;
|
|
68
|
+
}
|
|
69
|
+
else if (this.bankAccount) {
|
|
70
|
+
return PaymentMethodTypes.bankAccount;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return PaymentMethodTypes.card;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
paymentMethodSelectedHandler(event) {
|
|
77
|
+
const paymentMethodType = event.detail;
|
|
78
|
+
this.selectedPaymentMethodType = paymentMethodType;
|
|
79
|
+
}
|
|
80
|
+
validateProps() {
|
|
81
|
+
return !!(this.clientId || this.authToken);
|
|
82
|
+
}
|
|
83
|
+
getToken() {
|
|
84
|
+
return this.authToken || this.clientId;
|
|
85
|
+
}
|
|
86
|
+
async submit(event) {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
if (!this.paymentMethodFormRef || !this.billingFormRef)
|
|
89
|
+
return;
|
|
90
|
+
const billingFormValidation = await this.billingFormRef.validate();
|
|
91
|
+
const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
|
|
92
|
+
if (!billingFormValidation.isValid || !paymentMethodFormValidation.isValid)
|
|
93
|
+
return;
|
|
94
|
+
this.isLoading = true;
|
|
95
|
+
try {
|
|
96
|
+
const billingFormFieldValues = await this.billingFormRef.getValues();
|
|
97
|
+
const paymentMethodData = Object.assign({ email: this.email }, billingFormFieldValues);
|
|
98
|
+
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(this.getToken(), paymentMethodData, this.accountId);
|
|
99
|
+
if (tokenizeResponse.error) {
|
|
100
|
+
this.errorEvent.emit({
|
|
101
|
+
errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
|
|
102
|
+
message: tokenizeResponse.error.message,
|
|
103
|
+
severity: ComponentErrorSeverity.ERROR
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
this.submitted.emit(tokenizeResponse);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
this.errorEvent.emit({
|
|
110
|
+
errorCode: ComponentErrorCodes.UNKNOWN_ERROR,
|
|
111
|
+
message: getErrorMessage(error),
|
|
112
|
+
severity: ComponentErrorSeverity.ERROR
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
this.isLoading = false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
render() {
|
|
120
|
+
return (h(StyledHost, { key: '8cb6e3903a0045fbffed5f17dc29aacc6b57ad7f' }, h("form", { key: '4e8f00c3d29c0db0bc99fd79da46abe7c40e3e30', class: "row gy-3" }, this.showPaymentMethodTypeSelector() && (h("div", { key: '344a1356f6f482493a35015c32f8e9a9b4cc8a80', class: "col-12" }, h("justifi-payment-method-selector", { key: '36b9dd7a9bc8336b4bef0d12f56c811effbc0a0b', selectedPaymentMethodType: this.getSelectedPaymentMethodType(), onPaymentMethodSelected: event => this.paymentMethodSelectedHandler(event) }))), h("div", { key: '225a260f817f9dd02a7f0a5b25562179ab80f7de', class: "col-12" }, h("justifi-payment-method-form", { key: '52e2bf20b265cc96ab556571a323370cc27ac278', "payment-method-form-type": this.getSelectedPaymentMethodType(), iframeOrigin: undefined, ref: el => {
|
|
121
|
+
if (el) {
|
|
122
|
+
this.paymentMethodFormRef = el;
|
|
123
|
+
}
|
|
124
|
+
} })), h("div", { key: '433a8ac42c0eec9180e37da222da1dbb1112e48e', class: "col-12" }, h("justifi-billing-form", { key: '4f24f1c8b4083e2d9e5bb2272d32d20bb5cc225d', legend: "Billing Info", ref: el => {
|
|
125
|
+
if (el) {
|
|
126
|
+
this.billingFormRef = el;
|
|
127
|
+
}
|
|
128
|
+
} })), h("slot", { key: '9397ae7fdd2677cd61a425fcf5818ae14fabbed0', name: 'insurance' }), h("div", { key: 'db9131f6f35165e69d3b59da7fa25b95f1e46168', class: "col-12" }, h(Button, { key: 'c280836cf6445a7132ff9202a09b6fdac8e29f77', variant: "primary", type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, isLoading: this.isLoading, "data-testid": "submit-button", style: { width: '100%' } }, this.submitButtonText || 'Submit')))));
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
PaymentForm.style = JustifiPaymentFormStyle0;
|
|
132
|
+
|
|
133
|
+
export { PaymentForm as justifi_payment_form };
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
var
|
|
1
|
+
var BusinessFormStep;
|
|
2
|
+
(function (BusinessFormStep) {
|
|
3
|
+
BusinessFormStep["coreInfo"] = "coreInfo";
|
|
4
|
+
BusinessFormStep["legalAddress"] = "legalAddress";
|
|
5
|
+
BusinessFormStep["additionalQuestions"] = "additionalQuestions";
|
|
6
|
+
BusinessFormStep["representative"] = "representative";
|
|
7
|
+
BusinessFormStep["owners"] = "owners";
|
|
8
|
+
BusinessFormStep["bankAccount"] = "bankAccount";
|
|
9
|
+
BusinessFormStep["documentUpload"] = "documentUpload";
|
|
10
|
+
BusinessFormStep["termsAndConditions"] = "termsAndConditions";
|
|
11
|
+
})(BusinessFormStep || (BusinessFormStep = {}));
|
|
12
|
+
var BusinessFormServerErrors;
|
|
13
|
+
(function (BusinessFormServerErrors) {
|
|
14
|
+
BusinessFormServerErrors["fetchData"] = "Error retrieving business data";
|
|
15
|
+
BusinessFormServerErrors["patchData"] = "Error updating business data";
|
|
16
|
+
})(BusinessFormServerErrors || (BusinessFormServerErrors = {}));
|
|
17
|
+
var BusinessFormClickActions;
|
|
18
|
+
(function (BusinessFormClickActions) {
|
|
19
|
+
BusinessFormClickActions["nextStep"] = "nextStep";
|
|
20
|
+
BusinessFormClickActions["previousStep"] = "previousStep";
|
|
21
|
+
BusinessFormClickActions["submit"] = "submit";
|
|
22
|
+
BusinessFormClickActions["removeOwner"] = "removeOwner";
|
|
23
|
+
BusinessFormClickActions["addOwner"] = "addOwner";
|
|
24
|
+
BusinessFormClickActions["addOwnerForm"] = "addOwnerForm";
|
|
25
|
+
BusinessFormClickActions["updateOwner"] = "updateOwner";
|
|
26
|
+
})(BusinessFormClickActions || (BusinessFormClickActions = {}));
|
|
27
|
+
var OwnerFormServerErrors;
|
|
28
|
+
(function (OwnerFormServerErrors) {
|
|
29
|
+
OwnerFormServerErrors["fetchData"] = "Error retrieving owner data";
|
|
30
|
+
OwnerFormServerErrors["patchData"] = "Error updating owner data";
|
|
31
|
+
OwnerFormServerErrors["postData"] = "Error adding owner data";
|
|
32
|
+
})(OwnerFormServerErrors || (OwnerFormServerErrors = {}));
|
|
33
|
+
var DocumentFormServerErrors;
|
|
34
|
+
(function (DocumentFormServerErrors) {
|
|
35
|
+
DocumentFormServerErrors["fetchData"] = "Error retrieving document data";
|
|
36
|
+
DocumentFormServerErrors["sendData"] = "Error uploading document data";
|
|
37
|
+
})(DocumentFormServerErrors || (DocumentFormServerErrors = {}));
|
|
38
|
+
|
|
39
|
+
export { BusinessFormServerErrors as B, BusinessFormClickActions as a, BusinessFormStep as b };
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
import{h
|
|
1
|
+
import { h } from './p-fad19d75.js';
|
|
2
|
+
|
|
3
|
+
const LoadingState = () => (h("main", { part: "detail-loading-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } },
|
|
4
|
+
h("div", { part: "detail-loading-spinner", class: "spinner-border spinner-border-sm", role: "status" },
|
|
5
|
+
h("span", { class: "visually-hidden" }, "Loading..."))));
|
|
6
|
+
const ErrorState = (errorMessage) => (h("main", { part: "detail-empty-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } },
|
|
7
|
+
h("div", null, errorMessage)));
|
|
8
|
+
const DetailSectionTitle = (props) => [
|
|
9
|
+
h("h5", { part: "detail-section-title", class: "mt-4" }, props.sectionTitle),
|
|
10
|
+
h("hr", null),
|
|
11
|
+
];
|
|
12
|
+
const DetailItem = ({ title, value, }) => title && value ? (h("div", { class: "d-table-row gap-2" },
|
|
13
|
+
h("span", { part: "detail-section-item-title", class: "fw-bold d-table-cell px-2" }, title),
|
|
14
|
+
h("span", { part: "detail-section-item-data", class: "flex-1 d-table-cell px-2 text-wrap", innerHTML: value }))) : null;
|
|
15
|
+
const EntityHeadInfoItem = ({ title, value, classes, }) => (h("div", { part: "detail-head-info-item", class: `d-flex flex-column ${classes}` },
|
|
16
|
+
h("span", { part: "detail-head-info-item-title", class: "fw-bold border-1 border-bottom ps-2 pe-2" }, title),
|
|
17
|
+
h("span", { part: "detail-head-info-item-data", class: "pt-2 ps-2 pe-2" }, value)));
|
|
18
|
+
const EntityHeadInfo = ({ title, slot, badge }, children) => (h("div", { slot: slot, part: "detail-head", class: "p-2" },
|
|
19
|
+
h("div", { class: "d-flex flex-row align-items-center gap-2 mb-2" },
|
|
20
|
+
h("h1", { class: "m-0", part: "detail-title" }, title),
|
|
21
|
+
badge),
|
|
22
|
+
h("div", { part: "detail-head-info", class: "d-flex flex-row align-items-top" }, children)));
|
|
23
|
+
const CodeBlock = ({ metadata }) => metadata && Object.keys(metadata).length ? (h("div", { class: 'mt-4' },
|
|
24
|
+
h("pre", { part: "detail-metadata", class: "p-2", "aria-label": "metadata content" },
|
|
25
|
+
h("code", null, JSON.stringify(metadata, null, 2))))) : null;
|
|
26
|
+
|
|
27
|
+
export { CodeBlock as C, DetailSectionTitle as D, ErrorState as E, LoadingState as L, EntityHeadInfo as a, EntityHeadInfoItem as b, DetailItem as c };
|
|
@@ -1 +1,120 @@
|
|
|
1
|
-
var
|
|
1
|
+
var CaptureStrategy;
|
|
2
|
+
(function (CaptureStrategy) {
|
|
3
|
+
CaptureStrategy["automatic"] = "automatic";
|
|
4
|
+
CaptureStrategy["manual"] = "manual";
|
|
5
|
+
})(CaptureStrategy || (CaptureStrategy = {}));
|
|
6
|
+
var PaymentMethodTypes;
|
|
7
|
+
(function (PaymentMethodTypes) {
|
|
8
|
+
PaymentMethodTypes["card"] = "card";
|
|
9
|
+
PaymentMethodTypes["bankAccount"] = "bankAccount";
|
|
10
|
+
PaymentMethodTypes["sezzle"] = "sezzle";
|
|
11
|
+
PaymentMethodTypes["saved"] = "saved";
|
|
12
|
+
})(PaymentMethodTypes || (PaymentMethodTypes = {}));
|
|
13
|
+
var PaymentStatuses;
|
|
14
|
+
(function (PaymentStatuses) {
|
|
15
|
+
PaymentStatuses["pending"] = "pending";
|
|
16
|
+
PaymentStatuses["automatic"] = "automatic";
|
|
17
|
+
PaymentStatuses["authorized"] = "authorized";
|
|
18
|
+
PaymentStatuses["succeeded"] = "succeeded";
|
|
19
|
+
PaymentStatuses["failed"] = "failed";
|
|
20
|
+
PaymentStatuses["disputed"] = "disputed";
|
|
21
|
+
PaymentStatuses["fully_refunded"] = "fully_refunded";
|
|
22
|
+
PaymentStatuses["partially_refunded"] = "partially_refunded";
|
|
23
|
+
})(PaymentStatuses || (PaymentStatuses = {}));
|
|
24
|
+
var PaymentDisputedStatuses;
|
|
25
|
+
(function (PaymentDisputedStatuses) {
|
|
26
|
+
// if a dispute is 'won', we don't show a dispute status, just general status
|
|
27
|
+
PaymentDisputedStatuses["lost"] = "lost";
|
|
28
|
+
PaymentDisputedStatuses["open"] = "open";
|
|
29
|
+
})(PaymentDisputedStatuses || (PaymentDisputedStatuses = {}));
|
|
30
|
+
class PaymentMethod {
|
|
31
|
+
constructor(paymentMethod) {
|
|
32
|
+
this.card = paymentMethod.card ? new Card(paymentMethod.card) : undefined;
|
|
33
|
+
this.bank_account = paymentMethod.bank_account
|
|
34
|
+
? new BankAccount(paymentMethod.bank_account)
|
|
35
|
+
: undefined;
|
|
36
|
+
}
|
|
37
|
+
get payersName() {
|
|
38
|
+
if (this.card) {
|
|
39
|
+
return this.card.name;
|
|
40
|
+
}
|
|
41
|
+
else if (this.bank_account) {
|
|
42
|
+
return this.bank_account.name;
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
get lastFourDigits() {
|
|
47
|
+
if (this.card) {
|
|
48
|
+
return `**** ${this.card.acct_last_four}`;
|
|
49
|
+
}
|
|
50
|
+
else if (this.bank_account) {
|
|
51
|
+
return `**** ${this.bank_account.acct_last_four}`;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
class BankAccount {
|
|
57
|
+
constructor(bankAccount) {
|
|
58
|
+
this.id = bankAccount.id;
|
|
59
|
+
this.acct_last_four = bankAccount.acct_last_four;
|
|
60
|
+
this.name = bankAccount.name;
|
|
61
|
+
this.brand = bankAccount.brand;
|
|
62
|
+
this.token = bankAccount.token;
|
|
63
|
+
this.created_at = bankAccount.created_at;
|
|
64
|
+
this.updated_at = bankAccount.updated_at;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
class Card {
|
|
68
|
+
constructor(card) {
|
|
69
|
+
this.id = card.id || '';
|
|
70
|
+
this.acct_last_four = card.acct_last_four;
|
|
71
|
+
this.name = card.name;
|
|
72
|
+
this.brand = card.brand;
|
|
73
|
+
this.token = card.token;
|
|
74
|
+
this.created_at = card.created_at;
|
|
75
|
+
this.updated_at = card.updated_at;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
class Payment {
|
|
79
|
+
constructor(payment) {
|
|
80
|
+
this.id = payment.id;
|
|
81
|
+
this.account_id = payment.account_id;
|
|
82
|
+
this.amount = payment.amount;
|
|
83
|
+
this.amount_disputed = payment.amount_disputed;
|
|
84
|
+
this.amount_refundable = payment.amount_refundable;
|
|
85
|
+
this.amount_refunded = payment.amount_refunded;
|
|
86
|
+
this.balance = payment.balance;
|
|
87
|
+
this.captured = payment.captured;
|
|
88
|
+
this.capture_strategy = payment.capture_strategy;
|
|
89
|
+
this.currency = payment.currency;
|
|
90
|
+
this.description = payment.description;
|
|
91
|
+
this.disputed = payment.disputed;
|
|
92
|
+
this.disputes = payment.disputes;
|
|
93
|
+
this.error_code = payment.error_code;
|
|
94
|
+
this.error_description = payment.error_description;
|
|
95
|
+
this.fee_amount = payment.fee_amount;
|
|
96
|
+
this.is_test = payment.is_test;
|
|
97
|
+
this.metadata = payment.metadata;
|
|
98
|
+
this.payment_method = new PaymentMethod(payment.payment_method);
|
|
99
|
+
this.payment_intent_id = payment.payment_intent_id;
|
|
100
|
+
this.refunded = payment.refunded;
|
|
101
|
+
this.status = payment.status;
|
|
102
|
+
this.created_at = payment.created_at;
|
|
103
|
+
this.updated_at = payment.updated_at;
|
|
104
|
+
}
|
|
105
|
+
get disputedStatus() {
|
|
106
|
+
const lost = this.disputes.some((dispute) => dispute.status === PaymentDisputedStatuses.lost);
|
|
107
|
+
// if a dispute is 'won', we don't show a dispute status, just general status
|
|
108
|
+
if (!this.disputed) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
else if (lost) {
|
|
112
|
+
return PaymentDisputedStatuses.lost;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return PaymentDisputedStatuses.open;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { Payment as P, PaymentMethodTypes as a };
|
|
@@ -1 +1,34 @@
|
|
|
1
|
-
import{h
|
|
1
|
+
import { h } from './p-fad19d75.js';
|
|
2
|
+
|
|
3
|
+
const TableEmptyState = (props) => {
|
|
4
|
+
const { columnSpan, isEmpty } = props;
|
|
5
|
+
if (!columnSpan || !isEmpty) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return (h("tr", null,
|
|
9
|
+
h("td", { class: "empty-state", part: "empty-state", colSpan: columnSpan, style: { textAlign: 'center' } }, "No results")));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const TableErrorState = (props) => {
|
|
13
|
+
const { columnSpan, errorMessage } = props;
|
|
14
|
+
if (!columnSpan || !errorMessage) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return (h("tr", null,
|
|
18
|
+
h("td", { class: "error-state", part: "error-state", colSpan: columnSpan, "data-test-id": "table-error-state", style: { textAlign: 'center' } },
|
|
19
|
+
"An unexpected error occurred: ",
|
|
20
|
+
errorMessage)));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const TableLoadingState = (props) => {
|
|
24
|
+
const { columnSpan, isLoading } = props;
|
|
25
|
+
if (!columnSpan || !isLoading) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return (h("tr", null,
|
|
29
|
+
h("td", { class: "loading-state", part: "loading-state-cell", colSpan: columnSpan, style: { textAlign: 'center' } },
|
|
30
|
+
h("div", { part: "loading-state-spinner", class: "spinner-border", role: "status" },
|
|
31
|
+
h("span", { class: "visually-hidden" }, "Loading...")))));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { TableLoadingState as T, TableEmptyState as a, TableErrorState as b };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, F as Fragment } from './p-fad19d75.js';
|
|
2
|
+
import './p-56f6ce4c.js';
|
|
3
|
+
import { a as PaymentMethodTypes } from './p-df21aaad.js';
|
|
4
|
+
import './p-e3fab0e2.js';
|
|
5
|
+
|
|
6
|
+
const paymentMethodSelectorCss = ":host{display:block}.jfi-btn-radio+.jfi-btn-radio-label{color:var(--jfi-radio-button-color);background-color:var(--jfi-radio-button-background-color);border-color:var(--jfi-radio-button-border-color);padding:var(--jfi-radio-button-padding);font-size:var(--jfi-radio-button-font-size)}.jfi-btn-radio:focus+.jfi-btn-radio-label{box-shadow:var(--jfi-box-shadow-focus)}.jfi-btn-radio+.jfi-btn-radio-label:hover{color:var(--jfi-radio-button-color-hover);border-color:var(--jfi-radio-button-border-color-hover);background-color:var(--jfi-radio-button-background-color-hover)}.jfi-btn-radio:checked+.jfi-btn-radio-label:hover{color:var(--jfi-radio-button-color-selected-hover);border-color:var(--jfi-radio-button-border-color-selected-hover);background-color:var(--jfi-radio-button-background-color-selected-hover)}.jfi-btn-radio:checked+.jfi-btn-radio-label{color:var(--jfi-radio-button-color-selected);background-color:var(--jfi-radio-button-background-color-selected);border-color:var(--jfi-radio-button-border-color-selected)}.jfi-btn-radio-group{font-family:var(--jfi-layout-font-family);display:inline-flex;width:var(--jfi-radio-button-group-width)}";
|
|
7
|
+
const JustifiPaymentMethodSelectorStyle0 = paymentMethodSelectorCss;
|
|
8
|
+
|
|
9
|
+
const PaymentMethodLabels = {
|
|
10
|
+
bankAccount: 'Bank Account',
|
|
11
|
+
card: 'Card',
|
|
12
|
+
};
|
|
13
|
+
const PaymentMethodSelector = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
registerInstance(this, hostRef);
|
|
16
|
+
this.paymentMethodSelected = createEvent(this, "paymentMethodSelected", 7);
|
|
17
|
+
this.paymentMethodTypes = [PaymentMethodTypes.card, PaymentMethodTypes.bankAccount];
|
|
18
|
+
this.selectedPaymentMethodType = undefined;
|
|
19
|
+
}
|
|
20
|
+
onChangeHandler(event) {
|
|
21
|
+
this.paymentMethodSelected.emit(event.target.value);
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return (h("div", { key: 'a0cd592094f7f69955469de84addde1d4bc5af4d', class: "btn-group jfi-btn-radio-group", role: "group", "aria-label": "Radio toggle group for payment method" }, this.paymentMethodTypes.map((paymentMethodType) => (h(Fragment, null, h("input", { id: paymentMethodType, type: "radio", name: "paymentMethodType", value: paymentMethodType, onChange: (event) => this.onChangeHandler(event), checked: this.selectedPaymentMethodType === paymentMethodType, class: "btn-check jfi-btn-radio" }), h("label", { htmlFor: paymentMethodType, class: "btn btn-outline-primary jfi-btn-radio-label" }, PaymentMethodLabels[paymentMethodType]))))));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
PaymentMethodSelector.style = JustifiPaymentMethodSelectorStyle0;
|
|
28
|
+
|
|
29
|
+
export { PaymentMethodSelector as justifi_payment_method_selector };
|