@justifi/webcomponents 4.0.5 → 4.0.6
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/CHANGELOG.md +7 -0
- package/dist/cjs/Api-11362403.js +111 -0
- package/dist/cjs/Api-11362403.js.map +1 -0
- package/dist/cjs/Payment-ac4dea02.js +2 -0
- package/dist/cjs/Payment-ac4dea02.js.map +1 -0
- package/dist/cjs/{index-051b6dd0.js → index-34312a38.js} +185 -21
- package/dist/cjs/index-34312a38.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/{index.esm-8df4906e.js → index.esm-bcf90c56.js} +2 -244
- package/dist/cjs/index.esm-bcf90c56.js.map +1 -0
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +8 -5
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-business-address.cjs.entry.js +7 -4
- package/dist/cjs/justifi-business-address.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-business-info.cjs.entry.js +174 -0
- package/dist/cjs/justifi-business-info.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-form.cjs.entry.js +10 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +12 -7
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payments-list.cjs.entry.js +5 -108
- package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -3
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/select-input_2.cjs.entry.js +5 -3
- package/dist/cjs/select-input_2.cjs.entry.js.map +1 -0
- package/dist/cjs/state-options-efeaa587.js +248 -0
- package/dist/cjs/state-options-efeaa587.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +12 -3
- package/dist/cjs/webcomponents.cjs.js.map +1 -0
- package/dist/collection/api/Api.js +2 -1
- package/dist/collection/api/Api.js.map +1 -0
- package/dist/collection/api/Pagination.js +1 -0
- package/dist/collection/api/Pagination.js.map +1 -0
- package/dist/collection/api/Payment.js +1 -0
- package/dist/collection/api/Payment.js.map +1 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/api/index.js.map +1 -0
- package/dist/collection/api/mockData/MockPayments.js +1 -0
- package/dist/collection/api/mockData/MockPayments.js.map +1 -0
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/bank-account-form/bank-account-form.js +1 -0
- package/dist/collection/components/bank-account-form/bank-account-form.js.map +1 -0
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js +1 -0
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.e2e.js +14 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.e2e.js.map +1 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.spec.js +48 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.spec.js.map +1 -0
- package/dist/collection/components/billing-form/billing-form-schema.js +1 -0
- package/dist/collection/components/billing-form/billing-form-schema.js.map +1 -0
- package/dist/collection/components/billing-form/billing-form.css +337 -0
- package/dist/collection/components/billing-form/billing-form.js +1 -0
- package/dist/collection/components/billing-form/billing-form.js.map +1 -0
- package/dist/collection/components/billing-form/billing-form.stories.js +1 -0
- package/dist/collection/components/billing-form/billing-form.stories.js.map +1 -0
- package/dist/collection/components/billing-form/state-options.js +1 -0
- package/dist/collection/components/billing-form/state-options.js.map +1 -0
- package/dist/collection/components/billing-form/test/billing-form.spec.js +31 -0
- package/dist/collection/components/billing-form/test/billing-form.spec.js.map +1 -0
- package/dist/collection/components/business-address/business-address-schema.js +1 -0
- package/dist/collection/components/business-address/business-address-schema.js.map +1 -0
- package/dist/collection/components/business-address/business-address.css +337 -0
- package/dist/collection/components/business-address/business-address.js +1 -0
- package/dist/collection/components/business-address/business-address.js.map +1 -0
- package/dist/collection/components/business-address/test/business-address.e2e.js +10 -0
- package/dist/collection/components/business-address/test/business-address.e2e.js.map +1 -0
- package/dist/collection/components/business-address/test/business-address.spec.js +18 -0
- package/dist/collection/components/business-address/test/business-address.spec.js.map +1 -0
- package/dist/collection/components/business-info/business-info-schema.js +94 -0
- package/dist/collection/components/business-info/business-info-schema.js.map +1 -0
- package/dist/collection/components/business-info/business-info.css +2274 -0
- package/dist/collection/components/business-info/business-info.js +168 -0
- package/dist/collection/components/business-info/business-info.js.map +1 -0
- package/dist/collection/components/card-form/card-form.js +1 -0
- package/dist/collection/components/card-form/card-form.js.map +1 -0
- package/dist/collection/components/card-form/card-form.stories.js +1 -0
- package/dist/collection/components/card-form/card-form.stories.js.map +1 -0
- package/dist/collection/components/card-form/test/card-form.e2e.js +14 -0
- package/dist/collection/components/card-form/test/card-form.e2e.js.map +1 -0
- package/dist/collection/components/card-form/test/card-form.spec.js +56 -0
- package/dist/collection/components/card-form/test/card-form.spec.js.map +1 -0
- package/dist/collection/components/payment-form/payment-form.css +412 -0
- package/dist/collection/components/payment-form/payment-form.js +8 -2
- package/dist/collection/components/payment-form/payment-form.js.map +1 -0
- package/dist/collection/components/payment-form/payment-form.stories.js +1 -0
- package/dist/collection/components/payment-form/payment-form.stories.js.map +1 -0
- package/dist/collection/components/payment-form/payment-method-selector.css +337 -0
- package/dist/collection/components/payment-form/payment-method-selector.js +1 -0
- package/dist/collection/components/payment-form/payment-method-selector.js.map +1 -0
- package/dist/collection/components/payment-form/test/payment-form.e2e.js +23 -0
- package/dist/collection/components/payment-form/test/payment-form.e2e.js.map +1 -0
- package/dist/collection/components/payment-form/test/payment-form.spec.js +182 -0
- package/dist/collection/components/payment-form/test/payment-form.spec.js.map +1 -0
- package/dist/collection/components/payment-form/tokenize.js +1 -0
- package/dist/collection/components/payment-form/tokenize.js.map +1 -0
- package/dist/collection/components/payment-method-form/get-computed-theme.js +1 -0
- package/dist/collection/components/payment-method-form/get-computed-theme.js.map +1 -0
- package/dist/collection/components/payment-method-form/message-event-types.js +1 -0
- package/dist/collection/components/payment-method-form/message-event-types.js.map +1 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +2 -2
- package/dist/collection/components/payment-method-form/payment-method-form.js.map +1 -0
- package/dist/collection/components/payment-method-form/payment-method-responses.js +1 -0
- package/dist/collection/components/payment-method-form/payment-method-responses.js.map +1 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.e2e.js +22 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.e2e.js.map +1 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +83 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js.map +1 -0
- package/dist/collection/components/payment-method-form/theme.js +1 -0
- package/dist/collection/components/payment-method-form/theme.js.map +1 -0
- package/dist/collection/components/payments-list/payments-list.js +1 -0
- package/dist/collection/components/payments-list/payments-list.js.map +1 -0
- package/dist/collection/components/payments-list/test/payments-list.spec.js +21 -0
- package/dist/collection/components/payments-list/test/payments-list.spec.js.map +1 -0
- package/dist/collection/components/select-input/select-input.css +337 -0
- package/dist/collection/components/select-input/select-input.js +1 -0
- package/dist/collection/components/select-input/select-input.js.map +1 -0
- package/dist/collection/components/select-input/test/select-input.spec.js +36 -0
- package/dist/collection/components/select-input/test/select-input.spec.js.map +1 -0
- package/dist/collection/components/text-input/test/text-input.spec.js +19 -0
- package/dist/collection/components/text-input/test/text-input.spec.js.map +1 -0
- package/dist/collection/components/text-input/text-input.css +337 -0
- package/dist/collection/components/text-input/text-input.js +1 -0
- package/dist/collection/components/text-input/text-input.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/Api.js +109 -0
- package/dist/components/Api.js.map +1 -0
- package/dist/components/Payment.js +2 -0
- package/dist/components/Payment.js.map +1 -0
- package/dist/components/billing-form.js +6 -3
- package/dist/components/billing-form.js.map +1 -0
- package/dist/components/index.d.ts +9 -13
- package/dist/{esm/index.esm-c6a89005.js → components/index.esm.js} +3 -244
- package/dist/components/index.esm.js.map +1 -0
- package/dist/components/index.js +3 -11
- package/dist/components/index.js.map +1 -0
- package/dist/components/justifi-bank-account-form.js +3 -1
- package/dist/components/justifi-bank-account-form.js.map +1 -0
- package/dist/components/justifi-billing-form.js +2 -0
- package/dist/components/justifi-billing-form.js.map +1 -0
- package/dist/components/justifi-business-address.js +6 -3
- package/dist/components/justifi-business-address.js.map +1 -0
- package/dist/components/justifi-business-info.d.ts +11 -0
- package/dist/components/justifi-business-info.js +207 -0
- package/dist/components/justifi-business-info.js.map +1 -0
- package/dist/components/justifi-card-form.js +3 -1
- package/dist/components/justifi-card-form.js.map +1 -0
- package/dist/components/justifi-payment-form.js +11 -4
- package/dist/components/justifi-payment-form.js.map +1 -0
- package/dist/components/justifi-payment-method-form.js +2 -0
- package/dist/components/justifi-payment-method-form.js.map +1 -0
- package/dist/components/justifi-payment-method-selector.js +2 -0
- package/dist/components/justifi-payment-method-selector.js.map +1 -0
- package/dist/components/justifi-payments-list.js +4 -107
- package/dist/components/justifi-payments-list.js.map +1 -0
- package/dist/components/payment-method-form.js +12 -7
- package/dist/components/payment-method-form.js.map +1 -0
- package/dist/components/payment-method-selector.js +4 -2
- package/dist/components/payment-method-selector.js.map +1 -0
- package/dist/components/select-input.js +2 -0
- package/dist/components/select-input.js.map +1 -0
- package/dist/components/select-input2.js +4 -2
- package/dist/components/select-input2.js.map +1 -0
- package/dist/components/state-options.js +3 -1845
- package/dist/components/state-options.js.map +1 -0
- package/dist/components/text-input.js +2 -0
- package/dist/components/text-input.js.map +1 -0
- package/dist/components/text-input2.js +4 -2
- package/dist/components/text-input2.js.map +1 -0
- package/dist/esm/Api-a07f0057.js +109 -0
- package/dist/esm/Api-a07f0057.js.map +1 -0
- package/dist/esm/Payment-c86e1e84.js +2 -0
- package/dist/esm/Payment-c86e1e84.js.map +1 -0
- package/dist/esm/{index-605b421a.js → index-044f93fc.js} +185 -22
- package/dist/esm/index-044f93fc.js.map +1 -0
- package/dist/esm/index.esm-5624a5ed.js +1847 -0
- package/dist/esm/index.esm-5624a5ed.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/justifi-bank-account-form.entry.js +3 -1
- package/dist/esm/justifi-bank-account-form.entry.js.map +1 -0
- package/dist/esm/justifi-billing-form_2.entry.js +7 -4
- package/dist/esm/justifi-billing-form_2.entry.js.map +1 -0
- package/dist/esm/justifi-business-address.entry.js +6 -3
- package/dist/esm/justifi-business-address.entry.js.map +1 -0
- package/dist/esm/justifi-business-info.entry.js +170 -0
- package/dist/esm/justifi-business-info.entry.js.map +1 -0
- package/dist/esm/justifi-card-form.entry.js +3 -1
- package/dist/esm/justifi-card-form.entry.js.map +1 -0
- package/dist/esm/justifi-payment-form.entry.js +10 -4
- package/dist/esm/justifi-payment-form.entry.js.map +1 -0
- package/dist/esm/justifi-payment-method-form.entry.js +12 -7
- package/dist/esm/justifi-payment-method-form.entry.js.map +1 -0
- package/dist/esm/justifi-payments-list.entry.js +4 -107
- package/dist/esm/justifi-payments-list.entry.js.map +1 -0
- package/dist/esm/loader.js +6 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/select-input_2.entry.js +5 -3
- package/dist/esm/select-input_2.entry.js.map +1 -0
- package/dist/esm/state-options-188acc34.js +246 -0
- package/dist/esm/state-options-188acc34.js.map +1 -0
- package/dist/esm/webcomponents.js +9 -3
- package/dist/esm/webcomponents.js.map +1 -0
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Payment.d.ts +1 -1
- package/dist/types/components/business-info/business-info-schema.d.ts +42 -0
- package/dist/types/components/business-info/business-info.d.ts +20 -0
- package/dist/types/components/payment-form/payment-form.d.ts +1 -0
- package/dist/types/components/payment-method-form/payment-method-responses.d.ts +1 -1
- package/dist/types/components.d.ts +63 -0
- package/dist/types/stencil-public-runtime.d.ts +72 -15
- package/dist/webcomponents/index.esm.js +2 -0
- package/dist/webcomponents/index.esm.js.map +1 -0
- package/dist/webcomponents/p-0ea23153.js +2 -0
- package/dist/webcomponents/p-0ea23153.js.map +1 -0
- package/dist/webcomponents/p-16b4e90a.entry.js +2 -0
- package/dist/webcomponents/p-16b4e90a.entry.js.map +1 -0
- package/dist/webcomponents/p-1ca0646b.js +2 -1
- package/dist/webcomponents/p-1ca0646b.js.map +1 -0
- package/dist/webcomponents/p-1f151d49.js +2 -0
- package/dist/webcomponents/p-1f151d49.js.map +1 -0
- package/dist/webcomponents/p-1f23b391.entry.js +2 -0
- package/dist/webcomponents/p-1f23b391.entry.js.map +1 -0
- package/dist/webcomponents/p-255b1284.entry.js +2 -0
- package/dist/webcomponents/p-255b1284.entry.js.map +1 -0
- package/dist/webcomponents/p-3aa91155.js +3 -0
- package/dist/webcomponents/p-3aa91155.js.map +1 -0
- package/dist/webcomponents/p-90c0d9e1.entry.js +2 -0
- package/dist/webcomponents/p-90c0d9e1.entry.js.map +1 -0
- package/dist/webcomponents/p-c903cc5a.entry.js +2 -0
- package/dist/webcomponents/p-c903cc5a.entry.js.map +1 -0
- package/dist/webcomponents/p-d87b0711.entry.js +2 -0
- package/dist/webcomponents/p-d87b0711.entry.js.map +1 -0
- package/dist/webcomponents/p-dbf7100f.entry.js +2 -0
- package/dist/webcomponents/p-dbf7100f.entry.js.map +1 -0
- package/dist/webcomponents/p-e0054bc3.js +2 -0
- package/dist/webcomponents/p-e0054bc3.js.map +1 -0
- package/dist/webcomponents/p-f30d1567.entry.js +2 -0
- package/dist/webcomponents/p-f30d1567.entry.js.map +1 -0
- package/dist/webcomponents/p-f66f024e.entry.js +2 -0
- package/dist/webcomponents/p-f66f024e.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.css +1 -1
- package/dist/webcomponents/webcomponents.esm.js +2 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -0
- package/loader/index.d.ts +9 -0
- package/package.json +8 -4
- package/dist/webcomponents/p-039e3540.entry.js +0 -1
- package/dist/webcomponents/p-11e5bef9.entry.js +0 -1
- package/dist/webcomponents/p-20732337.js +0 -1
- package/dist/webcomponents/p-24409e8e.entry.js +0 -1
- package/dist/webcomponents/p-4a406704.js +0 -2
- package/dist/webcomponents/p-5774e36e.entry.js +0 -1
- package/dist/webcomponents/p-5b5e8351.entry.js +0 -1
- package/dist/webcomponents/p-5b68fa52.entry.js +0 -1
- package/dist/webcomponents/p-7747c086.entry.js +0 -1
- package/dist/webcomponents/p-bc35e124.entry.js +0 -1
|
@@ -67,6 +67,343 @@
|
|
|
67
67
|
--bs-highlight-bg: #fff3cd;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
.spinner-grow,
|
|
71
|
+
.spinner-border {
|
|
72
|
+
display: inline-block;
|
|
73
|
+
width: var(--bs-spinner-width);
|
|
74
|
+
height: var(--bs-spinner-height);
|
|
75
|
+
vertical-align: var(--bs-spinner-vertical-align);
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
animation: var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@keyframes spinner-border {
|
|
81
|
+
to {
|
|
82
|
+
transform: rotate(360deg) /* rtl:ignore */;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.spinner-border {
|
|
86
|
+
--bs-spinner-width: 2rem;
|
|
87
|
+
--bs-spinner-height: 2rem;
|
|
88
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
89
|
+
--bs-spinner-border-width: 0.25em;
|
|
90
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
91
|
+
--bs-spinner-animation-name: spinner-border;
|
|
92
|
+
border: var(--bs-spinner-border-width) solid currentcolor;
|
|
93
|
+
border-right-color: transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.spinner-border-sm {
|
|
97
|
+
--bs-spinner-width: 1rem;
|
|
98
|
+
--bs-spinner-height: 1rem;
|
|
99
|
+
--bs-spinner-border-width: 0.2em;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@keyframes spinner-grow {
|
|
103
|
+
0% {
|
|
104
|
+
transform: scale(0);
|
|
105
|
+
}
|
|
106
|
+
50% {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: none;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
.spinner-grow {
|
|
112
|
+
--bs-spinner-width: 2rem;
|
|
113
|
+
--bs-spinner-height: 2rem;
|
|
114
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
115
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
116
|
+
--bs-spinner-animation-name: spinner-grow;
|
|
117
|
+
background-color: currentcolor;
|
|
118
|
+
opacity: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.spinner-grow-sm {
|
|
122
|
+
--bs-spinner-width: 1rem;
|
|
123
|
+
--bs-spinner-height: 1rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@media (prefers-reduced-motion: reduce) {
|
|
127
|
+
.spinner-border,
|
|
128
|
+
.spinner-grow {
|
|
129
|
+
--bs-spinner-animation-speed: 1.5s;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.clearfix::after {
|
|
133
|
+
display: block;
|
|
134
|
+
clear: both;
|
|
135
|
+
content: "";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.text-bg-primary {
|
|
139
|
+
color: #fff !important;
|
|
140
|
+
background-color: RGBA(13, 110, 253, var(--bs-bg-opacity, 1)) !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.text-bg-secondary {
|
|
144
|
+
color: #fff !important;
|
|
145
|
+
background-color: RGBA(108, 117, 125, var(--bs-bg-opacity, 1)) !important;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.text-bg-success {
|
|
149
|
+
color: #fff !important;
|
|
150
|
+
background-color: RGBA(25, 135, 84, var(--bs-bg-opacity, 1)) !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.text-bg-info {
|
|
154
|
+
color: #000 !important;
|
|
155
|
+
background-color: RGBA(13, 202, 240, var(--bs-bg-opacity, 1)) !important;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.text-bg-warning {
|
|
159
|
+
color: #000 !important;
|
|
160
|
+
background-color: RGBA(255, 193, 7, var(--bs-bg-opacity, 1)) !important;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.text-bg-danger {
|
|
164
|
+
color: #fff !important;
|
|
165
|
+
background-color: RGBA(220, 53, 69, var(--bs-bg-opacity, 1)) !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.text-bg-light {
|
|
169
|
+
color: #000 !important;
|
|
170
|
+
background-color: RGBA(248, 249, 250, var(--bs-bg-opacity, 1)) !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.text-bg-dark {
|
|
174
|
+
color: #fff !important;
|
|
175
|
+
background-color: RGBA(33, 37, 41, var(--bs-bg-opacity, 1)) !important;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.link-primary {
|
|
179
|
+
color: #0d6efd !important;
|
|
180
|
+
}
|
|
181
|
+
.link-primary:hover, .link-primary:focus {
|
|
182
|
+
color: #0a58ca !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.link-secondary {
|
|
186
|
+
color: #6c757d !important;
|
|
187
|
+
}
|
|
188
|
+
.link-secondary:hover, .link-secondary:focus {
|
|
189
|
+
color: #565e64 !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.link-success {
|
|
193
|
+
color: #198754 !important;
|
|
194
|
+
}
|
|
195
|
+
.link-success:hover, .link-success:focus {
|
|
196
|
+
color: #146c43 !important;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.link-info {
|
|
200
|
+
color: #0dcaf0 !important;
|
|
201
|
+
}
|
|
202
|
+
.link-info:hover, .link-info:focus {
|
|
203
|
+
color: #3dd5f3 !important;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.link-warning {
|
|
207
|
+
color: #ffc107 !important;
|
|
208
|
+
}
|
|
209
|
+
.link-warning:hover, .link-warning:focus {
|
|
210
|
+
color: #ffcd39 !important;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.link-danger {
|
|
214
|
+
color: #dc3545 !important;
|
|
215
|
+
}
|
|
216
|
+
.link-danger:hover, .link-danger:focus {
|
|
217
|
+
color: #b02a37 !important;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.link-light {
|
|
221
|
+
color: #f8f9fa !important;
|
|
222
|
+
}
|
|
223
|
+
.link-light:hover, .link-light:focus {
|
|
224
|
+
color: #f9fafb !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.link-dark {
|
|
228
|
+
color: #212529 !important;
|
|
229
|
+
}
|
|
230
|
+
.link-dark:hover, .link-dark:focus {
|
|
231
|
+
color: #1a1e21 !important;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.ratio {
|
|
235
|
+
position: relative;
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
.ratio::before {
|
|
239
|
+
display: block;
|
|
240
|
+
padding-top: var(--bs-aspect-ratio);
|
|
241
|
+
content: "";
|
|
242
|
+
}
|
|
243
|
+
.ratio > * {
|
|
244
|
+
position: absolute;
|
|
245
|
+
top: 0;
|
|
246
|
+
left: 0;
|
|
247
|
+
width: 100%;
|
|
248
|
+
height: 100%;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.ratio-1x1 {
|
|
252
|
+
--bs-aspect-ratio: 100%;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.ratio-4x3 {
|
|
256
|
+
--bs-aspect-ratio: 75%;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.ratio-16x9 {
|
|
260
|
+
--bs-aspect-ratio: 56.25%;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.ratio-21x9 {
|
|
264
|
+
--bs-aspect-ratio: 42.8571428571%;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.fixed-top {
|
|
268
|
+
position: fixed;
|
|
269
|
+
top: 0;
|
|
270
|
+
right: 0;
|
|
271
|
+
left: 0;
|
|
272
|
+
z-index: 1030;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.fixed-bottom {
|
|
276
|
+
position: fixed;
|
|
277
|
+
right: 0;
|
|
278
|
+
bottom: 0;
|
|
279
|
+
left: 0;
|
|
280
|
+
z-index: 1030;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.sticky-top {
|
|
284
|
+
position: sticky;
|
|
285
|
+
top: 0;
|
|
286
|
+
z-index: 1020;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.sticky-bottom {
|
|
290
|
+
position: sticky;
|
|
291
|
+
bottom: 0;
|
|
292
|
+
z-index: 1020;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@media (min-width: 576px) {
|
|
296
|
+
.sticky-sm-top {
|
|
297
|
+
position: sticky;
|
|
298
|
+
top: 0;
|
|
299
|
+
z-index: 1020;
|
|
300
|
+
}
|
|
301
|
+
.sticky-sm-bottom {
|
|
302
|
+
position: sticky;
|
|
303
|
+
bottom: 0;
|
|
304
|
+
z-index: 1020;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
@media (min-width: 768px) {
|
|
308
|
+
.sticky-md-top {
|
|
309
|
+
position: sticky;
|
|
310
|
+
top: 0;
|
|
311
|
+
z-index: 1020;
|
|
312
|
+
}
|
|
313
|
+
.sticky-md-bottom {
|
|
314
|
+
position: sticky;
|
|
315
|
+
bottom: 0;
|
|
316
|
+
z-index: 1020;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
@media (min-width: 992px) {
|
|
320
|
+
.sticky-lg-top {
|
|
321
|
+
position: sticky;
|
|
322
|
+
top: 0;
|
|
323
|
+
z-index: 1020;
|
|
324
|
+
}
|
|
325
|
+
.sticky-lg-bottom {
|
|
326
|
+
position: sticky;
|
|
327
|
+
bottom: 0;
|
|
328
|
+
z-index: 1020;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
@media (min-width: 1200px) {
|
|
332
|
+
.sticky-xl-top {
|
|
333
|
+
position: sticky;
|
|
334
|
+
top: 0;
|
|
335
|
+
z-index: 1020;
|
|
336
|
+
}
|
|
337
|
+
.sticky-xl-bottom {
|
|
338
|
+
position: sticky;
|
|
339
|
+
bottom: 0;
|
|
340
|
+
z-index: 1020;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
@media (min-width: 1400px) {
|
|
344
|
+
.sticky-xxl-top {
|
|
345
|
+
position: sticky;
|
|
346
|
+
top: 0;
|
|
347
|
+
z-index: 1020;
|
|
348
|
+
}
|
|
349
|
+
.sticky-xxl-bottom {
|
|
350
|
+
position: sticky;
|
|
351
|
+
bottom: 0;
|
|
352
|
+
z-index: 1020;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
.hstack {
|
|
356
|
+
display: flex;
|
|
357
|
+
flex-direction: row;
|
|
358
|
+
align-items: center;
|
|
359
|
+
align-self: stretch;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.vstack {
|
|
363
|
+
display: flex;
|
|
364
|
+
flex: 1 1 auto;
|
|
365
|
+
flex-direction: column;
|
|
366
|
+
align-self: stretch;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.visually-hidden,
|
|
370
|
+
.visually-hidden-focusable:not(:focus):not(:focus-within) {
|
|
371
|
+
position: absolute !important;
|
|
372
|
+
width: 1px !important;
|
|
373
|
+
height: 1px !important;
|
|
374
|
+
padding: 0 !important;
|
|
375
|
+
margin: -1px !important;
|
|
376
|
+
overflow: hidden !important;
|
|
377
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
378
|
+
white-space: nowrap !important;
|
|
379
|
+
border: 0 !important;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.stretched-link::after {
|
|
383
|
+
position: absolute;
|
|
384
|
+
top: 0;
|
|
385
|
+
right: 0;
|
|
386
|
+
bottom: 0;
|
|
387
|
+
left: 0;
|
|
388
|
+
z-index: 1;
|
|
389
|
+
content: "";
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.text-truncate {
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
text-overflow: ellipsis;
|
|
395
|
+
white-space: nowrap;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.vr {
|
|
399
|
+
display: inline-block;
|
|
400
|
+
align-self: stretch;
|
|
401
|
+
width: 1px;
|
|
402
|
+
min-height: 1em;
|
|
403
|
+
background-color: currentcolor;
|
|
404
|
+
opacity: 0.25;
|
|
405
|
+
}
|
|
406
|
+
|
|
70
407
|
.form-label {
|
|
71
408
|
margin-bottom: 0.5rem;
|
|
72
409
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-method-selector.js","sourceRoot":"","sources":["../../../../src/components/payment-form/payment-method-selector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGlF,MAAM,mBAAmB,GAAG;EAC1B,WAAW,EAAE,cAAc;EAC3B,IAAI,EAAE,MAAM;CACb,CAAC;AAOF,MAAM,OAAO,qBAAqB;;8BACmB,EAAE;;;EAMrD,eAAe,CAAC,KAAU;IACxB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;EACtD,CAAC;EAED,MAAM;IACJ,OAAO,CACL,WAAK,KAAK,EAAC,+BAA+B,EAAC,IAAI,EAAC,OAAO,gBAAY,uCAAuC,IACvG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,iBAAqC,EAAE,EAAE,CAAC,CACtE,EAAC,QAAQ;MACP,aACE,EAAE,EAAE,iBAAiB,EACrB,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,mBAAmB,EACxB,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EACrD,OAAO,EAAE,IAAI,CAAC,yBAAyB,KAAK,iBAAiB,EAC7D,KAAK,EAAC,yBAAyB,GAC/B;MACF,aAAO,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAC,6CAA6C,IACnF,mBAAmB,CAAC,iBAAiB,CAAC,CACjC,CACC,CACZ,CAAC,CACE,CACP,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Fragment, h, Prop } from '@stencil/core';\nimport { PaymentMethodTypes } from '../../api';\n\nconst PaymentMethodLabels = {\n bankAccount: 'Bank Account',\n card: 'Card',\n};\n\n@Component({\n tag: 'justifi-payment-method-selector',\n styleUrl: 'payment-method-selector.scss',\n shadow: true,\n})\nexport class PaymentMethodSelector {\n @Prop() paymentMethodTypes: PaymentMethodTypes[] = [];\n @Prop() selectedPaymentMethodType: PaymentMethodTypes;\n @Event({ bubbles: true }) paymentMethodSelected: EventEmitter;\n\n defaultRadioButtonOption!: HTMLInputElement;\n\n onChangeHandler(event: any) {\n this.paymentMethodSelected.emit(event.target.value);\n }\n\n render() {\n return (\n <div class=\"btn-group jfi-btn-radio-group\" role=\"group\" aria-label=\"Radio toggle group for payment method\">\n {this.paymentMethodTypes.map((paymentMethodType: PaymentMethodTypes) => (\n <Fragment>\n <input\n id={paymentMethodType}\n type=\"radio\"\n name=\"paymentMethodType\"\n value={paymentMethodType}\n onChange={(event: any) => this.onChangeHandler(event)}\n checked={this.selectedPaymentMethodType === paymentMethodType}\n class=\"btn-check jfi-btn-radio\"\n />\n <label htmlFor={paymentMethodType} class=\"btn btn-outline-primary jfi-btn-radio-label\">\n {PaymentMethodLabels[paymentMethodType]}\n </label>\n </Fragment>\n ))}\n </div>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { newE2EPage } from '@stencil/core/testing';
|
|
2
|
+
describe('justifi-payment-form', () => {
|
|
3
|
+
it('should correctly render submit button with correct text', async () => {
|
|
4
|
+
// Create new testing page and add our component to it
|
|
5
|
+
const page = await newE2EPage();
|
|
6
|
+
await page.setContent(`
|
|
7
|
+
<justifi-payment-form
|
|
8
|
+
bank-account="true"
|
|
9
|
+
card="true"
|
|
10
|
+
email="test@example.com"
|
|
11
|
+
iframe-origin="https://iframe.example.com"
|
|
12
|
+
client-id="testId"
|
|
13
|
+
account-id="accountId"
|
|
14
|
+
submit-button-text="Pay Now"
|
|
15
|
+
/>
|
|
16
|
+
`);
|
|
17
|
+
// Find the submit button on the page
|
|
18
|
+
const submitButton = await page.find('justifi-payment-form >>> button');
|
|
19
|
+
// Assert that the submit button's text is set correctly
|
|
20
|
+
expect(await submitButton.textContent).toBe('Pay Now');
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=payment-form.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-form.e2e.js","sourceRoot":"","sources":["../../../../../src/components/payment-form/test/payment-form.e2e.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;EACpC,EAAE,CAAC,yDAAyD,EAAE,KAAK,IAAI,EAAE;IACvE,sDAAsD;IACtD,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;IAChC,MAAM,IAAI,CAAC,UAAU,CACnB;;;;;;;;;;OAUC,CACF,CAAC;IAEF,qCAAqC;IACrC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAExE,wDAAwD;IACxD,MAAM,CAAC,MAAM,YAAY,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;EACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('justifi-payment-form', () => {\n it('should correctly render submit button with correct text', async () => {\n // Create new testing page and add our component to it\n const page = await newE2EPage();\n await page.setContent(\n `\n <justifi-payment-form\n bank-account=\"true\"\n card=\"true\"\n email=\"test@example.com\"\n iframe-origin=\"https://iframe.example.com\"\n client-id=\"testId\"\n account-id=\"accountId\"\n submit-button-text=\"Pay Now\"\n />\n `,\n );\n\n // Find the submit button on the page\n const submitButton = await page.find('justifi-payment-form >>> button');\n\n // Assert that the submit button's text is set correctly\n expect(await submitButton.textContent).toBe('Pay Now');\n });\n});\n"]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { newSpecPage } from '@stencil/core/testing';
|
|
2
|
+
import { PaymentForm } from '../payment-form';
|
|
3
|
+
import { PaymentMethodTypes } from '../../../api';
|
|
4
|
+
describe('justifi-payment-form', () => {
|
|
5
|
+
// State Testing
|
|
6
|
+
it('should update allowedPaymentMethodTypes and selectedPaymentMethodType state correctly when connectedCallback is invoked', async () => {
|
|
7
|
+
// Mock properties
|
|
8
|
+
const mockComponent = new PaymentForm();
|
|
9
|
+
mockComponent.bankAccount = true;
|
|
10
|
+
mockComponent.card = true;
|
|
11
|
+
// Invoke the lifecycle method
|
|
12
|
+
mockComponent.connectedCallback();
|
|
13
|
+
// Assertions
|
|
14
|
+
expect(mockComponent.allowedPaymentMethodTypes).toEqual([PaymentMethodTypes.card, PaymentMethodTypes.bankAccount]);
|
|
15
|
+
expect(mockComponent.selectedPaymentMethodType).toBe(PaymentMethodTypes.card);
|
|
16
|
+
});
|
|
17
|
+
it('should update submitButtonEnabled state when enableSubmitButton method is called', async () => {
|
|
18
|
+
// Mock component
|
|
19
|
+
const mockComponent = new PaymentForm();
|
|
20
|
+
mockComponent.submitButtonEnabled = false;
|
|
21
|
+
// Call the method
|
|
22
|
+
await mockComponent.enableSubmitButton();
|
|
23
|
+
// Assertion
|
|
24
|
+
expect(mockComponent.submitButtonEnabled).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it('should update selectedPaymentMethodType when paymentMethodSelected event is fired', async () => {
|
|
27
|
+
// Mock component
|
|
28
|
+
const mockComponent = new PaymentForm();
|
|
29
|
+
mockComponent.selectedPaymentMethodType = PaymentMethodTypes.card;
|
|
30
|
+
// Define the event details
|
|
31
|
+
const detail = PaymentMethodTypes.bankAccount;
|
|
32
|
+
const event = new CustomEvent('paymentMethodSelected', { detail });
|
|
33
|
+
// Simulate the event
|
|
34
|
+
mockComponent.paymentMethodSelectedHandler(event);
|
|
35
|
+
// Assertion
|
|
36
|
+
expect(mockComponent.selectedPaymentMethodType).toBe(PaymentMethodTypes.bankAccount);
|
|
37
|
+
});
|
|
38
|
+
// Props Testing
|
|
39
|
+
it('should have the expected default properties', () => {
|
|
40
|
+
const paymentForm = new PaymentForm();
|
|
41
|
+
// Assert that the properties exist and have the expected default values
|
|
42
|
+
expect(paymentForm).toHaveProperty('bankAccount', undefined);
|
|
43
|
+
expect(paymentForm).toHaveProperty('card', undefined);
|
|
44
|
+
expect(paymentForm).toHaveProperty('email', undefined);
|
|
45
|
+
expect(paymentForm).toHaveProperty('iframeOrigin', undefined);
|
|
46
|
+
expect(paymentForm).toHaveProperty('clientId', undefined);
|
|
47
|
+
expect(paymentForm).toHaveProperty('accountId', undefined);
|
|
48
|
+
expect(paymentForm).toHaveProperty('submitButtonText', undefined);
|
|
49
|
+
});
|
|
50
|
+
// Method Testing
|
|
51
|
+
it('should correctly fill billing form when fillBillingForm method is called', async () => {
|
|
52
|
+
// Mock child component
|
|
53
|
+
const mockBillingFormRef = {
|
|
54
|
+
fill: jest.fn(),
|
|
55
|
+
};
|
|
56
|
+
// Mock component
|
|
57
|
+
const mockComponent = new PaymentForm();
|
|
58
|
+
// Cast to any to bypass type checker and directly set private property
|
|
59
|
+
mockComponent.billingFormRef = mockBillingFormRef;
|
|
60
|
+
// Define the fields to fill the billing form
|
|
61
|
+
const fields = {
|
|
62
|
+
name: 'John Doe',
|
|
63
|
+
address_line1: '123 Main St',
|
|
64
|
+
address_line2: 'Apt 4B',
|
|
65
|
+
address_city: 'Townsville',
|
|
66
|
+
address_state: 'TS',
|
|
67
|
+
address_postal_code: '12345',
|
|
68
|
+
};
|
|
69
|
+
// Call the method
|
|
70
|
+
await mockComponent.fillBillingForm(fields);
|
|
71
|
+
// Check that the child component's fill method was called with the correct arguments
|
|
72
|
+
expect(mockBillingFormRef.fill).toHaveBeenCalledWith(fields);
|
|
73
|
+
});
|
|
74
|
+
it('should submit the form correctly and trigger the "submitted" event with the correct payload when submit method is called', async () => {
|
|
75
|
+
// Mock billingFormRef and paymentMethodFormRef
|
|
76
|
+
const mockBillingFormRef = {
|
|
77
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
78
|
+
getValues: jest.fn().mockResolvedValue({ name: 'John Doe' }),
|
|
79
|
+
};
|
|
80
|
+
const mockPaymentMethodFormRef = {
|
|
81
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
82
|
+
tokenize: jest.fn().mockResolvedValue({ token: 'abc123' }),
|
|
83
|
+
};
|
|
84
|
+
// Mock component
|
|
85
|
+
const mockComponent = new PaymentForm();
|
|
86
|
+
// Cast to any to bypass type checker and directly set private properties
|
|
87
|
+
mockComponent.billingFormRef = mockBillingFormRef;
|
|
88
|
+
mockComponent.paymentMethodFormRef = mockPaymentMethodFormRef;
|
|
89
|
+
// Mock event
|
|
90
|
+
const mockEvent = { preventDefault: jest.fn() };
|
|
91
|
+
// Mock event emitter
|
|
92
|
+
const mockEmitter = { emit: jest.fn() };
|
|
93
|
+
mockComponent.submitted = mockEmitter;
|
|
94
|
+
// Call submit method
|
|
95
|
+
await mockComponent.submit(mockEvent);
|
|
96
|
+
// Expectations
|
|
97
|
+
expect(mockEvent.preventDefault).toHaveBeenCalled();
|
|
98
|
+
expect(mockBillingFormRef.validate).toHaveBeenCalled();
|
|
99
|
+
expect(mockPaymentMethodFormRef.validate).toHaveBeenCalled();
|
|
100
|
+
expect(mockBillingFormRef.getValues).toHaveBeenCalled();
|
|
101
|
+
expect(mockPaymentMethodFormRef.tokenize).toHaveBeenCalledWith(mockComponent.clientId, { email: mockComponent.email, name: 'John Doe' }, mockComponent.accountId);
|
|
102
|
+
expect(mockEmitter.emit).toHaveBeenCalledWith({ token: 'abc123' });
|
|
103
|
+
});
|
|
104
|
+
// Event Testing
|
|
105
|
+
it('should fire the "submitted" event with correct data when the form is submitted', async () => {
|
|
106
|
+
// Mock billingFormRef and paymentMethodFormRef
|
|
107
|
+
const mockBillingFormRef = {
|
|
108
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
109
|
+
getValues: jest.fn().mockResolvedValue({
|
|
110
|
+
name: 'John Doe',
|
|
111
|
+
address_line1: 'Address 1',
|
|
112
|
+
address_line2: 'Address 2',
|
|
113
|
+
address_city: 'City',
|
|
114
|
+
address_state: 'State',
|
|
115
|
+
address_postal_code: 'Postal Code',
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
const mockPaymentMethodFormRef = {
|
|
119
|
+
validate: jest.fn().mockResolvedValue({ isValid: true }),
|
|
120
|
+
tokenize: jest.fn().mockResolvedValue({ token: 'abc123' }),
|
|
121
|
+
};
|
|
122
|
+
// Mock component
|
|
123
|
+
const mockComponent = new PaymentForm();
|
|
124
|
+
mockComponent.email = 'john@example.com'; // set email prop
|
|
125
|
+
// Cast to any to bypass type checker and directly set private properties
|
|
126
|
+
mockComponent.billingFormRef = mockBillingFormRef;
|
|
127
|
+
mockComponent.paymentMethodFormRef = mockPaymentMethodFormRef;
|
|
128
|
+
// Mock event
|
|
129
|
+
const mockEvent = { preventDefault: jest.fn() };
|
|
130
|
+
// Mock event emitter
|
|
131
|
+
const mockEmitter = { emit: jest.fn() };
|
|
132
|
+
mockComponent.submitted = mockEmitter;
|
|
133
|
+
// Call submit method
|
|
134
|
+
await mockComponent.submit(mockEvent);
|
|
135
|
+
// Define expected payload
|
|
136
|
+
const expectedPayload = { token: 'abc123' };
|
|
137
|
+
// Expectations
|
|
138
|
+
expect(mockEmitter.emit).toHaveBeenCalledWith(expectedPayload);
|
|
139
|
+
});
|
|
140
|
+
// Render Testing
|
|
141
|
+
it('should correctly render the child components based on the given props and state', async () => {
|
|
142
|
+
// Set up new PaymentForm with specific props and state
|
|
143
|
+
const component = new PaymentForm();
|
|
144
|
+
component.bankAccount = true;
|
|
145
|
+
component.card = true;
|
|
146
|
+
component.email = 'test@test.com';
|
|
147
|
+
component.iframeOrigin = 'https://example.com';
|
|
148
|
+
component.clientId = 'abc123';
|
|
149
|
+
component.accountId = 'def456';
|
|
150
|
+
component.submitButtonText = 'Submit';
|
|
151
|
+
// Cast to any to bypass type checker and directly set private properties
|
|
152
|
+
component.submitButtonEnabled = true;
|
|
153
|
+
component.selectedPaymentMethodType = PaymentMethodTypes.card;
|
|
154
|
+
component.allowedPaymentMethodTypes = [PaymentMethodTypes.card, PaymentMethodTypes.bankAccount];
|
|
155
|
+
// Render the component
|
|
156
|
+
const { root } = await newSpecPage({
|
|
157
|
+
components: [PaymentForm],
|
|
158
|
+
html: '<justifi-payment-form payment-method-form-type="card" iframe-origin="https://example.com"></justifi-payment-form>',
|
|
159
|
+
});
|
|
160
|
+
// Assert that the rendered output is correct
|
|
161
|
+
expect(root).toEqualHtml(`
|
|
162
|
+
<justifi-payment-form iframe-origin="https://example.com" payment-method-form-type="card">
|
|
163
|
+
<mock:shadow-root>
|
|
164
|
+
<form class="gy-3 row">
|
|
165
|
+
<div class="col-12">
|
|
166
|
+
<justifi-payment-method-form iframe-origin="https://example.com" payment-method-form-type="card"></justifi-payment-method-form>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="col-12">
|
|
169
|
+
<justifi-billing-form legend="Billing Info"></justifi-billing-form>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="col-12">
|
|
172
|
+
<button class="btn btn-primary jfi-submit-button" type="submit">
|
|
173
|
+
Submit
|
|
174
|
+
</button>
|
|
175
|
+
</div>
|
|
176
|
+
</form>
|
|
177
|
+
</mock:shadow-root>
|
|
178
|
+
</justifi-payment-form>
|
|
179
|
+
`);
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
//# sourceMappingURL=payment-form.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-form.spec.js","sourceRoot":"","sources":["../../../../../src/components/payment-form/test/payment-form.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;EACpC,gBAAgB;EAChB,EAAE,CAAC,yHAAyH,EAAE,KAAK,IAAI,EAAE;IACvI,kBAAkB;IAClB,MAAM,aAAa,GAAG,IAAI,WAAW,EAAE,CAAC;IACxC,aAAa,CAAC,WAAW,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC;IAE1B,8BAA8B;IAC9B,aAAa,CAAC,iBAAiB,EAAE,CAAC;IAElC,aAAa;IACb,MAAM,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,CAAC,WAAW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UAAU,EAAE,CAAC,WAAW,CAAC;MACzB,IAAI,EAAE,mHAAmH;KAC1H,CAAC,CAAC;IAEH,6CAA6C;IAC7C,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;KAkBxB,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { PaymentForm } from '../payment-form';\nimport { PaymentMethodTypes } from '../../../api';\nimport { BillingFormFields } from '../../billing-form/billing-form-schema';\n\ndescribe('justifi-payment-form', () => {\n // State Testing\n it('should update allowedPaymentMethodTypes and selectedPaymentMethodType state correctly when connectedCallback is invoked', async () => {\n // Mock properties\n const mockComponent = new PaymentForm();\n mockComponent.bankAccount = true;\n mockComponent.card = true;\n\n // Invoke the lifecycle method\n mockComponent.connectedCallback();\n\n // Assertions\n expect(mockComponent.allowedPaymentMethodTypes).toEqual([PaymentMethodTypes.card, PaymentMethodTypes.bankAccount]);\n expect(mockComponent.selectedPaymentMethodType).toBe(PaymentMethodTypes.card);\n });\n\n it('should update submitButtonEnabled state when enableSubmitButton method is called', async () => {\n // Mock component\n const mockComponent = new PaymentForm();\n mockComponent.submitButtonEnabled = false;\n\n // Call the method\n await mockComponent.enableSubmitButton();\n\n // Assertion\n expect(mockComponent.submitButtonEnabled).toBe(true);\n });\n\n it('should update selectedPaymentMethodType when paymentMethodSelected event is fired', async () => {\n // Mock component\n const mockComponent = new PaymentForm();\n mockComponent.selectedPaymentMethodType = PaymentMethodTypes.card;\n\n // Define the event details\n const detail = PaymentMethodTypes.bankAccount;\n const event = new CustomEvent('paymentMethodSelected', { detail });\n\n // Simulate the event\n mockComponent.paymentMethodSelectedHandler(event);\n\n // Assertion\n expect(mockComponent.selectedPaymentMethodType).toBe(PaymentMethodTypes.bankAccount);\n });\n\n // Props Testing\n it('should have the expected default properties', () => {\n const paymentForm = new PaymentForm();\n\n // Assert that the properties exist and have the expected default values\n expect(paymentForm).toHaveProperty('bankAccount', undefined);\n expect(paymentForm).toHaveProperty('card', undefined);\n expect(paymentForm).toHaveProperty('email', undefined);\n expect(paymentForm).toHaveProperty('iframeOrigin', undefined);\n expect(paymentForm).toHaveProperty('clientId', undefined);\n expect(paymentForm).toHaveProperty('accountId', undefined);\n expect(paymentForm).toHaveProperty('submitButtonText', undefined);\n });\n\n // Method Testing\n it('should correctly fill billing form when fillBillingForm method is called', async () => {\n // Mock child component\n const mockBillingFormRef = {\n fill: jest.fn(),\n };\n\n // Mock component\n const mockComponent = new PaymentForm();\n\n // Cast to any to bypass type checker and directly set private property\n (mockComponent as any).billingFormRef = mockBillingFormRef;\n\n // Define the fields to fill the billing form\n const fields: BillingFormFields = {\n name: 'John Doe',\n address_line1: '123 Main St',\n address_line2: 'Apt 4B',\n address_city: 'Townsville',\n address_state: 'TS',\n address_postal_code: '12345',\n };\n\n // Call the method\n await mockComponent.fillBillingForm(fields);\n\n // Check that the child component's fill method was called with the correct arguments\n expect(mockBillingFormRef.fill).toHaveBeenCalledWith(fields);\n });\n\n it('should submit the form correctly and trigger the \"submitted\" event with the correct payload when submit method is called', async () => {\n // Mock billingFormRef and paymentMethodFormRef\n const mockBillingFormRef = {\n validate: jest.fn().mockResolvedValue({ isValid: true }),\n getValues: jest.fn().mockResolvedValue({ name: 'John Doe' }),\n };\n\n const mockPaymentMethodFormRef = {\n validate: jest.fn().mockResolvedValue({ isValid: true }),\n tokenize: jest.fn().mockResolvedValue({ token: 'abc123' }),\n };\n\n // Mock component\n const mockComponent = new PaymentForm();\n\n // Cast to any to bypass type checker and directly set private properties\n (mockComponent as any).billingFormRef = mockBillingFormRef;\n (mockComponent as any).paymentMethodFormRef = mockPaymentMethodFormRef;\n\n // Mock event\n const mockEvent = { preventDefault: jest.fn() };\n\n // Mock event emitter\n const mockEmitter = { emit: jest.fn() };\n mockComponent.submitted = mockEmitter as any;\n\n // Call submit method\n await mockComponent.submit(mockEvent);\n\n // Expectations\n expect(mockEvent.preventDefault).toHaveBeenCalled();\n expect(mockBillingFormRef.validate).toHaveBeenCalled();\n expect(mockPaymentMethodFormRef.validate).toHaveBeenCalled();\n expect(mockBillingFormRef.getValues).toHaveBeenCalled();\n expect(mockPaymentMethodFormRef.tokenize).toHaveBeenCalledWith(mockComponent.clientId, { email: mockComponent.email, name: 'John Doe' }, mockComponent.accountId);\n expect(mockEmitter.emit).toHaveBeenCalledWith({ token: 'abc123' });\n });\n\n // Event Testing\n it('should fire the \"submitted\" event with correct data when the form is submitted', async () => {\n // Mock billingFormRef and paymentMethodFormRef\n const mockBillingFormRef = {\n validate: jest.fn().mockResolvedValue({ isValid: true }),\n getValues: jest.fn().mockResolvedValue({\n name: 'John Doe',\n address_line1: 'Address 1',\n address_line2: 'Address 2',\n address_city: 'City',\n address_state: 'State',\n address_postal_code: 'Postal Code',\n }),\n };\n\n const mockPaymentMethodFormRef = {\n validate: jest.fn().mockResolvedValue({ isValid: true }),\n tokenize: jest.fn().mockResolvedValue({ token: 'abc123' }),\n };\n\n // Mock component\n const mockComponent = new PaymentForm();\n mockComponent.email = 'john@example.com'; // set email prop\n\n // Cast to any to bypass type checker and directly set private properties\n (mockComponent as any).billingFormRef = mockBillingFormRef;\n (mockComponent as any).paymentMethodFormRef = mockPaymentMethodFormRef;\n\n // Mock event\n const mockEvent = { preventDefault: jest.fn() };\n\n // Mock event emitter\n const mockEmitter = { emit: jest.fn() };\n mockComponent.submitted = mockEmitter as any;\n\n // Call submit method\n await mockComponent.submit(mockEvent);\n\n // Define expected payload\n const expectedPayload = { token: 'abc123' };\n\n // Expectations\n expect(mockEmitter.emit).toHaveBeenCalledWith(expectedPayload);\n });\n\n // Render Testing\n it('should correctly render the child components based on the given props and state', async () => {\n // Set up new PaymentForm with specific props and state\n const component = new PaymentForm();\n component.bankAccount = true;\n component.card = true;\n component.email = 'test@test.com';\n component.iframeOrigin = 'https://example.com';\n component.clientId = 'abc123';\n component.accountId = 'def456';\n component.submitButtonText = 'Submit';\n\n // Cast to any to bypass type checker and directly set private properties\n (component as any).submitButtonEnabled = true;\n (component as any).selectedPaymentMethodType = PaymentMethodTypes.card;\n (component as any).allowedPaymentMethodTypes = [PaymentMethodTypes.card, PaymentMethodTypes.bankAccount];\n\n // Render the component\n const { root } = await newSpecPage({\n components: [PaymentForm],\n html: '<justifi-payment-form payment-method-form-type=\"card\" iframe-origin=\"https://example.com\"></justifi-payment-form>',\n });\n\n // Assert that the rendered output is correct\n expect(root).toEqualHtml(`\n <justifi-payment-form iframe-origin=\"https://example.com\" payment-method-form-type=\"card\">\n <mock:shadow-root>\n <form class=\"gy-3 row\">\n <div class=\"col-12\">\n <justifi-payment-method-form iframe-origin=\"https://example.com\" payment-method-form-type=\"card\"></justifi-payment-method-form>\n </div>\n <div class=\"col-12\">\n <justifi-billing-form legend=\"Billing Info\"></justifi-billing-form>\n </div>\n <div class=\"col-12\">\n <button class=\"btn btn-primary jfi-submit-button\" type=\"submit\">\n Submit\n </button>\n </div>\n </form>\n </mock:shadow-root>\n </justifi-payment-form>\n `);\n });\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenize.js","sourceRoot":"","sources":["../../../../src/components/payment-form/tokenize.ts"],"names":[],"mappings":"","sourcesContent":["export interface TokenizeArguments {\n clientId: string;\n paymentMethodData: any;\n accountId?: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-computed-theme.js","sourceRoot":"","sources":["../../../../src/components/payment-method-form/get-computed-theme.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAG,GAAG,EAAE;EAC5B,MAAM,cAAc,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;EAEvD,MAAM,aAAa,GAAU;IAC3B,MAAM,EAAE;MACN,OAAO,EAAE,cAAc,CAAC,gBAAgB,CAAC,sBAAsB,CAAC;MAChE,4BAA4B,EAAE,cAAc,CAAC,gBAAgB,CAAC,qCAAqC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C;MAC7E,UAAU,EAAE,cAAc,CAAC,gBAAgB,CAAC,gCAAgC,CAAC;MAC7E,MAAM,EAAE,cAAc,CAAC,gBAAgB,CAAC,2BAA2B,CAAC;MACpE,OAAO,EAAE,cAAc,CAAC,gBAAgB,CAAC,4BAA4B,CAAC;KACvE;IACD,SAAS,EAAE;MACT,KAAK,EAAE,cAAc,CAAC,gBAAgB,CAAC,wBAAwB,CAAC;MAChE,UAAU,EAAE,cAAc,CAAC,gBAAgB,CAAC,8BAA8B,CAAC;MAC3E,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAAC,4BAA4B,CAAC;MACvE,UAAU,EAAE,cAAc,CAAC,gBAAgB,CAAC,8BAA8B,CAAC;MAC3E,MAAM,EAAE,cAAc,CAAC,gBAAgB,CAAC,yBAAyB,CAAC;KACnE;IACD,YAAY,EAAE;MACZ,KAAK,EAAE,cAAc,CAAC,gBAAgB,CAAC,2BAA2B,CAAC;MACnE,MAAM,EAAE,cAAc,CAAC,gBAAgB,CAAC,4BAA4B,CAAC;MACrE,QAAQ,EAAE,cAAc,CAAC,gBAAgB,CAAC,+BAA+B,CAAC;KAC3E;GACF,CAAC;EAEF,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import { Theme } from './theme';\n\nconst getComputedTheme = () => {\n const computedStyles = getComputedStyle(document.body);\n\n const computedTheme: Theme = {\n layout: {\n padding: computedStyles.getPropertyValue('--jfi-layout-padding'),\n formControlSpacingHorizontal: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-x'),\n formControlSpacingVertical: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-y'),\n },\n formControl: {\n backgroundColor: computedStyles.getPropertyValue('--jfi-form-control-background-color'),\n borderColor: computedStyles.getPropertyValue('--jfi-form-control-border-color'),\n borderColorFocus: computedStyles.getPropertyValue('--jfi-form-control-border-color-focus'),\n borderColorError: computedStyles.getPropertyValue('--jfi-form-control-border-color-error'),\n borderWidth: computedStyles.getPropertyValue('--jfi-form-control-border-width'),\n borderBottomWidth: computedStyles.getPropertyValue('--jfi-form-control-border-bottom-width'),\n borderLeftWidth: computedStyles.getPropertyValue('--jfi-form-control-border-left-width'),\n borderRightWidth: computedStyles.getPropertyValue('--jfi-form-control-border-right-width'),\n borderTopWidth: computedStyles.getPropertyValue('--jfi-form-control-border-top-width'),\n borderRadius: computedStyles.getPropertyValue('--jfi-form-control-border-radius'),\n borderStyle: computedStyles.getPropertyValue('--jfi-form-control-border-style'),\n boxShadow: computedStyles.getPropertyValue('--jfi-form-control-box-shadow'),\n boxShadowError: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error'),\n boxShadowErrorFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error-focus'),\n boxShadowFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-focus'),\n color: computedStyles.getPropertyValue('--jfi-form-control-color'),\n colorFocus: computedStyles.getPropertyValue('--jfi-form-control-color-focus'),\n fontSize: computedStyles.getPropertyValue('--jfi-form-control-font-size'),\n fontWeight: computedStyles.getPropertyValue('--jfi-form-control-font-weight'),\n lineHeight: computedStyles.getPropertyValue('--jfi-form-control-line-height'),\n margin: computedStyles.getPropertyValue('--jfi-form-control-margin'),\n padding: computedStyles.getPropertyValue('--jfi-form-control-padding'),\n },\n formLabel: {\n color: computedStyles.getPropertyValue('--jfi-form-label-color'),\n fontFamily: computedStyles.getPropertyValue('--jfi-form-label-font-family'),\n fontSize: computedStyles.getPropertyValue('--jfi-form-label-font-size'),\n fontWeight: computedStyles.getPropertyValue('--jfi-form-label-font-weight'),\n margin: computedStyles.getPropertyValue('--jfi-form-label-margin'),\n },\n errorMessage: {\n color: computedStyles.getPropertyValue('--jfi-error-message-color'),\n margin: computedStyles.getPropertyValue('--jfi-error-message-margin'),\n fontSize: computedStyles.getPropertyValue('--jfi-error-message-font-size'),\n },\n };\n\n return computedTheme;\n};\n\nexport default getComputedTheme;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-event-types.js","sourceRoot":"","sources":["../../../../src/components/payment-method-form/message-event-types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;EAC9B,IAAI,EAAE;IACJ,KAAK,EAAE,oBAAoB;IAC3B,QAAQ,EAAE,uBAAuB;IACjC,QAAQ,EAAE,uBAAuB;IACjC,MAAM,EAAE,qBAAqB;IAC7B,cAAc,EAAE,6BAA6B;GAC9C;EACD,WAAW,EAAE;IACX,KAAK,EAAE,2BAA2B;IAClC,QAAQ,EAAE,8BAA8B;IACxC,QAAQ,EAAE,8BAA8B;IACxC,MAAM,EAAE,4BAA4B;IACpC,cAAc,EAAE,oCAAoC;GACrD;CACF,CAAC","sourcesContent":["export const MessageEventType = {\n card: {\n ready: 'justifi.card.ready',\n tokenize: 'justifi.card.tokenize',\n validate: 'justifi.card.validate',\n resize: 'justifi.card.resize',\n styleOverrides: 'justifi.card.styleOverrides',\n },\n bankAccount: {\n ready: 'justifi.bankAccount.ready',\n tokenize: 'justifi.bankAccount.tokenize',\n validate: 'justifi.bankAccount.validate',\n resize: 'justifi.bankAccount.resize',\n styleOverrides: 'justifi.bankAccount.styleOverrides',\n },\n};\n"]}
|
|
@@ -77,8 +77,7 @@ export class PaymentMethodForm {
|
|
|
77
77
|
return queryParams.join('');
|
|
78
78
|
}
|
|
79
79
|
getIframeSrc() {
|
|
80
|
-
const
|
|
81
|
-
const iframeOrigin = this.iframeOrigin || productionIframeOrigin;
|
|
80
|
+
const iframeOrigin = process.env.IFRAME_ORIGIN;
|
|
82
81
|
let iframeSrc = `${iframeOrigin}/${this.paymentMethodFormType}`;
|
|
83
82
|
let paramsList = [];
|
|
84
83
|
if (this.paymentMethodFormValidationMode) {
|
|
@@ -263,3 +262,4 @@ export class PaymentMethodForm {
|
|
|
263
262
|
};
|
|
264
263
|
}
|
|
265
264
|
}
|
|
265
|
+
//# sourceMappingURL=payment-method-form.js.map
|