@justifi/webcomponents 6.7.1 → 6.7.2

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.
Files changed (160) hide show
  1. package/dist/cjs/{check-pkg-version-cLAIX_H6.js → check-pkg-version-BG-Rfkh5.js} +1 -1
  2. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  3. package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +9 -7
  4. package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +5 -4
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-refund-payment.cjs.entry.js +98 -6
  21. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/{package-C9E_BIbT.js → package-Df5lTFe6.js} +1 -1
  26. package/dist/cjs/webcomponents.cjs.js +1 -1
  27. package/dist/collection/actions/void/void-actions.js +31 -0
  28. package/dist/collection/api/services/void.service.js +9 -0
  29. package/dist/collection/components/modular-checkout/modular-checkout.js +3 -2
  30. package/dist/collection/components/modular-checkout/sub-components/bank-account.js +6 -3
  31. package/dist/collection/components/modular-checkout/sub-components/card-form.js +6 -3
  32. package/dist/collection/components/refund-payment/refund-payment.js +66 -10
  33. package/dist/docs.json +15 -10
  34. package/dist/esm/{check-pkg-version-o2X_8wJ4.js → check-pkg-version-c_8fDHCB.js} +1 -1
  35. package/dist/esm/hidden-input_2.entry.js +1 -1
  36. package/dist/esm/internal-tokenize-payment-method_7.entry.js +9 -7
  37. package/dist/esm/justifi-apple-pay_8.entry.js +5 -4
  38. package/dist/esm/justifi-business-details.entry.js +2 -2
  39. package/dist/esm/justifi-business-form.entry.js +2 -2
  40. package/dist/esm/justifi-checkout.entry.js +2 -2
  41. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  42. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  43. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  44. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  45. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  46. package/dist/esm/justifi-payment-details.entry.js +2 -2
  47. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  48. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  49. package/dist/esm/justifi-payments-list.entry.js +2 -2
  50. package/dist/esm/justifi-payout-details.entry.js +2 -2
  51. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  52. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  53. package/dist/esm/justifi-refund-payment.entry.js +98 -6
  54. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  55. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  56. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  57. package/dist/esm/loader.js +1 -1
  58. package/dist/esm/{package-Dr8Z8wfP.js → package-BzT9OxlN.js} +1 -1
  59. package/dist/esm/webcomponents.js +1 -1
  60. package/dist/module/bank-account-form.js +1 -1
  61. package/dist/module/bank-account.js +5 -2
  62. package/dist/module/card-form.js +1 -1
  63. package/dist/module/card-form2.js +5 -2
  64. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  65. package/dist/module/justifi-payment-transactions-list.js +1 -1
  66. package/dist/module/justifi-payments-list-filters.js +1 -1
  67. package/dist/module/justifi-payout-transactions-list.js +1 -1
  68. package/dist/module/justifi-payouts-list-filters.js +1 -1
  69. package/dist/module/justifi-refund-payment.js +97 -4
  70. package/dist/module/justifi-terminal-orders-list-filters.js +1 -1
  71. package/dist/module/modular-checkout.js +3 -2
  72. package/dist/module/package.js +1 -1
  73. package/dist/module/payments-list-core2.js +1 -1
  74. package/dist/module/payout-details-core2.js +1 -1
  75. package/dist/module/payouts-list-core2.js +1 -1
  76. package/dist/module/terminal-orders-list-core2.js +1 -1
  77. package/dist/module/utils2.js +1 -1
  78. package/dist/types/actions/void/void-actions.d.ts +10 -0
  79. package/dist/types/api/services/void.service.d.ts +7 -0
  80. package/dist/types/components/modular-checkout/sub-components/bank-account.d.ts +1 -0
  81. package/dist/types/components/modular-checkout/sub-components/card-form.d.ts +1 -0
  82. package/dist/types/components/refund-payment/refund-payment.d.ts +6 -2
  83. package/dist/types/components.d.ts +3 -3
  84. package/dist/webcomponents/{p-4dc358aa.entry.js → p-035a4adc.entry.js} +1 -1
  85. package/dist/webcomponents/{p-e2d33311.entry.js → p-0935600b.entry.js} +1 -1
  86. package/dist/webcomponents/{p-c8a5a2a9.entry.js → p-0ab9a3ae.entry.js} +1 -1
  87. package/dist/webcomponents/{p-BEu9YFnf.js → p-11wdbrqX.js} +1 -1
  88. package/dist/webcomponents/{p-cbd52897.entry.js → p-138ada4a.entry.js} +1 -1
  89. package/dist/webcomponents/{p-d5765545.entry.js → p-148d3327.entry.js} +1 -1
  90. package/dist/webcomponents/p-2cb9edad.entry.js +1 -0
  91. package/dist/webcomponents/{p-ad3a73af.entry.js → p-2d4a2d26.entry.js} +1 -1
  92. package/dist/webcomponents/p-3f14d0c4.entry.js +1 -0
  93. package/dist/webcomponents/{p-cc2a1c7c.entry.js → p-5c6727ae.entry.js} +1 -1
  94. package/dist/webcomponents/{p-3fbe8ac3.entry.js → p-622af881.entry.js} +1 -1
  95. package/dist/webcomponents/{p-062fcfd5.entry.js → p-64ebff16.entry.js} +1 -1
  96. package/dist/webcomponents/p-71577fa1.entry.js +1 -0
  97. package/dist/webcomponents/{p-3fb1cf2b.entry.js → p-7ec4838f.entry.js} +1 -1
  98. package/dist/webcomponents/p-BzT9OxlN.js +1 -0
  99. package/dist/webcomponents/{p-5a7207c0.entry.js → p-af7c219d.entry.js} +1 -1
  100. package/dist/webcomponents/{p-5e6f2128.entry.js → p-b752c5bc.entry.js} +1 -1
  101. package/dist/webcomponents/{p-8884e000.entry.js → p-bbff6196.entry.js} +1 -1
  102. package/dist/webcomponents/p-c0c36187.entry.js +1 -0
  103. package/dist/webcomponents/{p-262e4b23.entry.js → p-d077569e.entry.js} +1 -1
  104. package/dist/webcomponents/{p-abcb4945.entry.js → p-d7b1b7b5.entry.js} +1 -1
  105. package/dist/webcomponents/{p-7bb7aaca.entry.js → p-dc6c9c79.entry.js} +1 -1
  106. package/dist/webcomponents/p-ecbc83bf.entry.js +1 -0
  107. package/dist/webcomponents/{p-cf644e46.entry.js → p-f56d7b4c.entry.js} +1 -1
  108. package/dist/webcomponents/webcomponents.esm.js +1 -1
  109. package/docs/.eslintrc.cjs +17 -0
  110. package/docs/changelog/index.mdx +17 -0
  111. package/docs/entities/businessdetails/index.mdx +143 -0
  112. package/docs/entities/businessform/index.mdx +241 -0
  113. package/docs/entities/index.mdx +19 -0
  114. package/docs/entities/payment-provisioning/index.mdx +128 -0
  115. package/docs/frameworks/angular/index.mdx +112 -0
  116. package/docs/frameworks/index.mdx +18 -0
  117. package/docs/frameworks/react/index.mdx +125 -0
  118. package/docs/frameworks/vue/index.mdx +102 -0
  119. package/docs/helpers/PartsTable.js +50 -0
  120. package/docs/helpers/PropsTable.js +56 -0
  121. package/docs/helpers/index.ts +3 -0
  122. package/docs/helpers/version.js +32 -0
  123. package/docs/introduction/index.mdx +125 -0
  124. package/docs/merchant-tools/checkouts-list/index.mdx +97 -0
  125. package/docs/merchant-tools/gross-payments-chart/index.mdx +83 -0
  126. package/docs/merchant-tools/index.mdx +25 -0
  127. package/docs/merchant-tools/order-terminals/index.mdx +84 -0
  128. package/docs/merchant-tools/payment-details/index.mdx +132 -0
  129. package/docs/merchant-tools/payment-transactions-list/index.mdx +85 -0
  130. package/docs/merchant-tools/payments-list/index.mdx +109 -0
  131. package/docs/merchant-tools/payout-details/index.mdx +84 -0
  132. package/docs/merchant-tools/payout-transactions-list/index.mdx +84 -0
  133. package/docs/merchant-tools/payouts-list/index.mdx +92 -0
  134. package/docs/merchant-tools/terminal-orders-list/index.mdx +85 -0
  135. package/docs/merchant-tools/terminals-list/index.mdx +93 -0
  136. package/docs/modular-checkout/complete-examples/index.mdx +20 -0
  137. package/docs/modular-checkout/index.mdx +20 -0
  138. package/docs/modular-checkout/introduction/index.mdx +102 -0
  139. package/docs/modular-checkout/sub-components/apple-pay.mdx +106 -0
  140. package/docs/modular-checkout/sub-components/bank-account-form.mdx +167 -0
  141. package/docs/modular-checkout/sub-components/card-form.mdx +178 -0
  142. package/docs/modular-checkout/sub-components/index.mdx +23 -0
  143. package/docs/modular-checkout/sub-components/payment-method-options.mdx +87 -0
  144. package/docs/modular-checkout/sub-components/plaid-payment-method.mdx +158 -0
  145. package/docs/modular-checkout/sub-components/saved-payment-methods.mdx +183 -0
  146. package/docs/modular-checkout/sub-components/season-interruption-insurance.mdx +221 -0
  147. package/docs/modular-checkout/sub-components/sezzle-payment-method.mdx +183 -0
  148. package/docs/modular-checkout/sub-components/summary.mdx +111 -0
  149. package/docs/payment-facilitation/dispute-management/index.mdx +99 -0
  150. package/docs/payment-facilitation/index.mdx +21 -0
  151. package/docs/payment-facilitation/refund-payment/index.mdx +241 -0
  152. package/docs/payment-facilitation/tokenize-payment-method/index.mdx +350 -0
  153. package/docs/payment-facilitation/unified-fintech-checkout/342/204/242/index.mdx +150 -0
  154. package/package.json +21 -6
  155. package/dist/webcomponents/p-1df660a9.entry.js +0 -1
  156. package/dist/webcomponents/p-296bd0b6.entry.js +0 -1
  157. package/dist/webcomponents/p-Dr8Z8wfP.js +0 -1
  158. package/dist/webcomponents/p-ca0d1c6c.entry.js +0 -1
  159. package/dist/webcomponents/p-cc0c722c.entry.js +0 -1
  160. package/dist/webcomponents/p-def84700.entry.js +0 -1
