@justifi/webcomponents 4.13.0-rc.0 → 4.13.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{Api-a06b996e.js → Api-ab34a402.js} +4 -1
- package/dist/cjs/{Business-98686045.js → Business-32a53780.js} +1 -1
- package/dist/cjs/{utils-f8079741.js → ComponentError-8ba0c0e7.js} +0 -25
- package/dist/cjs/{business-additional-questions-schema-f8086f7a.js → business-additional-questions-schema-0a35f597.js} +1 -1
- package/dist/cjs/{business-form-options-fd1c0032.js → business-form-options-43366c9a.js} +1 -1
- package/dist/cjs/form-control-date_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-file.cjs.entry.js +44 -0
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +6 -6
- package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +3 -3
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +9 -8
- package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
- package/dist/cjs/justifi-business-list.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +22 -8
- package/dist/cjs/justifi-checkout.cjs.entry.js +14 -9
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +7 -6
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +11 -11
- package/dist/cjs/justifi-owner-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +8 -7
- package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payments-list.cjs.entry.js +8 -7
- package/dist/cjs/justifi-payout-details.cjs.entry.js +8 -7
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +7 -6
- 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 +1 -1
- package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{payload-parsers-fe27be37.js → payload-parsers-6c4b5323.js} +2 -2
- package/dist/cjs/{payment.service-9db24ab9.js → payment.service-336189d3.js} +1 -1
- package/dist/cjs/{payout.service-a0efb71a.js → payout.service-6012d576.js} +1 -1
- package/dist/cjs/{state-options-4145f9b4.js → state-options-4fbcb48a.js} +4 -0
- package/dist/cjs/utils-491248ca.js +28 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Api.js +4 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/checkout-actions.js +1 -2
- package/dist/collection/components/checkout/checkout-core.js +22 -9
- package/dist/collection/components/checkout/checkout.js +30 -2
- package/dist/collection/components/checkout/new-payment-method.js +11 -11
- package/dist/collection/components/checkout/test/checkout-actions.spec.js +1 -3
- package/dist/collection/components/checkout/test/checkout-core.spec.js +2 -2
- package/dist/collection/components/form/form-control-file.css +1806 -0
- package/dist/collection/components/form/form-control-file.js +169 -0
- package/dist/collection/components/form/test/form-control-file.spec.js +84 -0
- package/dist/collection/utils/state-options.js +4 -0
- package/dist/docs.json +183 -4
- package/dist/esm/{Api-0e88671c.js → Api-e9d568c7.js} +4 -1
- package/dist/esm/{Business-6e0efa26.js → Business-d83fbdb4.js} +1 -1
- package/dist/esm/{utils-4609f32c.js → ComponentError-2a58dbbc.js} +1 -23
- package/dist/esm/{business-additional-questions-schema-8e742129.js → business-additional-questions-schema-e96b0509.js} +1 -1
- package/dist/esm/{business-form-options-75c0a7ec.js → business-form-options-de11bc46.js} +1 -1
- package/dist/esm/form-control-date_3.entry.js +1 -1
- package/dist/esm/form-control-file.entry.js +40 -0
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +6 -6
- package/dist/esm/justifi-additional-questions_4.entry.js +3 -3
- package/dist/esm/justifi-billing-form_4.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +5 -4
- package/dist/esm/justifi-business-form.entry.js +6 -6
- package/dist/esm/justifi-business-list.entry.js +3 -3
- package/dist/esm/justifi-checkout-core.entry.js +22 -8
- package/dist/esm/justifi-checkout.entry.js +11 -6
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -2
- package/dist/esm/justifi-new-payment-method_4.entry.js +11 -11
- package/dist/esm/justifi-owner-form.entry.js +5 -5
- package/dist/esm/justifi-payment-balance-transactions.entry.js +1 -1
- package/dist/esm/justifi-payment-details.entry.js +4 -3
- package/dist/esm/justifi-payment-form.entry.js +2 -1
- package/dist/esm/justifi-payments-list.entry.js +4 -3
- package/dist/esm/justifi-payout-details.entry.js +4 -3
- package/dist/esm/justifi-payouts-list.entry.js +4 -3
- 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 +1 -1
- package/dist/esm/justifi-subaccounts-list.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{payload-parsers-73c12fa2.js → payload-parsers-32028700.js} +2 -2
- package/dist/esm/{payment.service-ec28a959.js → payment.service-2fdc5018.js} +1 -1
- package/dist/esm/{payout.service-5fd5986c.js → payout.service-15064bcc.js} +1 -1
- package/dist/esm/{state-options-c0b757ad.js → state-options-a356fb11.js} +4 -0
- package/dist/esm/utils-f580d6b7.js +25 -0
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Api.js +4 -1
- package/dist/module/ComponentError.js +16 -0
- package/dist/module/checkout-core.js +22 -9
- package/dist/module/form-control-file.d.ts +11 -0
- package/dist/module/form-control-file.js +67 -0
- package/dist/module/justifi-business-details.js +2 -1
- package/dist/module/justifi-checkout.js +11 -7
- package/dist/module/justifi-gross-payment-chart.js +2 -1
- package/dist/module/justifi-payment-details.js +2 -1
- package/dist/module/justifi-payment-form.js +2 -1
- package/dist/module/justifi-payments-list.js +2 -1
- package/dist/module/justifi-payout-details.js +2 -1
- package/dist/module/justifi-payouts-list.js +2 -1
- package/dist/module/new-payment-method.js +11 -11
- package/dist/module/payment-method-form.js +1 -1
- package/dist/module/state-options.js +4 -0
- package/dist/module/utils3.js +2 -15
- package/dist/types/api/Api.d.ts +1 -0
- package/dist/types/components/checkout/checkout-core.d.ts +6 -2
- package/dist/types/components/checkout/checkout.d.ts +3 -0
- package/dist/types/components/checkout/payment-method-payload.d.ts +5 -0
- package/dist/types/components/form/form-control-file.d.ts +17 -0
- package/dist/types/components/payment-method-form/payment-method-responses.d.ts +1 -0
- package/dist/types/components.d.ts +57 -0
- package/dist/webcomponents/p-00ca94d1.js +1 -0
- package/dist/webcomponents/p-02b18979.entry.js +1 -0
- package/dist/webcomponents/p-0d80748f.js +1 -0
- package/dist/webcomponents/{p-30b6ea06.entry.js → p-101b2648.entry.js} +1 -1
- package/dist/webcomponents/{p-ed6ca114.js → p-132ba228.js} +1 -1
- package/dist/webcomponents/p-13e2f667.js +1 -0
- package/dist/webcomponents/{p-19885f77.entry.js → p-1885c478.entry.js} +1 -1
- package/dist/webcomponents/{p-8abba4c2.entry.js → p-23099f1f.entry.js} +1 -1
- package/dist/webcomponents/{p-31fe7232.entry.js → p-230b96df.entry.js} +1 -1
- package/dist/webcomponents/{p-35e59bb5.entry.js → p-3367225e.entry.js} +1 -1
- package/dist/webcomponents/{p-57fbd98d.js → p-3da23f21.js} +1 -1
- package/dist/webcomponents/p-41bdee27.entry.js +1 -0
- package/dist/webcomponents/{p-5ff7826e.entry.js → p-4c84952f.entry.js} +1 -1
- package/dist/webcomponents/p-6078a370.js +1 -0
- package/dist/webcomponents/{p-3ffe6784.js → p-61fd33c7.js} +1 -1
- package/dist/webcomponents/{p-2c4c5f0d.entry.js → p-64710363.entry.js} +1 -1
- package/dist/webcomponents/{p-9245777b.js → p-731085e3.js} +1 -1
- package/dist/webcomponents/p-78b32fb9.entry.js +1 -0
- package/dist/webcomponents/p-7e334dce.entry.js +1 -0
- package/dist/webcomponents/{p-5a789239.entry.js → p-7faacb1e.entry.js} +1 -1
- package/dist/webcomponents/{p-49c349e7.js → p-9ada56da.js} +1 -1
- package/dist/webcomponents/p-9ba31a6a.entry.js +1 -0
- package/dist/webcomponents/{p-4d335a3d.entry.js → p-a9af8f40.entry.js} +1 -1
- package/dist/webcomponents/p-b81afd51.entry.js +1 -0
- package/dist/webcomponents/{p-c556deda.entry.js → p-bb58e656.entry.js} +1 -1
- package/dist/webcomponents/p-bc12b8b9.js +1 -0
- package/dist/webcomponents/p-bfe7c55c.entry.js +1 -0
- package/dist/webcomponents/p-c1be3378.entry.js +1 -0
- package/dist/webcomponents/p-cb31488b.entry.js +1 -0
- package/dist/webcomponents/{p-31e8f29c.entry.js → p-cf3151a3.entry.js} +1 -1
- package/dist/webcomponents/{p-f3cf3513.entry.js → p-d0a8c631.entry.js} +1 -1
- package/dist/webcomponents/p-e6ab1f0d.entry.js +1 -0
- package/dist/webcomponents/{p-3adc0688.entry.js → p-efbc8ffc.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-04c7f8f8.js +0 -1
- package/dist/webcomponents/p-0c269feb.entry.js +0 -1
- package/dist/webcomponents/p-0eb77101.entry.js +0 -1
- package/dist/webcomponents/p-19001cc5.entry.js +0 -1
- package/dist/webcomponents/p-3496e37f.js +0 -1
- package/dist/webcomponents/p-3934a3a8.entry.js +0 -1
- package/dist/webcomponents/p-6f294d5d.js +0 -1
- package/dist/webcomponents/p-8da13f40.entry.js +0 -1
- package/dist/webcomponents/p-a8caec98.entry.js +0 -1
- package/dist/webcomponents/p-a90f7ca0.js +0 -1
- package/dist/webcomponents/p-abc03d5a.entry.js +0 -1
- package/dist/webcomponents/p-ba454cd7.entry.js +0 -1
- package/dist/webcomponents/p-d69a485a.entry.js +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { C as ComponentErrorSeverity,
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError.js';
|
|
3
|
+
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
3
4
|
import { A as Api } from './Api.js';
|
|
4
5
|
import './Pagination.js';
|
|
5
6
|
import './Payment.js';
|
|
@@ -47,8 +48,7 @@ const makeCheckoutComplete = ({ authToken, checkoutId, service }) => async ({ pa
|
|
|
47
48
|
try {
|
|
48
49
|
const response = await service.complete(authToken, checkoutId, payment);
|
|
49
50
|
if (!response.error) {
|
|
50
|
-
|
|
51
|
-
onSuccess({ checkout });
|
|
51
|
+
onSuccess(response);
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
const responseError = getErrorMessage(response.error);
|
|
@@ -89,7 +89,7 @@ const Checkout = /*@__PURE__*/ proxyCustomElement(class Checkout extends HTMLEle
|
|
|
89
89
|
constructor() {
|
|
90
90
|
super();
|
|
91
91
|
this.__registerHost();
|
|
92
|
-
this.
|
|
92
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
93
93
|
this.iframeOrigin = undefined;
|
|
94
94
|
this.authToken = undefined;
|
|
95
95
|
this.checkoutId = undefined;
|
|
@@ -114,7 +114,11 @@ const Checkout = /*@__PURE__*/ proxyCustomElement(class Checkout extends HTMLEle
|
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
117
|
-
this.
|
|
117
|
+
this.errorEvent.emit({
|
|
118
|
+
message: 'auth-token and checkout-id are required',
|
|
119
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
120
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
121
|
+
});
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
propChanged() {
|
|
@@ -127,7 +131,7 @@ const Checkout = /*@__PURE__*/ proxyCustomElement(class Checkout extends HTMLEle
|
|
|
127
131
|
"authToken": ["propChanged"],
|
|
128
132
|
"checkoutId": ["propChanged"]
|
|
129
133
|
}; }
|
|
130
|
-
}, [
|
|
134
|
+
}, [0, "justifi-checkout", {
|
|
131
135
|
"iframeOrigin": [1, "iframe-origin"],
|
|
132
136
|
"authToken": [1, "auth-token"],
|
|
133
137
|
"checkoutId": [1, "checkout-id"],
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { c as config } from './config.js';
|
|
3
3
|
import { A as Api } from './Api.js';
|
|
4
|
-
import { C as ComponentErrorSeverity,
|
|
4
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError.js';
|
|
5
|
+
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
5
6
|
import { E as ErrorState } from './utils.js';
|
|
6
7
|
import { d as defineCustomElement$2 } from './gross-payment-chart-core2.js';
|
|
7
8
|
|
|
@@ -3,7 +3,8 @@ import { P as PaymentService } from './payment.service.js';
|
|
|
3
3
|
import './Pagination.js';
|
|
4
4
|
import { b as Payment } from './Payment.js';
|
|
5
5
|
import './Payout.js';
|
|
6
|
-
import { C as ComponentErrorSeverity,
|
|
6
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError.js';
|
|
7
|
+
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
7
8
|
import { E as ErrorState } from './utils.js';
|
|
8
9
|
import { d as defineCustomElement$3 } from './details.js';
|
|
9
10
|
import { d as defineCustomElement$2 } from './payment-details-core2.js';
|
|
@@ -4,7 +4,8 @@ import { P as PaymentMethodTypes } from './Payment.js';
|
|
|
4
4
|
import './Payout.js';
|
|
5
5
|
import { l as loadFontsOnParent } from './utils2.js';
|
|
6
6
|
import { c as config } from './config.js';
|
|
7
|
-
import {
|
|
7
|
+
import { a as ComponentErrorCodes, C as ComponentErrorSeverity } from './ComponentError.js';
|
|
8
|
+
import { g as getErrorMessage } from './utils3.js';
|
|
8
9
|
import { d as defineCustomElement$6 } from './billing-form.js';
|
|
9
10
|
import { d as defineCustomElement$5 } from './payment-method-form.js';
|
|
10
11
|
import { d as defineCustomElement$4 } from './payment-method-selector.js';
|
|
@@ -3,7 +3,8 @@ import { P as PaymentService } from './payment.service.js';
|
|
|
3
3
|
import './Pagination.js';
|
|
4
4
|
import { b as Payment } from './Payment.js';
|
|
5
5
|
import './Payout.js';
|
|
6
|
-
import { C as ComponentErrorSeverity,
|
|
6
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError.js';
|
|
7
|
+
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
7
8
|
import { E as ErrorState } from './utils.js';
|
|
8
9
|
import { d as defineCustomElement$4 } from './table.js';
|
|
9
10
|
import { d as defineCustomElement$3 } from './pagination-menu2.js';
|
|
@@ -3,7 +3,8 @@ import { P as PayoutService } from './payout.service.js';
|
|
|
3
3
|
import './Pagination.js';
|
|
4
4
|
import './Payment.js';
|
|
5
5
|
import { P as Payout } from './Payout.js';
|
|
6
|
-
import { C as ComponentErrorSeverity,
|
|
6
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError.js';
|
|
7
|
+
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
7
8
|
import { E as ErrorState } from './utils.js';
|
|
8
9
|
import { d as defineCustomElement$3 } from './details.js';
|
|
9
10
|
import { d as defineCustomElement$2 } from './payout-details-core2.js';
|
|
@@ -4,7 +4,8 @@ import { P as PayoutService } from './payout.service.js';
|
|
|
4
4
|
import './Pagination.js';
|
|
5
5
|
import './Payment.js';
|
|
6
6
|
import { P as Payout } from './Payout.js';
|
|
7
|
-
import { C as ComponentErrorSeverity,
|
|
7
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError.js';
|
|
8
|
+
import { g as getErrorMessage, a as getErrorCode } from './utils3.js';
|
|
8
9
|
import { E as ErrorState } from './utils.js';
|
|
9
10
|
import { d as defineCustomElement$3 } from './pagination-menu2.js';
|
|
10
11
|
import { d as defineCustomElement$2 } from './payouts-list-core2.js';
|
|
@@ -24,14 +24,21 @@ const NewPaymentMethod = /*@__PURE__*/ proxyCustomElement(class NewPaymentMethod
|
|
|
24
24
|
this.isSelected = undefined;
|
|
25
25
|
}
|
|
26
26
|
async resolvePaymentMethod() {
|
|
27
|
+
var _a, _b;
|
|
27
28
|
if (!this.paymentMethodFormRef || !this.billingFormRef)
|
|
28
29
|
return;
|
|
29
30
|
const billingFormValidation = await this.billingFormRef.validate();
|
|
30
31
|
const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
|
|
31
32
|
if (!billingFormValidation.isValid || !paymentMethodFormValidation.isValid)
|
|
32
33
|
return;
|
|
33
|
-
const
|
|
34
|
-
|
|
34
|
+
const tokenizeResponse = await this.tokenize();
|
|
35
|
+
if (tokenizeResponse.error) {
|
|
36
|
+
return { error: tokenizeResponse.error };
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const tokenizeRessponseData = tokenizeResponse.data;
|
|
40
|
+
return { token: ((_a = tokenizeRessponseData.card) === null || _a === void 0 ? void 0 : _a.token) || ((_b = tokenizeRessponseData.bank_account) === null || _b === void 0 ? void 0 : _b.token) };
|
|
41
|
+
}
|
|
35
42
|
}
|
|
36
43
|
async tokenize() {
|
|
37
44
|
try {
|
|
@@ -39,17 +46,10 @@ const NewPaymentMethod = /*@__PURE__*/ proxyCustomElement(class NewPaymentMethod
|
|
|
39
46
|
const paymentMethodData = Object.assign({}, billingFormFieldValues);
|
|
40
47
|
const clientId = this.clientId;
|
|
41
48
|
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(clientId, paymentMethodData, this.accountId);
|
|
42
|
-
|
|
43
|
-
console.error(`An error occured submitting the form: ${tokenizeResponse.error.message}`);
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
const data = tokenizeResponse.data;
|
|
47
|
-
const tokenizedPaymentMethod = data.card || data.ach; // fix the response types to avoid this
|
|
48
|
-
return tokenizedPaymentMethod.token;
|
|
49
|
+
return tokenizeResponse;
|
|
49
50
|
}
|
|
50
51
|
catch (error) {
|
|
51
|
-
|
|
52
|
-
return null;
|
|
52
|
+
return error;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
showNewPaymentMethodForm() {
|
|
@@ -1490,7 +1490,7 @@ const MessageEventType = {
|
|
|
1490
1490
|
};
|
|
1491
1491
|
|
|
1492
1492
|
const name = "@justifi/webcomponents";
|
|
1493
|
-
const version = "4.13.0-rc.
|
|
1493
|
+
const version = "4.13.0-rc.1";
|
|
1494
1494
|
const description = "JustiFi Web Components";
|
|
1495
1495
|
const main = "dist/module/index.js";
|
|
1496
1496
|
const module = "dist/module/index.js";
|
package/dist/module/utils3.js
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
(function (ComponentErrorCodes) {
|
|
3
|
-
ComponentErrorCodes["MISSING_PROPS"] = "missing-props";
|
|
4
|
-
ComponentErrorCodes["FETCH_ERROR"] = "fetch-error";
|
|
5
|
-
ComponentErrorCodes["UNKNOWN_ERROR"] = "unknown-error";
|
|
6
|
-
ComponentErrorCodes["TOKENIZE_ERROR"] = "tokenize-error";
|
|
7
|
-
ComponentErrorCodes["NOT_AUTHENTICATED"] = "not-authenticated";
|
|
8
|
-
})(ComponentErrorCodes || (ComponentErrorCodes = {}));
|
|
9
|
-
var ComponentErrorSeverity;
|
|
10
|
-
(function (ComponentErrorSeverity) {
|
|
11
|
-
ComponentErrorSeverity["INFO"] = "info";
|
|
12
|
-
ComponentErrorSeverity["WARNING"] = "warning";
|
|
13
|
-
ComponentErrorSeverity["ERROR"] = "error";
|
|
14
|
-
})(ComponentErrorSeverity || (ComponentErrorSeverity = {}));
|
|
1
|
+
import { a as ComponentErrorCodes } from './ComponentError.js';
|
|
15
2
|
|
|
16
3
|
// Errors on [capital]/config/locales/en.yml
|
|
17
4
|
// Add more errors as needed
|
|
@@ -35,4 +22,4 @@ const getErrorCode = (code) => {
|
|
|
35
22
|
}
|
|
36
23
|
};
|
|
37
24
|
|
|
38
|
-
export {
|
|
25
|
+
export { getErrorCode as a, getErrorMessage as g };
|
package/dist/types/api/Api.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface IApiResponseCollection<T> extends IApiResponse<T> {
|
|
|
19
19
|
declare const Api: (authToken: string, apiOrigin: string) => {
|
|
20
20
|
get: (endpoint: string, params?: any, signal?: AbortSignal) => Promise<any>;
|
|
21
21
|
post: (endpoint: string, body?: any, params?: any, signal?: AbortSignal) => Promise<any>;
|
|
22
|
+
put: (endpoint: string, body?: any, params?: any, signal?: AbortSignal) => Promise<any>;
|
|
22
23
|
patch: (endpoint: string, body?: any, params?: any, signal?: AbortSignal) => Promise<any>;
|
|
23
24
|
destroy: (endpoint: string, params?: any, signal?: AbortSignal) => Promise<any>;
|
|
24
25
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
2
|
import { ICheckout, ICheckoutCompleteResponse } from '../../api/Checkout';
|
|
3
|
-
import { ComponentError } from '../../api/ComponentError';
|
|
3
|
+
import { ComponentError, ComponentErrorCodes, ComponentErrorSeverity } from '../../api/ComponentError';
|
|
4
4
|
export declare class CheckoutCore {
|
|
5
5
|
/**
|
|
6
6
|
* URL for the rendered iFrame. End-users need not use this.
|
|
@@ -14,7 +14,6 @@ export declare class CheckoutCore {
|
|
|
14
14
|
isLoading: boolean;
|
|
15
15
|
checkout: ICheckout;
|
|
16
16
|
serverError: boolean;
|
|
17
|
-
errorMessage: string;
|
|
18
17
|
creatingNewPaymentMethod: boolean;
|
|
19
18
|
submitted: EventEmitter<ICheckoutCompleteResponse>;
|
|
20
19
|
errorEvent: EventEmitter<ComponentError>;
|
|
@@ -25,6 +24,11 @@ export declare class CheckoutCore {
|
|
|
25
24
|
loadFontsOnParent(): Promise<any>;
|
|
26
25
|
submit(event: any): Promise<void>;
|
|
27
26
|
onSubmitted: (data: ICheckoutCompleteResponse) => void;
|
|
27
|
+
onError: ({ error, code, severity }: {
|
|
28
|
+
error: string;
|
|
29
|
+
code: ComponentErrorCodes;
|
|
30
|
+
severity: ComponentErrorSeverity;
|
|
31
|
+
}) => void;
|
|
28
32
|
private loadingSpinner;
|
|
29
33
|
render(): any;
|
|
30
34
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { ComponentError } from '../../api/ComponentError';
|
|
1
3
|
export declare class Checkout {
|
|
2
4
|
iframeOrigin?: string;
|
|
3
5
|
authToken: string;
|
|
@@ -5,6 +7,7 @@ export declare class Checkout {
|
|
|
5
7
|
getCheckout: Function;
|
|
6
8
|
complete: Function;
|
|
7
9
|
errorMessage: string;
|
|
10
|
+
errorEvent: EventEmitter<ComponentError>;
|
|
8
11
|
componentWillLoad(): void;
|
|
9
12
|
private initializeGetCheckout;
|
|
10
13
|
propChanged(): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class FileInput {
|
|
3
|
+
el: HTMLElement;
|
|
4
|
+
label: string;
|
|
5
|
+
name: any;
|
|
6
|
+
error: string;
|
|
7
|
+
inputHandler: (name: string, value: string) => void;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
input: string;
|
|
10
|
+
file: File;
|
|
11
|
+
formControlInput: EventEmitter<any>;
|
|
12
|
+
formControlBlur: EventEmitter<any>;
|
|
13
|
+
updateInput(newValue: any): void;
|
|
14
|
+
handleFormControlInput(event: any): void;
|
|
15
|
+
handleFileChange(event: any): void;
|
|
16
|
+
render(): any;
|
|
17
|
+
}
|
|
@@ -72,6 +72,13 @@ export namespace Components {
|
|
|
72
72
|
"name": string;
|
|
73
73
|
"type": 'day' | 'month' | 'year';
|
|
74
74
|
}
|
|
75
|
+
interface FormControlFile {
|
|
76
|
+
"disabled": boolean;
|
|
77
|
+
"error": string;
|
|
78
|
+
"inputHandler": (name: string, value: string) => void;
|
|
79
|
+
"label": string;
|
|
80
|
+
"name": any;
|
|
81
|
+
}
|
|
75
82
|
interface FormControlMonetary {
|
|
76
83
|
"defaultValue": string;
|
|
77
84
|
"error": string;
|
|
@@ -685,6 +692,10 @@ export interface FormControlDatepartCustomEvent<T> extends CustomEvent<T> {
|
|
|
685
692
|
detail: T;
|
|
686
693
|
target: HTMLFormControlDatepartElement;
|
|
687
694
|
}
|
|
695
|
+
export interface FormControlFileCustomEvent<T> extends CustomEvent<T> {
|
|
696
|
+
detail: T;
|
|
697
|
+
target: HTMLFormControlFileElement;
|
|
698
|
+
}
|
|
688
699
|
export interface FormControlMonetaryCustomEvent<T> extends CustomEvent<T> {
|
|
689
700
|
detail: T;
|
|
690
701
|
target: HTMLFormControlMonetaryElement;
|
|
@@ -741,6 +752,10 @@ export interface JustifiCardFormCustomEvent<T> extends CustomEvent<T> {
|
|
|
741
752
|
detail: T;
|
|
742
753
|
target: HTMLJustifiCardFormElement;
|
|
743
754
|
}
|
|
755
|
+
export interface JustifiCheckoutCustomEvent<T> extends CustomEvent<T> {
|
|
756
|
+
detail: T;
|
|
757
|
+
target: HTMLJustifiCheckoutElement;
|
|
758
|
+
}
|
|
744
759
|
export interface JustifiCheckoutCoreCustomEvent<T> extends CustomEvent<T> {
|
|
745
760
|
detail: T;
|
|
746
761
|
target: HTMLJustifiCheckoutCoreElement;
|
|
@@ -908,6 +923,24 @@ declare global {
|
|
|
908
923
|
prototype: HTMLFormControlDatepartElement;
|
|
909
924
|
new (): HTMLFormControlDatepartElement;
|
|
910
925
|
};
|
|
926
|
+
interface HTMLFormControlFileElementEventMap {
|
|
927
|
+
"formControlInput": any;
|
|
928
|
+
"formControlBlur": any;
|
|
929
|
+
}
|
|
930
|
+
interface HTMLFormControlFileElement extends Components.FormControlFile, HTMLStencilElement {
|
|
931
|
+
addEventListener<K extends keyof HTMLFormControlFileElementEventMap>(type: K, listener: (this: HTMLFormControlFileElement, ev: FormControlFileCustomEvent<HTMLFormControlFileElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
932
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
933
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
934
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
935
|
+
removeEventListener<K extends keyof HTMLFormControlFileElementEventMap>(type: K, listener: (this: HTMLFormControlFileElement, ev: FormControlFileCustomEvent<HTMLFormControlFileElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
936
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
937
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
938
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
939
|
+
}
|
|
940
|
+
var HTMLFormControlFileElement: {
|
|
941
|
+
prototype: HTMLFormControlFileElement;
|
|
942
|
+
new (): HTMLFormControlFileElement;
|
|
943
|
+
};
|
|
911
944
|
interface HTMLFormControlMonetaryElementEventMap {
|
|
912
945
|
"formControlInput": any;
|
|
913
946
|
"formControlBlur": any;
|
|
@@ -1280,7 +1313,18 @@ declare global {
|
|
|
1280
1313
|
prototype: HTMLJustifiCardFormElement;
|
|
1281
1314
|
new (): HTMLJustifiCardFormElement;
|
|
1282
1315
|
};
|
|
1316
|
+
interface HTMLJustifiCheckoutElementEventMap {
|
|
1317
|
+
"error-event": ComponentError;
|
|
1318
|
+
}
|
|
1283
1319
|
interface HTMLJustifiCheckoutElement extends Components.JustifiCheckout, HTMLStencilElement {
|
|
1320
|
+
addEventListener<K extends keyof HTMLJustifiCheckoutElementEventMap>(type: K, listener: (this: HTMLJustifiCheckoutElement, ev: JustifiCheckoutCustomEvent<HTMLJustifiCheckoutElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1321
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1322
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
1323
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1324
|
+
removeEventListener<K extends keyof HTMLJustifiCheckoutElementEventMap>(type: K, listener: (this: HTMLJustifiCheckoutElement, ev: JustifiCheckoutCustomEvent<HTMLJustifiCheckoutElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
1325
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1326
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
1327
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1284
1328
|
}
|
|
1285
1329
|
var HTMLJustifiCheckoutElement: {
|
|
1286
1330
|
prototype: HTMLJustifiCheckoutElement;
|
|
@@ -1925,6 +1969,7 @@ declare global {
|
|
|
1925
1969
|
"business-details-core": HTMLBusinessDetailsCoreElement;
|
|
1926
1970
|
"form-control-date": HTMLFormControlDateElement;
|
|
1927
1971
|
"form-control-datepart": HTMLFormControlDatepartElement;
|
|
1972
|
+
"form-control-file": HTMLFormControlFileElement;
|
|
1928
1973
|
"form-control-monetary": HTMLFormControlMonetaryElement;
|
|
1929
1974
|
"form-control-number": HTMLFormControlNumberElement;
|
|
1930
1975
|
"form-control-number-masked": HTMLFormControlNumberMaskedElement;
|
|
@@ -2026,6 +2071,15 @@ declare namespace LocalJSX {
|
|
|
2026
2071
|
"onFormControlInput"?: (event: FormControlDatepartCustomEvent<any>) => void;
|
|
2027
2072
|
"type"?: 'day' | 'month' | 'year';
|
|
2028
2073
|
}
|
|
2074
|
+
interface FormControlFile {
|
|
2075
|
+
"disabled"?: boolean;
|
|
2076
|
+
"error"?: string;
|
|
2077
|
+
"inputHandler"?: (name: string, value: string) => void;
|
|
2078
|
+
"label"?: string;
|
|
2079
|
+
"name"?: any;
|
|
2080
|
+
"onFormControlBlur"?: (event: FormControlFileCustomEvent<any>) => void;
|
|
2081
|
+
"onFormControlInput"?: (event: FormControlFileCustomEvent<any>) => void;
|
|
2082
|
+
}
|
|
2029
2083
|
interface FormControlMonetary {
|
|
2030
2084
|
"defaultValue"?: string;
|
|
2031
2085
|
"error"?: string;
|
|
@@ -2306,6 +2360,7 @@ declare namespace LocalJSX {
|
|
|
2306
2360
|
"authToken"?: string;
|
|
2307
2361
|
"checkoutId"?: string;
|
|
2308
2362
|
"iframeOrigin"?: string;
|
|
2363
|
+
"onError-event"?: (event: JustifiCheckoutCustomEvent<ComponentError>) => void;
|
|
2309
2364
|
}
|
|
2310
2365
|
interface JustifiCheckoutCore {
|
|
2311
2366
|
"authToken"?: string;
|
|
@@ -2680,6 +2735,7 @@ declare namespace LocalJSX {
|
|
|
2680
2735
|
"business-details-core": BusinessDetailsCore;
|
|
2681
2736
|
"form-control-date": FormControlDate;
|
|
2682
2737
|
"form-control-datepart": FormControlDatepart;
|
|
2738
|
+
"form-control-file": FormControlFile;
|
|
2683
2739
|
"form-control-monetary": FormControlMonetary;
|
|
2684
2740
|
"form-control-number": FormControlNumber;
|
|
2685
2741
|
"form-control-number-masked": FormControlNumberMasked;
|
|
@@ -2760,6 +2816,7 @@ declare module "@stencil/core" {
|
|
|
2760
2816
|
"business-details-core": LocalJSX.BusinessDetailsCore & JSXBase.HTMLAttributes<HTMLBusinessDetailsCoreElement>;
|
|
2761
2817
|
"form-control-date": LocalJSX.FormControlDate & JSXBase.HTMLAttributes<HTMLFormControlDateElement>;
|
|
2762
2818
|
"form-control-datepart": LocalJSX.FormControlDatepart & JSXBase.HTMLAttributes<HTMLFormControlDatepartElement>;
|
|
2819
|
+
"form-control-file": LocalJSX.FormControlFile & JSXBase.HTMLAttributes<HTMLFormControlFileElement>;
|
|
2763
2820
|
"form-control-monetary": LocalJSX.FormControlMonetary & JSXBase.HTMLAttributes<HTMLFormControlMonetaryElement>;
|
|
2764
2821
|
"form-control-number": LocalJSX.FormControlNumber & JSXBase.HTMLAttributes<HTMLFormControlNumberElement>;
|
|
2765
2822
|
"form-control-number-masked": LocalJSX.FormControlNumberMasked & JSXBase.HTMLAttributes<HTMLFormControlNumberMaskedElement>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./p-0d80748f.js";const a=t=>"string"==typeof t?t:t.message,o=a=>"not_authenticated"===a?t.NOT_AUTHENTICATED:t.FETCH_ERROR;export{o as a,a as g}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as s,h as r,H as o}from"./p-9ee8ad4d.js";import{t as e}from"./p-2b6c9c4f.js";import{P as i}from"./p-731085e3.js";import"./p-56f6ce4c.js";import"./p-02fa533c.js";import{P as a}from"./p-e3fab0e2.js";import{C as n,a as p}from"./p-0d80748f.js";import{g as c,a as h}from"./p-00ca94d1.js";import{E as d}from"./p-3302bc76.js";import"./p-13e2f667.js";import"./p-ae263544.js";const u=class{constructor(r){t(this,r),this.errorEvent=s(this,"error-event",7),this.handleOnError=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.accountId=void 0,this.authToken=void 0,this.getPayouts=void 0,this.errorMessage=null}componentWillLoad(){this.initializeGetPayouts()}propChanged(){this.initializeGetPayouts()}initializeGetPayouts(){this.accountId&&this.authToken?this.getPayouts=(({id:t,authToken:s,service:r})=>async({params:o,onSuccess:e,onError:i})=>{var p,d;try{const u=await r.fetchPayouts(t,s,o);if(u.error)return i({error:c(u.error),code:h(null===(d=u.error)||void 0===d?void 0:d.code),severity:n.ERROR});{const t=Object.assign({},u.page_info);e({payouts:(null===(p=u.data)||void 0===p?void 0:p.map((t=>new a(t))))||[],pagingInfo:t})}}catch(t){return i({error:c(t),code:h(null==t?void 0:t.code),severity:n.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new i}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:p.MISSING_PROPS,message:"Account ID and Auth Token are required"}))}render(){return this.errorMessage?d(this.errorMessage):r(o,{exportedparts:e},r("payouts-list-core",{getPayouts:this.getPayouts,"onError-event":this.handleOnError}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payouts_list}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r,n;!function(r){r.MISSING_PROPS="missing-props",r.FETCH_ERROR="fetch-error",r.UNKNOWN_ERROR="unknown-error",r.TOKENIZE_ERROR="tokenize-error",r.NOT_AUTHENTICATED="not-authenticated"}(r||(r={})),function(r){r.INFO="info",r.WARNING="warning",r.ERROR="error"}(n||(n={}));export{n as C,r as a}
|