@justifi/webcomponents 4.19.1-rc → 4.19.1-rc-4
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-0b3db49d.js → Analytics-985bc298.js} +2 -3
- package/dist/cjs/{business.service-c384784d.js → business.service-6bb7ac82.js} +5 -6
- package/dist/cjs/{get-payout-csv-51a02be7.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-39dc73ed.js → package-cbc08fe3.js} +2 -4
- package/dist/cjs/{payment.service-2dbfb83d.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-37556050.js → Analytics-79e20e2d.js} +2 -3
- package/dist/esm/{business.service-eee46ab1.js → business.service-f45decfc.js} +5 -6
- package/dist/esm/{get-payout-csv-4d6b29d8.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-e2a7aa3f.js → package-cf64a48c.js} +2 -4
- package/dist/esm/{payment.service-9005a501.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-02c58e00.entry.js +97 -0
- package/dist/webcomponents/p-03d35880.entry.js +130 -0
- package/dist/webcomponents/p-05f46d63.entry.js +99 -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-1ad5995e.js +3599 -1
- package/dist/webcomponents/p-1ff8810b.js +29 -1
- 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-2eab3c90.js +3052 -1
- package/dist/webcomponents/p-3e9ef4a8.js +28 -0
- package/dist/webcomponents/p-3fd13ca3.js +52 -1
- package/dist/webcomponents/p-492588bf.js +79 -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-5cb3f0b2.entry.js +261 -0
- package/dist/webcomponents/p-5f835b89.entry.js +606 -0
- package/dist/webcomponents/p-6053809a.entry.js +80 -0
- package/dist/webcomponents/p-6078a370.js +244 -1
- package/dist/webcomponents/p-66e4869f.entry.js +75 -0
- package/dist/webcomponents/p-6f1c56d4.entry.js +94 -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-7a70ff09.entry.js +133 -0
- package/dist/webcomponents/p-7bbf73bd.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-9282eab8.js +77 -0
- package/dist/webcomponents/p-96c12fef.entry.js +73 -0
- package/dist/webcomponents/p-9c9c7dac.js +24 -1
- package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
- package/dist/webcomponents/p-9fd108be.entry.js +74 -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-acbac8b8.entry.js +131 -0
- package/dist/webcomponents/p-adc30a61.entry.js +145 -0
- package/dist/webcomponents/p-af244664.js +126 -1
- package/dist/webcomponents/p-b6e3d7ed.entry.js +94 -0
- package/dist/webcomponents/p-b82c146f.entry.js +111 -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-cb26f708.js +18 -0
- package/dist/webcomponents/p-d17aee2b.entry.js +26 -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-e3e5f95f.entry.js +98 -0
- package/dist/webcomponents/p-e3fab0e2.js +43 -1
- package/dist/webcomponents/p-eb5dbd23.entry.js +1684 -0
- 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-037e67d0.js +0 -15
- package/dist/config.js +0 -11
- package/dist/esm/config-58e393e2.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-023779ee.entry.js +0 -1
- package/dist/webcomponents/p-037763f4.entry.js +0 -1
- 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-1a43e355.entry.js +0 -19
- package/dist/webcomponents/p-1f6afff9.entry.js +0 -1
- package/dist/webcomponents/p-246a6c6a.entry.js +0 -1
- package/dist/webcomponents/p-2d3b1692.entry.js +0 -1
- package/dist/webcomponents/p-30a493cd.entry.js +0 -1
- package/dist/webcomponents/p-32286934.js +0 -1
- package/dist/webcomponents/p-3f5e7e86.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-52021fa1.entry.js +0 -1
- package/dist/webcomponents/p-53e64f15.entry.js +0 -1
- package/dist/webcomponents/p-57e1f2fd.js +0 -1
- package/dist/webcomponents/p-5f095525.entry.js +0 -1
- package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
- package/dist/webcomponents/p-69faef3f.entry.js +0 -1
- package/dist/webcomponents/p-6c078cd1.js +0 -1
- package/dist/webcomponents/p-8e541a32.entry.js +0 -1
- package/dist/webcomponents/p-8f325782.entry.js +0 -1
- package/dist/webcomponents/p-987b5de2.entry.js +0 -1
- package/dist/webcomponents/p-a63fc384.entry.js +0 -1
- package/dist/webcomponents/p-a8220709.entry.js +0 -1
- package/dist/webcomponents/p-ae530971.entry.js +0 -1
- package/dist/webcomponents/p-b7cf49f4.entry.js +0 -1
- package/dist/webcomponents/p-b87b27ba.js +0 -1
- package/dist/webcomponents/p-bbed6107.entry.js +0 -1
- package/dist/webcomponents/p-be39c802.entry.js +0 -1
- package/dist/webcomponents/p-c28db166.js +0 -1
- package/dist/webcomponents/p-c9f8f7ec.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-edac2b43.entry.js +0 -1
- package/dist/webcomponents/p-ef23c091.entry.js +0 -1
- package/dist/webcomponents/p-f06910aa.entry.js +0 -1
- package/dist/webcomponents/p-f0866375.entry.js +0 -1
- package/dist/webcomponents/p-f0a06884.entry.js +0 -1
- package/dist/webcomponents/p-f2f94d9f.entry.js +0 -1
- package/dist/webcomponents/p-f49b7170.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,58 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { M as MapPaymentStatusToBadge, f as formatCurrency, b as formatDate, c as formatTime, s as snakeCaseToHumanReadable } from './p-83125497.js';
|
|
3
|
+
import { a as EntityHeadInfo, b as EntityHeadInfoItem, D as DetailSectionTitle, c as DetailItem, C as CodeBlock, E as ErrorState, L as LoadingState } from './p-dce846bf.js';
|
|
4
|
+
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
5
|
+
|
|
6
|
+
const PaymentDetailsCore = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
10
|
+
this.getPaymentDetails = undefined;
|
|
11
|
+
this.payment = undefined;
|
|
12
|
+
this.loading = true;
|
|
13
|
+
this.errorMessage = undefined;
|
|
14
|
+
}
|
|
15
|
+
componentWillLoad() {
|
|
16
|
+
if (this.getPaymentDetails) {
|
|
17
|
+
this.fetchData();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
updateOnPropChange() {
|
|
21
|
+
this.fetchData();
|
|
22
|
+
}
|
|
23
|
+
fetchData() {
|
|
24
|
+
this.loading = true;
|
|
25
|
+
this.getPaymentDetails({
|
|
26
|
+
onSuccess: ({ payment }) => {
|
|
27
|
+
this.payment = payment;
|
|
28
|
+
this.loading = false;
|
|
29
|
+
this.errorMessage = null;
|
|
30
|
+
},
|
|
31
|
+
onError: ({ error, code, severity }) => {
|
|
32
|
+
this.errorMessage = error;
|
|
33
|
+
this.errorEvent.emit({
|
|
34
|
+
errorCode: code,
|
|
35
|
+
message: error,
|
|
36
|
+
severity,
|
|
37
|
+
});
|
|
38
|
+
this.loading = false;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
var _a;
|
|
44
|
+
return (h(StyledHost, { key: 'aaaea4076938af5a74197256dba1093265f0e2d6' }, this.loading && LoadingState(), !this.loading && this.errorMessage && ErrorState(this.errorMessage), !this.loading && !this.errorMessage &&
|
|
45
|
+
this.payment && (h("justifi-details", { key: '12f06fa05915380403e244cbed053d0c04bfa1d4', "error-message": this.errorMessage }, h(EntityHeadInfo, { key: '4d496def6abfc728e6f184fb0729ac648fb2deaf', slot: "head-info", badge: h("span", { slot: 'badge', innerHTML: MapPaymentStatusToBadge(this.payment.status) }), title: `${formatCurrency(this.payment.amount)} ${(_a = this.payment) === null || _a === void 0 ? void 0 : _a.currency.toUpperCase()}` }, h(EntityHeadInfoItem, { key: '78dcff13206646d594bdc80f6297d45dc9932694', classes: "border-1 border-end", title: "Updated At", value: `${formatDate(this.payment.updated_at)} ${formatTime(this.payment.updated_at)}` }), h(EntityHeadInfoItem, { key: 'dfa0de667ebd28efd217b6bdf548b9b1b728b57e', classes: "border-1 border-end", title: "Created At", value: `${formatDate(this.payment.created_at)} ${formatTime(this.payment.created_at)}` }), h(EntityHeadInfoItem, { key: 'b449b180034f28504007a9c2fb0598607dc00efb', title: "ID", value: this.payment.id })), h("div", { key: '62af84e244e38b24b32f791d13f1b21b49942597', slot: 'detail-sections' }, h(DetailSectionTitle, { key: '0ddb0366b4ab737c7b08a37764b8ce2f7ec4a1e9', sectionTitle: "Details" }), h("div", { key: 'cb699194db16cb8608834779f560e882f6f9da7c', class: "d-table gap-2 w-100" }, h(DetailItem, { key: '3b6eb4a8b782668951bba90be3b5d522f3f7c69b', title: "Amount", value: formatCurrency(this.payment.amount) }), h(DetailItem, { key: '7a59ab0b12a263c38c40a98acbff6492d370b28b', title: "Fees", value: formatCurrency(this.payment.fee_amount) }), h(DetailItem, { key: 'a9eaa5d1959425205c144dc2aa7c7fad77014290', title: "Refunded", value: formatCurrency(this.payment.amount_refunded) }), h(DetailItem, { key: 'd70c3a4bf48c9c69625d5f27f1095f9b0744a71e', title: "Net", value: formatCurrency(this.payment.balance) }), h(DetailItem, { key: '28f526b1adcd475c2ae88a8bf09ae4aea7935df6', title: "Status", value: MapPaymentStatusToBadge(this.payment.status) }), h(DetailItem, { key: '700f51d787f20f575e3e11aa72a8da29a9587c2a', title: "Payment ID", value: this.payment.id }), h(DetailItem, { key: 'ea72ecc9c2f5055d4b0f6b37cd16cb318f9a797c', title: "Processing Fees", value: formatCurrency(this.payment.fee_amount) }), h(DetailItem, { key: '9d66af2c0c0baef4e8b7b021daf0b4d6adb267d2', title: "Statement Descriptor", value: this.payment.statement_descriptor }), h(DetailItem, { key: '3f21501c1e08feeee1e7427a42faf1c5d1d9c84d', title: "Description", value: this.payment.description })), this.payment.payment_method.card && [
|
|
46
|
+
h(DetailSectionTitle, { key: 'b7767b93e090c0195aca6c99b66b48d61b6134b3', sectionTitle: "Payment Method" }),
|
|
47
|
+
h("div", { key: 'a363c7a7e69932a8ffeddb5e0d53f7df13119a9a', class: "d-table gap-2 w-100" }, h(DetailItem, { key: 'fb0e1f64fcec23e513590b3048593565685d8400', title: "ID", value: this.payment.payment_method.card.id }), h(DetailItem, { key: 'bc181b1b94039e1aad341a8e563ba923976c806b', title: "Payment Type", value: "Card" }), h(DetailItem, { key: '88b21dd2368b88232cd0f464c381d4423fe3c774', title: "Last 4 Numbers", value: this.payment.payment_method.lastFourDigits }), h(DetailItem, { key: '040fd71315ead633f9c89e9a9dad906889759d77', title: "Brand", value: snakeCaseToHumanReadable(this.payment.payment_method.card.brand) }), h(DetailItem, { key: '35ebc74de2c5c8fafd95fc5b15ff4f2ca85220cc', title: "Cardholder", value: this.payment.payment_method.payersName }))
|
|
48
|
+
], this.payment.payment_method.bank_account && [
|
|
49
|
+
h(DetailSectionTitle, { key: 'f10eef0b4e4067fb78dbff16719a6f266f4e6bab', sectionTitle: "Payment Method" }),
|
|
50
|
+
h("div", { key: '6c1ef713b5dcabba5b516f3cbbd088d098873303', class: "d-table gap-2 w-100" }, h(DetailItem, { key: '8880fd0fb2b16ee6f177aba15d6f4485c95af252', title: "ID", value: this.payment.payment_method.bank_account.id }), h(DetailItem, { key: 'baa70304d2972f69ce8a5d077a076b16f986745b', title: "Last 4 Numbers", value: this.payment.payment_method.lastFourDigits }), h(DetailItem, { key: 'dcb63b9258bea698bf2d165c611dfa05cb320f30', title: "Bank Name", value: this.payment.payment_method.bank_account.brand }), h(DetailItem, { key: '806696c15aa5ef242c230d9c9aea642ddfdfd93d', title: "Account Owner", value: this.payment.payment_method.payersName }))
|
|
51
|
+
], h(DetailSectionTitle, { key: '83289d8f2cf57a624678260555f00af4ea96a566', sectionTitle: 'Metadata' }), h("div", { key: '02e248b962e0c06f4d83bae75a5759b234fea36b', class: "d-table gap-2 w-100" }, h(CodeBlock, { key: '5d81879c7815102219ed010dab9f573ad6b7985d', metadata: this.payment.metadata })))))));
|
|
52
|
+
}
|
|
53
|
+
static get watchers() { return {
|
|
54
|
+
"getPaymentDetails": ["updateOnPropChange"]
|
|
55
|
+
}; }
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { PaymentDetailsCore as payment_details_core };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { A as Api } from './p-29c0b182.js';
|
|
3
|
+
import './p-56f6ce4c.js';
|
|
4
|
+
import './p-df21aaad.js';
|
|
5
|
+
import './p-e3fab0e2.js';
|
|
6
|
+
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
7
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
8
|
+
import { J as JustifiAnalytics } from './p-9282eab8.js';
|
|
9
|
+
import './p-492588bf.js';
|
|
10
|
+
|
|
11
|
+
class InsuranceService {
|
|
12
|
+
async fetchQuote(authToken, payload) {
|
|
13
|
+
const endpoint = 'insurance/quotes';
|
|
14
|
+
return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
|
|
15
|
+
}
|
|
16
|
+
async toggleCoverage(authToken, quoteId, payload) {
|
|
17
|
+
const endpoint = `insurance/quotes/${quoteId}/toggle`;
|
|
18
|
+
return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const makeGetQuote = ({ authToken, service }) => async ({ payload, onSuccess, onError }) => {
|
|
23
|
+
var _a;
|
|
24
|
+
try {
|
|
25
|
+
const response = await service.fetchQuote(authToken, payload);
|
|
26
|
+
if (!response.error) {
|
|
27
|
+
const quote = response.data;
|
|
28
|
+
onSuccess({ quote });
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const responseError = getErrorMessage(response.error);
|
|
32
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
33
|
+
return onError({
|
|
34
|
+
error: responseError,
|
|
35
|
+
code,
|
|
36
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
42
|
+
return onError({
|
|
43
|
+
error: error.message || error,
|
|
44
|
+
code,
|
|
45
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const makeToggleCoverage = ({ authToken, service }) => async ({ quoteId, payload, onSuccess, onError }) => {
|
|
50
|
+
var _a;
|
|
51
|
+
try {
|
|
52
|
+
const response = await service.toggleCoverage(authToken, quoteId, payload);
|
|
53
|
+
if (!response.error) {
|
|
54
|
+
const quote = response.data;
|
|
55
|
+
onSuccess({ quote });
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const responseError = getErrorMessage(response.error);
|
|
59
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
60
|
+
return onError({
|
|
61
|
+
error: responseError,
|
|
62
|
+
code,
|
|
63
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
69
|
+
return onError({
|
|
70
|
+
error: error.message || error,
|
|
71
|
+
code,
|
|
72
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const SeasonInterruptionInsurance = class {
|
|
78
|
+
constructor(hostRef) {
|
|
79
|
+
registerInstance(this, hostRef);
|
|
80
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
81
|
+
this.authToken = undefined;
|
|
82
|
+
this.checkoutId = undefined;
|
|
83
|
+
this.primaryIdentityFirstName = undefined;
|
|
84
|
+
this.primaryIdentityLastName = undefined;
|
|
85
|
+
this.primaryIdentityState = undefined;
|
|
86
|
+
this.primaryIdentityPostalCode = undefined;
|
|
87
|
+
this.primaryIdentityCountry = undefined;
|
|
88
|
+
this.primaryIdentityEmailAddress = undefined;
|
|
89
|
+
this.policyAttributesInsurableAmount = undefined;
|
|
90
|
+
this.policyAttributesStartDate = undefined;
|
|
91
|
+
this.policyAttributesEndDate = undefined;
|
|
92
|
+
this.coveredIdentityFirstName = undefined;
|
|
93
|
+
this.coveredIdentityLastName = undefined;
|
|
94
|
+
this.getQuote = undefined;
|
|
95
|
+
this.toggleCoverage = undefined;
|
|
96
|
+
this.quote = undefined;
|
|
97
|
+
}
|
|
98
|
+
async validate() {
|
|
99
|
+
return this.seasonInterruptionCoreRef.validate();
|
|
100
|
+
}
|
|
101
|
+
componentWillLoad() {
|
|
102
|
+
this.analytics = new JustifiAnalytics(this);
|
|
103
|
+
this.initializeServiceMethods();
|
|
104
|
+
}
|
|
105
|
+
disconnectedCallback() {
|
|
106
|
+
this.analytics.cleanup();
|
|
107
|
+
}
|
|
108
|
+
initializeServiceMethods() {
|
|
109
|
+
if (!this.authToken) {
|
|
110
|
+
this.errorEvent.emit({
|
|
111
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
112
|
+
message: 'Missing authToken',
|
|
113
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
this.getQuote = makeGetQuote({
|
|
118
|
+
authToken: this.authToken,
|
|
119
|
+
service: new InsuranceService(),
|
|
120
|
+
});
|
|
121
|
+
this.toggleCoverage = makeToggleCoverage({
|
|
122
|
+
authToken: this.authToken,
|
|
123
|
+
service: new InsuranceService(),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
render() {
|
|
127
|
+
return (h("justifi-season-interruption-insurance-core", { key: '256d45d39c5d297abb7f955229b0e0e9fbc9504a', ref: (el) => (this.seasonInterruptionCoreRef = el), "checkout-id": this.checkoutId, getQuote: this.getQuote, toggleCoverage: this.toggleCoverage, "primary-identity-first-name": this.primaryIdentityFirstName, "primary-identity-last-name": this.primaryIdentityLastName, "primary-identity-state": this.primaryIdentityState, "primary-identity-postal-code": this.primaryIdentityPostalCode, "primary-identity-country": this.primaryIdentityCountry, "primary-identity-email-address": this.primaryIdentityEmailAddress, "policy-attributes-insurable-amount": this.policyAttributesInsurableAmount, "policy-attributes-start-date": this.policyAttributesStartDate, "policy-attributes-end-date": this.policyAttributesEndDate, "covered-identity-first-name": this.coveredIdentityFirstName, "covered-identity-last-name": this.coveredIdentityLastName }));
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export { SeasonInterruptionInsurance as justifi_season_interruption_insurance };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
3
|
+
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
4
|
+
import { A as Api } from './p-29c0b182.js';
|
|
5
|
+
import './p-56f6ce4c.js';
|
|
6
|
+
import './p-df21aaad.js';
|
|
7
|
+
import './p-e3fab0e2.js';
|
|
8
|
+
import { J as JustifiAnalytics } from './p-9282eab8.js';
|
|
9
|
+
import './p-492588bf.js';
|
|
10
|
+
|
|
11
|
+
const makeGetCheckout = ({ authToken, checkoutId, service }) => async ({ onSuccess, onError }) => {
|
|
12
|
+
var _a;
|
|
13
|
+
try {
|
|
14
|
+
const response = await service.fetchCheckout(authToken, checkoutId);
|
|
15
|
+
if (!response.error) {
|
|
16
|
+
const checkout = response.data;
|
|
17
|
+
onSuccess({ checkout });
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const responseError = getErrorMessage(response.error);
|
|
21
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
22
|
+
return onError({
|
|
23
|
+
error: responseError,
|
|
24
|
+
code,
|
|
25
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
31
|
+
return onError({
|
|
32
|
+
error: error.message || error,
|
|
33
|
+
code,
|
|
34
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const makeCheckoutComplete = ({ authToken, checkoutId, service }) => async ({ payment, onSuccess, onError }) => {
|
|
39
|
+
var _a;
|
|
40
|
+
try {
|
|
41
|
+
const response = await service.complete(authToken, checkoutId, payment);
|
|
42
|
+
if (!response.error) {
|
|
43
|
+
onSuccess(response);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const responseError = getErrorMessage(response.error);
|
|
47
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
48
|
+
return onError({
|
|
49
|
+
error: responseError,
|
|
50
|
+
code,
|
|
51
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
57
|
+
return onError({
|
|
58
|
+
error: error.message || error,
|
|
59
|
+
code,
|
|
60
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
class CheckoutService {
|
|
66
|
+
async fetchCheckout(authToken, checkoutId) {
|
|
67
|
+
const endpoint = `checkouts/${checkoutId}`;
|
|
68
|
+
return Api({ authToken, apiOrigin: undefined }).get(endpoint);
|
|
69
|
+
}
|
|
70
|
+
async complete(authToken, checkoutId, payment) {
|
|
71
|
+
const endpoint = `checkouts/${checkoutId}/complete`;
|
|
72
|
+
const payload = {
|
|
73
|
+
payment_mode: payment.payment_mode,
|
|
74
|
+
};
|
|
75
|
+
if (payment.payment_token) {
|
|
76
|
+
payload.payment_token = payment.payment_token;
|
|
77
|
+
}
|
|
78
|
+
return Api({ authToken, apiOrigin: undefined }).post(endpoint, JSON.stringify(payload));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const Checkout = class {
|
|
83
|
+
constructor(hostRef) {
|
|
84
|
+
registerInstance(this, hostRef);
|
|
85
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
86
|
+
this.loadedEvent = createEvent(this, "loaded", 7);
|
|
87
|
+
this.iframeOrigin = undefined;
|
|
88
|
+
this.authToken = undefined;
|
|
89
|
+
this.checkoutId = undefined;
|
|
90
|
+
this.disableCreditCard = undefined;
|
|
91
|
+
this.disableBankAccount = undefined;
|
|
92
|
+
this.disableBnpl = undefined;
|
|
93
|
+
this.disablePaymentMethodGroup = undefined;
|
|
94
|
+
this.getCheckout = undefined;
|
|
95
|
+
this.complete = undefined;
|
|
96
|
+
this.errorMessage = '';
|
|
97
|
+
}
|
|
98
|
+
componentWillLoad() {
|
|
99
|
+
this.analytics = new JustifiAnalytics(this);
|
|
100
|
+
this.initializeGetCheckout();
|
|
101
|
+
}
|
|
102
|
+
disconnectedCallback() {
|
|
103
|
+
this.analytics.cleanup();
|
|
104
|
+
}
|
|
105
|
+
initializeGetCheckout() {
|
|
106
|
+
if (this.authToken && this.checkoutId) {
|
|
107
|
+
this.getCheckout = makeGetCheckout({
|
|
108
|
+
authToken: this.authToken,
|
|
109
|
+
checkoutId: this.checkoutId,
|
|
110
|
+
service: new CheckoutService()
|
|
111
|
+
});
|
|
112
|
+
this.complete = makeCheckoutComplete({
|
|
113
|
+
authToken: this.authToken,
|
|
114
|
+
checkoutId: this.checkoutId,
|
|
115
|
+
service: new CheckoutService()
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.errorEvent.emit({
|
|
120
|
+
message: 'auth-token and checkout-id are required',
|
|
121
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
122
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
propChanged() {
|
|
127
|
+
this.initializeGetCheckout();
|
|
128
|
+
}
|
|
129
|
+
async fillBillingForm(fields) {
|
|
130
|
+
this.checkoutCoreRef.fillBillingForm(fields);
|
|
131
|
+
}
|
|
132
|
+
render() {
|
|
133
|
+
return (h("justifi-checkout-core", { key: 'd2f6bfed1be767edcf4ba21cddc503ff5efbec1a', getCheckout: this.getCheckout, authToken: this.authToken, complete: this.complete, disableCreditCard: this.disableCreditCard, disableBankAccount: this.disableBankAccount, disableBnpl: this.disableBnpl, disablePaymentMethodGroup: this.disablePaymentMethodGroup, ref: el => {
|
|
134
|
+
if (el) {
|
|
135
|
+
this.checkoutCoreRef = el;
|
|
136
|
+
}
|
|
137
|
+
} }, h("div", { key: '45ac1bea74ca8ef7999211b51fe7791225d61f00', slot: "insurance" }, h("slot", { key: '13e051844cc7cb4aed98076ccd64954b2dd68228', name: "insurance" }))));
|
|
138
|
+
}
|
|
139
|
+
static get watchers() { return {
|
|
140
|
+
"authToken": ["propChanged"],
|
|
141
|
+
"checkoutId": ["propChanged"]
|
|
142
|
+
}; }
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export { Checkout as justifi_checkout };
|
|
@@ -1 +1,126 @@
|
|
|
1
|
-
import{f as
|
|
1
|
+
import { f as filterNumber, c as constructDate, g as getStateAbbreviation } from './p-1ff8810b.js';
|
|
2
|
+
|
|
3
|
+
class Owner {
|
|
4
|
+
constructor(owner) {
|
|
5
|
+
this.address = Object.assign({}, new Address(owner.address || {}));
|
|
6
|
+
this.created_at = owner.created_at;
|
|
7
|
+
this.dob_day = filterNumber(owner.dob_day);
|
|
8
|
+
this.dob_month = filterNumber(owner.dob_month);
|
|
9
|
+
this.dob_year = owner.dob_year;
|
|
10
|
+
this.dob_full = constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
|
|
11
|
+
this.documents = owner.documents;
|
|
12
|
+
this.email = owner.email;
|
|
13
|
+
this.id = owner.id;
|
|
14
|
+
this.business_id = owner.business_id;
|
|
15
|
+
this.is_owner = owner.is_owner;
|
|
16
|
+
this.metadata = owner.metadata;
|
|
17
|
+
this.name = owner.name;
|
|
18
|
+
this.phone = owner.phone;
|
|
19
|
+
this.platform_account_id = owner.platform_account_id;
|
|
20
|
+
this.identification_number = owner.identification_number;
|
|
21
|
+
this.ssn_last4 = owner.ssn_last4;
|
|
22
|
+
this.title = owner.title;
|
|
23
|
+
this.updated_at = owner.updated_at;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class Representative {
|
|
27
|
+
constructor(representative) {
|
|
28
|
+
this.address = Object.assign({}, new Address(representative.address || {}));
|
|
29
|
+
this.created_at = representative.created_at;
|
|
30
|
+
this.dob_day = filterNumber(representative.dob_day);
|
|
31
|
+
this.dob_month = filterNumber(representative.dob_month);
|
|
32
|
+
this.dob_year = representative.dob_year;
|
|
33
|
+
this.dob_full = constructDate(this.dob_year, this.dob_month, this.dob_day) || '';
|
|
34
|
+
this.documents = representative.documents;
|
|
35
|
+
this.email = representative.email;
|
|
36
|
+
this.id = representative.id;
|
|
37
|
+
this.business_id = representative.business_id;
|
|
38
|
+
this.is_owner = representative.is_owner;
|
|
39
|
+
this.metadata = representative.metadata;
|
|
40
|
+
this.name = representative.name;
|
|
41
|
+
this.phone = representative.phone;
|
|
42
|
+
this.platform_account_id = representative.platform_account_id;
|
|
43
|
+
this.identification_number = representative.identification_number;
|
|
44
|
+
this.ssn_last4 = representative.ssn_last4;
|
|
45
|
+
this.title = representative.title;
|
|
46
|
+
this.updated_at = representative.updated_at;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var BusinessClassification;
|
|
51
|
+
(function (BusinessClassification) {
|
|
52
|
+
BusinessClassification["sole_proprietor"] = "sole_proprietor";
|
|
53
|
+
BusinessClassification["partnership"] = "partnership";
|
|
54
|
+
BusinessClassification["corporation"] = "corporation";
|
|
55
|
+
BusinessClassification["public_company"] = "public_company";
|
|
56
|
+
BusinessClassification["limited"] = "limited";
|
|
57
|
+
BusinessClassification["non_profit"] = "non_profit";
|
|
58
|
+
BusinessClassification["government"] = "government";
|
|
59
|
+
})(BusinessClassification || (BusinessClassification = {}));
|
|
60
|
+
class Address {
|
|
61
|
+
constructor(address) {
|
|
62
|
+
this.id = address.id;
|
|
63
|
+
this.platform_account_id = address.platform_account_id;
|
|
64
|
+
this.line1 = address.line1;
|
|
65
|
+
this.line2 = address.line2;
|
|
66
|
+
this.postal_code = address.postal_code;
|
|
67
|
+
this.city = address.city;
|
|
68
|
+
this.state = getStateAbbreviation(address.state);
|
|
69
|
+
this.country = address.country || 'USA';
|
|
70
|
+
this.created_at = address.created_at;
|
|
71
|
+
this.updated_at = address.updated_at;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
class AdditionalQuestions {
|
|
75
|
+
constructor(additionalQuestions) {
|
|
76
|
+
this.business_revenue = additionalQuestions.business_revenue;
|
|
77
|
+
this.business_payment_volume = additionalQuestions.business_payment_volume;
|
|
78
|
+
this.business_when_service_received = additionalQuestions.business_when_service_received;
|
|
79
|
+
this.business_recurring_payments = additionalQuestions.business_recurring_payments;
|
|
80
|
+
this.business_recurring_payments_percentage = additionalQuestions.business_recurring_payments_percentage;
|
|
81
|
+
this.business_seasonal = additionalQuestions.business_seasonal;
|
|
82
|
+
this.business_other_payment_details = additionalQuestions.business_other_payment_details;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
class CoreBusinessInfo {
|
|
86
|
+
constructor(coreBusinessInfo) {
|
|
87
|
+
this.classification = coreBusinessInfo.classification;
|
|
88
|
+
this.legal_name = coreBusinessInfo.legal_name;
|
|
89
|
+
this.doing_business_as = coreBusinessInfo.doing_business_as;
|
|
90
|
+
this.industry = coreBusinessInfo.industry;
|
|
91
|
+
this.tax_id = coreBusinessInfo.tax_id;
|
|
92
|
+
this.website_url = coreBusinessInfo.website_url;
|
|
93
|
+
this.email = coreBusinessInfo.email;
|
|
94
|
+
this.phone = coreBusinessInfo.phone;
|
|
95
|
+
this.date_of_incorporation = coreBusinessInfo.date_of_incorporation;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
class Business {
|
|
99
|
+
constructor(business) {
|
|
100
|
+
this.additional_questions = Object.assign({}, new AdditionalQuestions(business.additional_questions || {}));
|
|
101
|
+
this.associated_accounts = business.associated_accounts;
|
|
102
|
+
this.classification = business.classification;
|
|
103
|
+
this.bank_accounts = business.bank_accounts;
|
|
104
|
+
this.created_at = business.created_at;
|
|
105
|
+
this.documents = business.documents;
|
|
106
|
+
this.doing_business_as = business.doing_business_as;
|
|
107
|
+
this.email = business.email;
|
|
108
|
+
this.id = business.id;
|
|
109
|
+
this.industry = business.industry;
|
|
110
|
+
this.legal_address = Object.assign({}, new Address(business.legal_address || {}));
|
|
111
|
+
this.legal_name = business.legal_name;
|
|
112
|
+
this.metadata = business.metadata;
|
|
113
|
+
this.owners = business.owners;
|
|
114
|
+
this.phone = business.phone;
|
|
115
|
+
this.platform_account_id = business.platform_account_id;
|
|
116
|
+
this.product_categories = business.product_categories;
|
|
117
|
+
this.representative = Object.assign({}, new Representative(business.representative || {}));
|
|
118
|
+
this.tax_id = business.tax_id;
|
|
119
|
+
this.terms_conditions_accepted = business.terms_conditions_accepted;
|
|
120
|
+
this.updated_at = business.updated_at;
|
|
121
|
+
this.website_url = business.website_url;
|
|
122
|
+
this.date_of_incorporation = business.date_of_incorporation;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { AdditionalQuestions as A, Business as B, CoreBusinessInfo as C, Owner as O, Representative as R, BusinessClassification as a, Address as b };
|
|
@@ -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-9282eab8.js';
|
|
10
|
+
import './p-29c0b182.js';
|
|
11
|
+
import './p-492588bf.js';
|
|
12
|
+
|
|
13
|
+
const makeGetPayments = ({ id, authToken, service }) => async ({ params, onSuccess, onError }) => {
|
|
14
|
+
var _a, _b;
|
|
15
|
+
try {
|
|
16
|
+
const response = await service.fetchPayments(id, authToken, params);
|
|
17
|
+
if (!response.error) {
|
|
18
|
+
const pagingInfo = Object.assign({}, response.page_info);
|
|
19
|
+
const payments = ((_a = response.data) === null || _a === void 0 ? void 0 : _a.map((dataItem) => new Payment(dataItem))) || [];
|
|
20
|
+
onSuccess({ payments, pagingInfo });
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const responseError = getErrorMessage(response.error);
|
|
24
|
+
const code = getErrorCode((_b = response.error) === null || _b === void 0 ? void 0 : _b.code);
|
|
25
|
+
return onError({
|
|
26
|
+
error: responseError,
|
|
27
|
+
code,
|
|
28
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
34
|
+
return onError({
|
|
35
|
+
error: error.message || error,
|
|
36
|
+
code,
|
|
37
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const PaymentsList = 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.accountId = undefined;
|
|
51
|
+
this.authToken = undefined;
|
|
52
|
+
this.getPayments = undefined;
|
|
53
|
+
this.errorMessage = null;
|
|
54
|
+
}
|
|
55
|
+
componentWillLoad() {
|
|
56
|
+
this.analytics = new JustifiAnalytics(this);
|
|
57
|
+
this.initializeGetPayments();
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
this.analytics.cleanup();
|
|
61
|
+
}
|
|
62
|
+
propChanged() {
|
|
63
|
+
this.initializeGetPayments();
|
|
64
|
+
}
|
|
65
|
+
initializeGetPayments() {
|
|
66
|
+
if (this.accountId && this.authToken) {
|
|
67
|
+
this.getPayments = makeGetPayments({
|
|
68
|
+
id: this.accountId,
|
|
69
|
+
authToken: this.authToken,
|
|
70
|
+
service: new PaymentService(),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.errorMessage = 'Account ID and Auth Token are required';
|
|
75
|
+
this.errorEvent.emit({
|
|
76
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
77
|
+
message: this.errorMessage,
|
|
78
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
if (this.errorMessage) {
|
|
84
|
+
return ErrorState(this.errorMessage);
|
|
85
|
+
}
|
|
86
|
+
return (h("payments-list-core", { getPayments: this.getPayments, "onError-event": this.handleErrorEvent }));
|
|
87
|
+
}
|
|
88
|
+
static get watchers() { return {
|
|
89
|
+
"accountId": ["propChanged"],
|
|
90
|
+
"authToken": ["propChanged"]
|
|
91
|
+
}; }
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export { PaymentsList as justifi_payments_list };
|