@justifi/webcomponents 4.7.1 → 4.7.2-rc.0
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/{Payout-68a99ee3.js → Payout-f8240e9c.js} +49 -1
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +2 -2
- package/dist/cjs/form-control-datepart_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +16 -12
- package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +22 -10
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +20 -11
- package/dist/cjs/justifi-payment-form.cjs.entry.js +16 -6
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-payments-list.cjs.entry.js +22 -23
- package/dist/cjs/justifi-payout-details.cjs.entry.js +19 -11
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +21 -11
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-refund-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-subaccount-details.cjs.entry.js +3 -5
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-table_2.cjs.entry.js +4 -4
- package/dist/collection/api/Payment.js +49 -1
- package/dist/collection/api/mockData/MockPayments.js +21 -21
- package/dist/collection/components/business-details/business-details.js +16 -12
- package/dist/collection/components/business-details/representative-details/representative-details.js +2 -2
- package/dist/collection/components/business-form/business-form-example.js +12 -0
- package/dist/collection/components/business-form/business-form-stepped-example.js +12 -0
- package/dist/collection/components/business-form/business-form-stepped.stories.js +1 -1
- package/dist/collection/components/form/form-control-datepart.js +1 -1
- package/dist/collection/components/gross-payment-chart/example.js +12 -0
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +20 -8
- package/dist/collection/components/payment-details/payment-details.js +21 -12
- package/dist/collection/components/payment-form/payment-form.js +16 -6
- package/dist/collection/components/payments-list/payments-list.js +21 -22
- package/dist/collection/components/payout-details/payout-details.js +19 -11
- package/dist/collection/components/payouts-list/payouts-list.js +20 -10
- package/dist/collection/components/subaccount-details/subaccount-details.js +2 -4
- package/dist/collection/components/table/table.css +5 -0
- package/dist/collection/components/table/table.js +2 -2
- package/dist/components/Payout.js +50 -2
- package/dist/components/form-control-datepart2.js +1 -1
- package/dist/components/justifi-business-details.js +15 -11
- package/dist/components/justifi-gross-payment-chart.js +21 -9
- package/dist/components/justifi-payment-details.js +21 -12
- package/dist/components/justifi-payment-form.js +16 -6
- package/dist/components/justifi-payments-list.js +22 -23
- package/dist/components/justifi-payout-details.js +19 -11
- package/dist/components/justifi-payouts-list.js +21 -11
- package/dist/components/justifi-subaccount-details.js +2 -4
- package/dist/components/pagination-menu2.js +1 -1
- package/dist/components/payment-method-form.js +3 -1
- package/dist/components/representative-details2.js +2 -2
- package/dist/components/table.js +3 -3
- package/dist/esm/{Payout-fcf16887.js → Payout-586f06a3.js} +50 -2
- package/dist/esm/additional-questions-details_5.entry.js +2 -2
- package/dist/esm/form-control-datepart_2.entry.js +1 -1
- package/dist/esm/justifi-business-details.entry.js +17 -13
- package/dist/esm/justifi-business-form-stepped.entry.js +1 -1
- package/dist/esm/justifi-business-form.entry.js +1 -1
- package/dist/esm/justifi-business-list.entry.js +1 -1
- package/dist/esm/justifi-gross-payment-chart.entry.js +22 -10
- package/dist/esm/justifi-payment-balance-transactions.entry.js +1 -1
- package/dist/esm/justifi-payment-details.entry.js +21 -12
- package/dist/esm/justifi-payment-form.entry.js +16 -6
- package/dist/esm/justifi-payment-method-form.entry.js +3 -1
- package/dist/esm/justifi-payments-list.entry.js +22 -23
- package/dist/esm/justifi-payout-details.entry.js +20 -12
- package/dist/esm/justifi-payouts-list.entry.js +21 -11
- package/dist/esm/justifi-proceeds-list.entry.js +1 -1
- package/dist/esm/justifi-refund-form.entry.js +1 -1
- package/dist/esm/justifi-subaccount-details.entry.js +4 -6
- package/dist/esm/justifi-subaccounts-list.entry.js +1 -1
- package/dist/esm/justifi-table_2.entry.js +4 -4
- package/dist/types/api/Payment.d.ts +32 -5
- package/dist/types/api/Payout.d.ts +2 -2
- package/dist/types/components/business-details/business-details.d.ts +0 -1
- package/dist/types/components/payment-method-form/payment-method-responses.d.ts +7 -1
- package/dist/types/components/payments-list/payments-list.d.ts +1 -3
- package/dist/webcomponents/p-0ce6fba2.entry.js +1 -0
- package/dist/webcomponents/p-2140e9ba.entry.js +1 -0
- package/dist/webcomponents/{p-914d2284.entry.js → p-311250e2.entry.js} +1 -1
- package/dist/webcomponents/{p-2306d7aa.entry.js → p-3501b0e8.entry.js} +1 -1
- package/dist/webcomponents/{p-29528eca.entry.js → p-3ee831ac.entry.js} +1 -1
- package/dist/webcomponents/{p-6075122d.entry.js → p-4214dbb8.entry.js} +1 -1
- package/dist/webcomponents/{p-5e78d370.entry.js → p-5df52341.entry.js} +1 -1
- package/dist/webcomponents/{p-3b80dc4a.entry.js → p-6a648652.entry.js} +1 -1
- package/dist/webcomponents/p-77a8bcea.entry.js +1 -0
- package/dist/webcomponents/p-9d46e7f1.entry.js +1 -0
- package/dist/webcomponents/p-a1ef6b4c.entry.js +1 -0
- package/dist/webcomponents/p-ac8ee442.entry.js +1 -0
- package/dist/webcomponents/{p-21998fea.entry.js → p-af771964.entry.js} +1 -1
- package/dist/webcomponents/p-bab3fd56.entry.js +1 -0
- package/dist/webcomponents/p-bc91044c.entry.js +1 -0
- package/dist/webcomponents/{p-98bb3c6a.entry.js → p-c29c587f.entry.js} +1 -1
- package/dist/webcomponents/{p-ce2e68df.entry.js → p-d6347f27.entry.js} +3 -3
- package/dist/webcomponents/p-d8d1f417.entry.js +1 -0
- package/dist/webcomponents/p-e12ab547.js +1 -0
- package/dist/webcomponents/{p-5cf9128c.entry.js → p-ed8c9b88.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +3 -2
- package/readme.md +38 -10
- package/dist/webcomponents/p-0e51a185.entry.js +0 -1
- package/dist/webcomponents/p-10210702.entry.js +0 -1
- package/dist/webcomponents/p-44271b0c.entry.js +0 -1
- package/dist/webcomponents/p-52643813.entry.js +0 -1
- package/dist/webcomponents/p-656a6bc8.entry.js +0 -1
- package/dist/webcomponents/p-76983a7e.js +0 -1
- package/dist/webcomponents/p-884b8cf4.entry.js +0 -1
- package/dist/webcomponents/p-a82e7fcd.entry.js +0 -1
- package/dist/webcomponents/p-b0fbddb2.entry.js +0 -1
- package/dist/webcomponents/p-d89b1a78.entry.js +0 -1
|
@@ -24,6 +24,54 @@ export var PaymentDisputedStatuses;
|
|
|
24
24
|
PaymentDisputedStatuses["lost"] = "lost";
|
|
25
25
|
PaymentDisputedStatuses["open"] = "open";
|
|
26
26
|
})(PaymentDisputedStatuses || (PaymentDisputedStatuses = {}));
|
|
27
|
+
export class PaymentMethod {
|
|
28
|
+
constructor(paymentMethod) {
|
|
29
|
+
this.card = paymentMethod.card ? new Card(paymentMethod.card) : undefined;
|
|
30
|
+
this.bank_account = paymentMethod.bank_account
|
|
31
|
+
? new BankAccount(paymentMethod.bank_account)
|
|
32
|
+
: undefined;
|
|
33
|
+
}
|
|
34
|
+
get payersName() {
|
|
35
|
+
if (this.card) {
|
|
36
|
+
return this.card.name;
|
|
37
|
+
}
|
|
38
|
+
else if (this.bank_account) {
|
|
39
|
+
return this.bank_account.name;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
get lastFourDigits() {
|
|
44
|
+
if (this.card) {
|
|
45
|
+
return `**** ${this.card.acct_last_four}`;
|
|
46
|
+
}
|
|
47
|
+
else if (this.bank_account) {
|
|
48
|
+
return `**** ${this.bank_account.acct_last_four}`;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export class BankAccount {
|
|
54
|
+
constructor(bankAccount) {
|
|
55
|
+
this.id = bankAccount.id;
|
|
56
|
+
this.acct_last_four = bankAccount.acct_last_four;
|
|
57
|
+
this.name = bankAccount.name;
|
|
58
|
+
this.brand = bankAccount.brand;
|
|
59
|
+
this.token = bankAccount.token;
|
|
60
|
+
this.created_at = bankAccount.created_at;
|
|
61
|
+
this.updated_at = bankAccount.updated_at;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class Card {
|
|
65
|
+
constructor(card) {
|
|
66
|
+
this.id = card.id || '';
|
|
67
|
+
this.acct_last_four = card.acct_last_four;
|
|
68
|
+
this.name = card.name;
|
|
69
|
+
this.brand = card.brand;
|
|
70
|
+
this.token = card.token;
|
|
71
|
+
this.created_at = card.created_at;
|
|
72
|
+
this.updated_at = card.updated_at;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
27
75
|
export class Payment {
|
|
28
76
|
constructor(payment) {
|
|
29
77
|
this.id = payment.id;
|
|
@@ -44,7 +92,7 @@ export class Payment {
|
|
|
44
92
|
this.fee_amount = payment.fee_amount;
|
|
45
93
|
this.is_test = payment.is_test;
|
|
46
94
|
this.metadata = payment.metadata;
|
|
47
|
-
this.payment_method = payment.payment_method;
|
|
95
|
+
this.payment_method = new PaymentMethod(payment.payment_method);
|
|
48
96
|
this.payment_intent_id = payment.payment_intent_id;
|
|
49
97
|
this.refunded = payment.refunded;
|
|
50
98
|
this.status = payment.status;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaptureStrategy, Payment, PaymentStatuses } from "../Payment";
|
|
1
|
+
import { CaptureStrategy, Card, Payment, PaymentMethod, PaymentStatuses } from "../Payment";
|
|
2
2
|
const mockPayments = [
|
|
3
3
|
// payment 0: succeeded
|
|
4
4
|
new Payment({
|
|
@@ -39,8 +39,8 @@ const mockPayments = [
|
|
|
39
39
|
],
|
|
40
40
|
},
|
|
41
41
|
payment_intent_id: null,
|
|
42
|
-
payment_method: {
|
|
43
|
-
card: {
|
|
42
|
+
payment_method: new PaymentMethod({
|
|
43
|
+
card: new Card({
|
|
44
44
|
acct_last_four: '6449',
|
|
45
45
|
brand: 'mastercard',
|
|
46
46
|
created_at: '2022-01-13T14:19:11.803Z',
|
|
@@ -48,8 +48,8 @@ const mockPayments = [
|
|
|
48
48
|
name: 'Nick Name',
|
|
49
49
|
token: 'fake-token',
|
|
50
50
|
updated_at: '2022-01-13T14:19:11.803Z',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
51
|
+
}),
|
|
52
|
+
}),
|
|
53
53
|
refunded: false,
|
|
54
54
|
status: PaymentStatuses.succeeded,
|
|
55
55
|
updated_at: '2022-01-10T15:29:58.940Z',
|
|
@@ -76,8 +76,8 @@ const mockPayments = [
|
|
|
76
76
|
is_test: false,
|
|
77
77
|
metadata: null,
|
|
78
78
|
payment_intent_id: null,
|
|
79
|
-
payment_method: {
|
|
80
|
-
card: {
|
|
79
|
+
payment_method: new PaymentMethod({
|
|
80
|
+
card: new Card({
|
|
81
81
|
acct_last_four: '1213',
|
|
82
82
|
brand: 'visa',
|
|
83
83
|
created_at: '2021-01-13T14:19:11.803Z',
|
|
@@ -85,8 +85,8 @@ const mockPayments = [
|
|
|
85
85
|
name: 'Good Customer',
|
|
86
86
|
token: 'fake-token',
|
|
87
87
|
updated_at: '2021-01-13T14:19:11.803Z',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
88
|
+
}),
|
|
89
|
+
}),
|
|
90
90
|
refunded: true,
|
|
91
91
|
status: PaymentStatuses.fully_refunded,
|
|
92
92
|
updated_at: '2021-01-10T15:29:58.940Z',
|
|
@@ -113,8 +113,8 @@ const mockPayments = [
|
|
|
113
113
|
is_test: false,
|
|
114
114
|
metadata: null,
|
|
115
115
|
payment_intent_id: null,
|
|
116
|
-
payment_method: {
|
|
117
|
-
card: {
|
|
116
|
+
payment_method: new PaymentMethod({
|
|
117
|
+
card: new Card({
|
|
118
118
|
acct_last_four: '9780',
|
|
119
119
|
brand: 'american_express',
|
|
120
120
|
created_at: '2021-11-13T14:19:11.803Z',
|
|
@@ -122,8 +122,8 @@ const mockPayments = [
|
|
|
122
122
|
name: 'Sal Gleason',
|
|
123
123
|
token: 'fake-token',
|
|
124
124
|
updated_at: '2021-11-13T14:19:11.803Z',
|
|
125
|
-
},
|
|
126
|
-
},
|
|
125
|
+
}),
|
|
126
|
+
}),
|
|
127
127
|
refunded: true,
|
|
128
128
|
status: PaymentStatuses.partially_refunded,
|
|
129
129
|
updated_at: '2022-01-10T15:29:58.940Z',
|
|
@@ -162,8 +162,8 @@ const mockPayments = [
|
|
|
162
162
|
is_test: false,
|
|
163
163
|
metadata: null,
|
|
164
164
|
payment_intent_id: null,
|
|
165
|
-
payment_method: {
|
|
166
|
-
card: {
|
|
165
|
+
payment_method: new PaymentMethod({
|
|
166
|
+
card: new Card({
|
|
167
167
|
acct_last_four: '1554',
|
|
168
168
|
brand: 'discover',
|
|
169
169
|
created_at: '2021-09-13T14:19:11.803Z',
|
|
@@ -171,8 +171,8 @@ const mockPayments = [
|
|
|
171
171
|
name: 'Sal Gleason',
|
|
172
172
|
token: 'fake-token',
|
|
173
173
|
updated_at: '2021-09-13T14:19:11.803Z',
|
|
174
|
-
},
|
|
175
|
-
},
|
|
174
|
+
}),
|
|
175
|
+
}),
|
|
176
176
|
refunded: false,
|
|
177
177
|
status: PaymentStatuses.disputed,
|
|
178
178
|
updated_at: '2021-09-10T15:29:58.940Z',
|
|
@@ -199,8 +199,8 @@ const mockPayments = [
|
|
|
199
199
|
is_test: true,
|
|
200
200
|
metadata: null,
|
|
201
201
|
payment_intent_id: null,
|
|
202
|
-
payment_method: {
|
|
203
|
-
card: {
|
|
202
|
+
payment_method: new PaymentMethod({
|
|
203
|
+
card: new Card({
|
|
204
204
|
acct_last_four: '8774',
|
|
205
205
|
brand: 'diners_club',
|
|
206
206
|
created_at: '2022-01-18T15:07:15.975Z',
|
|
@@ -208,8 +208,8 @@ const mockPayments = [
|
|
|
208
208
|
name: 'Minnie Bernhard',
|
|
209
209
|
token: 'fake-token',
|
|
210
210
|
updated_at: '2022-01-18T15:07:15.975Z',
|
|
211
|
-
},
|
|
212
|
-
},
|
|
211
|
+
}),
|
|
212
|
+
}),
|
|
213
213
|
refunded: false,
|
|
214
214
|
status: PaymentStatuses.failed,
|
|
215
215
|
updated_at: '2022-01-18T12:54:44.822Z',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
import { Api } from "../../api";
|
|
3
|
-
import { ErrorState, LoadingState } from "../details/utils";
|
|
3
|
+
import { ErrorState, LoadingState } from "../details/utils";
|
|
4
4
|
import { config } from "../../../config";
|
|
5
5
|
var RENDER_STATES;
|
|
6
6
|
(function (RENDER_STATES) {
|
|
@@ -24,15 +24,16 @@ export class BusinessDetails {
|
|
|
24
24
|
this.renderState = RENDER_STATES.LOADING;
|
|
25
25
|
this.errorMessage = 'An error ocurred.';
|
|
26
26
|
this.fetchBusiness = this.fetchBusiness.bind(this);
|
|
27
|
-
this.setError = this.setError.bind(this);
|
|
28
27
|
}
|
|
29
28
|
async componentWillLoad() {
|
|
30
29
|
if (!this.authToken) {
|
|
31
|
-
this.
|
|
30
|
+
this.errorMessage = 'Missing auth-token. The form will not be functional without it.';
|
|
31
|
+
console.error(this.errorMessage);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
if (!this.businessId) {
|
|
35
|
-
this.
|
|
35
|
+
this.errorMessage = 'Missing business-id. The form will not be functional without it.';
|
|
36
|
+
console.error(this.errorMessage);
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
this.api = Api(this.authToken, config.proxyApiOrigin);
|
|
@@ -43,27 +44,30 @@ export class BusinessDetails {
|
|
|
43
44
|
try {
|
|
44
45
|
const response = await this.api.get(`entities/business/${businessId}`);
|
|
45
46
|
if (response.error) {
|
|
46
|
-
this.
|
|
47
|
+
this.errorMessage = `${this.errorMessage}: ${response.error}`;
|
|
48
|
+
console.error(this.errorMessage);
|
|
49
|
+
this.renderState = RENDER_STATES.ERROR;
|
|
47
50
|
return;
|
|
48
51
|
}
|
|
49
52
|
this.business = response.data;
|
|
50
53
|
this.renderState = RENDER_STATES.READY;
|
|
51
54
|
}
|
|
52
55
|
catch (error) {
|
|
53
|
-
this.
|
|
56
|
+
this.errorMessage = `${this.errorMessage}: ${error}`;
|
|
57
|
+
console.error(this.errorMessage);
|
|
58
|
+
this.renderState = RENDER_STATES.ERROR;
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
this.renderState = RENDER_STATES.READY;
|
|
54
62
|
}
|
|
55
|
-
}
|
|
56
|
-
setError(error) {
|
|
57
|
-
this.errorMessage = error || this.errorMessage;
|
|
58
|
-
this.renderState = RENDER_STATES.ERROR;
|
|
59
63
|
}
|
|
60
64
|
render() {
|
|
61
65
|
var _a, _b, _c;
|
|
62
66
|
if (this.renderState === RENDER_STATES.LOADING) {
|
|
63
|
-
return LoadingState;
|
|
67
|
+
return h(Host, null, LoadingState);
|
|
64
68
|
}
|
|
65
69
|
if (this.renderState === RENDER_STATES.ERROR) {
|
|
66
|
-
return ErrorState(this.errorMessage);
|
|
70
|
+
return h(Host, null, ErrorState(this.errorMessage));
|
|
67
71
|
}
|
|
68
72
|
return (h(Host, null, h("generic-info-details", { business: this.business }), h("legal-address-details", { legalAddress: (_a = this.business) === null || _a === void 0 ? void 0 : _a.legal_address }), h("representative-details", { representative: (_b = this.business) === null || _b === void 0 ? void 0 : _b.representative }), h("owner-details", { owners: (_c = this.business) === null || _c === void 0 ? void 0 : _c.owners }), h("additional-questions-details", { business: this.business })));
|
|
69
73
|
}
|
package/dist/collection/components/business-details/representative-details/representative-details.js
CHANGED
|
@@ -14,8 +14,8 @@ export class JustifiRepresentativeDetails {
|
|
|
14
14
|
this.representative = undefined;
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
18
|
-
return (h(Host, null, h(DetailSection, { sectionTitle: "Representative Details" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: "Name", value: (_a = this.representative) === null || _a === void 0 ? void 0 : _a.name }), h(DetailItem, { title: "ID", value: (_b = this.representative) === null || _b === void 0 ? void 0 : _b.id }), h(DetailItem, { title: "Representative Address", value: (_c = this.representative) === null || _c === void 0 ? void 0 : _c.address.line1 }), h(DetailItem, { title: "
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
18
|
+
return (h(Host, null, h(DetailSection, { sectionTitle: "Representative Details" }, h("div", { class: "row gy-3" }, h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: "Name", value: (_a = this.representative) === null || _a === void 0 ? void 0 : _a.name }), h(DetailItem, { title: "ID", value: (_b = this.representative) === null || _b === void 0 ? void 0 : _b.id }), h(DetailItem, { title: "Representative Address", value: (_c = this.representative) === null || _c === void 0 ? void 0 : _c.address.line1 }), h(DetailItem, { title: "Created At", value: ((_d = this.representative) === null || _d === void 0 ? void 0 : _d.created_at) && formatMediumDate((_e = this.representative) === null || _e === void 0 ? void 0 : _e.created_at) })), h("div", { class: "col-12 col-md-6" }, h(DetailItem, { title: "Title", value: (_f = this.representative) === null || _f === void 0 ? void 0 : _f.title }), h(DetailItem, { title: "Is Owner?", value: (_g = this.representative) === null || _g === void 0 ? void 0 : _g.is_owner.toString() }), h(DetailItem, { title: "Date Of Birth", value: this.representative && formatMediumDate(new Date(Number((_h = this.representative) === null || _h === void 0 ? void 0 : _h.dob_year), Number((_j = this.representative) === null || _j === void 0 ? void 0 : _j.dob_month) - 1, Number((_k = this.representative) === null || _k === void 0 ? void 0 : _k.dob_day))) }), h(DetailItem, { title: "Email", value: (_l = this.representative) === null || _l === void 0 ? void 0 : _l.email }), h(DetailItem, { title: "Phone", value: (_m = this.representative) === null || _m === void 0 ? void 0 : _m.phone }), h(DetailItem, { title: "Updated At", value: this.representative && formatMediumDate((_o = this.representative) === null || _o === void 0 ? void 0 : _o.updated_at) }))))));
|
|
19
19
|
}
|
|
20
20
|
static get is() { return "representative-details"; }
|
|
21
21
|
static get encapsulation() { return "shadow"; }
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { head } from '../../../storybook-pages/example-parts';
|
|
2
|
+
|
|
3
|
+
export default `<!DOCTYPE html>
|
|
4
|
+
<html dir="ltr" lang="en">
|
|
5
|
+
|
|
6
|
+
${head('justifi-business-form-stepped')}
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<justifi-business-form-stepped></justifi-business-form-stepped>
|
|
10
|
+
</body>
|
|
11
|
+
|
|
12
|
+
</html>`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { config } from "../../../config";
|
|
2
2
|
class BusinessFormSteppedStoryArgs {
|
|
3
3
|
constructor(args) {
|
|
4
|
-
this['auth-token'] = args['auth-token'] ||
|
|
4
|
+
this['auth-token'] = args['auth-token'] || config.proxyAuthToken;
|
|
5
5
|
this['business-id'] = args['business-id'] || '';
|
|
6
6
|
this['account-id'] = args['account-id'] || config.exampleAccountId;
|
|
7
7
|
this['css-variables'] = args['css-variables'] || '';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { head } from '../../../storybook-pages/example-parts';
|
|
2
|
+
|
|
3
|
+
export default `<DOCTYPE html>
|
|
4
|
+
<html dir="ltr" lang="en">
|
|
5
|
+
|
|
6
|
+
${head('justifi-gross-payment-chart')}
|
|
7
|
+
|
|
8
|
+
<body>
|
|
9
|
+
<justifi-gross-payment-chart></justifi-gross-payment-chart>
|
|
10
|
+
</body>
|
|
11
|
+
|
|
12
|
+
</html>`;
|
|
@@ -31,15 +31,27 @@ export class GrossPaymentChart {
|
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
this.loading = true;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
try {
|
|
35
|
+
const api = Api(this.authToken, config.proxyApiOrigin);
|
|
36
|
+
const endpoint = `account/${this.accountId}/reports/gross_volume`;
|
|
37
|
+
const response = await api.get(endpoint);
|
|
38
|
+
if (!response.error) {
|
|
39
|
+
this.total = response === null || response === void 0 ? void 0 : response.data.total;
|
|
40
|
+
this.dates = response === null || response === void 0 ? void 0 : response.data.dates.reverse();
|
|
41
|
+
this.endDate = this.dates[this.dates.length - 1].date;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.errorMessage = `Error trying to fetch data : ${response.error}`;
|
|
45
|
+
console.error(this.errorMessage);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.errorMessage = `Error trying to fetch data : ${error}`;
|
|
50
|
+
console.error(this.errorMessage);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
this.loading = false;
|
|
41
54
|
}
|
|
42
|
-
this.loading = false;
|
|
43
55
|
}
|
|
44
56
|
renderChart() {
|
|
45
57
|
if (this.chart) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { Api } from "../../api";
|
|
3
|
-
import { MapPaymentStatusToBadge, formatCurrency, formatDate, formatTime } from "../../utils/utils";
|
|
2
|
+
import { Api, Payment } from "../../api";
|
|
3
|
+
import { MapPaymentStatusToBadge, formatCurrency, formatDate, formatTime, snakeCaseToHumanReadable } from "../../utils/utils";
|
|
4
4
|
import { CodeBlock, DetailItem, DetailSection, EntityHeadInfo, EntityHeadInfoItem, ErrorState, LoadingState } from "../details/utils";
|
|
5
5
|
import { config } from "../../../config";
|
|
6
6
|
/**
|
|
@@ -42,26 +42,35 @@ export class PaymentDetails {
|
|
|
42
42
|
this.fetchData();
|
|
43
43
|
}
|
|
44
44
|
async fetchData() {
|
|
45
|
-
this.errorMessage = '';
|
|
46
45
|
if (!this.paymentId || !this.authToken) {
|
|
47
46
|
this.errorMessage = "Can not fetch any data without a PaymentID and an AuthToken";
|
|
48
47
|
this.loading = false;
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
50
|
this.loading = true;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
try {
|
|
52
|
+
const endpoint = `payments/${this.paymentId}`;
|
|
53
|
+
const response = await Api(this.authToken, config.proxyApiOrigin).get(endpoint);
|
|
54
|
+
if (!response.error) {
|
|
55
|
+
this.payment = new Payment(response.data);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const responseError = typeof response.error === 'string' ? response.error : response.error.message;
|
|
59
|
+
this.errorMessage = `Error trying to fetch data : ${responseError}`;
|
|
60
|
+
console.error(this.errorMessage);
|
|
61
|
+
}
|
|
56
62
|
}
|
|
57
|
-
|
|
58
|
-
this.errorMessage =
|
|
63
|
+
catch (error) {
|
|
64
|
+
this.errorMessage = `Error trying to fetch data : ${error}`;
|
|
65
|
+
console.error(this.errorMessage);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
this.loading = false;
|
|
59
69
|
}
|
|
60
|
-
this.loading = false;
|
|
61
70
|
}
|
|
62
71
|
render() {
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
return (h(Host, null, this.loading && LoadingState, !this.loading && this.errorMessage && ErrorState(this.errorMessage), !this.loading && !this.errorMessage &&
|
|
73
|
+
this.payment && (h("justifi-details", { "error-message": this.errorMessage }, h(EntityHeadInfo, { slot: "head-info", badge: h("span", { slot: 'badge', innerHTML: MapPaymentStatusToBadge(this.payment.status) }), title: `${formatCurrency(this.payment.amount)} ${this.payment.currency.toUpperCase()}` }, h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Updated At", value: `${formatDate(this.payment.updated_at)} ${formatTime(this.payment.updated_at)}` }), h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Created At", value: `${formatDate(this.payment.created_at)} ${formatTime(this.payment.created_at)}` }), h(EntityHeadInfoItem, { title: "ID", value: this.payment.id })), h("div", { slot: 'detail-sections' }, h(DetailSection, { sectionTitle: "Details" }, h(DetailItem, { title: "Amount", value: formatCurrency(this.payment.amount) }), h(DetailItem, { title: "Fees", value: formatCurrency(this.payment.fee_amount) }), h(DetailItem, { title: "Refunded", value: formatCurrency(this.payment.amount_refunded) }), h(DetailItem, { title: "Net", value: formatCurrency(this.payment.balance) }), h(DetailItem, { title: "Status", value: MapPaymentStatusToBadge(this.payment.status) }), h(DetailItem, { title: "Payment ID", value: this.payment.id }), h(DetailItem, { title: "Processing Fees", value: formatCurrency(this.payment.fee_amount) }), h(DetailItem, { title: "Statement Descriptor", value: this.payment.statement_descriptor }), h(DetailItem, { title: "Description", value: this.payment.description })), this.payment.payment_method.card && (h(DetailSection, { sectionTitle: "Payment Method" }, h(DetailItem, { title: "ID", value: this.payment.payment_method.card.id }), h(DetailItem, { title: "Payment Type", value: "Card" }), h(DetailItem, { title: "Last 4 Numbers", value: this.payment.payment_method.lastFourDigits }), h(DetailItem, { title: "Brand", value: snakeCaseToHumanReadable(this.payment.payment_method.card.brand) }), h(DetailItem, { title: "Cardholder", value: this.payment.payment_method.payersName }))), this.payment.payment_method.bank_account && (h(DetailSection, { sectionTitle: "Payment Method" }, h(DetailItem, { title: "ID", value: this.payment.payment_method.bank_account.id }), h(DetailItem, { title: "Last 4 Numbers", value: this.payment.payment_method.lastFourDigits }), h(DetailItem, { title: "Bank Name", value: this.payment.payment_method.bank_account.brand }), h(DetailItem, { title: "Account Owner", value: this.payment.payment_method.payersName }))), h(DetailSection, { sectionTitle: 'Metadata' }, h(CodeBlock, { metadata: this.payment.metadata })))))));
|
|
65
74
|
}
|
|
66
75
|
static get is() { return "justifi-payment-details"; }
|
|
67
76
|
static get encapsulation() { return "shadow"; }
|
|
@@ -63,11 +63,21 @@ export class PaymentForm {
|
|
|
63
63
|
if (!billingFormValidation.isValid || !paymentMethodFormValidation.isValid)
|
|
64
64
|
return;
|
|
65
65
|
this.isLoading = true;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
try {
|
|
67
|
+
const billingFormFieldValues = await this.billingFormRef.getValues();
|
|
68
|
+
const paymentMethodData = Object.assign({ email: this.email }, billingFormFieldValues);
|
|
69
|
+
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(this.clientId, paymentMethodData, this.accountId);
|
|
70
|
+
if (tokenizeResponse.error) {
|
|
71
|
+
console.error(`An error occured submitting the form: ${tokenizeResponse.error.message}`);
|
|
72
|
+
}
|
|
73
|
+
this.submitted.emit(tokenizeResponse);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
console.error(`An error occured submitting the form: ${error}`);
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
this.isLoading = false;
|
|
80
|
+
}
|
|
71
81
|
}
|
|
72
82
|
render() {
|
|
73
83
|
return (h(Host, null, h("form", { class: "row gy-3" }, this.allowedPaymentMethodTypes.length > 1 && (h("div", { class: "col-12" }, h("justifi-payment-method-selector", { paymentMethodTypes: this.allowedPaymentMethodTypes, selectedPaymentMethodType: this.selectedPaymentMethodType }))), h("div", { class: "col-12" }, h("justifi-payment-method-form", { "payment-method-form-type": this.selectedPaymentMethodType, "iframe-origin": this.iframeOrigin, ref: el => {
|
|
@@ -239,7 +249,7 @@ export class PaymentForm {
|
|
|
239
249
|
},
|
|
240
250
|
"complexType": {
|
|
241
251
|
"original": "CreatePaymentMethodResponse",
|
|
242
|
-
"resolved": "BankAccountCreateResponse | CardCreateResponse",
|
|
252
|
+
"resolved": "BankAccountCreateResponse | CardCreateResponse | PaymentMethodErrorResponse",
|
|
243
253
|
"references": {
|
|
244
254
|
"CreatePaymentMethodResponse": {
|
|
245
255
|
"location": "import",
|
|
@@ -55,28 +55,27 @@ export class PaymentsList {
|
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
this.loading = true;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
try {
|
|
59
|
+
const api = Api(this.authToken, config.proxyApiOrigin);
|
|
60
|
+
const endpoint = `account/${this.accountId}/payments`;
|
|
61
|
+
const response = await api.get(endpoint, this.params);
|
|
62
|
+
if (!response.error) {
|
|
63
|
+
this.paging = Object.assign(Object.assign({}, this.paging), response.page_info);
|
|
64
|
+
const data = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.map(dataItem => new Payment(dataItem));
|
|
65
|
+
this.payments = data;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const responseError = typeof response.error === 'string' ? response.error : response.error.message;
|
|
69
|
+
console.error(`Error fetching payments: ${responseError}`);
|
|
70
|
+
this.errorMessage = 'No results';
|
|
71
|
+
}
|
|
68
72
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return paymentMethod.card || paymentMethod.bank_account;
|
|
73
|
-
}
|
|
74
|
-
getPaymentMethodName(paymentMethod) {
|
|
75
|
-
if (paymentMethod.card) {
|
|
76
|
-
return paymentMethod.card.name;
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error(`Error fetching payments: ${error.message}`);
|
|
75
|
+
this.errorMessage = 'No results';
|
|
77
76
|
}
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
finally {
|
|
78
|
+
this.loading = false;
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
render() {
|
|
@@ -104,8 +103,8 @@ export class PaymentsList {
|
|
|
104
103
|
},
|
|
105
104
|
formatCurrency(payment.amount),
|
|
106
105
|
payment.description,
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
payment.payment_method.payersName,
|
|
107
|
+
payment.payment_method.lastFourDigits,
|
|
109
108
|
{
|
|
110
109
|
type: 'inner',
|
|
111
110
|
value: MapPaymentStatusToBadge(payment.status)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { Api } from "../../api";
|
|
2
|
+
import { Api, Payout } from "../../api";
|
|
3
3
|
import { MapPayoutStatusToBadge, formatCurrency, formatDate, formatTime } from "../../utils/utils";
|
|
4
4
|
import { CodeBlock, DetailItem, DetailSection, EntityHeadInfo, EntityHeadInfoItem, ErrorState, LoadingState } from "../details/utils";
|
|
5
5
|
import { config } from "../../../config";
|
|
@@ -49,21 +49,29 @@ export class PaymentDetails {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
this.loading = true;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
try {
|
|
53
|
+
const endpoint = `payouts/${this.payoutId}`;
|
|
54
|
+
const response = await Api(this.authToken, config.proxyApiOrigin).get(endpoint);
|
|
55
|
+
if (!response.error) {
|
|
56
|
+
this.payout = new Payout(response.data);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const responseError = typeof response.error === 'string' ? response.error : response.error.message;
|
|
60
|
+
this.errorMessage = `Error fetching payout details: ${responseError}`;
|
|
61
|
+
console.error(this.errorMessage);
|
|
62
|
+
}
|
|
56
63
|
}
|
|
57
|
-
|
|
58
|
-
this.errorMessage =
|
|
64
|
+
catch (error) {
|
|
65
|
+
this.errorMessage = `Error fetching payout details: ${error}`;
|
|
66
|
+
console.error(this.errorMessage);
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
this.loading = false;
|
|
59
70
|
}
|
|
60
|
-
this.loading = false;
|
|
61
71
|
}
|
|
62
72
|
render() {
|
|
63
73
|
var _a;
|
|
64
|
-
return (h(Host, null, this.loading
|
|
65
|
-
!this.payout ? ErrorState(this.errorMessage) :
|
|
66
|
-
h("justifi-details", { "error-message": this.errorMessage }, h(EntityHeadInfo, { slot: "head-info", badge: h("span", { slot: 'badge', innerHTML: MapPayoutStatusToBadge((_a = this.payout) === null || _a === void 0 ? void 0 : _a.status) }), title: `${formatCurrency(this.payout.amount)} ${this.payout.currency.toUpperCase()}` }, h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Updated At", value: `${formatDate(this.payout.updated_at)} ${formatTime(this.payout.updated_at)}` }), h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Created At", value: `${formatDate(this.payout.created_at)} ${formatTime(this.payout.created_at)}` }), h(EntityHeadInfoItem, { title: "ID", value: this.payout.id })), h("div", { slot: 'detail-sections' }, h(DetailSection, { sectionTitle: "Details" }, h(DetailItem, { title: "Date paid", value: formatDate(this.payout.deposits_at) }), h(DetailItem, { title: "Statement Description", value: this.payout.description }), h(DetailItem, { title: "Payout Method", value: this.payout.delivery_method }), h(DetailItem, { title: "Amount", value: formatCurrency(this.payout.amount) }), h(DetailItem, { title: "Fee", value: formatCurrency(this.payout.fees_total) })), h(DetailSection, { sectionTitle: "Account" }, h(DetailItem, { title: "ID", value: this.payout.account_id }), h(DetailItem, { title: "Account Type", value: this.payout.bank_account.account_type }), h(DetailItem, { title: "Institution", value: this.payout.bank_account.account_type }), h(DetailItem, { title: "Routing Number", value: this.payout.bank_account.routing_number }), h(DetailItem, { title: "Account Number", value: this.payout.bank_account.account_number_last4 })), h(DetailSection, { sectionTitle: 'Metadata' }, h(CodeBlock, { metadata: this.payout.metadata }))))));
|
|
74
|
+
return (h(Host, null, this.loading && LoadingState, !this.loading && this.errorMessage && ErrorState(this.errorMessage), !this.loading && this.payout && (h("justifi-details", { "error-message": this.errorMessage }, h(EntityHeadInfo, { slot: "head-info", badge: h("span", { slot: 'badge', innerHTML: MapPayoutStatusToBadge((_a = this.payout) === null || _a === void 0 ? void 0 : _a.status) }), title: `${formatCurrency(this.payout.amount)} ${this.payout.currency.toUpperCase()}` }, h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Updated At", value: `${formatDate(this.payout.updated_at)} ${formatTime(this.payout.updated_at)}` }), h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Created At", value: `${formatDate(this.payout.created_at)} ${formatTime(this.payout.created_at)}` }), h(EntityHeadInfoItem, { title: "ID", value: this.payout.id })), h("div", { slot: 'detail-sections' }, h(DetailSection, { sectionTitle: "Details" }, h(DetailItem, { title: "Date paid", value: formatDate(this.payout.deposits_at) }), h(DetailItem, { title: "Statement Description", value: this.payout.description }), h(DetailItem, { title: "Payout Method", value: this.payout.delivery_method }), h(DetailItem, { title: "Amount", value: formatCurrency(this.payout.amount) }), h(DetailItem, { title: "Fee", value: formatCurrency(this.payout.fees_total) })), h(DetailSection, { sectionTitle: "Account" }, h(DetailItem, { title: "ID", value: this.payout.account_id }), h(DetailItem, { title: "Account Type", value: this.payout.bank_account.account_type }), h(DetailItem, { title: "Institution", value: this.payout.bank_account.account_type }), h(DetailItem, { title: "Routing Number", value: this.payout.bank_account.routing_number }), h(DetailItem, { title: "Account Number", value: this.payout.bank_account.account_number_last4 })), h(DetailSection, { sectionTitle: 'Metadata' }, h(CodeBlock, { metadata: this.payout.metadata })))))));
|
|
67
75
|
}
|
|
68
76
|
static get is() { return "justifi-payout-details"; }
|
|
69
77
|
static get encapsulation() { return "shadow"; }
|
|
@@ -71,18 +71,28 @@ export class PayoutsList {
|
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
this.loading = true;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
try {
|
|
75
|
+
const api = Api(this.authToken, config.proxyApiOrigin);
|
|
76
|
+
const endpoint = `account/${this.accountId}/payouts`;
|
|
77
|
+
const response = await api.get(endpoint, this.params);
|
|
78
|
+
if (!response.error) {
|
|
79
|
+
this.paging = Object.assign(Object.assign({}, this.paging), response.page_info);
|
|
80
|
+
const data = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.map(dataItem => new Payout(dataItem));
|
|
81
|
+
this.payouts = data;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const responseError = typeof response.error === 'string' ? response.error : response.error.message;
|
|
85
|
+
console.error(`Error fetching payouts: ${responseError}`);
|
|
86
|
+
this.errorMessage = 'No results';
|
|
87
|
+
}
|
|
81
88
|
}
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error(`Error fetching payouts: ${error}`);
|
|
91
|
+
this.errorMessage = 'No results';
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
this.loading = false;
|
|
84
95
|
}
|
|
85
|
-
this.loading = false;
|
|
86
96
|
}
|
|
87
97
|
render() {
|
|
88
98
|
return (h(Host, null, h("justifi-table", { rowClickHandler: (e) => {
|
|
@@ -55,10 +55,8 @@ export class SubaccountDetails {
|
|
|
55
55
|
this.loading = false;
|
|
56
56
|
}
|
|
57
57
|
render() {
|
|
58
|
-
var _a, _b
|
|
59
|
-
return (h(Host, null, this.loading
|
|
60
|
-
!this.subaccount || !this.onboardingData ? ErrorState(this.errorMessage) :
|
|
61
|
-
h("justifi-details", null, h(EntityHeadInfo, { slot: 'head-info', badge: h("span", { slot: 'badge', innerHTML: MapSubAccountStatusToBadge((_a = this.subaccount) === null || _a === void 0 ? void 0 : _a.status) }), title: (_b = this.subaccount) === null || _b === void 0 ? void 0 : _b.name }, h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Created At", value: `${formatDate(this.subaccount.created_at)} ${formatTime(this.subaccount.created_at)}` }), h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Last Updated", value: `${formatDate(this.subaccount.updated_at)} ${formatTime(this.subaccount.updated_at)}` }), h(EntityHeadInfoItem, { title: "ID", value: this.subaccount.id })), h("div", { slot: 'detail-sections' }, h("subaccount-account-details", { subaccount: this.subaccount, onboardingData: this.onboardingData }), h("subaccount-merchant-details", { onboardingData: this.onboardingData }), h("subaccount-representative-details", { data: (_d = (_c = this.onboardingData) === null || _c === void 0 ? void 0 : _c.payload) === null || _d === void 0 ? void 0 : _d.representative }), h("subaccount-owners-details", { data: (_f = (_e = this.onboardingData) === null || _e === void 0 ? void 0 : _e.payload) === null || _f === void 0 ? void 0 : _f.owners })))));
|
|
58
|
+
var _a, _b;
|
|
59
|
+
return (h(Host, null, this.loading && LoadingState, !this.loading && this.errorMessage && ErrorState(this.errorMessage), !this.loading && this.subaccount && this.onboardingData && (h("justifi-details", null, h(EntityHeadInfo, { slot: 'head-info', badge: h("span", { slot: 'badge', innerHTML: MapSubAccountStatusToBadge(this.subaccount.status) }), title: this.subaccount.name }, h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Created At", value: `${formatDate(this.subaccount.created_at)} ${formatTime(this.subaccount.created_at)}` }), h(EntityHeadInfoItem, { classes: "border-1 border-end", title: "Last Updated", value: `${formatDate(this.subaccount.updated_at)} ${formatTime(this.subaccount.updated_at)}` }), h(EntityHeadInfoItem, { title: "ID", value: this.subaccount.id })), h("div", { slot: 'detail-sections' }, h("subaccount-account-details", { subaccount: this.subaccount, onboardingData: this.onboardingData }), h("subaccount-merchant-details", { onboardingData: this.onboardingData }), h("subaccount-representative-details", { data: (_a = this.onboardingData.payload) === null || _a === void 0 ? void 0 : _a.representative }), h("subaccount-owners-details", { data: (_b = this.onboardingData.payload) === null || _b === void 0 ? void 0 : _b.owners }))))));
|
|
62
60
|
}
|
|
63
61
|
static get is() { return "justifi-subaccount-details"; }
|
|
64
62
|
static get encapsulation() { return "shadow"; }
|