@@ -0,0 +1,350 @@
1
+ ---
2
+ id: payment-facilitation/tokenize-payment-method/index
3
+ title: Tokenize Payment Method
4
+ description: Secure standalone card/bank tokenization form with built-in validation and iframe isolation.
5
+ sidebar_position: 1
6
+ ---
7
+
8
+ import {
9
+ PropsTable,
10
+ PartsTable,
11
+ getWebcomponentsVersion,
12
+ } from '@justifi/webcomponents/docs/helpers';
13
+
14
+ ## Overview
15
+
16
+ Component to render an entire form including a switch to use a credit card or bank account, a submit button and all fields required for proper use. This component can be used standalone or as part of the modular checkout system.
17
+
18
+ ## Usage
19
+
20
+ <pre><code className="language-html">{`<!DOCTYPE html>
21
+ <html dir="ltr" lang="en">
22
+
23
+ <head>
24
+ <meta charset="utf-8" />
25
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
26
+ <title>justifi-tokenize-payment-method</title>
27
+
28
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@${getWebcomponentsVersion()}/dist/webcomponents/webcomponents.esm.js"></script>
29
+
30
+ <script
31
+ nomodule
32
+ src="https://cdn.jsdelivr.net/npm/@justifi/webcomponents@${getWebcomponentsVersion()}/dist/webcomponents/webcomponents.js"
33
+ ></script>
34
+
35
+ <style>
36
+ ::part(font-family) {
37
+ font-family: georgia;
38
+ }
39
+
40
+ ::part(color) {
41
+ color: darkslategray;
42
+ }
43
+
44
+ ::part(background-color) {
45
+ background-color: transparent;
46
+ }
47
+
48
+ ::part(button) {
49
+ padding: 0.375rem 0.75rem;
50
+ font-size: 16px;
51
+ box-shadow: none;
52
+ border-radius: 0px;
53
+ line-height: 1.5;
54
+ text-transform: none;
55
+ }
56
+
57
+ ::part(button-disabled) {
58
+ opacity: 0.5;
59
+ }
60
+
61
+ ::part(input) {
62
+ border-color: #555;
63
+ border-width: 1px;
64
+ border-bottom-width: 1px;
65
+ border-left-width: 1px;
66
+ border-right-width: 1px;
67
+ border-top-width: 1px;
68
+ border-radius: 0;
69
+ border-style: solid;
70
+ box-shadow: none;
71
+ font-size: 1rem;
72
+ font-weight: normal;
73
+ line-height: 1.5;
74
+ padding: 0.375rem 0.75rem;
75
+ }
76
+
77
+ ::part(input-focused) {
78
+ border-color: #333;
79
+ box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.25);
80
+ }
81
+
82
+ ::part(input-invalid) {
83
+ border-color: #8a2a35;
84
+ box-shadow: 0 0 0 0.25rem rgba(244, 67, 54, 0.25);
85
+ }
86
+
87
+ ::part(input-invalid-and-focused) {
88
+ box-shadow: 0 0 0 0.25rem rgba(244, 67, 54, 0.25);
89
+ border-color: #8a2a35;
90
+ }
91
+
92
+ ::part(input-radio) {
93
+ background-color: #fff;
94
+ border-color: #333;
95
+ }
96
+
97
+ ::part(input-checkbox) {
98
+ border-color: #333;
99
+ }
100
+
101
+ ::part(input-checkbox-checked) {
102
+ background-color: #000;
103
+ border-color: #333;
104
+ }
105
+
106
+ ::part(input-checkbox-checked-focused) {
107
+ background-color: #000;
108
+ box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.25);
109
+ }
110
+
111
+ ::part(input-checkbox-focused) {
112
+ background-color: #fff;
113
+ box-shadow: 0 0 0 0.25rem rgba(0, 0, 0, 0.25);
114
+ }
115
+
116
+ ::part(button-primary) {
117
+ color: #333;
118
+ background-color: transparent;
119
+ border-color: #333;
120
+ }
121
+
122
+ ::part(button-primary):hover {
123
+ background-color: rgba(0, 0, 0, .05);
124
+ border-color: #333;
125
+ color: #333;
126
+ }
127
+
128
+ ::part(radio-list-item) {
129
+ border-bottom: 1px solid #ddd;
130
+ }
131
+
132
+ ::part(radio-list-item):hover {
133
+ background-color: #f9f9f9;
134
+ cursor: pointer;
135
+ }
136
+ </style>
137
+
138
+ </head>
139
+
140
+ <body>
141
+ <justifi-tokenize-payment-method
142
+ account-id="acc_123"
143
+ auth-token="authToken"
144
+ payment-method-group-id="pmg_123"
145
+ submit-button-text="Tokenize Payment Method"
146
+ />
147
+ </body>
148
+
149
+ <script>
150
+ const justifiTokenizePaymentMethod = document.querySelector("justifi-tokenize-payment-method");
151
+
152
+ // Handle successful tokenization
153
+ justifiTokenizePaymentMethod.addEventListener("submit-event", (event) => {
154
+ const response = event.detail.response;
155
+ console.log("Tokenization successful:", response);
156
+
157
+ if (response.token) {
158
+ console.log("Payment method token:", response.token);
159
+ }
160
+
161
+ if (response.data) {
162
+ console.log("Full payment method data:", response.data);
163
+ }
164
+ });
165
+
166
+ // Handle errors
167
+ justifiTokenizePaymentMethod.addEventListener("error-event", (event) => {
168
+ console.error("Tokenization error:", event.detail);
169
+ });
170
+
171
+ // External tokenize button (when built-in submit button is hidden)
172
+ document.getElementById("tokenize-button").addEventListener("click", async () => {
173
+ try {
174
+ const result = await justifiTokenizePaymentMethod.tokenizePaymentMethod();
175
+ console.log("External tokenization result:", result);
176
+ } catch (error) {
177
+ console.error("External tokenization failed:", error);
178
+ }
179
+ });
180
+
181
+ // Fill billing form programmatically
182
+ document.getElementById("fill-billing-form").addEventListener("click", async () => {
183
+ await justifiTokenizePaymentMethod.fillBillingForm({
184
+ name: "John Doe",
185
+ address_line1: "123 Main St",
186
+ address_line2: "Apt 1",
187
+ address_city: "Anytown",
188
+ address_state: "NY", // Use 2-letter state code
189
+ address_postal_code: "12345",
190
+ });
191
+ console.log("Billing form filled");
192
+ });
193
+
194
+ // Validate form
195
+ document.getElementById("validate-form").addEventListener("click", async () => {
196
+ const validation = await justifiTokenizePaymentMethod.validate();
197
+ console.log("Validation result:", validation);
198
+
199
+ if (validation.isValid) {
200
+ console.log("Form is valid!");
201
+ } else {
202
+ console.log("Form has errors:", validation.errors);
203
+ }
204
+ });
205
+
206
+ </script>
207
+
208
+ </html>`}</code></pre>
209
+
210
+ ## Props, Events & Methods
211
+
212
+ <div
213
+ dangerouslySetInnerHTML={{
214
+ __html: PropsTable([
215
+ {
216
+ name: 'account-id',
217
+ type: 'string',
218
+ required: true,
219
+ description:
220
+ 'Platform account that will own the resulting payment method.',
221
+ },
222
+ {
223
+ name: 'auth-token',
224
+ type: 'string',
225
+ required: true,
226
+ description:
227
+ 'Short-lived Web Component Token with `write:tokenize:account_id` scope.',
228
+ },
229
+ {
230
+ name: 'payment-method-group-id',
231
+ type: 'string',
232
+ description:
233
+ 'Optional grouping identifier that lets you preselect payment rails in Modular Checkout.',
234
+ },
235
+ {
236
+ name: 'hide-submit-button',
237
+ type: 'boolean',
238
+ defaultValue: 'false',
239
+ description:
240
+ 'Hides the internal CTA when hosting app handles submission.',
241
+ },
242
+ {
243
+ name: 'save-payment-method-label',
244
+ type: 'string',
245
+ description:
246
+ 'Overrides the checkbox label when allowing customers to store a card.',
247
+ },
248
+ {
249
+ name: 'locale',
250
+ type: 'string',
251
+ defaultValue: 'en-US',
252
+ description:
253
+ 'Controls localization of labels, placeholders, and currency formatting.',
254
+ },
255
+ {
256
+ name: 'theme',
257
+ type: 'string',
258
+ description:
259
+ 'Name of a predefined theme exported by JustiFi (optional).',
260
+ },
261
+ ]),
262
+ }}
263
+ />
264
+
265
+ ### Events
266
+
267
+ - `tokenized`: fires when a payment token is created; payload includes `payment_method_token` and metadata.
268
+ - `error`: fires if tokenization fails; payload includes `code`, `message`, and validation hints.
269
+
270
+ ### Public methods
271
+
272
+ 1. `tokenizePaymentMethod()` – programmatically trigger submission (returns a promise that resolves to a token payload).
273
+ 2. `fillBillingForm(partialBillingDetails)` – prefill customers' billing information from saved data.
274
+
275
+ ## Theming & Layout
276
+
277
+ - Hosted fields remain inside PCI-safe iframes, so styling focuses on the outer wrapper plus the `::part` hooks listed below.
278
+
279
+ <div
280
+ dangerouslySetInnerHTML={{
281
+ __html: PartsTable([
282
+ {
283
+ name: 'font-family',
284
+ description: 'Controls the font family for the component.',
285
+ },
286
+ {
287
+ name: 'color',
288
+ description: 'Controls the text color.',
289
+ },
290
+ {
291
+ name: 'background-color',
292
+ description: 'Controls the background color.',
293
+ },
294
+ {
295
+ name: 'button',
296
+ description: 'Button styles.',
297
+ },
298
+ {
299
+ name: 'button-disabled',
300
+ description: 'Disabled button styles.',
301
+ },
302
+ {
303
+ name: 'input',
304
+ description: 'Input field styles.',
305
+ },
306
+ {
307
+ name: 'input-focused',
308
+ description: 'Input styles when focused.',
309
+ },
310
+ {
311
+ name: 'input-invalid',
312
+ description: 'Input styles when invalid.',
313
+ },
314
+ {
315
+ name: 'input-invalid-and-focused',
316
+ description: 'Input styles when invalid and focused.',
317
+ },
318
+ {
319
+ name: 'input-radio',
320
+ description: 'Radio input styles.',
321
+ },
322
+ {
323
+ name: 'input-checkbox',
324
+ description: 'Checkbox input styles.',
325
+ },
326
+ {
327
+ name: 'input-checkbox-checked',
328
+ description: 'Checkbox input styles when checked.',
329
+ },
330
+ {
331
+ name: 'input-checkbox-checked-focused',
332
+ description: 'Checkbox input styles when checked and focused.',
333
+ },
334
+ {
335
+ name: 'input-checkbox-focused',
336
+ description: 'Checkbox input styles when focused.',
337
+ },
338
+ {
339
+ name: 'button-primary',
340
+ description: 'Primary button styles.',
341
+ },
342
+ {
343
+ name: 'radio-list-item',
344
+ description: 'Radio list item styles.',
345
+ },
346
+ ]),
347
+ }}
348
+ />
349
+
350
+ - Slots are not exposed (all inputs are encapsulated in PCI iframes), so styling relies on CSS variables and `::part` hooks for wrapper elements.
@@ -0,0 +1,150 @@
1
+ ---
2
+ id: payment-facilitation/unified-fintech-checkout™/index
3
+ title: Unified Fintech Checkout™
4
+ description: Unified Fintech Checkout™ component that orchestrates payment capture, verification, and confirmation states.
5
+ sidebar_position: 20
6
+ ---
7
+
8
+ import { PropsTable, PartsTable } from '@justifi/webcomponents/docs/helpers';
9
+
10
+ ## Overview
11
+
12
+ `<justifi-checkout>` renders a complete checkout experience: payment method entry, order summary, error handling, and confirmation states. Use it when you want a turnkey experience without composing Modular Checkout subcomponents manually.
13
+
14
+ ## Usage
15
+
16
+ <pre>
17
+ <code className="language-html">{`<justifi-checkout
18
+ account-id="acc_123"
19
+ auth-token="wct_checkout"
20
+ checkout-id="chk_456"
21
+ locale="en-US"
22
+ />`}</code>
23
+ </pre>
24
+
25
+ ## Props, Events & Methods
26
+
27
+ <div
28
+ dangerouslySetInnerHTML={{
29
+ __html: PropsTable([
30
+ {
31
+ name: 'account-id',
32
+ type: 'string',
33
+ required: true,
34
+ description:
35
+ 'Owning platform account; determines branding + permissions.',
36
+ },
37
+ {
38
+ name: 'auth-token',
39
+ type: 'string',
40
+ required: true,
41
+ description: 'Web Component Token with `write:checkout` scope.',
42
+ },
43
+ {
44
+ name: 'checkout-id',
45
+ type: 'string',
46
+ required: true,
47
+ description:
48
+ 'Server-generated checkout session controlling line items and totals.',
49
+ },
50
+ {
51
+ name: 'require-save-payment-method',
52
+ type: 'boolean',
53
+ defaultValue: 'false',
54
+ description:
55
+ 'When true, forces customers to save the payment method for future use.',
56
+ },
57
+ {
58
+ name: 'locale',
59
+ type: 'string',
60
+ defaultValue: 'en-US',
61
+ description:
62
+ 'Controls currency formatting, copy, and date presentation.',
63
+ },
64
+ ]),
65
+ }}
66
+ />
67
+
68
+ ### Events
69
+
70
+ - `completed`: Emits when payment succeeds; payload includes `checkout_id`, `payment_method_token`, and receipt data.
71
+ - `error`: Fires if payment processing fails; includes error codes for analytics.
72
+ - `step-changed`: Useful when you pipe analytics or breadcrumbs for multi-step flows.
73
+
74
+ ### Public methods
75
+
76
+ 1. `submit()` – Programmatically trigger the pay button (helpful if you hide the built-in CTA).
77
+ 2. `reset(checkoutId)` – Reload a different checkout session without re-mounting the component.
78
+
79
+ ## Theming & Layout
80
+
81
+ <div
82
+ dangerouslySetInnerHTML={{
83
+ __html: PartsTable([
84
+ {
85
+ name: 'font-family',
86
+ description: 'Controls the font family for the component.',
87
+ },
88
+ {
89
+ name: 'color',
90
+ description: 'Controls the text color.',
91
+ },
92
+ {
93
+ name: 'background-color',
94
+ description: 'Controls the background color.',
95
+ },
96
+ {
97
+ name: 'button',
98
+ description: 'Button styles.',
99
+ },
100
+ {
101
+ name: 'button-disabled',
102
+ description: 'Disabled button styles.',
103
+ },
104
+ {
105
+ name: 'input',
106
+ description: 'Input field styles.',
107
+ },
108
+ {
109
+ name: 'input-focused',
110
+ description: 'Input styles when focused.',
111
+ },
112
+ {
113
+ name: 'input-invalid',
114
+ description: 'Input styles when invalid.',
115
+ },
116
+ {
117
+ name: 'input-invalid-and-focused',
118
+ description: 'Input styles when invalid and focused.',
119
+ },
120
+ {
121
+ name: 'input-radio',
122
+ description: 'Radio input styles.',
123
+ },
124
+ {
125
+ name: 'input-checkbox',
126
+ description: 'Checkbox input styles.',
127
+ },
128
+ {
129
+ name: 'input-checkbox-checked',
130
+ description: 'Checkbox input styles when checked.',
131
+ },
132
+ {
133
+ name: 'input-checkbox-checked-focused',
134
+ description: 'Checkbox input styles when checked and focused.',
135
+ },
136
+ {
137
+ name: 'input-checkbox-focused',
138
+ description: 'Checkbox input styles when focused.',
139
+ },
140
+ {
141
+ name: 'button-primary',
142
+ description: 'Primary button styles.',
143
+ },
144
+ {
145
+ name: 'radio-list-item',
146
+ description: 'Radio list item styles.',
147
+ },
148
+ ]),
149
+ }}
150
+ />
package/package.json CHANGED
@@ -1,11 +1,24 @@
1
1
  {
2
2
  "name": "@justifi/webcomponents",
3
- "version": "6.7.1",
3
+ "version": "6.7.2",
4
4
  "description": "JustiFi Web Components",
5
5
  "collection": "dist/collection/collection-manifest.json",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/module/index.js",
8
8
  "types": "dist/types/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "require": "./dist/index.cjs.js",
13
+ "import": "./dist/module/index.js"
14
+ },
15
+ "./docs/*": "./docs/*",
16
+ "./docs/helpers": "./docs/helpers/index.ts",
17
+ "./docs/helpers/*": "./docs/helpers/*.js",
18
+ "./dist/module/*": "./dist/module/*.js",
19
+ "./dist/docs.json": "./dist/docs.json",
20
+ "./package.json": "./package.json"
21
+ },
9
22
  "repository": {
10
23
  "type": "git",
11
24
  "url": "git+https://github.com/justifi-tech/web-component-library.git"
@@ -15,7 +28,8 @@
15
28
  "registry": "https://registry.npmjs.org"
16
29
  },
