@justifi/webcomponents 4.19.1-rc-6 → 4.19.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/{Analytics-54b8e890.js → Analytics-f870b3ee.js} +3 -2
- package/dist/cjs/{business-additional-questions-schema-cf545610.js → business-additional-questions-schema-11ce0005.js} +1 -1
- package/dist/cjs/{business-form-options-582467fe.js → business-form-options-26f9900c.js} +1 -1
- package/dist/cjs/{business.service-6bb7ac82.js → business.service-f63650f5.js} +6 -5
- package/dist/cjs/config-ff2dda66.js +15 -0
- package/dist/cjs/form-alert_5.cjs.entry.js +1 -1
- package/dist/cjs/form-control-checkbox_9.cjs.entry.js +4 -4
- package/dist/cjs/{get-payout-csv-1391ff3e.js → get-payout-csv-f3aee6d0.js} +4 -3
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +10 -9
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-business-form.cjs.entry.js +9 -8
- package/dist/cjs/justifi-card-form.cjs.entry.js +5 -4
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +5 -4
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +4 -3
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +9 -11
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +5 -4
- package/dist/cjs/justifi-payment-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payment-form.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +6 -5
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -3
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +4 -3
- package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +5 -4
- package/dist/cjs/{package-b75f8267.js → package-1321b070.js} +4 -2
- package/dist/cjs/{payload-parsers-1cbc3b57.js → payload-parsers-969ab9b6.js} +1 -1
- package/dist/cjs/{payment.service-dfcfa19b.js → payment.service-0a64f9cd.js} +3 -2
- package/dist/cjs/{schema-validations-2733de42.js → schema-validations-f3db892c.js} +1 -1
- package/dist/collection/api/services/analytics.service.js +2 -1
- package/dist/collection/api/services/business.service.js +6 -5
- package/dist/collection/api/services/checkout.service.js +3 -2
- package/dist/collection/api/services/insurance.service.js +3 -2
- package/dist/collection/api/services/payment.service.js +3 -2
- package/dist/collection/api/services/payout.service.js +4 -3
- package/dist/collection/api/services/provision.service.js +4 -2
- package/dist/collection/api/services/reports.service.js +2 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js +4 -3
- package/dist/collection/components/business-forms/business-form/business-form.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +3 -2
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +3 -2
- package/dist/collection/components/business-forms/utils/business-form-options.js +1 -1
- package/dist/collection/components/card-form/card-form.js +4 -3
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- package/dist/collection/components/checkout/new-payment-method.js +4 -6
- package/dist/collection/components/checkout/payment-method-options.js +4 -3
- package/dist/collection/components/checkout/saved-payment-method.js +4 -3
- package/dist/collection/components/checkout/sezzle-payment-method.js +4 -3
- package/dist/collection/components/payment-form/payment-form.js +4 -3
- package/dist/collection/components/refund-form/refund-form.js +3 -2
- package/dist/config.js +11 -0
- package/dist/docs.json +8 -8
- package/dist/esm/{Analytics-25ef1b60.js → Analytics-262cdde5.js} +3 -2
- package/dist/esm/{business-additional-questions-schema-956e3caf.js → business-additional-questions-schema-e39bc781.js} +1 -1
- package/dist/esm/{business-form-options-7a9a74fc.js → business-form-options-0b08e08c.js} +1 -1
- package/dist/esm/{business.service-f45decfc.js → business.service-74bd1212.js} +6 -5
- package/dist/esm/config-476c7241.js +13 -0
- package/dist/esm/form-alert_5.entry.js +1 -1
- package/dist/esm/form-control-checkbox_9.entry.js +4 -4
- package/dist/esm/{get-payout-csv-e784a2ab.js → get-payout-csv-b494abfe.js} +4 -3
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +10 -9
- package/dist/esm/justifi-bank-account-form.entry.js +5 -4
- package/dist/esm/justifi-billing-form_2.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +4 -3
- package/dist/esm/justifi-business-form.entry.js +9 -8
- package/dist/esm/justifi-card-form.entry.js +5 -4
- package/dist/esm/justifi-checkout-core.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +5 -4
- package/dist/esm/justifi-gross-payment-chart.entry.js +4 -3
- package/dist/esm/justifi-new-payment-method_4.entry.js +9 -11
- package/dist/esm/justifi-owner-form_3.entry.js +5 -4
- package/dist/esm/justifi-payment-details.entry.js +4 -3
- package/dist/esm/justifi-payment-form.entry.js +6 -5
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +6 -5
- 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-refund-form.entry.js +3 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +5 -4
- package/dist/esm/{package-478b028a.js → package-d88677e9.js} +4 -2
- package/dist/esm/{payload-parsers-acb719d1.js → payload-parsers-62f443e1.js} +1 -1
- package/dist/esm/{payment.service-dad5153b.js → payment.service-3ca4a492.js} +3 -2
- package/dist/esm/{schema-validations-a83ff220.js → schema-validations-2f4fdebb.js} +1 -1
- package/dist/module/Analytics.js +2 -1
- package/dist/module/business-bank-account-form-step.js +3 -2
- package/dist/module/business-document-upload-form-step.js +3 -2
- package/dist/module/business-form-options.js +1 -1
- package/dist/module/business-terms-conditions-form-step.js +3 -2
- package/dist/module/business.service.js +6 -5
- package/dist/module/checkout-core.js +3 -3
- package/dist/module/config.js +13 -0
- package/dist/module/get-payout-csv.js +4 -3
- package/dist/module/justifi-bank-account-form.js +3 -2
- package/dist/module/justifi-business-form.js +3 -2
- package/dist/module/justifi-card-form.js +3 -2
- package/dist/module/justifi-checkout.js +3 -2
- package/dist/module/justifi-gross-payment-chart.js +2 -1
- package/dist/module/justifi-payment-form.js +4 -3
- package/dist/module/justifi-payment-provisioning.js +3 -2
- package/dist/module/justifi-refund-form.js +3 -2
- package/dist/module/justifi-season-interruption-insurance.js +3 -2
- package/dist/module/new-payment-method.js +3 -5
- package/dist/module/package.js +4 -2
- package/dist/module/payment-method-options.js +3 -2
- package/dist/module/payment.service.js +3 -2
- package/dist/module/saved-payment-method.js +3 -2
- package/dist/module/sezzle-payment-method.js +3 -2
- package/dist/types/components/checkout/new-payment-method.d.ts +0 -1
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +11 -0
- package/dist/webcomponents/index.esm.js +0 -1
- package/dist/webcomponents/p-04a0dbb6.js +1 -0
- package/dist/webcomponents/p-061dcb79.entry.js +1 -0
- package/dist/webcomponents/p-07109641.entry.js +1 -0
- package/dist/webcomponents/p-08b0fb31.js +1 -41
- package/dist/webcomponents/p-0f7b9555.entry.js +1 -0
- package/dist/webcomponents/p-14c91ffd.js +1 -20
- package/dist/webcomponents/p-198994c0.entry.js +1 -0
- package/dist/webcomponents/p-1a43e355.entry.js +19 -0
- package/dist/webcomponents/p-1ad5995e.js +1 -3599
- package/dist/webcomponents/p-1f70fa27.entry.js +1 -0
- package/dist/webcomponents/p-1ff8810b.js +1 -29
- package/dist/webcomponents/p-2338affa.js +1 -213
- package/dist/webcomponents/p-241b0ed9.js +1 -0
- package/dist/webcomponents/p-2799383d.entry.js +1 -0
- package/dist/webcomponents/p-29c0b182.js +1 -114
- package/dist/webcomponents/p-2b6c9c4f.js +1 -7
- package/dist/webcomponents/p-2eab3c90.js +1 -3052
- package/dist/webcomponents/p-3affadfc.entry.js +1 -0
- package/dist/webcomponents/p-3d4d566d.entry.js +1 -0
- package/dist/webcomponents/p-3dd4c6c3.entry.js +1 -0
- package/dist/webcomponents/p-462dc522.entry.js +1 -0
- package/dist/webcomponents/p-46f679a9.js +1 -0
- package/dist/webcomponents/p-487b72a8.entry.js +1 -0
- package/dist/webcomponents/p-48ae16e0.entry.js +1 -0
- package/dist/webcomponents/p-4abc17f0.entry.js +1 -0
- package/dist/webcomponents/p-4bac636e.entry.js +1 -0
- package/dist/webcomponents/p-52021fa1.entry.js +1 -0
- package/dist/webcomponents/p-525db3e8.js +1 -22
- package/dist/webcomponents/p-53948ff8.entry.js +1 -0
- package/dist/webcomponents/p-53e64f15.entry.js +1 -0
- package/dist/webcomponents/p-554a3c18.js +1 -0
- package/dist/webcomponents/p-56f6ce4c.js +1 -10
- package/dist/webcomponents/p-5968ff8a.js +1 -178
- package/dist/webcomponents/p-6078a370.js +1 -244
- package/dist/webcomponents/p-60a370fc.entry.js +1 -0
- package/dist/webcomponents/p-62b32c4c.entry.js +1 -0
- package/dist/webcomponents/p-65b561da.entry.js +1 -0
- package/dist/webcomponents/p-72c9e6b3.entry.js +1 -0
- package/dist/webcomponents/p-75b4daef.js +1 -0
- package/dist/webcomponents/p-7d85af5c.js +1 -16
- package/dist/webcomponents/p-8115b2f4.js +1 -28
- package/dist/webcomponents/p-83125497.js +1 -4027
- package/dist/webcomponents/p-8603348a.js +1 -0
- package/dist/webcomponents/p-890b3254.entry.js +1 -0
- package/dist/webcomponents/p-8df7bde8.js +1 -27
- package/dist/webcomponents/p-92bb1e5f.entry.js +1 -0
- package/dist/webcomponents/p-9c9c7dac.js +1 -24
- package/dist/webcomponents/p-9ccfa1c9.entry.js +1 -0
- package/dist/webcomponents/p-9dc36f76.entry.js +1 -0
- package/dist/webcomponents/p-ad41c8c7.entry.js +1 -0
- package/dist/webcomponents/p-ae263544.js +1 -0
- package/dist/webcomponents/p-af244664.js +1 -126
- package/dist/webcomponents/p-b16dfd5d.entry.js +1 -0
- package/dist/webcomponents/p-ba4bae6f.js +1 -12
- package/dist/webcomponents/p-bbed6107.entry.js +1 -0
- package/dist/webcomponents/p-bc92235c.entry.js +1 -0
- package/dist/webcomponents/p-be39c802.entry.js +1 -0
- package/dist/webcomponents/p-c9f8f7ec.entry.js +1 -0
- package/dist/webcomponents/p-d101c5db.js +1 -0
- package/dist/webcomponents/p-d1c8d794.entry.js +1 -0
- package/dist/webcomponents/p-d25c2f12.js +1 -0
- package/dist/webcomponents/p-d2a5054f.entry.js +1 -0
- package/dist/webcomponents/p-d765d638.js +1 -0
- package/dist/webcomponents/p-d8355f91.entry.js +1 -0
- package/dist/webcomponents/p-d89bad72.js +1 -39
- package/dist/webcomponents/p-dce846bf.js +1 -27
- package/dist/webcomponents/p-df21aaad.js +1 -120
- package/dist/webcomponents/p-e1255160.js +1 -3
- package/dist/webcomponents/p-e2c88817.entry.js +1 -0
- package/dist/webcomponents/p-e31f0f3e.entry.js +1 -0
- package/dist/webcomponents/p-e333620e.js +1 -34
- package/dist/webcomponents/p-e3fab0e2.js +1 -43
- package/dist/webcomponents/p-f0866375.entry.js +1 -0
- package/dist/webcomponents/p-fad19d75.js +2 -1638
- package/dist/webcomponents/p-fb58feb5.entry.js +1 -0
- package/dist/webcomponents/p-fe33151d.entry.js +1 -0
- package/dist/webcomponents/webcomponents.css +4 -362
- package/dist/webcomponents/webcomponents.esm.js +1 -20
- package/package.json +4 -2
- package/dist/globals.d.ts +0 -2
- package/dist/webcomponents/p-01a404ca.entry.js +0 -44
- package/dist/webcomponents/p-03d35880.entry.js +0 -130
- package/dist/webcomponents/p-06ff0429.entry.js +0 -65
- package/dist/webcomponents/p-0e2384b5.entry.js +0 -1684
- package/dist/webcomponents/p-1bbbf15d.js +0 -79
- package/dist/webcomponents/p-20abace7.js +0 -77
- package/dist/webcomponents/p-258b1ee2.entry.js +0 -149
- package/dist/webcomponents/p-25d8cd65.entry.js +0 -102
- package/dist/webcomponents/p-3b5948ea.entry.js +0 -133
- package/dist/webcomponents/p-3c50942c.entry.js +0 -94
- package/dist/webcomponents/p-3e9ef4a8.js +0 -28
- package/dist/webcomponents/p-3fd13ca3.js +0 -52
- package/dist/webcomponents/p-40236338.entry.js +0 -80
- package/dist/webcomponents/p-5482d030.entry.js +0 -21
- package/dist/webcomponents/p-576826b1.entry.js +0 -43
- package/dist/webcomponents/p-5cb3f0b2.entry.js +0 -261
- package/dist/webcomponents/p-5f835b89.entry.js +0 -606
- package/dist/webcomponents/p-70a2aa74.entry.js +0 -76
- package/dist/webcomponents/p-73210c03.entry.js +0 -75
- package/dist/webcomponents/p-7582b554.entry.js +0 -18
- package/dist/webcomponents/p-79646550.entry.js +0 -61
- package/dist/webcomponents/p-800d31fe.entry.js +0 -162
- package/dist/webcomponents/p-8371f61c.entry.js +0 -94
- package/dist/webcomponents/p-85fc69e5.js +0 -90
- package/dist/webcomponents/p-890088fc.entry.js +0 -298
- package/dist/webcomponents/p-89887332.js +0 -301
- package/dist/webcomponents/p-8eb774df.entry.js +0 -54
- package/dist/webcomponents/p-9f94bbb6.entry.js +0 -118
- package/dist/webcomponents/p-a096bc5b.entry.js +0 -145
- package/dist/webcomponents/p-a5a225d9.entry.js +0 -125
- package/dist/webcomponents/p-a5c5821e.entry.js +0 -101
- package/dist/webcomponents/p-a5fb51dc.entry.js +0 -131
- package/dist/webcomponents/p-a64f0ebe.entry.js +0 -117
- package/dist/webcomponents/p-a6d04afc.js +0 -44
- package/dist/webcomponents/p-ac086069.entry.js +0 -58
- package/dist/webcomponents/p-b233d1e2.entry.js +0 -74
- package/dist/webcomponents/p-b82c146f.entry.js +0 -111
- package/dist/webcomponents/p-ba5fae28.js +0 -90
- package/dist/webcomponents/p-ba6661f2.entry.js +0 -73
- package/dist/webcomponents/p-c636f563.entry.js +0 -791
- package/dist/webcomponents/p-cb26f708.js +0 -18
- package/dist/webcomponents/p-d17aee2b.entry.js +0 -26
- package/dist/webcomponents/p-e26541b9.entry.js +0 -98
- package/dist/webcomponents/p-e356f280.entry.js +0 -29
- package/dist/webcomponents/p-e78af6d3.entry.js +0 -97
- package/dist/webcomponents/p-e7b8199d.entry.js +0 -131
- package/dist/webcomponents/p-ec854a3e.entry.js +0 -11053
- package/dist/webcomponents/p-f02b75dc.entry.js +0 -96
- package/dist/webcomponents/p-fd7918c2.entry.js +0 -99
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
const name = "@justifi/webcomponents";
|
|
2
|
-
const version = "4.19.1-rc-6";
|
|
3
|
-
const description = "JustiFi Web Components";
|
|
4
|
-
const collection = "dist/collection/collection-manifest.json";
|
|
5
|
-
const main = "dist/index.cjs.js";
|
|
6
|
-
const module = "dist/module/index.js";
|
|
7
|
-
const types = "dist/module/index.d.ts";
|
|
8
|
-
const repository = {
|
|
9
|
-
type: "git",
|
|
10
|
-
url: "git+https://github.com/justifi-tech/web-component-library.git"
|
|
11
|
-
};
|
|
12
|
-
const homepage = "https://storybook.justifi.ai/?path=/docs/introduction--docs";
|
|
13
|
-
const publishConfig = {
|
|
14
|
-
registry: "https://registry.npmjs.org"
|
|
15
|
-
};
|
|
16
|
-
const files = [
|
|
17
|
-
"dist/"
|
|
18
|
-
];
|
|
19
|
-
const scripts = {
|
|
20
|
-
build: "stencil build --docs",
|
|
21
|
-
dev: "stencil build --watch",
|
|
22
|
-
lint: "eslint . --max-warnings 0",
|
|
23
|
-
clean: "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
24
|
-
generate: "stencil generate",
|
|
25
|
-
test: "TZ=utc stencil test --spec",
|
|
26
|
-
"test:watch": "TZ=utc stencil test --spec --watchAll",
|
|
27
|
-
"test:file": "stencil test --spec --watch --"
|
|
28
|
-
};
|
|
29
|
-
const dependencies = {
|
|
30
|
-
"@stencil/core": "^4.0.5",
|
|
31
|
-
"@stencil/store": "^2.0.8",
|
|
32
|
-
bootstrap: "^5.2.3",
|
|
33
|
-
"chart.js": "^4.4.1",
|
|
34
|
-
"date-fns": "^2.29.3",
|
|
35
|
-
"dinero.js": "^1.9.1",
|
|
36
|
-
"iframe-resizer": "^4.3.7",
|
|
37
|
-
imask: "^7.6.0",
|
|
38
|
-
rxjs: "^7.8.1",
|
|
39
|
-
"ts-dedent": "^2.2.0",
|
|
40
|
-
uuid: "^9.0.0",
|
|
41
|
-
yup: "^1.0.0"
|
|
42
|
-
};
|
|
43
|
-
const devDependencies = {
|
|
44
|
-
"@babel/preset-env": "^7.21.5",
|
|
45
|
-
"@babel/preset-react": "^7.18.6",
|
|
46
|
-
"@babel/preset-typescript": "^7.21.5",
|
|
47
|
-
"@rollup/plugin-replace": "^5.0.7",
|
|
48
|
-
"@stencil/sass": "^3.0.1",
|
|
49
|
-
"@types/jest": "27.0.3",
|
|
50
|
-
"@types/react": "^18.0.37",
|
|
51
|
-
"@types/react-dom": "^18.0.11",
|
|
52
|
-
dotenv: "^16.3.1",
|
|
53
|
-
jest: "^29.7.0",
|
|
54
|
-
"jest-cli": "^29.7.0",
|
|
55
|
-
"jest-environment-node": "^29.7.0",
|
|
56
|
-
"ts-jest": "^29.1.2"
|
|
57
|
-
};
|
|
58
|
-
const license = "MIT";
|
|
59
|
-
const gitHead = "507bac1d941eae6e1f56e185ecd9bc9d22637783";
|
|
60
|
-
const packageJson = {
|
|
61
|
-
name: name,
|
|
62
|
-
version: version,
|
|
63
|
-
description: description,
|
|
64
|
-
collection: collection,
|
|
65
|
-
main: main,
|
|
66
|
-
module: module,
|
|
67
|
-
types: types,
|
|
68
|
-
repository: repository,
|
|
69
|
-
homepage: homepage,
|
|
70
|
-
publishConfig: publishConfig,
|
|
71
|
-
files: files,
|
|
72
|
-
scripts: scripts,
|
|
73
|
-
dependencies: dependencies,
|
|
74
|
-
devDependencies: devDependencies,
|
|
75
|
-
license: license,
|
|
76
|
-
gitHead: gitHead
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export { packageJson as p };
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { p as packageJson } from './p-1bbbf15d.js';
|
|
2
|
-
import { A as Api } from './p-29c0b182.js';
|
|
3
|
-
|
|
4
|
-
class AnalyticsService {
|
|
5
|
-
async record(body) {
|
|
6
|
-
const endpoint = 'analytics';
|
|
7
|
-
return Api({ apiOrigin: undefined }).post(endpoint, JSON.stringify(body));
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @class JustifiAnalytics
|
|
13
|
-
* @description A class to track analytics for a component
|
|
14
|
-
* @param { component } ComponentInterface - The component to track
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
class JustifiAnalytics {
|
|
18
|
-
constructor(component) {
|
|
19
|
-
this.handleCustomEvent = async (data) => {
|
|
20
|
-
// Track the event
|
|
21
|
-
await this.service.record(data);
|
|
22
|
-
};
|
|
23
|
-
this.service = new AnalyticsService();
|
|
24
|
-
this.componentInstance = component;
|
|
25
|
-
this.setUpBasicData();
|
|
26
|
-
this.setupLifecycleTracking();
|
|
27
|
-
this.trackCustomEvents();
|
|
28
|
-
}
|
|
29
|
-
get resourceId() {
|
|
30
|
-
return (this.componentInstance.accountId ||
|
|
31
|
-
this.componentInstance.businessId ||
|
|
32
|
-
this.componentInstance.paymentId ||
|
|
33
|
-
this.componentInstance.payoutId ||
|
|
34
|
-
this.componentInstance.checkoutId);
|
|
35
|
-
}
|
|
36
|
-
setUpBasicData() {
|
|
37
|
-
this.basicData = {
|
|
38
|
-
component_name: this.componentInstance.tagName,
|
|
39
|
-
component_version: packageJson.version,
|
|
40
|
-
client_user_agent: navigator.userAgent,
|
|
41
|
-
// navigator.platform is deprecated, use navigator.userAgent instead
|
|
42
|
-
client_platform: navigator.userAgent,
|
|
43
|
-
client_origin: window.location.origin,
|
|
44
|
-
resource_id: this.resourceId,
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
trackCustomEvents() {
|
|
48
|
-
this.eventEmitters = ['submitted', 'error-event'];
|
|
49
|
-
// for each event, add an event listener
|
|
50
|
-
this.eventEmitters.forEach((eventName) => {
|
|
51
|
-
// if this.componentInstance.addEventListener is a function add the event listener
|
|
52
|
-
if (typeof this.componentInstance.addEventListener === 'function') {
|
|
53
|
-
this.componentInstance.addEventListener(eventName, (event) => this.handleCustomEvent({
|
|
54
|
-
event_type: eventName,
|
|
55
|
-
data: Object.assign(Object.assign({}, this.basicData), { error: event.detail }),
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
setupLifecycleTracking() {
|
|
61
|
-
const originalComponentDidLoad = this.componentInstance.componentDidLoad;
|
|
62
|
-
this.componentInstance.componentDidLoad = () => {
|
|
63
|
-
this.service.record({ event_type: 'init', data: this.basicData });
|
|
64
|
-
if (originalComponentDidLoad) {
|
|
65
|
-
return originalComponentDidLoad.apply(this.componentInstance);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
cleanup() {
|
|
70
|
-
// Remove event listeners
|
|
71
|
-
this.eventEmitters.forEach((event) => {
|
|
72
|
-
this.componentInstance.removeEventListener(event, this.handleCustomEvent);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export { JustifiAnalytics as J };
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
-
import { f as formatCurrency } from './p-83125497.js';
|
|
3
|
-
import { C as ComponentErrorSeverity } from './p-14c91ffd.js';
|
|
4
|
-
import { i as insuranceValuesOn, v as validateInsuranceValues, a as insuranceValues } from './p-2338affa.js';
|
|
5
|
-
import { B as Button } from './p-9c9c7dac.js';
|
|
6
|
-
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
7
|
-
import { S as Skeleton } from './p-08b0fb31.js';
|
|
8
|
-
|
|
9
|
-
class Checkout {
|
|
10
|
-
constructor(data) {
|
|
11
|
-
Object.assign(this, data);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const checkoutCoreCss = ":host{display:block}justifi-payment-method-form{display:block;margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}.jfi-checkout-core{color:var(--jfi-body-color)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}*::part(invalid-feedback){color:var(--jfi-error-message-color);font-size:var(--jfi-error-message-font-size);margin:var(--jfi-error-message-margin);line-height:normal}.jfi-submit-button{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow);line-height:var(--jfi-submit-button-line-height);text-transform:var(--jfi-submit-button-text-transform)}.jfi-submit-button:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.jfi-submit-button:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn.jfi-submit-button:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}.btn.jfi-submit-button-loading{min-width:75px;color:var(--jfi-submit-button-color-loading);background-color:var(--jfi-submit-button-background-color-loading);border-color:var(--jfi-submit-button-border-color-loading)}.btn.jfi-submit-button-loading .spinner-border{border-top-color:var(--jfi-submit-button-color-loading);border-bottom-color:var(--jfi-submit-button-color-loading);border-left-color:var(--jfi-submit-button-color-loading)}";
|
|
16
|
-
const JustifiCheckoutCoreStyle0 = checkoutCoreCss;
|
|
17
|
-
|
|
18
|
-
const headerCss = ".jfi-header{color:var(--jfi-header-color);border-bottom:var(--jfi-header-border)}";
|
|
19
|
-
const JustifiCheckoutCoreStyle1 = headerCss;
|
|
20
|
-
|
|
21
|
-
const CheckoutCore = class {
|
|
22
|
-
constructor(hostRef) {
|
|
23
|
-
registerInstance(this, hostRef);
|
|
24
|
-
this.submitted = createEvent(this, "submitted", 7);
|
|
25
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
26
|
-
this.loaded = createEvent(this, "loaded", 7);
|
|
27
|
-
this.completeCheckout = async (payment) => {
|
|
28
|
-
this.complete({
|
|
29
|
-
payment,
|
|
30
|
-
onSuccess: this.onSubmitted,
|
|
31
|
-
onError: this.onError,
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
this.onSubmitted = (data) => {
|
|
35
|
-
this.submitted.emit(data);
|
|
36
|
-
this.renderState = 'success';
|
|
37
|
-
};
|
|
38
|
-
this.onError = ({ error, code, severity }) => {
|
|
39
|
-
this.serverError = error;
|
|
40
|
-
this.errorEvent.emit({
|
|
41
|
-
errorCode: code,
|
|
42
|
-
message: error,
|
|
43
|
-
severity,
|
|
44
|
-
});
|
|
45
|
-
this.renderState = 'error';
|
|
46
|
-
};
|
|
47
|
-
this.iframeOrigin = undefined;
|
|
48
|
-
this.authToken = undefined;
|
|
49
|
-
this.getCheckout = undefined;
|
|
50
|
-
this.complete = undefined;
|
|
51
|
-
this.checkoutId = undefined;
|
|
52
|
-
this.disableCreditCard = undefined;
|
|
53
|
-
this.disableBankAccount = undefined;
|
|
54
|
-
this.disableBnpl = undefined;
|
|
55
|
-
this.disablePaymentMethodGroup = undefined;
|
|
56
|
-
this.hasLoadedFonts = false;
|
|
57
|
-
this.checkout = undefined;
|
|
58
|
-
this.serverError = undefined;
|
|
59
|
-
this.renderState = 'loading';
|
|
60
|
-
this.creatingNewPaymentMethod = false;
|
|
61
|
-
this.insuranceToggled = false;
|
|
62
|
-
}
|
|
63
|
-
async fillBillingForm(fields) {
|
|
64
|
-
this.paymentMethodOptionsRef.fillBillingForm(fields);
|
|
65
|
-
}
|
|
66
|
-
componentWillLoad() {
|
|
67
|
-
console.log('CheckoutCore: componentWillLoad iframeOrigin', this, this.iframeOrigin);
|
|
68
|
-
if (this.getCheckout) {
|
|
69
|
-
this.fetchData();
|
|
70
|
-
// Refresh the checkout data when insurance is added or removed
|
|
71
|
-
insuranceValuesOn('set', (key) => {
|
|
72
|
-
const value = insuranceValues[key];
|
|
73
|
-
if (value !== undefined) {
|
|
74
|
-
this.insuranceToggled = value;
|
|
75
|
-
this.fetchData();
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
fetchData() {
|
|
81
|
-
this.renderState = 'loading';
|
|
82
|
-
this.getCheckout({
|
|
83
|
-
onSuccess: ({ checkout }) => {
|
|
84
|
-
this.checkout = new Checkout(checkout);
|
|
85
|
-
const { status } = this.checkout;
|
|
86
|
-
this.loaded.emit({ checkout_status: status });
|
|
87
|
-
this.renderState = 'success';
|
|
88
|
-
},
|
|
89
|
-
onError: ({ error, code, severity }) => {
|
|
90
|
-
this.serverError = error;
|
|
91
|
-
this.renderState = 'error';
|
|
92
|
-
this.errorEvent.emit({
|
|
93
|
-
errorCode: code,
|
|
94
|
-
message: error,
|
|
95
|
-
severity,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
;
|
|
101
|
-
async submit(event) {
|
|
102
|
-
var _a;
|
|
103
|
-
event.preventDefault();
|
|
104
|
-
this.renderState = 'loading';
|
|
105
|
-
const insuranceValidation = validateInsuranceValues();
|
|
106
|
-
const payload = await this.paymentMethodOptionsRef.resolvePaymentMethod(insuranceValidation);
|
|
107
|
-
if (payload.validationError) {
|
|
108
|
-
this.renderState = 'error';
|
|
109
|
-
}
|
|
110
|
-
else if (payload.error) {
|
|
111
|
-
this.renderState = 'error';
|
|
112
|
-
this.serverError = payload.error.message;
|
|
113
|
-
this.onError({
|
|
114
|
-
code: payload.error.code,
|
|
115
|
-
error: payload.error.message,
|
|
116
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
else if (payload.token) {
|
|
120
|
-
this.completeCheckout({ payment_mode: 'ecom', payment_token: payload.token });
|
|
121
|
-
}
|
|
122
|
-
else if (((_a = payload.bnpl) === null || _a === void 0 ? void 0 : _a.status) === 'success') {
|
|
123
|
-
this.completeCheckout({ payment_mode: 'bnpl' });
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
this.renderState = 'error';
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
get isLoading() {
|
|
130
|
-
return this.renderState === 'loading';
|
|
131
|
-
}
|
|
132
|
-
get isError() {
|
|
133
|
-
return this.renderState === 'error';
|
|
134
|
-
}
|
|
135
|
-
get paymentType() {
|
|
136
|
-
var _a, _b, _c, _d, _e;
|
|
137
|
-
return (h("section", null, h("div", { class: !this.isLoading && 'visually-hidden' }, h(Skeleton, { variant: "rounded", height: "300px" })), h("div", { class: this.isLoading && 'visually-hidden' }, h("justifi-payment-method-options", { ref: (el) => (this.paymentMethodOptionsRef = el), "show-card": !this.disableCreditCard, "show-ach": !this.disableBankAccount, "show-bnpl": !this.disableBnpl, paymentMethodGroupId: (_a = this.checkout) === null || _a === void 0 ? void 0 : _a.payment_method_group_id, "show-saved-payment-methods": !this.disablePaymentMethodGroup, bnpl: (_b = this.checkout) === null || _b === void 0 ? void 0 : _b.bnpl, authToken: this.authToken, "account-id": (_c = this.checkout) === null || _c === void 0 ? void 0 : _c.account_id, savedPaymentMethods: ((_d = this.checkout) === null || _d === void 0 ? void 0 : _d.payment_methods) || [], paymentAmount: (_e = this.checkout) === null || _e === void 0 ? void 0 : _e.payment_amount, insuranceToggled: this.insuranceToggled }))));
|
|
138
|
-
}
|
|
139
|
-
get summary() {
|
|
140
|
-
var _a, _b;
|
|
141
|
-
return (h("section", null, h("div", { class: !this.isLoading && 'visually-hidden' }, h(Skeleton, { height: "24px" })), h("div", { class: this.isLoading && 'visually-hidden' }, h("div", { class: "jfi-payment-description" }, (_a = this.checkout) === null || _a === void 0 ? void 0 : _a.payment_description), h("div", { class: "jfi-payment-total" }, h("span", { class: "jfi-payment-total-label" }, "Total"), "\u00A0", h("span", { class: "jfi-payment-total-amount" }, formatCurrency(+((_b = this.checkout) === null || _b === void 0 ? void 0 : _b.total_amount)))))));
|
|
142
|
-
}
|
|
143
|
-
render() {
|
|
144
|
-
return (h(StyledHost, { key: '991ae6970e426028ace0d1e8327119bc197639b0' }, h("div", { key: '1e57ee21429b494240e644235a2d5815ced99d43', class: "row gy-3 jfi-checkout-core" }, h("div", { key: '70023ce10dea6ff8d5bd8e30c7d474f774682c65', class: "col-12" }, h("h2", { key: '8b09b03c1998e4d60e174fefb3d196e48d50b84a', class: "fs-5 fw-bold pb-3 jfi-header" }, "Summary"), this.summary), h("div", { key: 'e3bbdaaaf010451a31fe9c60bdf81e89bdd142f2', class: "col-12" }, h("slot", { key: '442a01184960f42b5e1f6694798633d3e7219bf5', name: "insurance" })), h("div", { key: '716e26e3dc675e9d72a3a992b1cb212ce48ffb1a', class: "col-12 mt-4" }, h("h2", { key: '762cfc8549b20d16583d0fd8748bde8035042c00', class: "fs-5 fw-bold pb-3 jfi-header" }, "Payment"), h("h3", { key: 'f07d716a87f3e2bd44471f7e93f7af5f5d20440e', class: "fs-6 fw-bold lh-lg" }, "Select payment type"), h("div", { key: '1156291dd748b90d64a08916ffb98c3123132175', class: "d-flex flex-column" }, this.paymentType)), h("div", { key: 'a5bd142a1c72c5abb29338a2cf24c180119d4ea7', class: "col-12" }, h("div", { key: '5a94ed9d54fd3dd24cfe3e34c23ee3c4995eca6d', class: "d-flex justify-content-end" }, h(Button, { key: '7fce3940d8fe562aa7c23e38201b5d2924157288', type: "submit", variant: "primary", onClick: (e) => this.submit(e), disabled: this.isLoading, isLoading: this.isLoading, style: { width: '100%' } }, "Pay"))))));
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
CheckoutCore.style = JustifiCheckoutCoreStyle0 + JustifiCheckoutCoreStyle1;
|
|
148
|
-
|
|
149
|
-
export { CheckoutCore as justifi_checkout_core };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
-
import { a as BusinessFormClickActions } from './p-d89bad72.js';
|
|
3
|
-
import { a as ComponentErrorCodes, C as ComponentErrorSeverity } from './p-14c91ffd.js';
|
|
4
|
-
import { a as checkProvisioningStatus } from './p-1ff8810b.js';
|
|
5
|
-
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
6
|
-
import './p-6078a370.js';
|
|
7
|
-
|
|
8
|
-
const PaymentProvisioningCore = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
registerInstance(this, hostRef);
|
|
11
|
-
this.clickEvent = createEvent(this, "click-event", 7);
|
|
12
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
13
|
-
this.submitted = createEvent(this, "submitted", 7);
|
|
14
|
-
this.setBusinessProvisioned = () => {
|
|
15
|
-
this.getBusiness({
|
|
16
|
-
onSuccess: (response) => {
|
|
17
|
-
this.businessProvisioned = checkProvisioningStatus(response.data);
|
|
18
|
-
if (this.businessProvisioned) {
|
|
19
|
-
this.errorEvent.emit({
|
|
20
|
-
message: 'A request to provision payments for this business has already been submitted.',
|
|
21
|
-
errorCode: ComponentErrorCodes.PROVISIONING_REQUESTED,
|
|
22
|
-
severity: ComponentErrorSeverity.INFO,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
onError: ({ error, code, severity }) => {
|
|
27
|
-
this.errorEvent.emit({
|
|
28
|
-
message: error,
|
|
29
|
-
errorCode: code,
|
|
30
|
-
severity: severity
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
this.postProvisioningData = () => {
|
|
36
|
-
this.postProvisioning({
|
|
37
|
-
onSuccess: (response) => {
|
|
38
|
-
this.submitted.emit({ data: { response } });
|
|
39
|
-
},
|
|
40
|
-
onError: ({ error, code, severity }) => {
|
|
41
|
-
this.submitted.emit({ data: { error } });
|
|
42
|
-
this.errorEvent.emit({
|
|
43
|
-
message: error,
|
|
44
|
-
errorCode: code,
|
|
45
|
-
severity: severity
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
this.refs = [];
|
|
51
|
-
this.incrementSteps = () => {
|
|
52
|
-
if (this.currentStep < this.totalSteps) {
|
|
53
|
-
return this.currentStep++;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
this.decrementSteps = () => { return this.currentStep--; };
|
|
57
|
-
this.previousStepButtonOnClick = () => {
|
|
58
|
-
this.clickEvent.emit({ name: BusinessFormClickActions.previousStep });
|
|
59
|
-
this.decrementSteps();
|
|
60
|
-
};
|
|
61
|
-
this.nextStepButtonOnClick = (e, clickEventName) => {
|
|
62
|
-
e.preventDefault();
|
|
63
|
-
this.clickEvent.emit({ name: clickEventName });
|
|
64
|
-
const currentStep = this.refs[this.currentStep];
|
|
65
|
-
currentStep.validateAndSubmit({ onSuccess: this.incrementSteps });
|
|
66
|
-
};
|
|
67
|
-
this.loading = false;
|
|
68
|
-
this.businessProvisioned = false;
|
|
69
|
-
this.currentStep = 0;
|
|
70
|
-
this.errorMessage = undefined;
|
|
71
|
-
this.businessId = undefined;
|
|
72
|
-
this.authToken = undefined;
|
|
73
|
-
this.allowOptionalFields = false;
|
|
74
|
-
this.formTitle = undefined;
|
|
75
|
-
this.getBusiness = undefined;
|
|
76
|
-
this.postProvisioning = undefined;
|
|
77
|
-
}
|
|
78
|
-
componentWillLoad() {
|
|
79
|
-
this.getBusiness && this.setBusinessProvisioned();
|
|
80
|
-
this.refs = [this.coreInfoRef, this.legalAddressRef, this.additionalQuestionsRef, this.representativeRef, this.ownersRef, this.bankAccountRef, this.documentUploadRef, this.termsRef];
|
|
81
|
-
}
|
|
82
|
-
get businessEndpoint() {
|
|
83
|
-
return `entities/business/${this.businessId}`;
|
|
84
|
-
}
|
|
85
|
-
get formDisabled() {
|
|
86
|
-
return this.loading || this.businessProvisioned;
|
|
87
|
-
}
|
|
88
|
-
get totalSteps() {
|
|
89
|
-
return this.refs.length - 1;
|
|
90
|
-
}
|
|
91
|
-
get stepCounter() {
|
|
92
|
-
return `${this.currentStep + 1} of ${this.totalSteps + 1}`;
|
|
93
|
-
}
|
|
94
|
-
handleFormLoading(event) {
|
|
95
|
-
this.loading = event.detail;
|
|
96
|
-
}
|
|
97
|
-
render() {
|
|
98
|
-
return (h(StyledHost, { key: '80f2730a6a4e273391888b086c3633a3dec012b8', exportparts: 'label,input,input-invalid' }, h("div", { key: 'b4e7be2fed14b404ee7bcbe42c3c1c54bb78fdb6', class: 'row gap-3' }, h("h1", { key: 'f477beb7934a94a74dfc6b8a9c18cc54a720f70e' }, this.formTitle), h("justifi-payment-provisioning-form-steps", { key: 'e74aa3a01cfe7550f4917d28ccda1aca211d9394', businessId: this.businessId, authToken: this.authToken, refs: this.refs, currentStep: this.currentStep, allowOptionalFields: this.allowOptionalFields, handleFormLoading: this.handleFormLoading, onFormCompleted: () => this.postProvisioningData() }), h("div", { key: '26a585ec4b6b677cb01ac17696269168887f4c76', class: 'd-flex justify-content-between align-items-center' }, h("div", { key: 'ca5ddc176f8c2eb3315620076b401e47f45039bd', class: 'd-flex align-items-center' }, this.stepCounter), h("justifi-payment-provisioning-form-buttons", { key: '8299387bf859b33c829d29d66947c3c053ffa53c', currentStep: this.currentStep, totalSteps: this.totalSteps, formLoading: this.loading, formDisabled: this.formDisabled, previousStepButtonOnClick: this.previousStepButtonOnClick, nextStepButtonOnClick: this.nextStepButtonOnClick })))));
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export { PaymentProvisioningCore as justifi_payment_provisioning_core };
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
-
import './p-56f6ce4c.js';
|
|
3
|
-
import { a as PaymentMethodTypes } from './p-df21aaad.js';
|
|
4
|
-
import './p-e3fab0e2.js';
|
|
5
|
-
import { l as loadFontsOnParent } from './p-83125497.js';
|
|
6
|
-
import { a as ComponentErrorCodes, C as ComponentErrorSeverity } from './p-14c91ffd.js';
|
|
7
|
-
import { g as getErrorMessage } from './p-8115b2f4.js';
|
|
8
|
-
import { J as JustifiAnalytics } from './p-20abace7.js';
|
|
9
|
-
import { B as Button } from './p-9c9c7dac.js';
|
|
10
|
-
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
11
|
-
import './p-1bbbf15d.js';
|
|
12
|
-
import './p-29c0b182.js';
|
|
13
|
-
|
|
14
|
-
const paymentFormCss = ":host{display:block}justifi-payment-method-form{display:block;margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){font-family:var(--jfi-layout-font-family);background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}.jfi-submit-button{font-family:var(--jfi-layout-font-family);color:var(--jfi-submit-button-color);background-color:var(--jfi-submit-button-background-color);border-color:var(--jfi-submit-button-border-color);padding:var(--jfi-submit-button-padding);font-size:var(--jfi-submit-button-font-size);border-radius:var(--jfi-submit-button-border-radius);width:var(--jfi-submit-button-width);box-shadow:var(--jfi-submit-button-box-shadow)}.jfi-submit-button:hover{color:var(--jfi-submit-button-color-hover);background-color:var(--jfi-submit-button-background-color-hover);border-color:var(--jfi-submit-button-border-color-hover)}.jfi-submit-button:focus{color:var(--jfi-submit-button-color-focus);background-color:var(--jfi-submit-button-background-color-focus);border-color:var(--jfi-submit-button-border-color-focus)}.btn.jfi-submit-button:active{color:var(--jfi-submit-button-color-active);background-color:var(--jfi-submit-button-background-color-active);border-color:var(--jfi-submit-button-border-color-active)}.btn.jfi-submit-button-loading{min-width:75px;color:var(--jfi-submit-button-color-loading);background-color:var(--jfi-submit-button-background-color-loading);border-color:var(--jfi-submit-button-border-color-loading)}.btn.jfi-submit-button-loading .spinner-border{border-top-color:var(--jfi-submit-button-color-loading);border-bottom-color:var(--jfi-submit-button-color-loading);border-left-color:var(--jfi-submit-button-color-loading)}";
|
|
15
|
-
const JustifiPaymentFormStyle0 = paymentFormCss;
|
|
16
|
-
|
|
17
|
-
const PaymentForm = class {
|
|
18
|
-
constructor(hostRef) {
|
|
19
|
-
registerInstance(this, hostRef);
|
|
20
|
-
this.submitted = createEvent(this, "submitted", 7);
|
|
21
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
22
|
-
this.bankAccount = undefined;
|
|
23
|
-
this.card = undefined;
|
|
24
|
-
this.email = undefined;
|
|
25
|
-
this.clientId = undefined;
|
|
26
|
-
this.authToken = undefined;
|
|
27
|
-
this.accountId = undefined;
|
|
28
|
-
this.submitButtonText = undefined;
|
|
29
|
-
this.submitButtonEnabled = true;
|
|
30
|
-
this.isLoading = false;
|
|
31
|
-
this.selectedPaymentMethodType = PaymentMethodTypes.card;
|
|
32
|
-
}
|
|
33
|
-
componentWillLoad() {
|
|
34
|
-
this.analytics = new JustifiAnalytics(this);
|
|
35
|
-
if (!this.validateProps()) {
|
|
36
|
-
this.errorEvent.emit({
|
|
37
|
-
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
38
|
-
message: 'clientId or authToken is required',
|
|
39
|
-
severity: ComponentErrorSeverity.ERROR
|
|
40
|
-
});
|
|
41
|
-
this.submitButtonEnabled = false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
connectedCallback() {
|
|
45
|
-
loadFontsOnParent();
|
|
46
|
-
}
|
|
47
|
-
disconnectedCallback() {
|
|
48
|
-
this.analytics.cleanup();
|
|
49
|
-
}
|
|
50
|
-
async fillBillingForm(fields) {
|
|
51
|
-
this.billingFormRef.fill(fields);
|
|
52
|
-
}
|
|
53
|
-
async enableSubmitButton() {
|
|
54
|
-
this.submitButtonEnabled = true;
|
|
55
|
-
}
|
|
56
|
-
async disableSubmitButton() {
|
|
57
|
-
this.submitButtonEnabled = false;
|
|
58
|
-
}
|
|
59
|
-
showPaymentMethodTypeSelector() {
|
|
60
|
-
return this.card && this.bankAccount;
|
|
61
|
-
}
|
|
62
|
-
getSelectedPaymentMethodType() {
|
|
63
|
-
if (this.showPaymentMethodTypeSelector()) {
|
|
64
|
-
return this.selectedPaymentMethodType;
|
|
65
|
-
}
|
|
66
|
-
else if (this.card) {
|
|
67
|
-
return PaymentMethodTypes.card;
|
|
68
|
-
}
|
|
69
|
-
else if (this.bankAccount) {
|
|
70
|
-
return PaymentMethodTypes.bankAccount;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
return PaymentMethodTypes.card;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
paymentMethodSelectedHandler(event) {
|
|
77
|
-
const paymentMethodType = event.detail;
|
|
78
|
-
this.selectedPaymentMethodType = paymentMethodType;
|
|
79
|
-
}
|
|
80
|
-
validateProps() {
|
|
81
|
-
return !!(this.clientId || this.authToken);
|
|
82
|
-
}
|
|
83
|
-
getToken() {
|
|
84
|
-
return this.authToken || this.clientId;
|
|
85
|
-
}
|
|
86
|
-
async submit(event) {
|
|
87
|
-
event.preventDefault();
|
|
88
|
-
if (!this.paymentMethodFormRef || !this.billingFormRef)
|
|
89
|
-
return;
|
|
90
|
-
const billingFormValidation = await this.billingFormRef.validate();
|
|
91
|
-
const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
|
|
92
|
-
if (!billingFormValidation.isValid || !paymentMethodFormValidation.isValid)
|
|
93
|
-
return;
|
|
94
|
-
this.isLoading = true;
|
|
95
|
-
try {
|
|
96
|
-
const billingFormFieldValues = await this.billingFormRef.getValues();
|
|
97
|
-
const paymentMethodData = Object.assign({ email: this.email }, billingFormFieldValues);
|
|
98
|
-
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(this.getToken(), paymentMethodData, this.accountId);
|
|
99
|
-
if (tokenizeResponse.error) {
|
|
100
|
-
this.errorEvent.emit({
|
|
101
|
-
errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
|
|
102
|
-
message: tokenizeResponse.error.message,
|
|
103
|
-
severity: ComponentErrorSeverity.ERROR
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
this.submitted.emit(tokenizeResponse);
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
this.errorEvent.emit({
|
|
110
|
-
errorCode: ComponentErrorCodes.UNKNOWN_ERROR,
|
|
111
|
-
message: getErrorMessage(error),
|
|
112
|
-
severity: ComponentErrorSeverity.ERROR
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
finally {
|
|
116
|
-
this.isLoading = false;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
render() {
|
|
120
|
-
return (h(StyledHost, { key: '8cb6e3903a0045fbffed5f17dc29aacc6b57ad7f' }, h("form", { key: '4e8f00c3d29c0db0bc99fd79da46abe7c40e3e30', class: "row gy-3" }, this.showPaymentMethodTypeSelector() && (h("div", { key: '344a1356f6f482493a35015c32f8e9a9b4cc8a80', class: "col-12" }, h("justifi-payment-method-selector", { key: '36b9dd7a9bc8336b4bef0d12f56c811effbc0a0b', selectedPaymentMethodType: this.getSelectedPaymentMethodType(), onPaymentMethodSelected: event => this.paymentMethodSelectedHandler(event) }))), h("div", { key: '225a260f817f9dd02a7f0a5b25562179ab80f7de', class: "col-12" }, h("justifi-payment-method-form", { key: '52e2bf20b265cc96ab556571a323370cc27ac278', "payment-method-form-type": this.getSelectedPaymentMethodType(), iframeOrigin: undefined, ref: el => {
|
|
121
|
-
if (el) {
|
|
122
|
-
this.paymentMethodFormRef = el;
|
|
123
|
-
}
|
|
124
|
-
} })), h("div", { key: '433a8ac42c0eec9180e37da222da1dbb1112e48e', class: "col-12" }, h("justifi-billing-form", { key: '4f24f1c8b4083e2d9e5bb2272d32d20bb5cc225d', legend: "Billing Info", ref: el => {
|
|
125
|
-
if (el) {
|
|
126
|
-
this.billingFormRef = el;
|
|
127
|
-
}
|
|
128
|
-
} })), h("slot", { key: '9397ae7fdd2677cd61a425fcf5818ae14fabbed0', name: 'insurance' }), h("div", { key: 'db9131f6f35165e69d3b59da7fa25b95f1e46168', class: "col-12" }, h(Button, { key: 'c280836cf6445a7132ff9202a09b6fdac8e29f77', variant: "primary", type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, isLoading: this.isLoading, "data-testid": "submit-button", style: { width: '100%' } }, this.submitButtonText || 'Submit')))));
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
PaymentForm.style = JustifiPaymentFormStyle0;
|
|
132
|
-
|
|
133
|
-
export { PaymentForm as justifi_payment_form };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
-
import { P as PaymentService } from './p-cb26f708.js';
|
|
3
|
-
import './p-56f6ce4c.js';
|
|
4
|
-
import { P as Payment } from './p-df21aaad.js';
|
|
5
|
-
import './p-e3fab0e2.js';
|
|
6
|
-
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
7
|
-
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
8
|
-
import { E as ErrorState } from './p-dce846bf.js';
|
|
9
|
-
import { J as JustifiAnalytics } from './p-20abace7.js';
|
|
10
|
-
import './p-29c0b182.js';
|
|
11
|
-
import './p-1bbbf15d.js';
|
|
12
|
-
|
|
13
|
-
const makeGetPayments = ({ id, authToken, service }) => async ({ params, onSuccess, onError }) => {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
try {
|
|
16
|
-
const response = await service.fetchPayments(id, authToken, params);
|
|
17
|
-
if (!response.error) {
|
|
18
|
-
const pagingInfo = Object.assign({}, response.page_info);
|
|
19
|
-
const payments = ((_a = response.data) === null || _a === void 0 ? void 0 : _a.map((dataItem) => new Payment(dataItem))) || [];
|
|
20
|
-
onSuccess({ payments, pagingInfo });
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
const responseError = getErrorMessage(response.error);
|
|
24
|
-
const code = getErrorCode((_b = response.error) === null || _b === void 0 ? void 0 : _b.code);
|
|
25
|
-
return onError({
|
|
26
|
-
error: responseError,
|
|
27
|
-
code,
|
|
28
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
34
|
-
return onError({
|
|
35
|
-
error: error.message || error,
|
|
36
|
-
code,
|
|
37
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const PaymentsList = class {
|
|
43
|
-
constructor(hostRef) {
|
|
44
|
-
registerInstance(this, hostRef);
|
|
45
|
-
this.errorEvent = createEvent(this, "error-event", 7);
|
|
46
|
-
this.handleErrorEvent = (event) => {
|
|
47
|
-
this.errorMessage = event.detail.message;
|
|
48
|
-
this.errorEvent.emit(event.detail);
|
|
49
|
-
};
|
|
50
|
-
this.accountId = undefined;
|
|
51
|
-
this.authToken = undefined;
|
|
52
|
-
this.getPayments = undefined;
|
|
53
|
-
this.errorMessage = null;
|
|
54
|
-
}
|
|
55
|
-
componentWillLoad() {
|
|
56
|
-
this.analytics = new JustifiAnalytics(this);
|
|
57
|
-
this.initializeGetPayments();
|
|
58
|
-
}
|
|
59
|
-
disconnectedCallback() {
|
|
60
|
-
this.analytics.cleanup();
|
|
61
|
-
}
|
|
62
|
-
propChanged() {
|
|
63
|
-
this.initializeGetPayments();
|
|
64
|
-
}
|
|
65
|
-
initializeGetPayments() {
|
|
66
|
-
if (this.accountId && this.authToken) {
|
|
67
|
-
this.getPayments = makeGetPayments({
|
|
68
|
-
id: this.accountId,
|
|
69
|
-
authToken: this.authToken,
|
|
70
|
-
service: new PaymentService(),
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.errorMessage = 'Account ID and Auth Token are required';
|
|
75
|
-
this.errorEvent.emit({
|
|
76
|
-
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
77
|
-
message: this.errorMessage,
|
|
78
|
-
severity: ComponentErrorSeverity.ERROR,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
render() {
|
|
83
|
-
if (this.errorMessage) {
|
|
84
|
-
return ErrorState(this.errorMessage);
|
|
85
|
-
}
|
|
86
|
-
return (h("payments-list-core", { getPayments: this.getPayments, "onError-event": this.handleErrorEvent }));
|
|
87
|
-
}
|
|
88
|
-
static get watchers() { return {
|
|
89
|
-
"accountId": ["propChanged"],
|
|
90
|
-
"authToken": ["propChanged"]
|
|
91
|
-
}; }
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export { PaymentsList as justifi_payments_list };
|