@justifi/webcomponents 5.4.2 → 5.4.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/{SubAccount-06f9030b.js → SubAccount-2a302ead.js} +1 -0
- package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +1 -1
- package/dist/cjs/billing-form_3.cjs.entry.js +1 -1
- package/dist/cjs/{check-pkg-version-15023e22.js → check-pkg-version-e6dcbeb7.js} +1 -1
- package/dist/cjs/{checkout.service-ab658f38.js → checkout.service-0a7835dc.js} +1 -1
- package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
- package/dist/cjs/{dispute.service-1494b42c.js → dispute.service-6efc7d7f.js} +1 -1
- package/dist/cjs/{get-payout-csv-4240b172.js → get-payout-csv-7607c71e.js} +1 -1
- package/dist/cjs/{get-subaccounts-fa8dc254.js → get-subaccounts-ae5b35a8.js} +1 -1
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +1 -1
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +4 -4
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +4 -4
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +8 -7
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +26 -29
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +6 -6
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{package-868b01af.js → package-5a9f02b2.js} +1 -1
- package/dist/cjs/{payment.service-97bef4f8.js → payment.service-537e049d.js} +1 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
- package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +2 -2
- package/dist/cjs/{terminal-orders-table-050e673f.js → terminal-orders-table-3b247193.js} +2 -0
- package/dist/cjs/{terminal.service-0aac977d.js → terminal.service-ab62c344.js} +1 -1
- package/dist/cjs/terminals-list-core.cjs.entry.js +2 -2
- package/dist/cjs/{terminals-table-6710a76c.js → terminals-table-594643fd.js} +2 -2
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/TerminalOrder.js +1 -0
- package/dist/collection/components/order-terminals/order-terminals.js +22 -3
- package/dist/collection/components/refund-payment/refund-payment.js +97 -52
- package/dist/collection/components/terminal-orders-list/terminal-orders-table.js +2 -0
- package/dist/collection/components/terminals-list/terminals-table.js +2 -2
- package/dist/docs.json +116 -43
- package/dist/esm/{SubAccount-837658ae.js → SubAccount-7520271c.js} +1 -0
- package/dist/esm/bank-account-document-form-inputs_4.entry.js +1 -1
- package/dist/esm/billing-form_3.entry.js +1 -1
- package/dist/esm/{check-pkg-version-a8dd8455.js → check-pkg-version-47fc35a7.js} +1 -1
- package/dist/esm/{checkout.service-87cd501d.js → checkout.service-e38e477f.js} +1 -1
- package/dist/esm/checkouts-list-core.entry.js +1 -1
- package/dist/esm/{dispute.service-1f79929b.js → dispute.service-7ba6d5a4.js} +1 -1
- package/dist/esm/{get-payout-csv-6139c5fc.js → get-payout-csv-fa34f40b.js} +1 -1
- package/dist/esm/{get-subaccounts-c4b2b829.js → get-subaccounts-3c6b9e84.js} +1 -1
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +1 -1
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +1 -1
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +4 -4
- package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-checkouts-list.entry.js +5 -5
- package/dist/esm/justifi-dispute-management.entry.js +4 -4
- package/dist/esm/justifi-dispute-notification_3.entry.js +4 -4
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-order-terminals.entry.js +8 -7
- package/dist/esm/justifi-payment-details.entry.js +4 -4
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +4 -4
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payouts-list.entry.js +5 -5
- package/dist/esm/justifi-refund-payment.entry.js +26 -29
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list.entry.js +4 -4
- package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminals-list.entry.js +6 -6
- package/dist/esm/justifi-tokenize-payment-method.entry.js +3 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{package-f0bb46fd.js → package-c8466624.js} +1 -1
- package/dist/esm/{payment.service-bc99d372.js → payment.service-af5bd8be.js} +1 -1
- package/dist/esm/payments-list-core.entry.js +1 -1
- package/dist/esm/payouts-list-core.entry.js +1 -1
- package/dist/esm/terminal-orders-list-core.entry.js +2 -2
- package/dist/esm/{terminal-orders-table-65d59323.js → terminal-orders-table-93e84d25.js} +2 -0
- package/dist/esm/{terminal.service-a8a968ac.js → terminal.service-d173566d.js} +1 -1
- package/dist/esm/terminals-list-core.entry.js +2 -2
- package/dist/esm/{terminals-table-5eb287ca.js → terminals-table-ff24bf27.js} +2 -2
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/SubAccount.js +1 -0
- package/dist/module/justifi-order-terminals.js +5 -3
- package/dist/module/justifi-refund-payment.js +31 -31
- package/dist/module/package.js +1 -1
- package/dist/module/terminal-orders-list-core2.js +2 -0
- package/dist/module/terminals-list-core2.js +2 -2
- package/dist/types/api/TerminalOrder.d.ts +2 -0
- package/dist/types/components/order-terminals/order-terminals.d.ts +1 -0
- package/dist/types/components/refund-payment/refund-payment.d.ts +9 -36
- package/dist/types/components/terminal-orders-list/terminal-orders-table.d.ts +2 -0
- package/dist/types/components/terminals-list/terminals-table.d.ts +2 -2
- package/dist/types/components.d.ts +11 -35
- package/dist/webcomponents/{p-c00ef77b.entry.js → p-04d6b37e.entry.js} +1 -1
- package/dist/webcomponents/{p-5bd1c32c.entry.js → p-0fa216eb.entry.js} +1 -1
- package/dist/webcomponents/p-1361d8eb.entry.js +1 -0
- package/dist/webcomponents/{p-507d8aa4.entry.js → p-1cfa5df9.entry.js} +1 -1
- package/dist/webcomponents/{p-d86add24.entry.js → p-21def20b.entry.js} +1 -1
- package/dist/webcomponents/{p-913e28d6.entry.js → p-290fa30d.entry.js} +1 -1
- package/dist/webcomponents/{p-0d7d61ac.js → p-2a9d7f6b.js} +1 -1
- package/dist/webcomponents/{p-190ee091.entry.js → p-2aad7e3b.entry.js} +1 -1
- package/dist/webcomponents/{p-a2d30370.entry.js → p-3075b7e1.entry.js} +1 -1
- package/dist/webcomponents/{p-45fda0bc.entry.js → p-35c296fc.entry.js} +1 -1
- package/dist/webcomponents/{p-a589b3a1.entry.js → p-3cc7527a.entry.js} +1 -1
- package/dist/webcomponents/{p-ebd814ab.entry.js → p-3cf317d3.entry.js} +1 -1
- package/dist/webcomponents/{p-746894be.entry.js → p-407d6d29.entry.js} +1 -1
- package/dist/webcomponents/{p-c438d1c8.entry.js → p-4451de8d.entry.js} +1 -1
- package/dist/webcomponents/{p-b299b597.entry.js → p-4f7432c3.entry.js} +1 -1
- package/dist/webcomponents/{p-96783edf.js → p-536fb8e2.js} +1 -1
- package/dist/webcomponents/{p-9e49cf17.js → p-54556fc6.js} +1 -1
- package/dist/webcomponents/{p-9c4e3bac.js → p-5a541d35.js} +1 -1
- package/dist/webcomponents/{p-8c70396c.entry.js → p-645db2cb.entry.js} +1 -1
- package/dist/webcomponents/p-70be104e.js +1 -0
- package/dist/webcomponents/{p-dcff8139.entry.js → p-7e8732f7.entry.js} +1 -1
- package/dist/webcomponents/p-81a6c3e2.entry.js +1 -0
- package/dist/webcomponents/{p-14cfb25e.entry.js → p-829480e7.entry.js} +1 -1
- package/dist/webcomponents/{p-ac9f2e2b.js → p-87a4fb5b.js} +1 -1
- package/dist/webcomponents/{p-e309516a.entry.js → p-94e4f1f1.entry.js} +1 -1
- package/dist/webcomponents/{p-72e71b3c.js → p-9a9732e1.js} +1 -1
- package/dist/webcomponents/p-9fecad5a.js +1 -0
- package/dist/webcomponents/{p-90b82e40.entry.js → p-a8c69f51.entry.js} +1 -1
- package/dist/webcomponents/{p-60ec062a.entry.js → p-ad713ab6.entry.js} +1 -1
- package/dist/webcomponents/{p-2819e94a.entry.js → p-b218af87.entry.js} +1 -1
- package/dist/webcomponents/{p-150e80db.entry.js → p-b50ca848.entry.js} +1 -1
- package/dist/webcomponents/p-b8664571.entry.js +1 -0
- package/dist/webcomponents/{p-6a594a9f.js → p-cbad44b7.js} +1 -1
- package/dist/webcomponents/{p-5c5c1e82.entry.js → p-dd2938d3.entry.js} +1 -1
- package/dist/webcomponents/{p-b99817a0.js → p-de03d0f8.js} +1 -1
- package/dist/webcomponents/{p-187d456b.entry.js → p-e1ae5e80.entry.js} +1 -1
- package/dist/webcomponents/{p-431670c6.entry.js → p-e3855f51.entry.js} +1 -1
- package/dist/webcomponents/{p-1da00a0c.entry.js → p-e73be1b9.entry.js} +1 -1
- package/dist/webcomponents/p-ef1db3da.entry.js +1 -0
- package/dist/webcomponents/{p-b5c7cb4c.entry.js → p-f13b2991.entry.js} +1 -1
- package/dist/webcomponents/{p-3da2652e.js → p-f4aeb100.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-74711d79.entry.js +0 -1
- package/dist/webcomponents/p-953e9dba.js +0 -1
- package/dist/webcomponents/p-b26fb429.js +0 -1
- package/dist/webcomponents/p-c7313123.entry.js +0 -1
- package/dist/webcomponents/p-cf9e893a.entry.js +0 -1
- package/dist/webcomponents/p-f0a56d96.entry.js +0 -1
|
@@ -2,14 +2,14 @@ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/i
|
|
|
2
2
|
import { c as create$3, a as create$6, F as FormController } from './form.js';
|
|
3
3
|
import { f as formatCurrency } from './utils2.js';
|
|
4
4
|
import { A as Api } from './Api.js';
|
|
5
|
-
import './ComponentError.js';
|
|
5
|
+
import { C as ComponentErrorCodes, a as ComponentErrorSeverity } from './ComponentError.js';
|
|
6
6
|
import './Checkout.js';
|
|
7
7
|
import './Pagination.js';
|
|
8
8
|
import './Payment.js';
|
|
9
9
|
import './SubAccount.js';
|
|
10
10
|
import './Document.js';
|
|
11
|
+
import { B as Button } from './button.js';
|
|
11
12
|
import { S as StyledHost } from './styled-host.js';
|
|
12
|
-
import { H as Header1 } from './header-1.js';
|
|
13
13
|
import './details.js';
|
|
14
14
|
import { d as defineCustomElement$7 } from './custom-popper2.js';
|
|
15
15
|
import { d as defineCustomElement$6 } from './form-control-help-text3.js';
|
|
@@ -55,14 +55,17 @@ const RefundPayment = /*@__PURE__*/ proxyCustomElement(class RefundPayment exten
|
|
|
55
55
|
super();
|
|
56
56
|
this.__registerHost();
|
|
57
57
|
this.__attachShadow();
|
|
58
|
-
this.
|
|
58
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
59
|
+
this.submitEvent = createEvent(this, "submit-event", 7);
|
|
59
60
|
this.authToken = undefined;
|
|
60
61
|
this.paymentId = undefined;
|
|
62
|
+
this.hideSubmitButton = false;
|
|
63
|
+
this.apiOrigin = "https://wc-proxy.justifi.ai";
|
|
61
64
|
this.paymentAmountRefundable = 0;
|
|
62
|
-
this.
|
|
65
|
+
this.errorMessage = null;
|
|
63
66
|
this.errors = {};
|
|
64
67
|
this.values = {};
|
|
65
|
-
this.
|
|
68
|
+
this.isLoading = false;
|
|
66
69
|
}
|
|
67
70
|
componentWillLoad() {
|
|
68
71
|
this.formController = new FormController(RefundPaymentSchema(this.paymentAmountRefundable.toString()));
|
|
@@ -76,58 +79,55 @@ const RefundPayment = /*@__PURE__*/ proxyCustomElement(class RefundPayment exten
|
|
|
76
79
|
this.values = Object.assign({}, values);
|
|
77
80
|
});
|
|
78
81
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Handles the form submission.
|
|
81
|
-
* Prevents the default form action, validates the form, and emits the 'submitted' event.
|
|
82
|
-
*/
|
|
83
82
|
async handleSubmit(event) {
|
|
84
83
|
event.preventDefault();
|
|
85
84
|
this.formController.validateAndSubmit(this.submitRefund);
|
|
86
85
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Submits the refund request to the API.
|
|
89
|
-
*/
|
|
90
86
|
async submitRefund(values) {
|
|
91
|
-
this.
|
|
87
|
+
this.isLoading = true;
|
|
88
|
+
let refundResponse;
|
|
92
89
|
try {
|
|
93
|
-
|
|
94
|
-
this.submitted.emit(response);
|
|
90
|
+
refundResponse = await this.api.post(`payments/${this.paymentId}/refunds`, values);
|
|
95
91
|
}
|
|
96
92
|
catch (error) {
|
|
97
93
|
console.error('Error submitting refund:', error);
|
|
98
|
-
this.
|
|
94
|
+
this.errorEvent.emit(error);
|
|
99
95
|
}
|
|
100
96
|
finally {
|
|
101
|
-
this.
|
|
97
|
+
this.submitEvent.emit({ response: refundResponse });
|
|
98
|
+
this.isLoading = false;
|
|
102
99
|
}
|
|
103
100
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Handles input changes, updating the refundFields state.
|
|
106
|
-
*/
|
|
107
101
|
handleInput(field, value) {
|
|
108
102
|
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [field]: value }));
|
|
109
103
|
}
|
|
110
|
-
/**
|
|
111
|
-
* Initializes the API with the given authentication token.
|
|
112
|
-
* Logs a warning if the auth token is missing.
|
|
113
|
-
*/
|
|
114
104
|
initializeApi() {
|
|
115
|
-
if (
|
|
116
|
-
|
|
105
|
+
if (this.paymentId && this.authToken) {
|
|
106
|
+
this.api = Api({ authToken: this.authToken, apiOrigin: "https://wc-proxy.justifi.ai" });
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.errorMessage = 'Payment ID and Auth Token are required';
|
|
110
|
+
this.errorEvent.emit({
|
|
111
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
112
|
+
message: this.errorMessage,
|
|
113
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
114
|
+
});
|
|
117
115
|
}
|
|
118
|
-
this.api = Api({ authToken: this.authToken, apiOrigin: "https://wc-proxy.justifi.ai" });
|
|
119
116
|
}
|
|
120
117
|
render() {
|
|
121
|
-
return (h(StyledHost, { key: '
|
|
118
|
+
return (h(StyledHost, { key: 'ea0429d62ea383b6525251150978bb0ebfb2704e' }, h("form", { key: '8f2e00b871ee896ba82311d8975574e5a2cbf6e3' }, h("div", { key: 'fa6476367e4a8b7fd7cdfff906671ef597b453de', class: "row gy-3" }, h("div", { key: '72a48181200d6116ceb4bb511bdd33c8c8197742', class: "form-group" }, h("form-control-monetary", { key: 'f6a3b3a7d8d8c733cb032db96878ad64ff712356', name: "amount", label: "Refund Amount", inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.amount, defaultValue: this.paymentAmountRefundable.toString() })), h("div", { key: '47e6dc07510e192caf00ce959348a2a9472f48f8', class: "form-group" }, h("form-control-select", { key: '9f9b761eea9964c7f6ac1dd907a4fee8cd63c906', label: "Reason for refund (optional)", options: refundReasonOptions, name: "reason", defaultValue: '' })), h("div", { key: 'daa4bf44ec311e0554ea28f97a0932673d542a31', class: "form-group" }, h("form-control-textarea", { key: 'a03d055e6462b9a23e714ca58a942a6da0365919', name: "description", label: "Note (optional)", inputHandler: (name, value) => this.handleInput(name, value), errorText: this.errors.description, maxLength: 250 })), h("div", { key: 'b744d28ff0a2d6aa37b1ebe2b7ea6d9b3edbbc39', class: "form-group d-flex flex-row-reverse" }, h(Button, { key: '3f62881a5fa333277478d35a7c19a8c4ca8bb929', variant: "primary", type: "submit", onClick: e => this.handleSubmit(e), isLoading: this.isLoading, hidden: this.hideSubmitButton }, `Refund ${formatCurrency(+this.values.amount)}`))))));
|
|
122
119
|
}
|
|
123
120
|
}, [1, "justifi-refund-payment", {
|
|
124
121
|
"authToken": [1, "auth-token"],
|
|
125
122
|
"paymentId": [1, "payment-id"],
|
|
126
|
-
"
|
|
127
|
-
"
|
|
123
|
+
"hideSubmitButton": [4, "hide-submit-button"],
|
|
124
|
+
"apiOrigin": [1, "api-origin"],
|
|
125
|
+
"paymentAmountRefundable": [32],
|
|
126
|
+
"errorMessage": [32],
|
|
128
127
|
"errors": [32],
|
|
129
128
|
"values": [32],
|
|
130
|
-
"
|
|
129
|
+
"isLoading": [32],
|
|
130
|
+
"submitRefund": [64]
|
|
131
131
|
}]);
|
|
132
132
|
function defineCustomElement$1() {
|
|
133
133
|
if (typeof customElements === "undefined") {
|
package/dist/module/package.js
CHANGED
|
@@ -41,6 +41,7 @@ const terminalOrdersTableColumns = {
|
|
|
41
41
|
updated_at: () => (h("th", { part: tableHeadCell, scope: "col", title: "The date and time the order was last updated" }, "Updated At")),
|
|
42
42
|
order_status: () => (h("th", { part: tableHeadCell, scope: "col", title: "The current status of the order" }, "Order Status")),
|
|
43
43
|
business_id: () => (h("th", { part: tableHeadCell, scope: "col", title: "The business ID associated with the order" }, "Business ID")),
|
|
44
|
+
company_name: () => (h("th", { part: tableHeadCell, scope: "col", title: "The business name associated with the order" }, "Business Name")),
|
|
44
45
|
provider: () => (h("th", { part: tableHeadCell, scope: "col", title: "The provider associated with the order" }, "Provider")),
|
|
45
46
|
order_type: () => (h("th", { part: tableHeadCell, scope: "col", title: "The type of order" }, "Order Type")),
|
|
46
47
|
quantity: () => (h("th", { part: tableHeadCell, scope: "col", title: "The number of terminals associated with the order" }, "Order Quantity")),
|
|
@@ -54,6 +55,7 @@ const terminalOrdersTableCells = {
|
|
|
54
55
|
h("div", { class: "fw-bold" }, convertToLocal(terminalOrder.updated_at, { showTime: true })))),
|
|
55
56
|
order_status: (terminalOrder, index) => (h("td", { part: getAlternateTableCellPart(index) }, MapTerminalOrderStatusToBadge(terminalOrder.order_status))),
|
|
56
57
|
business_id: (terminalOrder, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminalOrder.business_id)),
|
|
58
|
+
company_name: (terminalOrder, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminalOrder.company_name)),
|
|
57
59
|
provider: (terminalOrder, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminalOrder.provider)),
|
|
58
60
|
order_type: (terminalOrder, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminalOrder.order_type)),
|
|
59
61
|
quantity: (terminalOrder, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminalOrder.terminals.length)),
|
|
@@ -47,7 +47,7 @@ const terminalTableColumns = {
|
|
|
47
47
|
id: () => (h("th", { part: tableHeadCell, scope: "col", title: "The ID of the terminal" }, "ID")),
|
|
48
48
|
provider: () => (h("th", { part: tableHeadCell, scope: "col", title: "The provider of the terminal" }, "Provider")),
|
|
49
49
|
provider_serial_number: () => (h("th", { part: tableHeadCell, scope: "col", title: "The serial number of the terminal" }, "Serial Number")),
|
|
50
|
-
|
|
50
|
+
device_id: () => (h("th", { part: tableHeadCell, scope: "col", title: "The device/provider ID of the terminal" }, "Device ID")),
|
|
51
51
|
sub_account_name: () => (h("th", { part: tableHeadCell, scope: "col", title: "The sub account associated with the terminal" }, "Sub Account")),
|
|
52
52
|
status: () => (h("th", { part: tableHeadCell, scope: "col", title: "The current status of each terminal" }, "Status")),
|
|
53
53
|
};
|
|
@@ -57,7 +57,7 @@ const terminalTableCells = {
|
|
|
57
57
|
id: (terminal, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminal.id)),
|
|
58
58
|
provider: (terminal, index) => (h("td", { part: getAlternateTableCellPart(index) }, capitalFirstLetter(terminal.provider))),
|
|
59
59
|
provider_serial_number: (terminal, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminal.provider_serial_number)),
|
|
60
|
-
|
|
60
|
+
device_id: (terminal, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminal.provider_id)),
|
|
61
61
|
sub_account_name: (terminal, index) => (h("td", { part: getAlternateTableCellPart(index) }, terminal.sub_account_name)),
|
|
62
62
|
status: (terminal, index) => (h("td", { part: getAlternateTableCellPart(index) }, MapTerminalStatusToBadge(terminal.status))),
|
|
63
63
|
};
|
|
@@ -27,6 +27,7 @@ interface TerminalOrderItem {
|
|
|
27
27
|
export interface ITerminalOrder {
|
|
28
28
|
id?: string;
|
|
29
29
|
business_id?: string;
|
|
30
|
+
company_name?: string;
|
|
30
31
|
sub_account_id?: string;
|
|
31
32
|
provider?: TerminalProviders;
|
|
32
33
|
order_type?: TerminalOrderType;
|
|
@@ -38,6 +39,7 @@ export interface ITerminalOrder {
|
|
|
38
39
|
export declare class TerminalOrder {
|
|
39
40
|
id: string;
|
|
40
41
|
business_id: string;
|
|
42
|
+
company_name: string;
|
|
41
43
|
sub_account_id: string;
|
|
42
44
|
provider: TerminalProviders;
|
|
43
45
|
order_type: TerminalOrderType;
|
|
@@ -1,51 +1,24 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { ComponentErrorEvent, ComponentSubmitEvent } from '../../api';
|
|
3
3
|
export declare class RefundPayment {
|
|
4
|
-
/**
|
|
5
|
-
* Authentication token required to authorize the refund transaction.
|
|
6
|
-
*/
|
|
7
4
|
authToken: string;
|
|
8
|
-
/**
|
|
9
|
-
* The unique identifier for the payment to be refunded.
|
|
10
|
-
*/
|
|
11
5
|
paymentId: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Flag to control the visibility of the submit button.
|
|
18
|
-
*/
|
|
19
|
-
withButton?: boolean;
|
|
6
|
+
hideSubmitButton?: boolean;
|
|
7
|
+
apiOrigin?: string;
|
|
8
|
+
paymentAmountRefundable: number;
|
|
9
|
+
errorMessage: string;
|
|
20
10
|
errors: any;
|
|
21
11
|
values: any;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* The submitted refund fields are passed as the event detail.
|
|
26
|
-
*/
|
|
27
|
-
submitted: EventEmitter<RefundPaymentFields>;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
errorEvent: EventEmitter<ComponentErrorEvent>;
|
|
14
|
+
submitEvent: EventEmitter<ComponentSubmitEvent>;
|
|
28
15
|
private formController;
|
|
29
16
|
private api;
|
|
30
17
|
componentWillLoad(): void;
|
|
31
18
|
componentDidLoad(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Handles the form submission.
|
|
34
|
-
* Prevents the default form action, validates the form, and emits the 'submitted' event.
|
|
35
|
-
*/
|
|
36
19
|
handleSubmit(event: Event): Promise<void>;
|
|
37
|
-
|
|
38
|
-
* Submits the refund request to the API.
|
|
39
|
-
*/
|
|
40
|
-
private submitRefund;
|
|
41
|
-
/**
|
|
42
|
-
* Handles input changes, updating the refundFields state.
|
|
43
|
-
*/
|
|
20
|
+
submitRefund(values: any): Promise<void>;
|
|
44
21
|
private handleInput;
|
|
45
|
-
/**
|
|
46
|
-
* Initializes the API with the given authentication token.
|
|
47
|
-
* Logs a warning if the auth token is missing.
|
|
48
|
-
*/
|
|
49
22
|
private initializeApi;
|
|
50
23
|
render(): any;
|
|
51
24
|
}
|
|
@@ -5,6 +5,7 @@ export declare const terminalOrdersTableColumns: {
|
|
|
5
5
|
updated_at: () => any;
|
|
6
6
|
order_status: () => any;
|
|
7
7
|
business_id: () => any;
|
|
8
|
+
company_name: () => any;
|
|
8
9
|
provider: () => any;
|
|
9
10
|
order_type: () => any;
|
|
10
11
|
quantity: () => any;
|
|
@@ -14,6 +15,7 @@ export declare const terminalOrdersTableCells: {
|
|
|
14
15
|
updated_at: (terminalOrder: TerminalOrder, index: number) => any;
|
|
15
16
|
order_status: (terminalOrder: TerminalOrder, index: number) => any;
|
|
16
17
|
business_id: (terminalOrder: TerminalOrder, index: number) => any;
|
|
18
|
+
company_name: (terminalOrder: TerminalOrder, index: number) => any;
|
|
17
19
|
provider: (terminalOrder: TerminalOrder, index: number) => any;
|
|
18
20
|
order_type: (terminalOrder: TerminalOrder, index: number) => any;
|
|
19
21
|
quantity: (terminalOrder: TerminalOrder, index: number) => any;
|
|
@@ -6,7 +6,7 @@ export declare const terminalTableColumns: {
|
|
|
6
6
|
id: () => any;
|
|
7
7
|
provider: () => any;
|
|
8
8
|
provider_serial_number: () => any;
|
|
9
|
-
|
|
9
|
+
device_id: () => any;
|
|
10
10
|
sub_account_name: () => any;
|
|
11
11
|
status: () => any;
|
|
12
12
|
};
|
|
@@ -16,7 +16,7 @@ export declare const terminalTableCells: {
|
|
|
16
16
|
id: (terminal: Terminal, index: number) => any;
|
|
17
17
|
provider: (terminal: Terminal, index: number) => any;
|
|
18
18
|
provider_serial_number: (terminal: Terminal, index: number) => any;
|
|
19
|
-
|
|
19
|
+
device_id: (terminal: Terminal, index: number) => any;
|
|
20
20
|
sub_account_name: (terminal: Terminal, index: number) => any;
|
|
21
21
|
status: (terminal: Terminal, index: number) => any;
|
|
22
22
|
};
|
|
@@ -19,7 +19,6 @@ import { ILoadedEventResponse as ILoadedEventResponse1 } from "./api/Checkout";
|
|
|
19
19
|
import { Dispute, IDispute } from "./api/Dispute";
|
|
20
20
|
import { PaymentMethodOption } from "./components/checkout/payment-method-option-utils";
|
|
21
21
|
import { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
|
|
22
|
-
import { RefundPaymentFields } from "./components/refund-payment/refund-payment-schema";
|
|
23
22
|
import { Identity } from "./api/Identity";
|
|
24
23
|
import { PaginationProps } from "./ui-components/pagination-menu/pagination-menu";
|
|
25
24
|
export { IAdditionalQuestions, IAddress, IBusiness } from "./api/Business";
|
|
@@ -36,7 +35,6 @@ export { ILoadedEventResponse as ILoadedEventResponse1 } from "./api/Checkout";
|
|
|
36
35
|
export { Dispute, IDispute } from "./api/Dispute";
|
|
37
36
|
export { PaymentMethodOption } from "./components/checkout/payment-method-option-utils";
|
|
38
37
|
export { PaymentMethodPayload } from "./components/checkout/payment-method-payload";
|
|
39
|
-
export { RefundPaymentFields } from "./components/refund-payment/refund-payment-schema";
|
|
40
38
|
export { Identity } from "./api/Identity";
|
|
41
39
|
export { PaginationProps } from "./ui-components/pagination-menu/pagination-menu";
|
|
42
40
|
export namespace Components {
|
|
@@ -493,6 +491,7 @@ export namespace Components {
|
|
|
493
491
|
"authToken": string;
|
|
494
492
|
"businessId": string;
|
|
495
493
|
"shipping": boolean;
|
|
494
|
+
"submitButtonText": string;
|
|
496
495
|
}
|
|
497
496
|
interface JustifiOwnerForm {
|
|
498
497
|
"allowOptionalFields"?: boolean;
|
|
@@ -591,22 +590,11 @@ export namespace Components {
|
|
|
591
590
|
"validateAndSubmit": (onSuccess: (formData: any, documentList: DisputeEvidenceDocument[], formStep: DisputeResponseFormStep) => void) => Promise<void>;
|
|
592
591
|
}
|
|
593
592
|
interface JustifiRefundPayment {
|
|
594
|
-
|
|
595
|
-
* Authentication token required to authorize the refund transaction.
|
|
596
|
-
*/
|
|
593
|
+
"apiOrigin"?: string;
|
|
597
594
|
"authToken": string;
|
|
598
|
-
|
|
599
|
-
* The amount of the payment to be refunded. This should be equal to the Payment `amount_refundable` property.
|
|
600
|
-
*/
|
|
601
|
-
"paymentAmountRefundable"?: number;
|
|
602
|
-
/**
|
|
603
|
-
* The unique identifier for the payment to be refunded.
|
|
604
|
-
*/
|
|
595
|
+
"hideSubmitButton"?: boolean;
|
|
605
596
|
"paymentId": string;
|
|
606
|
-
|
|
607
|
-
* Flag to control the visibility of the submit button.
|
|
608
|
-
*/
|
|
609
|
-
"withButton"?: boolean;
|
|
597
|
+
"submitRefund": (values: any) => Promise<void>;
|
|
610
598
|
}
|
|
611
599
|
interface JustifiRefundPolicy {
|
|
612
600
|
"disputeResponse": any;
|
|
@@ -2143,7 +2131,8 @@ declare global {
|
|
|
2143
2131
|
new (): HTMLJustifiProductOrServiceElement;
|
|
2144
2132
|
};
|
|
2145
2133
|
interface HTMLJustifiRefundPaymentElementEventMap {
|
|
2146
|
-
"
|
|
2134
|
+
"error-event": ComponentErrorEvent1;
|
|
2135
|
+
"submit-event": ComponentSubmitEvent1;
|
|
2147
2136
|
}
|
|
2148
2137
|
interface HTMLJustifiRefundPaymentElement extends Components.JustifiRefundPayment, HTMLStencilElement {
|
|
2149
2138
|
addEventListener<K extends keyof HTMLJustifiRefundPaymentElementEventMap>(type: K, listener: (this: HTMLJustifiRefundPaymentElement, ev: JustifiRefundPaymentCustomEvent<HTMLJustifiRefundPaymentElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -3123,6 +3112,7 @@ declare namespace LocalJSX {
|
|
|
3123
3112
|
"onError-event"?: (event: JustifiOrderTerminalsCustomEvent<ComponentErrorEvent1>) => void;
|
|
3124
3113
|
"onSubmit-event"?: (event: JustifiOrderTerminalsCustomEvent<any>) => void;
|
|
3125
3114
|
"shipping"?: boolean;
|
|
3115
|
+
"submitButtonText"?: string;
|
|
3126
3116
|
}
|
|
3127
3117
|
interface JustifiOwnerForm {
|
|
3128
3118
|
"allowOptionalFields"?: boolean;
|
|
@@ -3224,26 +3214,12 @@ declare namespace LocalJSX {
|
|
|
3224
3214
|
"documentErrors"?: any;
|
|
3225
3215
|
}
|
|
3226
3216
|
interface JustifiRefundPayment {
|
|
3227
|
-
|
|
3228
|
-
* Authentication token required to authorize the refund transaction.
|
|
3229
|
-
*/
|
|
3217
|
+
"apiOrigin"?: string;
|
|
3230
3218
|
"authToken"?: string;
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
"onSubmitted"?: (event: JustifiRefundPaymentCustomEvent<RefundPaymentFields>) => void;
|
|
3235
|
-
/**
|
|
3236
|
-
* The amount of the payment to be refunded. This should be equal to the Payment `amount_refundable` property.
|
|
3237
|
-
*/
|
|
3238
|
-
"paymentAmountRefundable"?: number;
|
|
3239
|
-
/**
|
|
3240
|
-
* The unique identifier for the payment to be refunded.
|
|
3241
|
-
*/
|
|
3219
|
+
"hideSubmitButton"?: boolean;
|
|
3220
|
+
"onError-event"?: (event: JustifiRefundPaymentCustomEvent<ComponentErrorEvent1>) => void;
|
|
3221
|
+
"onSubmit-event"?: (event: JustifiRefundPaymentCustomEvent<ComponentSubmitEvent1>) => void;
|
|
3242
3222
|
"paymentId"?: string;
|
|
3243
|
-
/**
|
|
3244
|
-
* Flag to control the visibility of the submit button.
|
|
3245
|
-
*/
|
|
3246
|
-
"withButton"?: boolean;
|
|
3247
3223
|
}
|
|
3248
3224
|
interface JustifiRefundPolicy {
|
|
3249
3225
|
"disputeResponse"?: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as r,h as s}from"./p-2783e363.js";import{S as t}from"./p-bfe9748b.js";import{c as e,J as o}from"./p-
|
|
1
|
+
import{r as i,c as r,h as s}from"./p-2783e363.js";import{S as t}from"./p-bfe9748b.js";import{c as e,J as o}from"./p-5a541d35.js";import{d as a}from"./p-9fecad5a.js";import{a as n,C as c}from"./p-9dd8685c.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import{a as p}from"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import{g as d,a as h}from"./p-87f8c596.js";import{A as m}from"./p-5f6b4bc9.js";import"./p-de03d0f8.js";import"./p-bf195b35.js";import"./p-f8fccf44.js";import"./p-c8b78136.js";import"./p-abdbcd8e.js";class f{async fetchTerminalOrders(i,r,s,t="https://wc-proxy.justifi.ai"){const e={account:i};return m({authToken:r,apiOrigin:t}).get("terminals/orders",s,null,e)}}const l=class{constructor(s){i(this,s),this.errorEvent=r(this,"error-event",7),this.handleErrorEvent=i=>{this.errorMessage=i.detail.message,this.errorEvent.emit(i.detail)},this.getTerminalOrders=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.columns=a}componentWillLoad(){e(),this.analytics=new o(this),this.initializeGetData()}initializeGetData(){this.accountId&&this.authToken?this.getTerminalOrders=(({id:i,authToken:r,service:s,apiOrigin:t})=>async({params:e,onSuccess:o,onError:a,final:c})=>{var m,f;try{const c=await s.fetchTerminalOrders(i,r,e,t);if(c.error)return a({error:d(c.error),code:h(null===(f=c.error)||void 0===f?void 0:f.code),severity:n.ERROR});{const i=Object.assign({},c.page_info);o({terminalOrders:(null===(m=c.data)||void 0===m?void 0:m.map((i=>new p(i))))||[],pagingInfo:i})}}catch(i){const r=h(null==i?void 0:i.code);return a({error:i.message||i,code:r,severity:n.ERROR})}finally{return c()}})({id:this.accountId,authToken:this.authToken,service:new f,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:c.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(t,{key:"beb7ebe2397c43c28b818133294b6c972d2834ac"},s("terminal-orders-list-core",{key:"87db98176b2a462b9446170c348352958d4e3a05",getTerminalOrders:this.getTerminalOrders,"onError-event":this.handleErrorEvent,columns:this.columns}))}};export{l as justifi_terminal_orders_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-2783e363.js";import"./p-9dd8685c.js";import"./p-1366a019.js";import{p as a}from"./p-56f6ce4c.js";import"./p-3f5e6602.js";import"./p-
|
|
1
|
+
import{r as t,c as s,h as e}from"./p-2783e363.js";import"./p-9dd8685c.js";import"./p-1366a019.js";import{p as a}from"./p-56f6ce4c.js";import"./p-3f5e6602.js";import"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import{V as i,W as r}from"./p-bf195b35.js";import{T as c,a as h,b as o,c as d,d as p}from"./p-58ee6ce9.js";import{p as b,a as n}from"./p-701a13ca.js";import{o as f,g as m}from"./p-dec18cc4.js";import"./p-f8fccf44.js";import"./p-abdbcd8e.js";import"./p-142bfae3.js";import"./p-a5579f53.js";import"./p-c8b78136.js";import"./p-f20b6ce1.js";const l=class{constructor(e){t(this,e),this.clickEvent=s(this,"click-event",7),this.errorEvent=s(this,"error-event",7),this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:c.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:c.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;if(!s)return;const e=this.payments.find((t=>t.id===s));this.clickEvent.emit({name:c.row,data:e})},this.getPayments=void 0,this.columns=void 0,this.payments=[],this.paymentsTable=void 0,this.loading=!0,this.errorMessage=void 0,this.paging=a,this.pagingParams={}}updateOnPropChange(){this.fetchData()}componentWillLoad(){this.paymentsTable=new h(this.payments,this.columns,b,n),this.getPayments&&this.fetchData(),f("set",(()=>{this.pagingParams={}})),f("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}fetchData(){this.loading=!0,this.getPayments({params:this.paymentParams,onSuccess:({payments:t,pagingInfo:s})=>{this.payments=t,this.paging=s,this.paymentsTable.collectionData=this.payments},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e})},final:()=>{this.loading=!1}})}get paymentParams(){const t=m();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.payments.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.paymentsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e("div",{key:"7650bc8c64b4b727048b748bb899b534159c2ecd"},e("div",{key:"ebf919d213a280adea8852c33c53314db3d73279",class:"table-wrapper"},e("table",{key:"618a5113b68901bef3df0aed342e8cc6e76f672d",class:"table table-hover",part:i},e("thead",{key:"4978a6a0572f228ce0b67aed63c0123f3c13251a",class:"table-head sticky-top"},e("tr",{key:"875633307c439d239ed9ff6c9eae5f414729b4fc",class:"table-light text-nowrap"},this.paymentsTable.columnData.map((t=>t)))),e("tbody",{key:"030a7ab7d92337fa4ee74d206e4a48c79f6eae4d",class:"table-body"},e(o,{key:"6b3a71f087ac93c2b6487043d1624518b01d7370",columnSpan:this.paymentsTable.columnData.length,isLoading:this.loading}),e(d,{key:"51a90cd22acfdf55b0c351e6b7f2b1b7e1f156d0",isEmpty:this.showEmptyState,columnSpan:this.paymentsTable.columnData.length}),e(p,{key:"47367183f197a6eafe761ac478a435bba5f9f6d6",columnSpan:this.paymentsTable.columnData.length,errorMessage:this.errorMessage}),this.showRowData&&this.paymentsTable.rowData.map(((t,s)=>e("tr",{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},t)))),this.paging&&e("tfoot",{key:"2ca665dbc33b954145cedba2d75e98a3d45ff85f",class:"sticky-bottom"},e("tr",{key:"a7ecd6b390fdb960c589e2c463d354afe7b29100",class:"table-light align-middle"},e("td",{key:"74f32baddb41ff3ca04b2199b1a5d75189fb406e",part:r,colSpan:this.paymentsTable.columnData.length},e("pagination-menu",{key:"123f359c4a1948ee0189e49b163520d5858936ec",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})})))))))}static get watchers(){return{pagingParams:["updateOnPropChange"],getPayments:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{l as payments_list_core}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as t,h as s}from"./p-2783e363.js";import{a as r,C as e}from"./p-9dd8685c.js";import{c as o,J as a}from"./p-5a541d35.js";import{T as n}from"./p-87a4fb5b.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import{d as c}from"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import{g as p,a as h}from"./p-87f8c596.js";import{m as d,S as m}from"./p-cbad44b7.js";import{S as f}from"./p-bfe9748b.js";import{d as u}from"./p-70be104e.js";import"./p-de03d0f8.js";import"./p-5f6b4bc9.js";import"./p-f8fccf44.js";import"./p-abdbcd8e.js";import"./p-c8b78136.js";import"./p-bf195b35.js";const b=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=i=>{this.errorMessage=i.detail.message,this.errorEvent.emit(i.detail)},this.getTerminals=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.columns=u}componentWillLoad(){o(),this.analytics=new a(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetTerminals(),this.initializeGetSubAccounts()}initializeGetTerminals(){this.accountId&&this.authToken?this.getTerminals=(({id:i,authToken:t,service:s,apiOrigin:e})=>async({params:o,onSuccess:a,onError:n})=>{var d,m;try{const f=await s.fetchTerminals(i,t,o,e);if(f.error)return n({error:p(f.error),code:h(null===(m=f.error)||void 0===m?void 0:m.code),severity:r.ERROR});{const i=Object.assign({},f.page_info);a({terminals:(null===(d=f.data)||void 0===d?void 0:d.map((i=>new c(i))))||[],pagingInfo:i})}}catch(i){const t=h(null==i?void 0:i.code);return n({error:i.message||i,code:t,severity:r.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new n,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:r.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=d({accountId:this.accountId,authToken:this.authToken,service:new m,apiOrigin:this.apiOrigin}))}render(){return s(f,{key:"008b4bd549c228dbf8972e5ce08764c40e0b45a7"},s("terminals-list-core",{key:"e57f76fa1560c97d76068503b48e92a5fa9a02ec",getTerminals:this.getTerminals,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{b as justifi_terminals_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as o,C as e}from"./p-9dd8685c.js";import{C as r}from"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import"./p-
|
|
1
|
+
import{r as t,c as i,h as s}from"./p-2783e363.js";import{a as o,C as e}from"./p-9dd8685c.js";import{C as r}from"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import{g as c,a}from"./p-87f8c596.js";import{c as h,J as n}from"./p-5a541d35.js";import{C as p}from"./p-54556fc6.js";import{m as d,S as m}from"./p-cbad44b7.js";import{S as u}from"./p-bfe9748b.js";import{d as f}from"./p-ca6cdfe6.js";import"./p-f8fccf44.js";import"./p-abdbcd8e.js";import"./p-de03d0f8.js";import"./p-5f6b4bc9.js";import"./p-c8b78136.js";import"./p-bf195b35.js";const b=class{constructor(s){t(this,s),this.errorEvent=i(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.getCheckouts=void 0,this.getSubAccounts=void 0,this.errorMessage=null,this.accountId=void 0,this.authToken=void 0,this.apiOrigin="https://wc-proxy.justifi.ai",this.columns=f}componentWillLoad(){h(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:i,service:s,apiOrigin:e})=>async({params:h,onSuccess:n,onError:p})=>{var d,m;try{const u=await s.fetchCheckouts(t,i,h,e);if(u.error)return p({error:c(u.error),code:a(null===(m=u.error)||void 0===m?void 0:m.code),severity:o.ERROR});{const t=Object.assign({},u.page_info);n({checkouts:(null===(d=u.data)||void 0===d?void 0:d.map((t=>new r(t))))||[],pagingInfo:t})}}catch(t){const i=a(null==t?void 0:t.code);return p({error:t.message||t,code:i,severity:o.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new p,apiOrigin:this.apiOrigin}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=d({accountId:this.accountId,authToken:this.authToken,service:new m,apiOrigin:this.apiOrigin}))}render(){return s(u,{key:"072e2dc9373eef92119a0b0a01b61615d3bdcec0"},s("checkouts-list-core",{key:"84027904ba2baf57aa22247c553ab585d0d71262",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{b as justifi_checkouts_list}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as s,h as t}from"./p-2783e363.js";import{B as e}from"./p-bfc2d88a.js";import{S as a}from"./p-bfe9748b.js";import{c as o,J as d}from"./p-
|
|
1
|
+
import{r as i,c as s,h as t}from"./p-2783e363.js";import{B as e}from"./p-bfc2d88a.js";import{S as a}from"./p-bfe9748b.js";import{c as o,J as d}from"./p-5a541d35.js";import{a as r,C as h}from"./p-9dd8685c.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import"./p-bf195b35.js";import"./p-de03d0f8.js";import"./p-5f6b4bc9.js";import"./p-f8fccf44.js";import"./p-abdbcd8e.js";const c=class{constructor(t){i(this,t),this.errorEvent=s(this,"error-event",7),this.submitEvent=s(this,"submit-event",7),this.authToken=void 0,this.accountId=void 0,this.paymentMethodGroupId=void 0,this.submitButtonText=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0,this.hideSubmitButton=void 0,this.hideCardBillingForm=void 0,this.iframeOrigin="https://components.justifi.ai",this.isLoading=!1}componentWillLoad(){o(),this.analytics=new d(this)}async tokenizePaymentMethod(i){let s;i&&i.preventDefault(),this.isLoading=!0;try{s=await this.paymentMethodOptionsRef.resolvePaymentMethod({isValid:!0}),s.error&&this.errorEvent.emit({errorCode:s.error.code,message:s.error.message,severity:r.ERROR})}catch(i){this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:i.message,severity:r.ERROR})}finally{return this.submitEvent.emit({response:s}),this.isLoading=!1,s}}async fillBillingForm(i){this.paymentMethodOptionsRef.fillBillingForm(i)}render(){return t(a,{key:"270b2dce491c95fd6a372bf4e59d4829c91290fa"},t("form",{key:"7e68afbac49260a92bb6c9e3bd08125129ab196c"},t("fieldset",{key:"95f911fa066f7fea0b36e4c99cb1c5008b4a886d"},t("div",{key:"aec8576644731d5960a1e041960076c503aa4a17",class:"row gy-3"},t("div",{key:"51436afb0c10e189d079226dd0a8e7b18580fd69",class:"col-12"},t("justifi-payment-method-options",{key:"59777ac37f44bfe9ef98d3b22a6e485f06db303d",ref:i=>this.paymentMethodOptionsRef=i,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!1,paymentMethodGroupId:this.paymentMethodGroupId,"show-saved-payment-methods":!1,hideCardBillingForm:this.hideCardBillingForm,authToken:this.authToken,"account-id":this.accountId,iframeOrigin:this.iframeOrigin})),t("div",{key:"ef37939fb4d8e0225f98f0c3874a83206307f671",class:"col-12"},t(e,{key:"4b193d76ad540cae97a2423948e18d60f6db0679",variant:"primary",type:"submit",onClick:i=>this.tokenizePaymentMethod(i),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.hideSubmitButton},this.submitButtonText||"Submit"))))))}};export{c as justifi_tokenize_payment_method}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,h as e}from"./p-2783e363.js";import{l as t}from"./p-c6be72b0.js";import{f as s,p as i,c as r}from"./p-f4739d31.js";import{R as d,S as l,T as c,U as f}from"./p-bf195b35.js";import{S as o}from"./p-bfe9748b.js";import"./p-9dd8685c.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import{I as p}from"./p-
|
|
1
|
+
import{r as a,h as e}from"./p-2783e363.js";import{l as t}from"./p-c6be72b0.js";import{f as s,p as i,c as r}from"./p-f4739d31.js";import{R as d,S as l,T as c,U as f}from"./p-bf195b35.js";import{S as o}from"./p-bfe9748b.js";import"./p-9dd8685c.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import{I as p}from"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import"./p-f20b6ce1.js";import"./p-f8fccf44.js";import"./p-abdbcd8e.js";const b=class{constructor(e){a(this,e),this.setParamsOnChange=(a,e)=>{s[a]=e},this.terminalId=void 0,this.terminalOrderId=void 0,this.terminalStatus=void 0}componentWillLoad(){this.debouncedSetParamsOnChange=t.exports.debounce(this.setParamsOnChange,300),Object.entries({terminal_id:this.terminalId,status:this.terminalStatus,terminal_order_id:this.terminalOrderId}).forEach((([a,e])=>{e&&(i[a]=e)}))}get terminalStatusOptions(){return[{label:"All",value:""},{label:"Connected",value:p.connected},{label:"Disconnected",value:p.disconnected},{label:"Unknown",value:p.unknown},{label:"Pending Configuration",value:p.pending_configuration}]}render(){const a=Object.assign({},s);return e(o,{key:"390b8788e785bc81711a1b0f68203fce5a348c4c"},e("table-filters-menu",{key:"ab37f284aad5b828c2a3d0ce78e5c49fe86c8ec7",params:a,clearParams:r,part:d},e("div",{key:"9f06d2199885d1cb8d9a4310fc94366717ca092c",class:"grid-cols-2 gap-3 p-1"},e("div",{key:"146fb3fa0a146c8011e1fc609f885ec3de0af8bf",class:"p-2"},e("form-control-text",{key:"f9d33f3facd5af88761033256e9bcdee772d187b",name:"terminal_id",label:"Terminal ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.terminalId||s.terminal_id,disabled:!!this.terminalId,part:l})),e("div",{key:"59b8af61f98c01e0cd04299780817b9a497d33bc",class:"p-2"},e("form-control-text",{key:"80c6ed5f37f4429aac0451f1b2c76fd99c52d246",name:"terminal_order_id",label:"Terminal Order ID",inputHandler:this.debouncedSetParamsOnChange,defaultValue:this.terminalOrderId||s.terminal_order_id,disabled:!!this.terminalOrderId,part:c})),e("div",{key:"4452ff9cbeb157408fdd8569af5792d32f0d1aa9",class:"p-2"},e("form-control-select",{key:"52406f154a9d5f7a01831047eedf09b909d1bc0d",name:"status",label:"Status",options:this.terminalStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.terminalStatus||s.status,disabled:!!this.terminalStatus,part:f})))))}};export{b as justifi_terminals_list_filters}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as t}from"./p-f8fccf44.js";var i,s,h,n,e,a,o,c,d;!function(t){t.paid="paid",t.failed="failed",t.forwarded="forwarded",t.scheduled="scheduled",t.in_transit="in_transit",t.canceled="canceled"}(i||(i={})),function(t){t.paid="Paid",t.failed="Failed",t.forwarded="Forwarded",t.scheduled="Scheduled",t.in_transit="In Transit",t.canceled="Canceled"}(s||(s={}));class r{constructor(t){this.id=t.id,this.account_id=t.account_id,this.currency=t.currency,this.amount=t.amount,this.bank_account=t.bank_account,this.delivery_method=t.delivery_method||"standard",this.description=t.description,this.deposits_at=t.deposits_at,this.fees_total=t.fees_total,this.refunds_count=t.refunds_count,this.refunds_total=t.refunds_total,this.payments_count=t.payments_count,this.payments_total=t.payments_total,this.payout_type=t.payout_type,this.other_total=t.other_total,this.status=t.status,this.metadata=t.metadata,this.created_at=t.created_at,this.updated_at=t.updated_at}formattedPaymentAmount(i){return t(i,this.currency)}}!function(t){t.connected="connected",t.disconnected="disconnected",t.unknown="unknown",t.pending_configuration="pending_configuration"}(h||(h={})),function(t){t.verifone="verifone"}(n||(n={}));class u{constructor(t){this.id=t.id||"",this.status=t.status,this.account_id=t.account_id||"",this.platform_account_id=t.platform_account_id||"",this.provider=t.provider||null,this.provider_id=t.provider_id||"",this.provider_serial_number=t.provider_serial_number||"",this.created_at=t.created_at||"",this.updated_at=t.updated_at||"",this.verified_at=t.verified_at||"",this.nickname=t.nickname||"",this.model_name=t.model_name||null}}!function(t){t.boardingOnly="boarding_only",t.boardingShipping="boarding_shipping"}(e||(e={})),function(t){t.created="created",t.submitted="submitted",t.completed="completed"}(a||(a={}));class l{constructor(t){this.id=t.id,this.business_id=t.business_id,this.sub_account_id=t.sub_account_id,this.provider=t.provider||n.verifone,this.order_items=[],this.order_type=t.order_type,this.order_status=t.order_status,this.terminals=t.terminals,this.created_at=t.created_at,this.updated_at=t.updated_at}get payload(){return{business_id:this.business_id,sub_account_id:this.sub_account_id,order_type:this.order_type,order_items:this.order_items}}get totalQuantity(){return this.order_items.reduce(((t,i)=>t+i.quantity),0)}updateTerminal(t,i){if(0===i)return void(this.order_items=this.order_items.filter((i=>i.model_name!==t)));const s=this.order_items.find((i=>i.model_name===t));s?s.quantity=i:this.order_items.push({model_name:t,quantity:i})}}!function(t){t.v400="v400",t.p400="p400+",t.e285="e285"}(o||(o={}));class f{constructor(t){this.id=t.id,this.model_name=t.model_name,this.description=t.description,this.image_url=t.image_url,this.help_url=t.help_url}}!function(t){t.test="test",t.live="live"}(c||(c={})),function(t){t.created="created",t.submitted="submitted",t.information_needed="information_needed",t.rejected="rejected",t.enabled="enabled",t.disabled="disabled",t.archived="archived"}(d||(d={}));class m{constructor(t){this.id=t.id,this.name=t.name,this.account_type=t.account_type,this.status=t.status,this.currency=t.currency,this.platform_account_id=t.platform_account_id,this.payout_account_id=t.payout_account_id,this.business_id=t.business_id,this.application_fee_rates=t.application_fee_rates,this.processing_ready=t.processing_ready,this.payout_ready=t.payout_ready,this.related_accounts=t.related_accounts,this.created_at=t.created_at,this.updated_at=t.updated_at}}export{h as I,r as P,m as S,f as T,l as a,e as b,a as c,u as d}
|
|
1
|
+
import{f as t}from"./p-f8fccf44.js";var i,s,h,n,e,a,o,c,d;!function(t){t.paid="paid",t.failed="failed",t.forwarded="forwarded",t.scheduled="scheduled",t.in_transit="in_transit",t.canceled="canceled"}(i||(i={})),function(t){t.paid="Paid",t.failed="Failed",t.forwarded="Forwarded",t.scheduled="Scheduled",t.in_transit="In Transit",t.canceled="Canceled"}(s||(s={}));class r{constructor(t){this.id=t.id,this.account_id=t.account_id,this.currency=t.currency,this.amount=t.amount,this.bank_account=t.bank_account,this.delivery_method=t.delivery_method||"standard",this.description=t.description,this.deposits_at=t.deposits_at,this.fees_total=t.fees_total,this.refunds_count=t.refunds_count,this.refunds_total=t.refunds_total,this.payments_count=t.payments_count,this.payments_total=t.payments_total,this.payout_type=t.payout_type,this.other_total=t.other_total,this.status=t.status,this.metadata=t.metadata,this.created_at=t.created_at,this.updated_at=t.updated_at}formattedPaymentAmount(i){return t(i,this.currency)}}!function(t){t.connected="connected",t.disconnected="disconnected",t.unknown="unknown",t.pending_configuration="pending_configuration"}(h||(h={})),function(t){t.verifone="verifone"}(n||(n={}));class u{constructor(t){this.id=t.id||"",this.status=t.status,this.account_id=t.account_id||"",this.platform_account_id=t.platform_account_id||"",this.provider=t.provider||null,this.provider_id=t.provider_id||"",this.provider_serial_number=t.provider_serial_number||"",this.created_at=t.created_at||"",this.updated_at=t.updated_at||"",this.verified_at=t.verified_at||"",this.nickname=t.nickname||"",this.model_name=t.model_name||null}}!function(t){t.boardingOnly="boarding_only",t.boardingShipping="boarding_shipping"}(e||(e={})),function(t){t.created="created",t.submitted="submitted",t.completed="completed"}(a||(a={}));class l{constructor(t){this.id=t.id,this.business_id=t.business_id,this.company_name=t.company_name,this.sub_account_id=t.sub_account_id,this.provider=t.provider||n.verifone,this.order_items=[],this.order_type=t.order_type,this.order_status=t.order_status,this.terminals=t.terminals,this.created_at=t.created_at,this.updated_at=t.updated_at}get payload(){return{business_id:this.business_id,sub_account_id:this.sub_account_id,order_type:this.order_type,order_items:this.order_items}}get totalQuantity(){return this.order_items.reduce(((t,i)=>t+i.quantity),0)}updateTerminal(t,i){if(0===i)return void(this.order_items=this.order_items.filter((i=>i.model_name!==t)));const s=this.order_items.find((i=>i.model_name===t));s?s.quantity=i:this.order_items.push({model_name:t,quantity:i})}}!function(t){t.v400="v400",t.p400="p400+",t.e285="e285"}(o||(o={}));class f{constructor(t){this.id=t.id,this.model_name=t.model_name,this.description=t.description,this.image_url=t.image_url,this.help_url=t.help_url}}!function(t){t.test="test",t.live="live"}(c||(c={})),function(t){t.created="created",t.submitted="submitted",t.information_needed="information_needed",t.rejected="rejected",t.enabled="enabled",t.disabled="disabled",t.archived="archived"}(d||(d={}));class m{constructor(t){this.id=t.id,this.name=t.name,this.account_type=t.account_type,this.status=t.status,this.currency=t.currency,this.platform_account_id=t.platform_account_id,this.payout_account_id=t.payout_account_id,this.business_id=t.business_id,this.application_fee_rates=t.application_fee_rates,this.processing_ready=t.processing_ready,this.payout_ready=t.payout_ready,this.related_accounts=t.related_accounts,this.created_at=t.created_at,this.updated_at=t.updated_at}}export{h as I,r as P,m as S,f as T,l as a,e as b,a as c,u as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-
|
|
1
|
+
import{r as t,c as s,h as i}from"./p-2783e363.js";import{P as e}from"./p-536fb8e2.js";import{a as r,C as o}from"./p-9dd8685c.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import{P as a}from"./p-3f5e6602.js";import"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import{g as p,a as n}from"./p-87f8c596.js";import{E as h}from"./p-12074378.js";import{c,J as m}from"./p-5a541d35.js";import"./p-5f6b4bc9.js";import"./p-f8fccf44.js";import"./p-abdbcd8e.js";import"./p-bf195b35.js";import"./p-de03d0f8.js";const d=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.paymentId=void 0,this.authToken=void 0,this.getPaymentDetails=void 0,this.errorMessage=null}componentWillLoad(){c(),this.analytics=new m(this),this.initializeGetPaymentDetails()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=(({id:t,authToken:s,service:i})=>async({onSuccess:e,onError:o})=>{var h;try{const c=await i.fetchPayment(t,s);c.error?o({error:p(c.error),code:n(null===(h=c.error)||void 0===h?void 0:h.code),severity:r.ERROR}):e({payment:new a(c.data)})}catch(t){const s=n(null==t?void 0:t.code);o({error:p(t),code:s,severity:r.ERROR})}})({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:o.MISSING_PROPS,severity:r.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_payment_details}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-f8fccf44.js";import{t as a,C as r}from"./p-bf195b35.js";import{B as d}from"./p-bfc2d88a.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-56c7fc8d.js";import{a as n,C as h}from"./p-9dd8685c.js";import{g as p,a as f}from"./p-87f8c596.js";import{D as l}from"./p-3da2652e.js";import{D as u}from"./p-667ebd79.js";import{c as b,J as y}from"./p-9c4e3bac.js";import"./p-5f6b4bc9.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import"./p-abdbcd8e.js";import"./p-0d7d61ac.js";import"./p-61f0a2ce.js";import"./p-b99817a0.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"ad76721d05d9dcdfb643d865aec1a6f0684e1e05"},this.isLoading&&s("div",{key:"a8b8e850e168cba9281a6f6302aef53976027346",style:{marginBottom:"8px"}},s(o,{key:"813563746b9f9b507b49762c9e1a1f006765345b",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"373c0596e6246860a17822eb5ec49f3ef9e37460",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"32f8083f0551fbea29de6ddbc847dc62fa0b0c48",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"9c032d9b8ea4b176f1fabfff45a2975ac9e6df17",part:a},s("h1",{key:"e1a906047a9c056138bb2bd69dddf2bbc54782c4",class:"h4",part:r},"This payment is disputed"),s("p",{key:"40d9d799d073318ba52a2c559c8119c64e9107aa"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"e2d3bc21f03cd47acc8feec8640410c1c74f9b58",class:"h5"},"Dispute details"),s("div",{key:"3e3c440350a6dc86b42204a43f80fa700c1d06f0",class:"d-table gap-2"},s("div",{key:"67b4dbf945dae00fe6e6144782c6c249cc032968",class:"d-table-row gap-2"},s("span",{key:"6570c2fc92f6a526a6e2afee91fa1017f5ef3c9b",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"269f42e3737b419978fb35e741f34a751f0b0d9b",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b498ff565dafbea3e3452d386883924bda431a96",class:"d-table-row gap-2"},s("span",{key:"afaecceeac44807453e1a99ffc0d8961022fd98f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"69b491d454f791d679528b77f9f75fc889add363",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"97515b0bd0dd113e31e6974c7e107af19eed2e73",class:"d-table-row gap-2"},s("span",{key:"e8a46a99bb2596d8aab980230088989c3a9455c4",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"aa5e2e6997bedfdbd31c2fe9ee540a4399e3a25e",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"4e35b26867fdde02426bd047932ca854c05421b7",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"2881172b26ffb36321094ea2f8af7cc622678229",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"e57fca0b48327bb898ec19938498eb1c945bbb4d",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"c1f0a2f35d9640efdfd76b13d6969374169b2631"},s("h1",{key:"800d59ebecc9f15890fe7f264a3b44910e322784",class:"h4"},"This payment is disputed and under review"),s("p",{key:"30a7d186c01e33f2a95b0cecb3a4a69b59d158e6"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"5d0fbdcc7a15817e1875d18a5f4d9cf982989ed1"},s("h1",{key:"b2814587c7bd46e28948346f5871456e6cc0589c",class:"h4"},"This payment was disputed"),s("p",{key:"bff6dbf512017e27b1fc6ea2a97b2dc47f4b2a65"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"548cf8e95c0933ec987862c162487abfd3c043bc"},s("h1",{key:"46f96b5e6785b5a4398918c0e29302403a7194bd",class:"h4"},"This payment was disputed"),s("p",{key:"71c3c1e1754cd0f0f042a6277ba93b2076cd7645"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin="https://wc-proxy.justifi.ai"}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"1a0ac889493d8008e9bd70e4c3aad9ea72d12453"},s("justifi-dispute-response-core",{key:"82e11a3f0d14640beca1ebed72364662db3ffdbd","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.currentStepComponentRef=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"1f44d3fa1d95758e9dc949bc9df9cb8def59aae5",class:"row gy-3"},s("div",{key:"5245e71606a4f69a8978c27bf8d0a985ecf3b835",class:"col-12"},s("h1",{key:"e843ee37344171cb159fe83889ddc244487d49ed",class:"h4",part:r},"Counter dispute")),s("div",{key:"7680b28f96255822f3048dc529bafa71cebf81cc",class:"col-12"},this.currentStepComponent),s("div",{key:"3ce0c6ac049c64a3ed18e42dcc001dd1f62a5aed",class:"col-12"},s("div",{key:"2192e17c236024e2c89ea361ac1a4e2b57c6b50e",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
|
|
1
|
+
import{r as e,c as t,h as s}from"./p-2783e363.js";import{f as i}from"./p-f8fccf44.js";import{t as a,C as r}from"./p-bf195b35.js";import{B as d}from"./p-bfc2d88a.js";import{S as c}from"./p-bfe9748b.js";import{S as o}from"./p-56c7fc8d.js";import{a as n,C as h}from"./p-9dd8685c.js";import{g as p,a as f}from"./p-87f8c596.js";import{D as l}from"./p-f4aeb100.js";import{D as u}from"./p-667ebd79.js";import{c as b,J as y}from"./p-5a541d35.js";import"./p-5f6b4bc9.js";import"./p-1366a019.js";import"./p-56f6ce4c.js";import"./p-3f5e6602.js";import"./p-abdbcd8e.js";import"./p-2a9d7f6b.js";import"./p-61f0a2ce.js";import"./p-de03d0f8.js";const v=({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.submitDisputeResponse(t,e,i);if(d.error){return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR})}a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}},m=class{constructor(s){e(this,s),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.submitEvent=t(this,"submit-event",7),this.dispute=void 0,this.authToken=void 0,this.isLoading=void 0}acceptDispute(){v({disputeId:this.dispute.id,authToken:this.authToken,service:new l})({payload:{forfeit:!0},onSuccess:e=>{this.submitEvent.emit({response:e})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}})}initiateRespondToDispute(){this.clickEvent.emit({name:u.respondToDispute})}render(){var e,t,n,h,p,f,l;return s(c,{key:"ad76721d05d9dcdfb643d865aec1a6f0684e1e05"},this.isLoading&&s("div",{key:"a8b8e850e168cba9281a6f6302aef53976027346",style:{marginBottom:"8px"}},s(o,{key:"813563746b9f9b507b49762c9e1a1f006765345b",height:"28px",width:"70%",styles:{marginBottom:"16px"}}),s(o,{key:"373c0596e6246860a17822eb5ec49f3ef9e37460",height:"18px",styles:{marginBottom:"8px"}}),s(o,{key:"32f8083f0551fbea29de6ddbc847dc62fa0b0c48",height:"18px",styles:{marginBottom:"8px"}})),(null===(e=this.dispute)||void 0===e?void 0:e.needsResponse)&&s("div",{key:"9c032d9b8ea4b176f1fabfff45a2975ac9e6df17",part:a},s("h1",{key:"e1a906047a9c056138bb2bd69dddf2bbc54782c4",class:"h4",part:r},"This payment is disputed"),s("p",{key:"40d9d799d073318ba52a2c559c8119c64e9107aa"},"The cardholder is disputing this payment. You may accept this dispute, or proceed to provide evidence in a counter dispute."),s("h2",{key:"e2d3bc21f03cd47acc8feec8640410c1c74f9b58",class:"h5"},"Dispute details"),s("div",{key:"3e3c440350a6dc86b42204a43f80fa700c1d06f0",class:"d-table gap-2"},s("div",{key:"67b4dbf945dae00fe6e6144782c6c249cc032968",class:"d-table-row gap-2"},s("span",{key:"6570c2fc92f6a526a6e2afee91fa1017f5ef3c9b",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Amount"),s("span",{key:"269f42e3737b419978fb35e741f34a751f0b0d9b",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},i(null===(t=this.dispute)||void 0===t?void 0:t.amount))),s("div",{key:"b498ff565dafbea3e3452d386883924bda431a96",class:"d-table-row gap-2"},s("span",{key:"afaecceeac44807453e1a99ffc0d8961022fd98f",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Reason"),s("span",{key:"69b491d454f791d679528b77f9f75fc889add363",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(n=this.dispute)||void 0===n?void 0:n.reason)),s("div",{key:"97515b0bd0dd113e31e6974c7e107af19eed2e73",class:"d-table-row gap-2"},s("span",{key:"e8a46a99bb2596d8aab980230088989c3a9455c4",part:"detail-section-item-title",class:"fw-bold d-table-cell pe-4"},"Dispute ID"),s("span",{key:"aa5e2e6997bedfdbd31c2fe9ee540a4399e3a25e",part:"detail-section-item-data",class:"flex-1 d-table-cell text-wrap"},null===(h=this.dispute)||void 0===h?void 0:h.id))),s("div",{key:"4e35b26867fdde02426bd047932ca854c05421b7",class:"d-flex gap-2 mt-4 justify-content-end"},s(d,{key:"2881172b26ffb36321094ea2f8af7cc622678229",variant:"secondary",onClick:()=>this.acceptDispute()},"Accept dispute"),s(d,{key:"e57fca0b48327bb898ec19938498eb1c945bbb4d",variant:"primary",onClick:()=>this.initiateRespondToDispute()},"Counter dispute"))),(null===(p=this.dispute)||void 0===p?void 0:p.underReview)&&s("div",{key:"c1f0a2f35d9640efdfd76b13d6969374169b2631"},s("h1",{key:"800d59ebecc9f15890fe7f264a3b44910e322784",class:"h4"},"This payment is disputed and under review"),s("p",{key:"30a7d186c01e33f2a95b0cecb3a4a69b59d158e6"},"The cardholder is disputing this payment. A counter dispute has been submitted and is under review.")),(null===(f=this.dispute)||void 0===f?void 0:f.won)&&s("div",{key:"5d0fbdcc7a15817e1875d18a5f4d9cf982989ed1"},s("h1",{key:"b2814587c7bd46e28948346f5871456e6cc0589c",class:"h4"},"This payment was disputed"),s("p",{key:"bff6dbf512017e27b1fc6ea2a97b2dc47f4b2a65"},"The cardholder disputed this payment and the card issuer has settled it in your favor.")),(null===(l=this.dispute)||void 0===l?void 0:l.lost)&&s("div",{key:"548cf8e95c0933ec987862c162487abfd3c043bc"},s("h1",{key:"46f96b5e6785b5a4398918c0e29302403a7194bd",class:"h4"},"This payment was disputed"),s("p",{key:"71c3c1e1754cd0f0f042a6277ba93b2076cd7645"},"The cardholder disputed this payment and the card issuer has settled it in their favor.")))}},k=class{constructor(s){e(this,s),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=e=>{this.errorMessage=e.detail.message,this.errorEvent.emit(e.detail)},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.errorMessage=null,this.authToken=void 0,this.disputeId=void 0,this.disputeResponse=void 0,this.apiOrigin="https://wc-proxy.justifi.ai"}componentWillLoad(){b(),this.analytics=new y(this),this.initializeDisputeServiceMethods()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeDisputeServiceMethods()}initializeDisputeServiceMethods(){this.disputeId&&this.authToken?(this.updateDisputeResponse=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.updateDisputeResponse(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.createDisputeEvidence=(({authToken:e,disputeId:t,service:s})=>async({payload:i,onSuccess:a,onError:r,final:d=(()=>{})})=>{var c;try{const d=await s.createDisputeEvidence(t,e,i);if(d.error)return r({error:p(d.error),code:f(null===(c=d.error)||void 0===c?void 0:c.code),severity:n.ERROR});a(d)}catch(e){const t=f(null==e?void 0:e.code);return r({error:e.message||e,code:t,severity:n.ERROR})}finally{return d()}})({disputeId:this.disputeId,authToken:this.authToken,service:new l}),this.submitDisputeResponse=v({disputeId:this.disputeId,authToken:this.authToken,service:new l})):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:h.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR}))}render(){return s(c,{key:"1a0ac889493d8008e9bd70e4c3aad9ea72d12453"},s("justifi-dispute-response-core",{key:"82e11a3f0d14640beca1ebed72364662db3ffdbd","onError-event":this.handleErrorEvent,"dispute-id":this.disputeId,disputeResponse:this.disputeResponse,createDisputeEvidence:this.createDisputeEvidence,updateDisputeResponse:this.updateDisputeResponse,submitDisputeResponse:this.submitDisputeResponse}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}},j=class{constructor(i){e(this,i),this.clickEvent=t(this,"click-event",7),this.errorEvent=t(this,"error-event",7),this.stepCompleteEvent=t(this,"complete-form-step-event",7),this.submitEvent=t(this,"submit-event",7),this.componentStepMapping=[()=>s("justifi-product-or-service",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-customer-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-cancellation-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-refund-policy",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-duplicate-charge",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-electronic-evidence",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-shipping-details",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors}),()=>s("justifi-additional-statement",{ref:e=>this.currentStepComponentRef=e,disputeResponse:this.disputeResponse,documentErrors:this.documentErrors})],this.saveData=async(e,t)=>{if(Object.keys(e).length)return this.isLastStep?this.submitDisputeResponse({payload:e,onSuccess:e=>{this.submitEvent.emit({response:e}),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}}):this.updateDisputeResponse({payload:e,onSuccess:e=>{this.disputeResponse=Object.assign({},e.data),this.stepCompleteEvent.emit({response:e,formStep:t})},onError:({error:e,code:t,severity:s})=>{this.errorEvent.emit({errorCode:t,message:e,severity:s})}});this.stepCompleteEvent.emit({response:null,formStep:t})},this.initializeMakePresignedURLs=async()=>{const e=this.documentList.map((e=>this.getPresignedFileUrl(e)));return await Promise.all(e)},this.initializeFileUploads=async()=>{const e=this.documentList.map((e=>this.uploadDocument(e)));return Promise.all(e)},this.getPresignedFileUrl=async e=>this.createDisputeEvidence({payload:{file_name:e.file_name,file_type:e.file_type,dispute_evidence_type:e.dispute_evidence_type},onSuccess:t=>{e.presignedUrl=t.data.presigned_url},onError:({error:t,code:s,severity:i})=>{const a={[e.dispute_evidence_type]:t};this.documentErrors=Object.assign(Object.assign({},this.documentErrors),a),this.errorEvent.emit({errorCode:s,message:t,severity:i})}}),this.uploadDocument=async e=>{const t=await e.getFileString();if(!e.presignedUrl)throw new Error("Presigned URL is not set");return await fetch(e.presignedUrl,{method:"PUT",body:t})},this.handleSubmit=async(e,t,s)=>{if(this.isLoading=!0,t.length){if(this.documentErrors={},this.documentList=t,await this.initializeMakePresignedURLs(),Object.keys(this.documentErrors).length)throw this.isLoading=!1,new Error("Could not presign all documents");await this.initializeFileUploads()}await this.saveData(e,s),this.isLoading=!1},this.onCancel=()=>{this.clickEvent.emit({name:u.cancelDispute})},this.onBack=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.previousStep}),await this.handleSubmit(e,t,s),this.currentStep--}))},this.onNext=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.nextStep}),await this.handleSubmit(e,t,s),this.currentStep++}))},this.onSubmit=async()=>{await this.currentStepComponentRef.validateAndSubmit((async(e,t,s)=>{this.clickEvent.emit({name:u.submit});const i=Object.assign(Object.assign({},e),{forfeit:!1});await this.handleSubmit(i,t,s)}))},this.updateDisputeResponse=void 0,this.submitDisputeResponse=void 0,this.createDisputeEvidence=void 0,this.disputeResponse={},this.isLoading=!1,this.documentList=[],this.documentErrors={},this.currentStep=0,this.currentStepComponentRef=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}get isLastStep(){return this.currentStep===this.componentStepMapping.length-1}get isFirstStep(){return 0===this.currentStep}render(){return s("div",{key:"1f44d3fa1d95758e9dc949bc9df9cb8def59aae5",class:"row gy-3"},s("div",{key:"5245e71606a4f69a8978c27bf8d0a985ecf3b835",class:"col-12"},s("h1",{key:"e843ee37344171cb159fe83889ddc244487d49ed",class:"h4",part:r},"Counter dispute")),s("div",{key:"7680b28f96255822f3048dc529bafa71cebf81cc",class:"col-12"},this.currentStepComponent),s("div",{key:"3ce0c6ac049c64a3ed18e42dcc001dd1f62a5aed",class:"col-12"},s("div",{key:"2192e17c236024e2c89ea361ac1a4e2b57c6b50e",class:"d-flex gap-2 mt-4 justify-content-end"},this.isFirstStep?s(d,{variant:"secondary",onClick:()=>this.onCancel(),disabled:this.isLoading,isLoading:this.isLoading},"Cancel"):s(d,{variant:"secondary",onClick:()=>this.onBack(),disabled:this.isLoading,isLoading:this.isLoading},"Back"),this.isLastStep?s(d,{variant:"primary",onClick:()=>this.onSubmit(),disabled:this.isLoading,isLoading:this.isLoading},"Submit Counter Dispute"):s(d,{variant:"primary",onClick:()=>this.onNext(),disabled:this.isLoading,isLoading:this.isLoading},"Next"))))}};export{m as justifi_dispute_notification,k as justifi_dispute_response,j as justifi_dispute_response_core}
|