17
30
  "files": [
18
- "dist/"
31
+ "dist/",
32
+ "docs/"
19
33
  ],
20
34
  "dependencies": {
21
35
  "@popperjs/core": "^2.11.8",
@@ -34,14 +48,14 @@
34
48
  },
35
49
  "devDependencies": {
36
50
  "@babel/preset-env": "^7.21.5",
37
- "@babel/preset-react": "^7.18.6",
38
51
  "@babel/preset-typescript": "^7.21.5",
52
+ "@eslint/eslintrc": "^3.3.1",
39
53
  "@rollup/plugin-replace": "^6.0.1",
40
54
  "@stencil/sass": "^3.0.1",
41
55
  "@types/jest": "29.5.14",
42
- "@types/react": "^19.0.12",
43
- "@types/react-dom": "^19.0.4",
44
56
  "dotenv": "^16.3.1",
57
+ "eslint": "^9.27.0",
58
+ "eslint-plugin-mdx": "^3.1.5",
45
59
  "jest": "^29.7.0",
46
60
  "jest-cli": "^29.7.0",
47
61
  "jest-environment-node": "^29.7.0",
@@ -58,6 +72,7 @@
58
72
  "generate": "stencil generate",
59
73
  "test": "TZ=utc stencil test --spec",
60
74
  "test:watch": "TZ=utc stencil test --spec --watchAll",
61
- "test:file": "stencil test --spec --watch --"
75
+ "test:file": "stencil test --spec --watch --",
76
+ "docs:lint": "eslint --ext .md,.mdx --config docs/.eslintrc.cjs docs"
62
77
  }
63
78
  }
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i,g as s,H as a}from"./p-DwYM91AU.js";import{S as r}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{c as n,J as d}from"./p-BEu9YFnf.js";import{w as o,c}from"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{a as h,C as l}from"./p-Cjcsf8ku.js";import{c as u}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{P as f}from"./p-DkoufM1t.js";import{S as m}from"./p-CsgUIrv8.js";import{B as b}from"./p-Ty7R7tsw.js";import{v as p}from"./p-sA8HBfkI.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";const y=class{constructor(i){t(this,i),this.radioClick=e(this,"radio-click"),this.checked=!1,this.hidden=!1,this.handleClick=()=>{this.radioClick.emit(this.value)}}render(){return i(r,{key:"1ae40f787970160e38b72f917bda96f480d2a890"},i("div",{key:"2130596c8294cc38365e6126806735da0f93ef4a",class:`radio-list-item p-3 ${this.class||""}`,part:p,onClick:this.handleClick,hidden:this.hidden},i("form-control-radio",{key:"7d5524f518430f2bfd1c9863f354318929353cfb",name:this.name,value:this.value,checked:this.checked,label:this.label,inputHandler:()=>null})))}},v={[f.NEW_BANK_ACCOUNT]:"New bank account",[f.NEW_CARD]:"New credit or debit card"},g="Payment form not ready",k="Validation error",w=class{constructor(i){t(this,i),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.computedHideSubmitButton=!1,this.isLoading=!1,this.submitButtonText="Submit"}paymentMethodsChanged(){this.setDefaultSelectedPaymentMethod()}connectedCallback(){this.setDefaultSelectedPaymentMethod(),this.setComputedHideSubmitButton()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup(),this.unsubscribeFromStore&&this.unsubscribeFromStore()}componentWillLoad(){n(),this.analytics=new d(this)}handleRadioClick(t){this.selectedPaymentMethod=t.detail,u.selectedPaymentMethod={type:t.detail}}async fillBillingForm(t){var e;null===(e=this.billingFormRef)||void 0===e||e.fill(t)}async tokenizePaymentMethod(t){null==t||t.preventDefault(),this.validateRequiredProps(),this.isLoading=!0;try{if(!(await this.validate()).isValid)return this.errorEvent.emit({errorCode:h.TOKENIZE_ERROR,message:k}),void(this.isLoading=!1);const t=await this.resolvePaymentMethod({isValid:!0});return t.error&&this.emitError({errorCode:t.error.code,message:t.error.message}),this.submitEvent.emit({response:t}),t}catch(t){const e=this.createErrorResponse(h.TOKENIZE_ERROR,t.message);return this.emitError({errorCode:h.TOKENIZE_ERROR,message:t.message}),this.submitEvent.emit({response:e}),e}finally{this.isLoading=!1}}async validate(){if(!this.areFormsReady())return{isValid:!1,errors:{general:g}};const[t,e]=await Promise.all([this.billingFormRef.validate(),this.paymentMethodFormRef.validate()]);return{isValid:t.isValid&&e.isValid,errors:Object.assign(Object.assign({},t.errors),e.errors)}}async tokenize(){try{const t=await this.billingFormRef.getValues(),e={clientId:this.authToken||u.authToken,account:this.accountId||u.accountId,paymentMethodMetadata:this.buildPaymentMethodMetadata(t)};return await this.paymentMethodFormRef.tokenize(e)}catch(t){return t}}validateRequiredProps(){this.authToken||u.authToken||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Auth token is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"}),this.accountId||u.accountId||this.emitError({errorCode:h.TOKENIZE_ERROR,message:"Account ID is required when using the tokenize-payment-method component not slotted in justifi-modular-checkout"})}setDefaultSelectedPaymentMethod(){this.selectedPaymentMethod||(this.disableCreditCard?this.disableBankAccount||(this.selectedPaymentMethod=f.NEW_BANK_ACCOUNT,u.selectedPaymentMethod={type:f.NEW_BANK_ACCOUNT}):(this.selectedPaymentMethod=f.NEW_CARD,u.selectedPaymentMethod={type:f.NEW_CARD}))}setComputedHideSubmitButton(){if(void 0!==this.hideSubmitButton)return void(this.computedHideSubmitButton=this.hideSubmitButton);const t=this.isSlottedWithinModularCheckout();this.computedHideSubmitButton=t}isSlottedWithinModularCheckout(){var t;let e=null===(t=this.host)||void 0===t?void 0:t.parentElement;for(;e;){if("JUSTIFI-MODULAR-CHECKOUT"===e.tagName)return!0;e=e.parentElement}return!1}get availablePaymentMethods(){const t=[];return this.disableCreditCard||t.push(f.NEW_CARD),this.disableBankAccount||t.push(f.NEW_BANK_ACCOUNT),t}areFormsReady(){return!(!this.billingFormRef||!this.paymentMethodFormRef)}emitError(t){this.errorEvent.emit(Object.assign(Object.assign({},t),{severity:l.ERROR}))}createErrorResponse(t,e){return{error:{code:t,message:e,decline_code:void 0}}}async resolvePaymentMethod(t){if(!this.areFormsReady())return this.createErrorResponse("form_not_ready",g);try{const e=await this.validate();if(!e.isValid||!t.isValid){const t=Object.values(e.errors)[0]||k;return{validationError:!0,error:{code:"validation_error",message:String(t),decline_code:void 0}}}return await this.performTokenization()}catch(t){return{error:t}}}async performTokenization(){var t,e;const i=await this.tokenize();if(i.error)return{error:i.error};const s=i.data;return{token:(null===(t=s.card)||void 0===t?void 0:t.token)||(null===(e=s.bank_account)||void 0===e?void 0:e.token),data:s}}buildPaymentMethodMetadata(t){return this.shouldSavePaymentMethod?Object.assign(Object.assign({},t),{payment_method_group_id:this.paymentMethodGroupID}):Object.assign({},t)}get paymentMethodGroupID(){return this.paymentMethodGroupId||u.paymentMethodGroupId}get shouldSavePaymentMethod(){return!(!this.paymentMethodGroupId&&!u.savePaymentMethod)}get shouldHideRadioInput(){return this.disableCreditCard||this.disableBankAccount}renderPaymentMethodOption(t){const e=this.selectedPaymentMethod===t&&void 0===u.selectedPaymentMethod.id;return i("div",{class:"payment-method"},i("justifi-radio-list-item",{name:"paymentMethodType",value:t,checked:e,label:v[t],hidden:this.shouldHideRadioInput}),e&&this.renderSelectedPaymentMethodForm(t))}renderSelectedPaymentMethodForm(t){return i("div",{class:"mt-4 pb-4"},this.renderPaymentMethodForm(t),i("div",{class:"mt-4"},i("justifi-billing-form",{ref:t=>this.billingFormRef=t,hideCardBillingForm:this.hideCardBillingForm,hideBankAccountBillingForm:this.hideBankAccountBillingForm,paymentMethodType:t})),i("div",{class:"mt-4"},i("justifi-save-new-payment-method",{hidden:!this.paymentMethodGroupID,label:this.savePaymentMethodLabel})))}renderPaymentMethodForm(t){return i(t===f.NEW_CARD?"justifi-card-form":"justifi-bank-account-form",{ref:t=>this.paymentMethodFormRef=t})}render(){return i(r,{key:"8017b0fe2b0e3045a097e30aadf6a54ed2c32e62"},i("form",{key:"c7b0ac690a66cfb693d28e7d0eabc93817de4659"},i("fieldset",{key:"fb29e26a4100985595c420024d2a5ff48c79043b"},i("div",{key:"589f51297059afda2e385281dcfeafd67fbd2268",class:"row gy-3"},i("div",{key:"bf067015fb3ff24e08501899e370f92dda774c2e",class:"col-12"},this.availablePaymentMethods.map((t=>this.renderPaymentMethodOption(t)))),i("div",{key:"28872ca9239e2f85cb83ad8e6f27dc10f84da151",class:"col-12"},i("justifi-button",{key:"1be3f46e34b42e69d065384dd195d7fdc09a0560",text:this.submitButtonText,variant:"primary",type:"submit",clickHandler:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button",hidden:this.computedHideSubmitButton}))))))}get host(){return s(this)}static get watchers(){return{disableCreditCard:["paymentMethodsChanged"],disableBankAccount:["paymentMethodsChanged"]}}},j=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"row mb-3"},i("div",{class:"col-12 align-content-end"},i(m,{height:"18px",width:"120px"}),i(m,{height:"36px"}))),i("div",{class:"row"},i("div",{class:"col-12 align-content-end"},i(m,{height:"18px",width:"110px"}),i(m,{height:"36px"}))))},C=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.accountNumberIframeElement,this.routingNumberIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.accountNumberIframeElement.validate(),e=await this.routingNumberIframeElement.validate();return t&&e}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.accountNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"0daa12da1ca699a05ca499425c4a37e4d913b2dd"},i(j,{key:"9d4ee0af94759d71d52130781401d322fcb5e397",isReady:this.isReady}),i("hidden-input",{key:"dc4ee0054cbc7acb214a1c410f8fd387677f92dc"}),i("div",{key:"b489311f205e0ffdaa4680621b706322bd3fc4ca",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"2d1b00b9705d1a94364f691d4ad705c339abbbce",class:"row mb-3"},i("iframe-input",{key:"21a66eb7d87b77c1ff1a1171a4cb84a4759853dd",inputId:"accountNumber",ref:t=>this.accountNumberIframeElement=t,label:"Account Number",iframeOrigin:`${this.iframeOrigin}/v2/accountNumber`})),i("div",{key:"1ff36d49f7304e203cdefea46010100ed750ed68",class:"row"},i("iframe-input",{key:"2211a638c875e504e7e25e0704788d7a437b5806",inputId:"routingNumber",ref:t=>this.routingNumberIframeElement=t,label:"Routing Number",iframeOrigin:`${this.iframeOrigin}/v2/routingNumber`}))))}},M=class{constructor(e){t(this,e)}get showSimpleCardBillingForm(){return this.paymentMethodType===f.NEW_CARD&&this.hideCardBillingForm}get showSimpleBankAccountBillingForm(){return this.paymentMethodType===f.NEW_BANK_ACCOUNT&&this.hideBankAccountBillingForm}async getValues(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.getValues()}async fill(t){var e;null===(e=this.selectedFormRef)||void 0===e||e.fill(t)}async validate(){var t;return null===(t=this.selectedFormRef)||void 0===t?void 0:t.validate()}render(){return i(a,null,i(this.showSimpleBankAccountBillingForm?"justifi-bank-account-billing-form-simple":this.showSimpleCardBillingForm?"justifi-card-billing-form-simple":"justifi-billing-form-full",{legend:this.legend,ref:t=>this.selectedFormRef=t}))}},x=class{constructor(e){t(this,e),this.variant="primary",this.type="button"}render(){return i(r,{key:"7c8b76c4eaa412f2dc2ba59fd56cb7c28f46656c"},i(b,{key:"9440f90ebb380703b35b6c5d811e5d0780e80fd2",variant:this.variant,isLoading:this.isLoading,clickHandler:this.clickHandler,class:this.class,type:this.type,disabled:this.disabled,style:this.customStyle},this.text))}},_=t=>{const{isReady:e}=t;return e?null:i("div",{class:"container-fluid p-0"},i("div",{class:"mb-3"},i(m,{height:"18px",width:"100px"}),i(m,{height:"36px"})),i("div",{class:"row"},i("div",{class:"col-4 align-content-end"},i(m,{height:"18px",width:"80px"}),i(m,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(m,{height:"36px"})),i("div",{class:"col-4 align-content-end"},i(m,{height:"18px",width:"30px"}),i(m,{height:"36px"}))))},P=class{constructor(e){t(this,e),this.isReady=!1}async componentWillLoad(){await o(),this.iframeOrigin=c.iframeOrigin,n(),this.analytics=new d(this)}componentDidRender(){Promise.all([this.cardNumberIframeElement,this.expirationMonthIframeElement,this.expirationYearIframeElement,this.cvvIframeElement].map((t=>new Promise((e=>{t.addEventListener("iframeLoaded",(()=>{e()}))}))))).then((()=>{this.isReady=!0}))}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}async validate(){const t=await this.cardNumberIframeElement.validate(),e=await this.expirationMonthIframeElement.validate(),i=await this.expirationYearIframeElement.validate(),s=await this.cvvIframeElement.validate();return t&&e&&i&&s}async tokenize({clientId:t,paymentMethodMetadata:e,account:i}){return this.cardNumberIframeElement.tokenize(t,e,i)}render(){return i(r,{key:"b0b07a928be767102b59ec93ab0df6296b8418af"},i(_,{key:"03d37e42253a905ece1e6a9b1d654e84665470d6",isReady:this.isReady}),i("hidden-input",{key:"62f657a6c0a4d5b7a7bbf809abeb42eba0d22345"}),i("div",{key:"874cac5eac376c8c4e12d99f760cd3cd487a6521",class:"container-fluid p-0",style:{opacity:this.isReady?"1":"0",height:this.isReady?"auto":"0"}},i("div",{key:"dcada2d72eebe506fe4cab8ad6eb959c551e9e2d",class:"mb-3"},i("iframe-input",{key:"7e784726f8dd0c8b35832646bc99e0d2131c08f9",inputId:"cardNumber",ref:t=>this.cardNumberIframeElement=t,label:"Card Number",iframeOrigin:`${this.iframeOrigin}/v2/cardNumber`})),i("div",{key:"2384099f3aa18b7d6bbc346f47ba9ff06e5b7e86",class:"row"},i("div",{key:"5fb523cd3f398894e5c7ee3e8a58d34581492410",class:"col-4 align-content-end"},i("iframe-input",{key:"a3b4aa06a5c85162d24e25a5261a9a2cc64a6b82",inputId:"expirationMonth",ref:t=>this.expirationMonthIframeElement=t,label:"Expiration",iframeOrigin:`${this.iframeOrigin}/v2/expirationMonth`})),i("div",{key:"3ccd6a19fce1c393a8c58534113239c518d51a4f",class:"col-4 align-content-end"},i("iframe-input",{key:"6d064b868c73b4431b476194602843b0f28729e0",inputId:"expirationYear",ref:t=>this.expirationYearIframeElement=t,label:"",iframeOrigin:`${this.iframeOrigin}/v2/expirationYear`})),i("div",{key:"26cd762bec43890e96ab5c6903943b0f4cfa9672",class:"col-4 align-content-end"},i("iframe-input",{key:"826dfe08347461bc5a94296b181826b70a7d1f6f",inputId:"CVV",ref:t=>this.cvvIframeElement=t,label:"CVV",iframeOrigin:`${this.iframeOrigin}/v2/CVV`})))))}},B=class{constructor(i){t(this,i),this.checkboxChanged=e(this,"checkboxChanged"),this.label="Save New Payment Method",this.isChecked=!1,this.handleCheckboxChange=(t,e)=>{this.isChecked=e,u.savePaymentMethod=e,this.checkboxChanged.emit(this.isChecked)}}render(){return i(r,{key:"7cc086e518b2defcea924398cd5957b44a893d94"},i("form-control-checkbox",{key:"523dd82fe06f0c0a6d259a84f320c0a335261232",label:this.label||"Save New Payment Method",name:"saveNewPaymentMethod",checked:this.isChecked,inputHandler:this.handleCheckboxChange}))}};export{w as internal_tokenize_payment_method,C as justifi_bank_account_form,M as justifi_billing_form,x as justifi_button,P as justifi_card_form,y as justifi_radio_list_item,B as justifi_save_new_payment_method}
@@ -1 +0,0 @@
1
- import{h as t,r as s,c as e}from"./p-DwYM91AU.js";import{c as r,a as i,F as o}from"./p-DiJD6Iqx.js";import{f as n}from"./p-B09GVew-.js";import"./p-tGDdRx0W.js";import{C as a,a as u}from"./p-Cjcsf8ku.js";import{R as l,l as m}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{B as h}from"./p-Ty7R7tsw.js";import{S as p}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{P as c}from"./p-DGGjRqDa.js";import{m as d}from"./p-DATDsXcA.js";import{c as f,J as v}from"./p-BEu9YFnf.js";import{g as j,a as y}from"./p-D2muobcE.js";import{A as b}from"./p-yyedWKWX.js";import{S as w}from"./p-CsgUIrv8.js";import"./p-BFTU3MAI.js";import"./p-HXpYMWUU.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-sA8HBfkI.js";import"./p-Dr8Z8wfP.js";const g=t=>{const s=+t;return i().required("Amount is required").test("max-amount",`Refund amount cannot be more than payment amount: ${n(s)}`,(function(t){return+t<=+s})).test("min-amount","Refund amount must be greater than 0",(function(t){return+t>0}))},A=t=>{if(t)return r({amount:g(t),description:i().optional(),reason:i().optional().oneOf([l.customerRequest,l.duplicate,l.fraudulent],"Select a reason")})},B=[{label:"Select a reason",value:""},{label:"Customer requested a refund",value:"customer_request"},{label:"Customer was double-charged",value:"duplicate"},{label:"Payment was reported as fraud",value:"fraudulent"}],R=b();class x{async postRefund(t,s,e,r){return R.post({endpoint:`payments/${t}/refunds`,headers:{"Sub-Account":s},body:r,authToken:e})}}const D=()=>t("div",{class:"row gap-3"},t("div",{class:"col-12"},t(w,{width:"100%",height:"40px"}))),T=()=>t(p,null,t("div",{class:"row gap-5"},t(D,null),t(D,null),t(D,null))),I=class{constructor(t){s(this,t),this.errorEvent=e(this,"error-event"),this.submitEvent=e(this,"submit-event"),this.refundPayload={},this.displayAmount="",this.errors={},this.paymentLoading=!0,this.refundLoading=!1,this.hideSubmitButton=!1,this.inputHandler=(t,s)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[t]:s}))}}componentWillLoad(){f(),this.analytics=new v(this),this.initializeApi(),this.formController=new o(A())}handleError(t,s,e){this.errorEvent.emit({errorCode:t,message:s,severity:e})}checkAmount(t){return t>0}handleInvalidAmount(){this.submitDisabled=!0,this.handleError(u.INVALID_REFUND_AMOUNT,"Refund amount must be greater than 0",a.ERROR)}initializeFormController(){const t=this.refundPayload.amount,s=t?t.toString():"0";this.formController=new o(A(s)),this.formController.setInitialValues({amount:s}),this.formController.values.subscribe((t=>{this.refundPayload=Object.assign({},t)})),this.formController.errors.subscribe((t=>{this.errors=Object.assign({},t)}))}initializeApi(){this.paymentId&&this.authToken?d({id:this.paymentId,authToken:this.authToken,service:new c})({onSuccess:({payment:t})=>{this.refundPayload=new m({amount:t.amount_refundable})},onError:({error:t,code:s,severity:e})=>{this.handleError(s,t,e)},final:()=>{this.checkAmount(this.refundPayload.amount)?this.initializeFormController():this.handleInvalidAmount(),this.paymentLoading=!1}}):this.handleError(u.MISSING_PROPS,"Payment ID and Auth Token are required",a.ERROR)}async refundPayment(t){if(t&&t.preventDefault(),!await this.formController.validate())return;const s=(({authToken:t,accountId:s,paymentId:e,service:r})=>async({refundBody:i,onSuccess:o,onError:n,final:u})=>{var l;try{const u=await r.postRefund(e,s,t,i);if(u.error)return n({error:y(u.error),code:j(null===(l=u.error)||void 0===l?void 0:l.code),severity:a.ERROR});o(u)}catch(t){const s=j(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:a.ERROR})}finally{return u()}})({authToken:this.authToken,accountId:this.accountId,paymentId:this.paymentId,service:new x}),e=this.formController.values.getValue();return this.refundLoading=!0,new Promise((t=>{let r;s({refundBody:e,onSuccess:t=>{r=t},onError:({error:t,code:s,severity:e})=>{r=t,this.handleError(t,s,e)},final:()=>{this.submitEvent.emit({response:r}),this.submitDisabled=!0,this.refundLoading=!1,t(r.data)}})}))}render(){if(this.paymentLoading)return t(T,null);const s=this.formController.getInitialValues(),e=this.refundPayload.amount;return t(p,null,t("form",null,t("fieldset",null,t("div",{class:"row gy-3"},t("div",{class:"col-12"},t("form-control-monetary",{name:"amount",label:"Refund Amount",defaultValue:s.amount,inputHandler:this.inputHandler,errorText:this.errors.amount})),t("div",{class:"col-12"},t("form-control-select",{name:"reason",label:"Reason for refund (optional)",defaultValue:s.reason,inputHandler:this.inputHandler,options:B,errorText:this.errors.reason})),t("div",{class:"col-12"},t("form-control-textarea",{name:"description",label:"Note (optional)",defaultValue:s.description,inputHandler:this.inputHandler,maxLength:250,errorText:this.errors.description})),t("div",{class:"form-group d-flex flex-row-reverse"},t(h,{variant:"primary",type:"submit",onClick:this.refundPayment.bind(this),isLoading:this.paymentLoading||this.refundLoading,hidden:this.hideSubmitButton,disabled:this.submitDisabled},`Refund ${n(+e)}`))))))}};export{I as justifi_refund_payment}
@@ -1 +0,0 @@
1
- var e={name:"@justifi/webcomponents",version:"6.7.1"};export{e as p}
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as r}from"./p-DwYM91AU.js";import{P as i}from"./p-DGGjRqDa.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as o,a as e}from"./p-Cjcsf8ku.js";import{P as p}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as n}from"./p-D2muobcE.js";import{c as m,J as c}from"./p-BEu9YFnf.js";import{S as h}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-RTAZ4tdd.js";import"./p-yyedWKWX.js";import"./p-B09GVew-.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-W9WWoLzT.js";import"./p-U3nU15el.js";import"./p-sA8HBfkI.js";const d=class{constructor(r){t(this,r),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=f,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){m(),this.analytics=new c(this),this.initializeGetPayments()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetPayments()}initializeGetPayments(){this.accountId&&this.authToken?this.getPayments=(({id:t,authToken:s,service:r})=>async({params:i,onSuccess:e,onError:m,final:c})=>{var h,f;try{const c=await r.fetchPayments(t,s,i);if(c.error)return m({error:n(c.error),code:a(null===(f=c.error)||void 0===f?void 0:f.code),severity:o.ERROR});{const t=Object.assign({},c.page_info);e({payments:(null===(h=c.data)||void 0===h?void 0:h.map((t=>new p(t))))||[],pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return m({error:t.message||t,code:s,severity:o.ERROR})}finally{return c()}})({id:this.accountId,authToken:this.authToken,service:new i}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:e.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}render(){return r(h,{key:"171935cc29253ff76262498183fd0f3a0f4a7eef"},r("payments-list-core",{key:"71be865f5035b6db46f4b97a3a36f08391de4f58",getPayments:this.getPayments,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{d as justifi_payments_list}
@@ -1 +0,0 @@
1
- import{r as t,c as s,h as i}from"./p-DwYM91AU.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{C as o,a as r}from"./p-Cjcsf8ku.js";import{C as e}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{g as a,a as c}from"./p-D2muobcE.js";import{c as p,J as n}from"./p-BEu9YFnf.js";import{C as h}from"./p-VRubcA-q.js";import{m as u,S as m}from"./p-C9VmfRis.js";import{S as d}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{d as f}from"./p-CBbwdoSa.js";import"./p-BYsgavgS.js";import"./p-B09GVew-.js";import"./p-DkoufM1t.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-U3nU15el.js";import"./p-sA8HBfkI.js";const j=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event"),this.errorMessage=null,this.columns=f,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)}}componentWillLoad(){p(),this.analytics=new n(this),this.initializeGetData()}disconnectedCallback(){var t;null===(t=this.analytics)||void 0===t||t.cleanup()}propChanged(){this.initializeGetData()}initializeGetData(){this.initializeGetCheckouts(),this.initializeGetSubAccounts()}initializeGetCheckouts(){this.accountId&&this.authToken?this.getCheckouts=(({accountId:t,authToken:s,service:i})=>async({params:r,onSuccess:p,onError:n})=>{var h,u;try{const m=await i.fetchCheckouts(t,s,r);if(m.error)return n({error:c(m.error),code:a(null===(u=m.error)||void 0===u?void 0:u.code),severity:o.ERROR});{const t=Object.assign({},m.page_info);p({checkouts:(null===(h=m.data)||void 0===h?void 0:h.map((t=>new e(t))))||[],pagingInfo:t})}}catch(t){const s=a(null==t?void 0:t.code);return n({error:t.message||t,code:s,severity:o.ERROR})}})({accountId:this.accountId,authToken:this.authToken,service:new h}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:r.MISSING_PROPS,message:this.errorMessage,severity:o.ERROR}))}initializeGetSubAccounts(){this.accountId&&this.authToken&&(this.getSubAccounts=u({accountId:this.accountId,authToken:this.authToken,service:new m}))}render(){return i(d,{key:"0e9e50e18983dad43cfab19f2271678d3f5e6abd"},i("checkouts-list-core",{key:"6f128cc756477ff64638625d9a9ff9a5b4533948",getCheckouts:this.getCheckouts,getSubAccounts:this.getSubAccounts,"onError-event":this.handleErrorEvent,columns:this.columns}))}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{j as justifi_checkouts_list}
@@ -1 +0,0 @@
1
- import{h as s,r as i,c as t}from"./p-DwYM91AU.js";import{ao as e,am as r,ai as o,G as l}from"./p-sA8HBfkI.js";import{S as d}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import{c as a,J as n}from"./p-BEu9YFnf.js";import{C as h,a as c}from"./p-Cjcsf8ku.js";import{B as u}from"./p-Dlrq1iZf.js";import{B as v}from"./p-B5rtFhtR.js";import{m as p}from"./p-sCHf--Vc.js";import{S as m}from"./p-CsgUIrv8.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import{k as f,j as w,b as g}from"./p-BrRsgB8S.js";import"./p-CLHwhyvu.js";import"./p-BH0Xfn-F.js";import{g as b,a as x}from"./p-D2muobcE.js";import{T as y}from"./p-CCxsFwC4.js";import{k as j}from"./p-B09GVew-.js";import"./p-Dr8Z8wfP.js";import"./p-yyedWKWX.js";import"./p-BYsgavgS.js";import"./p-DkoufM1t.js";const k=()=>s("div",{class:"row gap-3"},s("div",{class:"col-12"},s(m,{width:"25%"})),s("div",{class:"col-12"},s(m,{width:"100%"})),s("div",{class:"col-12 d-flex gap-3"},s(m,{width:"50%"}),s(m,{width:"50%"})),s("div",{class:"col-12 d-flex gap-3"},s(m,{width:"65%"}),s(m,{width:"35%"}))),S=()=>s("div",{class:"row gap-5"},s("div",{class:"col-12"},s(m,{width:"40%",height:"40px"})),s(k,null)),B=()=>s("div",{class:"terminal-selector-skeleton mt-4 rounded shadow-sm"},s("div",{class:"d-flex align-items-center gap-3"},s(m,{width:"125px",height:"125px",styles:{borderRadius:"8px"}}),s("div",{class:"flex-grow-1"},s("div",{class:"d-flex row flex-row"},s("div",{class:"col-6 flex-column"},s(m,null),s(m,{width:"60%"})),s("div",{class:"d-flex justify-content-end align-items-center gap-2 col-6"},s(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}),s(m,{width:"80px",height:"32px"}),s(m,{width:"32px",height:"32px",styles:{borderRadius:"50%"}}))),s("div",{class:"mt-4"},s("div",{class:"d-flex flex-column gap-2"},s(m,null),s(m,null)))))),C=class{constructor(s){i(this,s),this.errorEvent=t(this,"error-event"),this.submitted=t(this,"submit-event"),this.shipping=!1,this.submitButtonText="Submit Order",this.loading={business:!0,terminals:!0},this.submitting=!1,this.error=null,this.totalQuantity=0}componentWillLoad(){this.order=new w({business_id:this.businessId,sub_account_id:this.accountId,order_type:this.shipping?g.boardingShipping:g.boardingOnly}),a(),this.analytics=new n(this),this.loadData()}disconnectedCallback(){var s;null===(s=this.analytics)||void 0===s||s.cleanup()}handleError(s,i,t){this.error={message:s,code:i,severity:t},this.errorEvent.emit({errorCode:i,message:s,severity:t})}loadData(){this.businessId&&this.authToken?(this.initializeGetBusiness(),this.initializeGetTerminalModels()):this.handleError("Invalid business id or auth token",c.MISSING_PROPS,h.ERROR)}initializeGetBusiness(){p({id:this.businessId,authToken:this.authToken,service:new u})({onSuccess:({business:s})=>{this.business=new v(s),this.loading.business=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.loading.business=!1}})}initializeGetTerminalModels(){(({id:s,authToken:i,service:t})=>async({onSuccess:e,onError:r})=>{var o,l,d,a;try{const n=await t.fetchTerminalModels(s,i);if(n.error)return r({error:x(n.error),code:b(null===(a=n.error)||void 0===a?void 0:a.code),severity:h.ERROR});e({terminals:(null===(l=null===(o=n.data)||void 0===o?void 0:o.terminal_order_models)||void 0===l?void 0:l.map((s=>new f(s))))||[],orderLimit:null===(d=n.data)||void 0===d?void 0:d.order_limit})}catch(s){const i=b(null==s?void 0:s.code);return r({error:s.message||s,code:i,severity:h.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new y})({onSuccess:({terminals:s,orderLimit:i})=>{this.terminalModels=s,this.orderLimit=i,this.loading.terminals=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.loading.terminals=!1}})}submitOrder(){const s=(({authToken:s,service:i,apiOrigin:t="https://wc-proxy.justifi.ai"})=>async({terminalOrder:e,onSuccess:r,onError:o})=>{var l;try{const d=await i.orderTerminals(s,e,t);if(d.error)return o({error:x(d.error),code:b(null===(l=d.error)||void 0===l?void 0:l.code),severity:h.ERROR});{const{data:s}=d;r({data:s})}}catch(s){const i=b(null==s?void 0:s.code);return o({error:s.message||s,code:i,severity:h.ERROR})}})({authToken:this.authToken,service:new y});this.submitting=!0,s({terminalOrder:this.order.payload,onSuccess:({data:s})=>{this.submitted.emit(s),this.submitting=!1},onError:({error:s,code:i,severity:t})=>{this.handleError(s,i,t),this.submitting=!1}})}onSelectedQuantityChange(s){this.order.updateTerminal(s.detail.modelName,s.detail.quantity),this.totalQuantity=this.order.totalQuantity}renderLoading(){return s("div",null,this.loading.business&&s(S,null),this.loading.terminals&&s("div",{class:"mt-5"},s(B,null),s(B,null),s(B,null)))}renderBusinessDetails(){var i,t,o,l,d,a,n,h;if(!this.loading.business&&this.business)return s("div",{class:"d-flex flex-column gap-4 mb-5 pt-5"},s("div",{class:"row"},s("div",{class:"col-12"},s("h2",{part:r},this.business.legal_name))),s("div",{class:"row"},s("div",{class:"col-6"},s("h5",{part:e},"Representative:"),s("div",null,s("div",null,null===(t=null===(i=this.business)||void 0===i?void 0:i.representative)||void 0===t?void 0:t.name),s("div",null,null===(l=null===(o=this.business)||void 0===o?void 0:o.representative)||void 0===l?void 0:l.title),s("div",null,null===(a=null===(d=this.business)||void 0===d?void 0:d.representative)||void 0===a?void 0:a.email),s("div",null,j(null===(h=null===(n=this.business)||void 0===n?void 0:n.representative)||void 0===h?void 0:h.phone)))),s("div",{class:"col-6"},s("h5",{part:e},this.shipping?"Shipping Address:":"Business Address:"),s("div",null,this.business.legal_address.line1,this.business.legal_address.line2?`, ${this.business.legal_address.line2}`:"",s("br",null),this.business.legal_address.city,", ",this.business.legal_address.state," ",this.business.legal_address.postal_code))))}renderTerminals(){if(!this.loading.terminals&&this.terminalModels)return s("div",{class:"d-flex flex-column gap-2 mt-5"},this.terminalModels.map((i=>s("terminal-quantity-selector",{modelName:i.model_name,description:i.description,imageUrl:i.image_url,helpUrl:i.help_url,limit:this.orderLimit-this.order.totalQuantity,onSelectedQuantityChange:this.onSelectedQuantityChange.bind(this)}))))}renderOrderSection(){return s("div",{class:"mt-3"},s("div",{class:"text-end"},"Order limit: ",this.orderLimit),s("div",{class:"d-flex justify-content-end mt-3"},s("button",{class:"btn btn-primary submit-btn",onClick:this.submitOrder.bind(this),disabled:0===this.order.totalQuantity||this.submitting,part:o},this.submitting?"Submitting...":this.submitButtonText)))}render(){return s(d,{key:"aa60b46b6f455a6e925a835f1b558c88966b2a90"},s("div",{key:"33361446b5b2848a0d7d4af36ff54a3be76a5779",part:l},this.renderLoading(),this.renderBusinessDetails(),this.renderTerminals(),this.renderOrderSection()))}};export{C as justifi_order_terminals}