@justifi/webcomponents 4.8.3 → 4.10.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/dist/cjs/{Business-42d0c522.js → Business-79361c8a.js} +7 -7
  2. package/dist/cjs/Identity-b6364aee.js +27 -0
  3. package/dist/cjs/{Payout-44b49b2d.js → Payment-89a8bc21.js} +0 -43
  4. package/dist/cjs/Payout-a2dd7b01.js +45 -0
  5. package/dist/cjs/{SubAccount-2a803b22.js → SubAccount-b3902202.js} +1 -1
  6. package/dist/cjs/additional-questions-details_5.cjs.entry.js +24 -10
  7. package/dist/cjs/business-additional-questions-schema-cbac27f2.js +26 -0
  8. package/dist/cjs/business-details-core.cjs.entry.js +55 -0
  9. package/dist/cjs/business-form-select-options-7ccd8dca.js +85 -0
  10. package/dist/cjs/business-form-types-3cdd5447.js +19 -0
  11. package/dist/cjs/form-control-datepart_3.cjs.entry.js +32 -46
  12. package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
  13. package/dist/cjs/{form-control-select_2.cjs.entry.js → form-control-number_3.cjs.entry.js} +44 -1
  14. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +11036 -0
  15. package/dist/cjs/{index-55950669.js → index-69b9386b.js} +57 -3
  16. package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +505 -0
  17. package/dist/cjs/{justifi-additional-questions_5.cjs.entry.js → justifi-additional-questions_4.cjs.entry.js} +12 -42
  18. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
  19. package/dist/cjs/{select-input_2.cjs.entry.js → justifi-billing-form_4.cjs.entry.js} +1810 -1
  20. package/dist/cjs/justifi-business-address-form-step.cjs.entry.js +35 -0
  21. package/dist/cjs/justifi-business-details.cjs.entry.js +43 -57
  22. package/dist/cjs/justifi-business-form-stepped.cjs.entry.js +36 -89
  23. package/dist/cjs/justifi-business-form.cjs.entry.js +18 -16
  24. package/dist/cjs/justifi-business-list.cjs.entry.js +5 -4
  25. package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
  26. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  27. package/dist/cjs/justifi-checkout-core.cjs.entry.js +95 -0
  28. package/dist/cjs/justifi-checkout.cjs.entry.js +99 -0
  29. package/dist/cjs/justifi-details.cjs.entry.js +2 -2
  30. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +39 -11008
  31. package/dist/cjs/justifi-new-payment-method_3.cjs.entry.js +168 -0
  32. package/dist/cjs/justifi-owner-form.cjs.entry.js +160 -0
  33. package/dist/cjs/justifi-payment-balance-transactions.cjs.entry.js +5 -4
  34. package/dist/cjs/justifi-payment-details.cjs.entry.js +6 -5
  35. package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -4
  36. package/dist/cjs/{justifi-billing-form_2.cjs.entry.js → justifi-payment-method-selector.cjs.entry.js} +4 -79
  37. package/dist/cjs/justifi-payments-list.cjs.entry.js +6 -5
  38. package/dist/cjs/justifi-payout-details.cjs.entry.js +5 -4
  39. package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -4
  40. package/dist/cjs/justifi-proceeds-list.cjs.entry.js +4 -3
  41. package/dist/cjs/justifi-refund-form.cjs.entry.js +3 -2
  42. package/dist/cjs/justifi-subaccount-details.cjs.entry.js +6 -5
  43. package/dist/cjs/justifi-subaccounts-list.cjs.entry.js +5 -4
  44. package/dist/cjs/justifi-table_2.cjs.entry.js +1 -1
  45. package/dist/cjs/loader.cjs.js +2 -2
  46. package/dist/cjs/payload-parsers-25ed3936.js +98 -0
  47. package/dist/cjs/payment-details-core.cjs.entry.js +10 -4
  48. package/dist/cjs/{payment.service-605896dc.js → payment.service-0b0086dc.js} +2 -1
  49. package/dist/cjs/payments-list-core.cjs.entry.js +4 -3
  50. package/dist/cjs/payout-details-core.cjs.entry.js +4 -4
  51. package/dist/cjs/{payout.service-b39f2739.js → payout.service-5cc3b4e9.js} +2 -1
  52. package/dist/cjs/payouts-list-core.cjs.entry.js +4 -3
  53. package/dist/cjs/subaccount-account-details_4.cjs.entry.js +7 -7
  54. package/dist/cjs/subaccount-bank-details.cjs.entry.js +3 -3
  55. package/dist/cjs/subaccount-terms-details.cjs.entry.js +3 -3
  56. package/dist/cjs/{utils-d126d17c.js → utils-23e70ef2.js} +5 -5
  57. package/dist/cjs/{utils-29a8a91d.js → utils-6f62f7a1.js} +29 -2
  58. package/dist/cjs/utils-df5167a8.js +13 -0
  59. package/dist/cjs/webcomponents.cjs.js +2 -2
  60. package/dist/collection/api/Business.js +6 -7
  61. package/dist/collection/api/Checkout.js +1 -0
  62. package/dist/collection/api/Identity.js +43 -0
  63. package/dist/collection/api/index.js +1 -0
  64. package/dist/collection/api/services/business.service.js +8 -0
  65. package/dist/collection/api/services/checkout.service.js +12 -0
  66. package/dist/collection/api/services/reports.service.js +9 -0
  67. package/dist/collection/collection-manifest.json +22 -8
  68. package/dist/collection/components/billing-form/billing-form-schema.js +1 -1
  69. package/dist/collection/components/billing-form/billing-form.js +1 -2
  70. package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +5 -2
  71. package/dist/collection/components/business-details/additional-questions-details/test/additional-questions.spec.js +16 -0
  72. package/dist/collection/components/business-details/business-details-core.js +86 -0
  73. package/dist/collection/components/business-details/business-details.js +20 -65
  74. package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +4 -2
  75. package/dist/collection/components/business-details/generic-info-details/test/generic-info-details.spec.js +16 -0
  76. package/dist/collection/components/business-details/get-business.js +17 -0
  77. package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +5 -2
  78. package/dist/collection/components/business-details/legal-address-details/test/legal-address-details.spec.js +16 -0
  79. package/dist/collection/components/business-details/owner-details/owner-details.js +12 -14
  80. package/dist/collection/components/business-details/owner-details/test/owner-details.spec.js +16 -0
  81. package/dist/collection/components/business-details/representative-details/representative-details.js +7 -5
  82. package/dist/collection/components/business-details/representative-details/test/representative-details.spec.js +16 -0
  83. package/dist/collection/components/business-details/test/busines-details-core.spec.js +53 -0
  84. package/dist/collection/components/business-details/test/business-details.spec.js +40 -0
  85. package/dist/collection/components/business-details/test/get-business.spec.js +60 -0
  86. package/dist/collection/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.js +1 -1
  87. package/dist/collection/components/business-forms/business-form/business-address/business-address-form.css +2536 -0
  88. package/dist/collection/components/{business-form → business-forms/business-form}/business-address/business-address-form.js +4 -4
  89. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.css +2493 -0
  90. package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +77 -0
  91. package/dist/collection/components/{business-form → business-forms/business-form}/business-form.js +32 -24
  92. package/dist/collection/components/business-forms/business-form/business-owners/business-owners.css +7779 -0
  93. package/dist/collection/components/{business-form → business-forms/business-form}/business-owners/business-owners.js +2 -2
  94. package/dist/collection/components/business-forms/business-form/business-representative/business-representative.css +2493 -0
  95. package/dist/collection/components/{business-form → business-forms/business-form}/business-representative/business-representative.js +3 -3
  96. package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.css +2493 -0
  97. package/dist/collection/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.js +1 -1
  98. package/dist/collection/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.js +218 -0
  99. package/dist/collection/components/business-forms/business-form-stepped/additional-questions/test/business-additional-questions-form-step.spec.js +97 -0
  100. package/dist/collection/components/business-forms/business-form-stepped/business-address/business-address-form-step.js +97 -0
  101. package/dist/collection/components/business-forms/business-form-stepped/business-address/test/business-address-form-step.spec.js +97 -0
  102. package/dist/collection/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.js +239 -0
  103. package/dist/collection/components/business-forms/business-form-stepped/business-core-info/test/business-core-info-form-step.spec.js +97 -0
  104. package/dist/collection/components/{business-form → business-forms/business-form-stepped}/business-form-stepped.css +105 -0
  105. package/dist/collection/components/business-forms/business-form-stepped/business-form-stepped.js +199 -0
  106. package/dist/collection/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.js +284 -0
  107. package/dist/collection/components/business-forms/business-form-stepped/business-owners/test/business-owners-form-step.spec.js +97 -0
  108. package/dist/collection/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.js +230 -0
  109. package/dist/collection/components/business-forms/business-form-stepped/business-representative/test/business-representative-form-step.spec.js +97 -0
  110. package/dist/collection/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.js +232 -0
  111. package/dist/collection/components/business-forms/business-form-stepped/test/business-form-stepped.spec.js +61 -0
  112. package/dist/collection/components/business-forms/owner-form/owner-form.css +7779 -0
  113. package/dist/collection/components/business-forms/owner-form/owner-form.js +367 -0
  114. package/dist/collection/components/business-forms/schemas/business-additional-questions-schema.js +7 -0
  115. package/dist/collection/components/business-forms/schemas/business-address-schema.js +15 -0
  116. package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +13 -0
  117. package/dist/collection/components/business-forms/schemas/business-form-schema.js +6 -0
  118. package/dist/collection/components/business-forms/schemas/business-identity-schema.js +35 -0
  119. package/dist/collection/components/business-forms/schemas/business-owners-schema.js +16 -0
  120. package/dist/collection/components/business-forms/utils/business-form-select-options.js +80 -0
  121. package/dist/collection/components/business-forms/utils/business-form-types.js +17 -0
  122. package/dist/collection/components/business-forms/utils/payload-parsers.js +37 -0
  123. package/dist/collection/components/checkout/checkout-actions.js +33 -0
  124. package/dist/collection/components/checkout/checkout-core.css +2604 -0
  125. package/dist/collection/components/checkout/checkout-core.js +248 -0
  126. package/dist/collection/components/checkout/checkout.js +112 -0
  127. package/dist/collection/components/checkout/new-payment-method.js +188 -0
  128. package/dist/collection/components/checkout/payment-method-option-utils.js +19 -0
  129. package/dist/collection/components/checkout/payment-method-options.css +7073 -0
  130. package/dist/collection/components/checkout/payment-method-options.js +248 -0
  131. package/dist/collection/components/checkout/saved-payment-method.js +123 -0
  132. package/dist/collection/components/checkout/test/checkout.js +22 -0
  133. package/dist/collection/components/checkout/test/checkout.spec.js +166 -0
  134. package/dist/collection/components/checkout/test/mockCheckout.js +19 -0
  135. package/dist/collection/components/details/utils.js +4 -1
  136. package/dist/collection/components/form/utils.js +1 -0
  137. package/dist/collection/components/gross-payment-chart/get-gross-payment-chart-data.js +14 -0
  138. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +119 -0
  139. package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +25 -73
  140. package/dist/collection/components/gross-payment-chart/test/get-gross-payment-chart-data.spec.js +69 -0
  141. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart-core.spec.js +64 -0
  142. package/dist/collection/components/gross-payment-chart/test/gross-payment-chart.spec.js +23 -8
  143. package/dist/collection/components/payment-details/payment-details-core.js +8 -2
  144. package/dist/collection/components/payment-details/payment-details.js +0 -1
  145. package/dist/collection/components/payment-form/payment-form.js +1 -1
  146. package/dist/collection/components/payment-method-form/payment-method-form.js +1 -1
  147. package/dist/collection/components/payout-details/payout-details-core.js +2 -2
  148. package/dist/collection/components/subaccount-details/subaccount-account-details/subaccount-account-details.js +2 -2
  149. package/dist/collection/components/subaccount-details/subaccount-bank-details/subaccount-bank-details.js +2 -2
  150. package/dist/collection/components/subaccount-details/subaccount-merchant-details/subaccount-merchant-details.js +2 -2
  151. package/dist/collection/components/subaccount-details/subaccount-owners-details/subaccount-owners-details.js +2 -2
  152. package/dist/collection/components/subaccount-details/subaccount-representative-details/subaccount-representative-details.js +2 -2
  153. package/dist/collection/components/subaccount-details/subaccount-terms-details/subaccount-terms-details.js +2 -2
  154. package/dist/collection/utils/utils.js +25 -3
  155. package/dist/docs.json +2945 -590
  156. package/dist/esm/{Business-e9340f6b.js → Business-1df362e0.js} +7 -8
  157. package/dist/esm/Identity-774788c0.js +25 -0
  158. package/dist/esm/{Payout-dc5f009c.js → Payment-55886c86.js} +1 -43
  159. package/dist/esm/Payout-dfe15b00.js +43 -0
  160. package/dist/esm/{SubAccount-46b4c2b1.js → SubAccount-f4ae9809.js} +1 -1
  161. package/dist/esm/additional-questions-details_5.entry.js +24 -10
  162. package/dist/esm/business-additional-questions-schema-2cb80f70.js +23 -0
  163. package/dist/esm/business-details-core.entry.js +51 -0
  164. package/dist/esm/business-form-select-options-6b9293fe.js +82 -0
  165. package/dist/esm/business-form-types-de9f38cd.js +19 -0
  166. package/dist/esm/form-control-datepart_3.entry.js +32 -46
  167. package/dist/esm/form-control-monetary.entry.js +1 -1
  168. package/dist/esm/{form-control-select_2.entry.js → form-control-number_3.entry.js} +44 -2
  169. package/dist/esm/gross-payment-chart-core.entry.js +11032 -0
  170. package/dist/esm/{index-62b8aa8a.js → index-df86d9a2.js} +57 -3
  171. package/dist/esm/justifi-additional-questions-form-step_5.entry.js +497 -0
  172. package/dist/esm/{justifi-additional-questions_5.entry.js → justifi-additional-questions_4.entry.js} +12 -41
  173. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  174. package/dist/esm/{select-input_2.entry.js → justifi-billing-form_4.entry.js} +1809 -2
  175. package/dist/esm/justifi-business-address-form-step.entry.js +31 -0
  176. package/dist/esm/justifi-business-details.entry.js +42 -56
  177. package/dist/esm/justifi-business-form-stepped.entry.js +36 -89
  178. package/dist/esm/justifi-business-form.entry.js +17 -15
  179. package/dist/esm/justifi-business-list.entry.js +5 -4
  180. package/dist/esm/justifi-business-owners.entry.js +1 -1
  181. package/dist/esm/justifi-card-form.entry.js +1 -1
  182. package/dist/esm/justifi-checkout-core.entry.js +91 -0
  183. package/dist/esm/justifi-checkout.entry.js +95 -0
  184. package/dist/esm/justifi-details.entry.js +2 -2
  185. package/dist/esm/justifi-gross-payment-chart.entry.js +39 -11008
  186. package/dist/esm/justifi-new-payment-method_3.entry.js +162 -0
  187. package/dist/esm/justifi-owner-form.entry.js +156 -0
  188. package/dist/esm/justifi-payment-balance-transactions.entry.js +4 -3
  189. package/dist/esm/justifi-payment-details.entry.js +5 -4
  190. package/dist/esm/justifi-payment-form.entry.js +4 -3
  191. package/dist/esm/{justifi-billing-form_2.entry.js → justifi-payment-method-selector.entry.js} +4 -78
  192. package/dist/esm/justifi-payments-list.entry.js +5 -4
  193. package/dist/esm/justifi-payout-details.entry.js +5 -4
  194. package/dist/esm/justifi-payouts-list.entry.js +5 -4
  195. package/dist/esm/justifi-proceeds-list.entry.js +4 -3
  196. package/dist/esm/justifi-refund-form.entry.js +3 -2
  197. package/dist/esm/justifi-subaccount-details.entry.js +6 -5
  198. package/dist/esm/justifi-subaccounts-list.entry.js +5 -4
  199. package/dist/esm/justifi-table_2.entry.js +1 -1
  200. package/dist/esm/loader.js +3 -3
  201. package/dist/esm/payload-parsers-1dd7474f.js +90 -0
  202. package/dist/esm/payment-details-core.entry.js +10 -4
  203. package/dist/esm/{payment.service-bea02ccf.js → payment.service-f274ef98.js} +2 -1
  204. package/dist/esm/payments-list-core.entry.js +4 -3
  205. package/dist/esm/payout-details-core.entry.js +4 -4
  206. package/dist/esm/{payout.service-92e56814.js → payout.service-af293f61.js} +2 -1
  207. package/dist/esm/payouts-list-core.entry.js +4 -3
  208. package/dist/esm/subaccount-account-details_4.entry.js +7 -7
  209. package/dist/esm/subaccount-bank-details.entry.js +3 -3
  210. package/dist/esm/subaccount-terms-details.entry.js +3 -3
  211. package/dist/esm/{utils-76a93600.js → utils-243abdb4.js} +26 -3
  212. package/dist/esm/utils-2828201a.js +10 -0
  213. package/dist/esm/{utils-576874df.js → utils-d01c5f3a.js} +5 -5
  214. package/dist/esm/webcomponents.js +3 -3
  215. package/dist/module/Business.js +7 -8
  216. package/dist/module/Payment.js +138 -0
  217. package/dist/module/Payout.js +1 -138
  218. package/dist/module/SubAccount.js +1 -1
  219. package/dist/module/additional-questions-details2.js +5 -2
  220. package/dist/module/billing-form.js +2 -3
  221. package/dist/module/business-additional-questions-form-step.js +120 -0
  222. package/dist/module/business-additional-questions-schema.js +10 -0
  223. package/dist/module/business-address-form.js +3 -3
  224. package/dist/module/business-address-schema.js +18 -0
  225. package/dist/module/business-core-info-form-step.js +141 -0
  226. package/dist/module/business-core-info-schema.js +16 -0
  227. package/dist/module/business-core-info.js +69 -0
  228. package/dist/module/business-details-core.d.ts +11 -0
  229. package/dist/module/business-details-core.js +6 -0
  230. package/dist/module/business-details-core2.js +101 -0
  231. package/dist/module/business-form-select-options.js +82 -0
  232. package/dist/module/business-form-types.js +19 -0
  233. package/dist/module/business-identity-schema.js +38 -0
  234. package/dist/module/business-owners-form-step.js +213 -0
  235. package/dist/module/business-representative-form-step.js +157 -0
  236. package/dist/module/business-representative.js +1 -1
  237. package/dist/module/checkout-core.js +163 -0
  238. package/dist/module/generic-info-details2.js +4 -2
  239. package/dist/module/gross-payment-chart-core.d.ts +11 -0
  240. package/dist/module/gross-payment-chart-core.js +6 -0
  241. package/dist/module/gross-payment-chart-core2.js +11055 -0
  242. package/dist/module/justifi-additional-questions-form-step.d.ts +11 -0
  243. package/dist/module/justifi-additional-questions-form-step.js +6 -0
  244. package/dist/module/justifi-business-address-form-step.d.ts +11 -0
  245. package/dist/module/justifi-business-address-form-step.js +75 -0
  246. package/dist/module/justifi-business-core-info-form-step.d.ts +11 -0
  247. package/dist/module/justifi-business-core-info-form-step.js +6 -0
  248. package/dist/module/justifi-business-core-info.d.ts +11 -0
  249. package/dist/module/justifi-business-core-info.js +6 -0
  250. package/dist/module/justifi-business-details.js +51 -60
  251. package/dist/module/justifi-business-form-stepped.js +72 -112
  252. package/dist/module/justifi-business-form.js +20 -14
  253. package/dist/module/justifi-business-list.js +2 -1
  254. package/dist/module/justifi-business-owners-form-step.d.ts +11 -0
  255. package/dist/module/justifi-business-owners-form-step.js +6 -0
  256. package/dist/module/justifi-business-representative-form-step.d.ts +11 -0
  257. package/dist/module/justifi-business-representative-form-step.js +6 -0
  258. package/dist/module/justifi-checkout-core.d.ts +11 -0
  259. package/dist/module/justifi-checkout-core.js +6 -0
  260. package/dist/module/justifi-checkout.d.ts +11 -0
  261. package/dist/module/justifi-checkout.js +172 -0
  262. package/dist/module/justifi-gross-payment-chart.js +49 -11016
  263. package/dist/module/justifi-legal-address-form-step.d.ts +11 -0
  264. package/dist/module/justifi-legal-address-form-step.js +6 -0
  265. package/dist/module/justifi-new-payment-method.d.ts +11 -0
  266. package/dist/module/justifi-new-payment-method.js +6 -0
  267. package/dist/module/justifi-owner-form.d.ts +11 -0
  268. package/dist/module/justifi-owner-form.js +6 -0
  269. package/dist/module/justifi-payment-balance-transactions.js +3 -2
  270. package/dist/module/justifi-payment-details.js +2 -1
  271. package/dist/module/justifi-payment-form.js +2 -1
  272. package/dist/module/justifi-payment-method-options.d.ts +11 -0
  273. package/dist/module/justifi-payment-method-options.js +6 -0
  274. package/dist/module/justifi-payments-list.js +2 -1
  275. package/dist/module/justifi-payout-details.js +2 -1
  276. package/dist/module/justifi-payouts-list.js +2 -1
  277. package/dist/module/justifi-proceeds-list.js +2 -1
  278. package/dist/module/justifi-refund-form.js +1 -0
  279. package/dist/module/justifi-saved-payment-method.d.ts +11 -0
  280. package/dist/module/justifi-saved-payment-method.js +6 -0
  281. package/dist/module/justifi-subaccount-details.js +2 -1
  282. package/dist/module/justifi-subaccounts-list.js +2 -1
  283. package/dist/module/legal-address-details2.js +5 -2
  284. package/dist/module/legal-address-form-step.js +136 -0
  285. package/dist/module/new-payment-method.js +105 -0
  286. package/dist/module/owner-details2.js +10 -4
  287. package/dist/module/owner-form.js +244 -0
  288. package/dist/module/payload-parsers.js +39 -0
  289. package/dist/module/payment-details-core2.js +9 -3
  290. package/dist/module/payment-method-form.js +4 -10
  291. package/dist/module/payment-method-options.js +128 -0
  292. package/dist/module/payment-method-selector.js +2 -1
  293. package/dist/module/payment.service.js +1 -0
  294. package/dist/module/payments-list-core2.js +2 -1
  295. package/dist/module/payout-details-core2.js +3 -3
  296. package/dist/module/payout.service.js +1 -0
  297. package/dist/module/payouts-list-core2.js +3 -2
  298. package/dist/module/representative-details2.js +5 -3
  299. package/dist/module/saved-payment-method.js +66 -0
  300. package/dist/module/subaccount-account-details2.js +2 -2
  301. package/dist/module/subaccount-bank-details.js +2 -2
  302. package/dist/module/subaccount-merchant-details2.js +3 -3
  303. package/dist/module/subaccount-owners-details2.js +2 -2
  304. package/dist/module/subaccount-representative-details2.js +2 -2
  305. package/dist/module/subaccount-terms-details.js +2 -2
  306. package/dist/module/utils.js +4 -4
  307. package/dist/module/utils2.js +26 -3
  308. package/dist/module/utils4.js +10 -0
  309. package/dist/types/api/Api.d.ts +1 -1
  310. package/dist/types/api/Business.d.ts +1 -18
  311. package/dist/types/api/Checkout.d.ts +14 -0
  312. package/dist/types/api/Identity.d.ts +60 -0
  313. package/dist/types/api/index.d.ts +1 -0
  314. package/dist/types/api/services/business.service.d.ts +8 -0
  315. package/dist/types/api/services/checkout.service.d.ts +9 -0
  316. package/dist/types/api/services/reports.service.d.ts +5 -0
  317. package/dist/types/components/billing-form/billing-form-schema.d.ts +0 -1
  318. package/dist/types/components/billing-form/billing-form.d.ts +0 -1
  319. package/dist/types/components/business-details/business-details-core.d.ts +16 -0
  320. package/dist/types/components/business-details/business-details.d.ts +3 -13
  321. package/dist/types/components/business-details/get-business.d.ts +8 -0
  322. package/dist/types/components/business-details/owner-details/owner-details.d.ts +1 -9
  323. package/dist/types/components/business-details/representative-details/representative-details.d.ts +1 -1
  324. package/dist/types/components/{business-form → business-forms/business-form}/additional-questions/additional-questions.d.ts +1 -1
  325. package/dist/types/components/{business-form → business-forms/business-form}/business-address/business-address-form.d.ts +1 -1
  326. package/dist/types/components/{business-form/business-generic-info/business-generic-info.d.ts → business-forms/business-form/business-core-info/business-core-info.d.ts} +5 -5
  327. package/dist/types/components/{business-form → business-forms/business-form}/business-form.d.ts +5 -10
  328. package/dist/types/components/{business-form → business-forms/business-form}/business-owners/business-owners.d.ts +1 -1
  329. package/dist/types/components/{business-form → business-forms/business-form}/business-representative/business-representative.d.ts +1 -1
  330. package/dist/types/components/{business-form → business-forms/business-form}/legal-address-form/legal-address-form.d.ts +2 -2
  331. package/dist/types/components/business-forms/business-form-stepped/additional-questions/business-additional-questions-form-step.d.ts +30 -0
  332. package/dist/types/components/business-forms/business-form-stepped/business-address/business-address-form-step.d.ts +9 -0
  333. package/dist/types/components/business-forms/business-form-stepped/business-core-info/business-core-info-form-step.d.ts +36 -0
  334. package/dist/types/components/business-forms/business-form-stepped/business-form-stepped.d.ts +45 -0
  335. package/dist/types/components/business-forms/business-form-stepped/business-owners/business-owners-form-step.d.ts +36 -0
  336. package/dist/types/components/business-forms/business-form-stepped/business-representative/business-representative-form-step.d.ts +26 -0
  337. package/dist/types/components/business-forms/business-form-stepped/legal-address-form/legal-address-form-step.d.ts +31 -0
  338. package/dist/types/components/business-forms/owner-form/owner-form.d.ts +36 -0
  339. package/dist/types/components/business-forms/schemas/business-additional-questions-schema.d.ts +11 -0
  340. package/dist/types/components/{business-form/business-address/business-address-form-schema.d.ts → business-forms/schemas/business-address-schema.d.ts} +11 -8
  341. package/dist/types/components/business-forms/schemas/business-core-info-schema.d.ts +19 -0
  342. package/dist/types/components/{business-form → business-forms/schemas}/business-form-schema.d.ts +2 -26
  343. package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +59 -0
  344. package/dist/types/components/business-forms/schemas/business-owners-schema.d.ts +33 -0
  345. package/dist/types/components/business-forms/utils/business-form-select-options.d.ts +11 -0
  346. package/dist/types/components/business-forms/utils/business-form-types.d.ts +39 -0
  347. package/dist/types/components/business-forms/utils/payload-parsers.d.ts +4 -0
  348. package/dist/types/components/checkout/checkout-actions.d.ts +17 -0
  349. package/dist/types/components/checkout/checkout-core.d.ts +28 -0
  350. package/dist/types/components/checkout/checkout.d.ts +12 -0
  351. package/dist/types/components/checkout/new-payment-method.d.ts +17 -0
  352. package/dist/types/components/checkout/payment-method-option-utils.d.ts +16 -0
  353. package/dist/types/components/checkout/payment-method-options.d.ts +18 -0
  354. package/dist/types/components/checkout/saved-payment-method.d.ts +11 -0
  355. package/dist/types/components/checkout/test/checkout.d.ts +1 -0
  356. package/dist/types/components/checkout/test/mockCheckout.d.ts +19 -0
  357. package/dist/types/components/details/utils.d.ts +1 -1
  358. package/dist/types/components/form/form.d.ts +1 -1
  359. package/dist/types/components/form/utils.d.ts +1 -0
  360. package/dist/types/components/gross-payment-chart/get-gross-payment-chart-data.d.ts +11 -0
  361. package/dist/types/components/gross-payment-chart/gross-payment-chart-core.d.ts +18 -0
  362. package/dist/types/components/gross-payment-chart/gross-payment-chart.d.ts +4 -14
  363. package/dist/types/components/payment-details/payment-details.d.ts +0 -1
  364. package/dist/types/components/payment-method-form/payment-method-responses.d.ts +3 -9
  365. package/dist/types/components.d.ts +626 -91
  366. package/dist/types/utils/utils.d.ts +3 -0
  367. package/dist/webcomponents/p-0399f02b.entry.js +1 -0
  368. package/dist/webcomponents/{p-6478f3ca.js → p-04a98c63.js} +1 -1
  369. package/dist/webcomponents/p-06888c2e.entry.js +1 -0
  370. package/dist/webcomponents/{p-234bc840.entry.js → p-07b326d0.entry.js} +1 -1
  371. package/dist/webcomponents/p-0811bc77.entry.js +1 -0
  372. package/dist/webcomponents/p-0923e39c.js +1 -0
  373. package/dist/webcomponents/p-17d72f4a.js +1 -0
  374. package/dist/webcomponents/p-17f64853.entry.js +1 -0
  375. package/dist/webcomponents/p-1bfadb9f.entry.js +1 -0
  376. package/dist/webcomponents/p-22085999.entry.js +1 -0
  377. package/dist/webcomponents/p-252835df.entry.js +1 -0
  378. package/dist/webcomponents/{p-22c1acd6.js → p-28b38699.js} +1 -1
  379. package/dist/webcomponents/p-34352d04.js +1 -0
  380. package/dist/webcomponents/p-374c44e6.entry.js +1 -0
  381. package/dist/webcomponents/{p-0a0cf2e6.entry.js → p-4697ccfa.entry.js} +1 -1
  382. package/dist/webcomponents/p-4781cd06.js +1 -0
  383. package/dist/webcomponents/{p-4c01df65.entry.js → p-4d50d08a.entry.js} +1 -1
  384. package/dist/webcomponents/p-4d806131.entry.js +1 -0
  385. package/dist/webcomponents/{p-7a1a06c0.entry.js → p-4df6174c.entry.js} +1 -1
  386. package/dist/webcomponents/p-4e0b3206.entry.js +1 -0
  387. package/dist/webcomponents/{p-4ee44c76.entry.js → p-583dd5a2.entry.js} +1 -1
  388. package/dist/webcomponents/p-5be4e217.entry.js +1 -0
  389. package/dist/webcomponents/p-5da4fbe7.entry.js +1 -0
  390. package/dist/webcomponents/{p-40349ffc.entry.js → p-6103c20d.entry.js} +1 -1
  391. package/dist/webcomponents/p-63296409.js +1 -0
  392. package/dist/webcomponents/{p-5c0310ee.js → p-65510838.js} +1 -1
  393. package/dist/webcomponents/p-688bb5da.js +2 -0
  394. package/dist/webcomponents/p-6b51cf97.entry.js +1 -0
  395. package/dist/webcomponents/p-7654c70d.entry.js +1 -0
  396. package/dist/webcomponents/p-7b2cddc7.js +1 -0
  397. package/dist/webcomponents/p-847441ce.entry.js +1 -0
  398. package/dist/webcomponents/p-861ba3fc.entry.js +1 -0
  399. package/dist/webcomponents/p-9207ccb2.entry.js +1 -0
  400. package/dist/webcomponents/p-975ab96e.js +1 -0
  401. package/dist/webcomponents/p-9ce8d98c.entry.js +1 -0
  402. package/dist/webcomponents/p-9e4b81ad.entry.js +1 -0
  403. package/dist/webcomponents/p-a141c531.js +1 -0
  404. package/dist/webcomponents/p-a2dbe90f.entry.js +1 -0
  405. package/dist/webcomponents/{p-4fa27a28.entry.js → p-a46174e0.entry.js} +1 -1
  406. package/dist/webcomponents/p-a98eea84.entry.js +1 -0
  407. package/dist/webcomponents/p-b1bc23af.entry.js +1 -0
  408. package/dist/webcomponents/p-b27c9b0d.entry.js +1 -0
  409. package/dist/webcomponents/{p-7c0f91fa.entry.js → p-b68f1dd9.entry.js} +1 -1
  410. package/dist/webcomponents/p-b8f22856.js +1 -0
  411. package/dist/webcomponents/p-c8d62072.entry.js +1 -0
  412. package/dist/webcomponents/{p-08833966.entry.js → p-da34bba7.entry.js} +1 -1
  413. package/dist/webcomponents/p-e3748ea4.entry.js +1 -0
  414. package/dist/webcomponents/p-e3fab0e2.js +1 -0
  415. package/dist/webcomponents/p-e924f2e1.entry.js +1 -0
  416. package/dist/webcomponents/p-ebf7c70f.entry.js +1 -0
  417. package/dist/webcomponents/p-eef5ed19.entry.js +1 -0
  418. package/dist/webcomponents/p-efc7025c.entry.js +1 -0
  419. package/dist/webcomponents/p-f3453ca2.js +1 -0
  420. package/dist/webcomponents/p-f3ca6fda.entry.js +1 -0
  421. package/dist/webcomponents/p-fb49ef28.entry.js +1 -0
  422. package/dist/webcomponents/p-fe2af0cf.entry.js +19 -0
  423. package/dist/webcomponents/p-fe8a94c1.entry.js +1 -0
  424. package/dist/webcomponents/webcomponents.esm.js +1 -1
  425. package/package.json +3 -2
  426. package/dist/cjs/BusinessFormEventTypes-863f48e9.js +0 -42
  427. package/dist/cjs/business-form-schema-37e5381d.js +0 -148
  428. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +0 -1747
  429. package/dist/collection/components/business-form/BusinessFormEventTypes.js +0 -6
  430. package/dist/collection/components/business-form/business-address/business-address-form-schema.js +0 -13
  431. package/dist/collection/components/business-form/business-form-schema.js +0 -159
  432. package/dist/collection/components/business-form/business-form-stepped.js +0 -260
  433. package/dist/collection/components/business-form/business-generic-info/business-generic-info.js +0 -77
  434. package/dist/collection/components/business-form/business-representative/business-representative-schema.js +0 -1
  435. package/dist/collection/components/business-form/helpers.js +0 -23
  436. package/dist/collection/components/business-form/legal-address-form/legal-address-form-schema.js +0 -10
  437. package/dist/esm/BusinessFormEventTypes-989960ba.js +0 -39
  438. package/dist/esm/business-form-schema-f8f554d1.js +0 -144
  439. package/dist/esm/justifi-payment-method-form.entry.js +0 -1743
  440. package/dist/module/BusinessFormEventTypes.js +0 -39
  441. package/dist/module/business-generic-info.js +0 -210
  442. package/dist/module/justifi-business-generic-info.d.ts +0 -11
  443. package/dist/module/justifi-business-generic-info.js +0 -6
  444. package/dist/types/components/business-form/BusinessFormEventTypes.d.ts +0 -5
  445. package/dist/types/components/business-form/business-form-stepped.d.ts +0 -48
  446. package/dist/types/components/business-form/business-representative/business-representative-schema.d.ts +0 -17
  447. package/dist/types/components/business-form/helpers.d.ts +0 -1
  448. package/dist/types/components/business-form/legal-address-form/legal-address-form-schema.d.ts +0 -17
  449. package/dist/webcomponents/p-081cf5f6.entry.js +0 -1
  450. package/dist/webcomponents/p-0bc8b02e.entry.js +0 -1
  451. package/dist/webcomponents/p-112acd3c.entry.js +0 -1
  452. package/dist/webcomponents/p-1555e6b1.js +0 -1
  453. package/dist/webcomponents/p-16f41fd0.entry.js +0 -1
  454. package/dist/webcomponents/p-17715325.js +0 -1
  455. package/dist/webcomponents/p-3a4d4869.entry.js +0 -1
  456. package/dist/webcomponents/p-3cb0b96d.js +0 -1
  457. package/dist/webcomponents/p-4ba2c711.entry.js +0 -1
  458. package/dist/webcomponents/p-4f14df36.js +0 -2
  459. package/dist/webcomponents/p-5422a24b.entry.js +0 -1
  460. package/dist/webcomponents/p-578e0a05.entry.js +0 -1
  461. package/dist/webcomponents/p-640d90dc.entry.js +0 -1
  462. package/dist/webcomponents/p-663bfe87.js +0 -1
  463. package/dist/webcomponents/p-696396c7.entry.js +0 -1
  464. package/dist/webcomponents/p-6ab67031.entry.js +0 -1
  465. package/dist/webcomponents/p-6d0725ef.entry.js +0 -1
  466. package/dist/webcomponents/p-810b72b5.js +0 -1
  467. package/dist/webcomponents/p-8516d602.entry.js +0 -1
  468. package/dist/webcomponents/p-894a7475.entry.js +0 -19
  469. package/dist/webcomponents/p-94ebfafb.entry.js +0 -1
  470. package/dist/webcomponents/p-9cb3ff78.entry.js +0 -1
  471. package/dist/webcomponents/p-9e81808f.entry.js +0 -1
  472. package/dist/webcomponents/p-a432110c.entry.js +0 -1
  473. package/dist/webcomponents/p-b1881723.entry.js +0 -1
  474. package/dist/webcomponents/p-b5aba473.entry.js +0 -1
  475. package/dist/webcomponents/p-b8a8b551.js +0 -1
  476. package/dist/webcomponents/p-bd099662.entry.js +0 -1
  477. package/dist/webcomponents/p-bfd917b8.entry.js +0 -1
  478. package/dist/webcomponents/p-c90fa055.entry.js +0 -1
  479. package/dist/webcomponents/p-ebb91944.entry.js +0 -1
  480. package/dist/webcomponents/p-ec4f27e7.entry.js +0 -1
  481. package/dist/webcomponents/p-fa495a43.entry.js +0 -1
  482. /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.e2e.js +0 -0
  483. /package/dist/collection/components/{business-form → business-forms/business-form}/business-address/test/business-address.spec.js +0 -0
  484. /package/dist/collection/components/{business-form → business-forms/business-form}/business-form.css +0 -0
  485. /package/dist/collection/components/{business-form → business-forms/business-form}/test/business-form.spec.js +0 -0
  486. /package/dist/collection/components/{business-form/business-address/business-address-form.css → business-forms/business-form-stepped/business-address/business-address-form-step.css} +0 -0
  487. /package/dist/collection/components/{business-form/business-generic-info/business-generic-info.css → business-forms/business-form-stepped/business-core-info/business-core-info-form-step.css} +0 -0
  488. /package/dist/collection/components/{business-form/business-owners/business-owners.css → business-forms/business-form-stepped/business-owners/business-owners-form-step.css} +0 -0
  489. /package/dist/collection/components/{business-form/business-representative/business-representative.css → business-forms/business-form-stepped/business-representative/business-representative-form-step.css} +0 -0
  490. /package/dist/collection/components/{business-form/legal-address-form/legal-address-form.css → business-forms/business-form-stepped/legal-address-form/legal-address-form-step.css} +0 -0
@@ -0,0 +1,248 @@
1
+ import { h } from "@stencil/core";
2
+ import { config } from "../../../config";
3
+ import { PaymentMethodTypes } from "../../api/Payment";
4
+ import { PaymentMethodOption } from "./payment-method-option-utils";
5
+ export class PaymentMethodOptions {
6
+ constructor() {
7
+ this.showCard = undefined;
8
+ this.showAch = undefined;
9
+ this.clientId = undefined;
10
+ this.accountId = undefined;
11
+ this.iframeOrigin = config.iframeOrigin;
12
+ this.savedPaymentMethods = [];
13
+ this.selectedPaymentMethodId = undefined;
14
+ this.paymentMethodOptions = [];
15
+ }
16
+ paymentMethodsChanged() {
17
+ this.paymentMethodOptions = this.savedPaymentMethods.map((paymentMethod) => new PaymentMethodOption(paymentMethod));
18
+ if (this.showCard) {
19
+ this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.card }));
20
+ }
21
+ if (this.showAch) {
22
+ this.paymentMethodOptions.push(new PaymentMethodOption({ id: PaymentMethodTypes.bankAccount }));
23
+ }
24
+ this.selectedPaymentMethodId = this.paymentMethodOptions[0].id;
25
+ }
26
+ paymentMethodOptionSelected(event) {
27
+ this.selectedPaymentMethodId = event.detail.id;
28
+ }
29
+ async getPaymentMethodToken() {
30
+ var _a;
31
+ return await ((_a = this.selectedPaymentMethodOptionRef) === null || _a === void 0 ? void 0 : _a.getPaymentMethodToken());
32
+ }
33
+ render() {
34
+ var _a;
35
+ return (h("div", null, (_a = this.paymentMethodOptions) === null || _a === void 0 ? void 0 : _a.map((paymentMethodOption) => {
36
+ const newCard = paymentMethodOption.id === PaymentMethodTypes.card;
37
+ const newBankAccount = paymentMethodOption.id === PaymentMethodTypes.bankAccount;
38
+ const isSelected = this.selectedPaymentMethodId === paymentMethodOption.id;
39
+ if (newCard || newBankAccount) {
40
+ return (h("justifi-new-payment-method", { paymentMethodOption: paymentMethodOption, "client-id": this.clientId, "account-id": this.accountId, "is-selected": isSelected, ref: (el) => {
41
+ if (isSelected) {
42
+ this.selectedPaymentMethodOptionRef = el;
43
+ }
44
+ } }));
45
+ }
46
+ else {
47
+ return (h("justifi-saved-payment-method", { paymentMethodOption: paymentMethodOption, "is-selected": isSelected, ref: (el) => {
48
+ if (isSelected) {
49
+ this.selectedPaymentMethodOptionRef = el;
50
+ }
51
+ } }));
52
+ }
53
+ })));
54
+ }
55
+ static get is() { return "justifi-payment-method-options"; }
56
+ static get originalStyleUrls() {
57
+ return {
58
+ "$": ["payment-method-options.scss"]
59
+ };
60
+ }
61
+ static get styleUrls() {
62
+ return {
63
+ "$": ["payment-method-options.css"]
64
+ };
65
+ }
66
+ static get properties() {
67
+ return {
68
+ "showCard": {
69
+ "type": "boolean",
70
+ "mutable": false,
71
+ "complexType": {
72
+ "original": "boolean",
73
+ "resolved": "boolean",
74
+ "references": {}
75
+ },
76
+ "required": false,
77
+ "optional": false,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": ""
81
+ },
82
+ "attribute": "show-card",
83
+ "reflect": false
84
+ },
85
+ "showAch": {
86
+ "type": "boolean",
87
+ "mutable": false,
88
+ "complexType": {
89
+ "original": "boolean",
90
+ "resolved": "boolean",
91
+ "references": {}
92
+ },
93
+ "required": false,
94
+ "optional": false,
95
+ "docs": {
96
+ "tags": [],
97
+ "text": ""
98
+ },
99
+ "attribute": "show-ach",
100
+ "reflect": false
101
+ },
102
+ "clientId": {
103
+ "type": "string",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "string",
107
+ "resolved": "string",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": ""
115
+ },
116
+ "attribute": "client-id",
117
+ "reflect": false
118
+ },
119
+ "accountId": {
120
+ "type": "string",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "string",
124
+ "resolved": "string",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": false,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": ""
132
+ },
133
+ "attribute": "account-id",
134
+ "reflect": false
135
+ },
136
+ "iframeOrigin": {
137
+ "type": "string",
138
+ "mutable": true,
139
+ "complexType": {
140
+ "original": "string",
141
+ "resolved": "string",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": true,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": ""
149
+ },
150
+ "attribute": "iframe-origin",
151
+ "reflect": false,
152
+ "defaultValue": "config.iframeOrigin"
153
+ },
154
+ "savedPaymentMethods": {
155
+ "type": "unknown",
156
+ "mutable": false,
157
+ "complexType": {
158
+ "original": "any[]",
159
+ "resolved": "any[]",
160
+ "references": {}
161
+ },
162
+ "required": false,
163
+ "optional": false,
164
+ "docs": {
165
+ "tags": [],
166
+ "text": ""
167
+ },
168
+ "defaultValue": "[]"
169
+ },
170
+ "selectedPaymentMethodId": {
171
+ "type": "string",
172
+ "mutable": false,
173
+ "complexType": {
174
+ "original": "string",
175
+ "resolved": "string",
176
+ "references": {}
177
+ },
178
+ "required": false,
179
+ "optional": false,
180
+ "docs": {
181
+ "tags": [],
182
+ "text": ""
183
+ },
184
+ "attribute": "selected-payment-method-id",
185
+ "reflect": false
186
+ }
187
+ };
188
+ }
189
+ static get states() {
190
+ return {
191
+ "paymentMethodOptions": {}
192
+ };
193
+ }
194
+ static get events() {
195
+ return [{
196
+ "method": "toggleCreatingNewPaymentMethod",
197
+ "name": "toggleCreatingNewPaymentMethod",
198
+ "bubbles": true,
199
+ "cancelable": true,
200
+ "composed": true,
201
+ "docs": {
202
+ "tags": [],
203
+ "text": ""
204
+ },
205
+ "complexType": {
206
+ "original": "any",
207
+ "resolved": "any",
208
+ "references": {}
209
+ }
210
+ }];
211
+ }
212
+ static get methods() {
213
+ return {
214
+ "getPaymentMethodToken": {
215
+ "complexType": {
216
+ "signature": "() => Promise<string>",
217
+ "parameters": [],
218
+ "references": {
219
+ "Promise": {
220
+ "location": "global",
221
+ "id": "global::Promise"
222
+ }
223
+ },
224
+ "return": "Promise<string>"
225
+ },
226
+ "docs": {
227
+ "text": "",
228
+ "tags": []
229
+ }
230
+ }
231
+ };
232
+ }
233
+ static get watchers() {
234
+ return [{
235
+ "propName": "savedPaymentMethods",
236
+ "methodName": "paymentMethodsChanged"
237
+ }];
238
+ }
239
+ static get listeners() {
240
+ return [{
241
+ "name": "paymentMethodOptionSelected",
242
+ "method": "paymentMethodOptionSelected",
243
+ "target": undefined,
244
+ "capture": false,
245
+ "passive": false
246
+ }];
247
+ }
248
+ }
@@ -0,0 +1,123 @@
1
+ import { Fragment, h } from "@stencil/core";
2
+ import { config } from "../../../config";
3
+ import { CardBrandLabels } from "./payment-method-option-utils";
4
+ export class SavedPaymentMethod {
5
+ constructor() {
6
+ this.onPaymentMethodOptionClick = () => {
7
+ this.paymentMethodOptionSelected.emit(this.paymentMethodOption);
8
+ };
9
+ this.iframeOrigin = config.iframeOrigin;
10
+ this.paymentMethodOption = undefined;
11
+ this.isSelected = undefined;
12
+ }
13
+ async getPaymentMethodToken() {
14
+ var _a;
15
+ return (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id;
16
+ }
17
+ ;
18
+ render() {
19
+ var _a, _b, _c, _d, _e;
20
+ return (h(Fragment, null, h("div", { class: "payment-method" }, h("div", { class: "payment-method-header p-3 border-bottom", onClick: () => this.onPaymentMethodOptionClick() }, h("input", { type: "radio", name: "paymentMethodType", id: (_a = this.paymentMethodOption) === null || _a === void 0 ? void 0 : _a.id, value: (_b = this.paymentMethodOption) === null || _b === void 0 ? void 0 : _b.id, onClick: (event) => event.preventDefault(), checked: this.isSelected, class: "form-check-input me-2" }), h("label", { htmlFor: (_c = this.paymentMethodOption) === null || _c === void 0 ? void 0 : _c.id, class: "form-check-label" }, CardBrandLabels[(_d = this.paymentMethodOption) === null || _d === void 0 ? void 0 : _d.brand], " *", (_e = this.paymentMethodOption) === null || _e === void 0 ? void 0 :
21
+ _e.acct_last_four)))));
22
+ }
23
+ static get is() { return "justifi-saved-payment-method"; }
24
+ static get properties() {
25
+ return {
26
+ "iframeOrigin": {
27
+ "type": "string",
28
+ "mutable": true,
29
+ "complexType": {
30
+ "original": "string",
31
+ "resolved": "string",
32
+ "references": {}
33
+ },
34
+ "required": false,
35
+ "optional": true,
36
+ "docs": {
37
+ "tags": [],
38
+ "text": ""
39
+ },
40
+ "attribute": "iframe-origin",
41
+ "reflect": false,
42
+ "defaultValue": "config.iframeOrigin"
43
+ },
44
+ "paymentMethodOption": {
45
+ "type": "unknown",
46
+ "mutable": false,
47
+ "complexType": {
48
+ "original": "PaymentMethodOption",
49
+ "resolved": "PaymentMethodOption",
50
+ "references": {
51
+ "PaymentMethodOption": {
52
+ "location": "import",
53
+ "path": "./payment-method-option-utils",
54
+ "id": "src/components/checkout/payment-method-option-utils.tsx::PaymentMethodOption"
55
+ }
56
+ }
57
+ },
58
+ "required": false,
59
+ "optional": false,
60
+ "docs": {
61
+ "tags": [],
62
+ "text": ""
63
+ }
64
+ },
65
+ "isSelected": {
66
+ "type": "boolean",
67
+ "mutable": false,
68
+ "complexType": {
69
+ "original": "boolean",
70
+ "resolved": "boolean",
71
+ "references": {}
72
+ },
73
+ "required": false,
74
+ "optional": false,
75
+ "docs": {
76
+ "tags": [],
77
+ "text": ""
78
+ },
79
+ "attribute": "is-selected",
80
+ "reflect": false
81
+ }
82
+ };
83
+ }
84
+ static get events() {
85
+ return [{
86
+ "method": "paymentMethodOptionSelected",
87
+ "name": "paymentMethodOptionSelected",
88
+ "bubbles": true,
89
+ "cancelable": true,
90
+ "composed": true,
91
+ "docs": {
92
+ "tags": [],
93
+ "text": ""
94
+ },
95
+ "complexType": {
96
+ "original": "any",
97
+ "resolved": "any",
98
+ "references": {}
99
+ }
100
+ }];
101
+ }
102
+ static get methods() {
103
+ return {
104
+ "getPaymentMethodToken": {
105
+ "complexType": {
106
+ "signature": "() => Promise<string>",
107
+ "parameters": [],
108
+ "references": {
109
+ "Promise": {
110
+ "location": "global",
111
+ "id": "global::Promise"
112
+ }
113
+ },
114
+ "return": "Promise<string>"
115
+ },
116
+ "docs": {
117
+ "text": "",
118
+ "tags": []
119
+ }
120
+ }
121
+ };
122
+ }
123
+ }
@@ -0,0 +1,22 @@
1
+ import { newE2EPage } from "@stencil/core/testing";
2
+ describe('justifi-checkout', () => {
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-checkout
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-checkout >>> button');
19
+ // Assert that the submit button's text is set correctly
20
+ expect(await submitButton.textContent).toBe('Pay Now');
21
+ });
22
+ });
@@ -0,0 +1,166 @@
1
+ import { newSpecPage } from "@stencil/core/testing";
2
+ import { Checkout } from "../checkout";
3
+ import { CheckoutCore } from "../checkout-core";
4
+ // import { PaymentMethodTypes } from '../../../api';
5
+ // import { BillingFormFields } from '../../billing-form/billing-form-schema';
6
+ describe('justifi-checkout', () => {
7
+ it('renders', async () => {
8
+ const page = await newSpecPage({
9
+ components: [Checkout, CheckoutCore],
10
+ html: '<justifi-checkout></justifi-checkout>',
11
+ });
12
+ await page.waitForChanges();
13
+ expect(page.root).toMatchSnapshot();
14
+ });
15
+ // it('should update selectedPaymentMethodType when paymentMethodSelected event is fired', async () => {
16
+ // // Mock component
17
+ // const mockComponent = new Checkout();
18
+ // mockComponent.selectedPaymentMethodType = PaymentMethodTypes.card;
19
+ // // Define the event details
20
+ // const detail = PaymentMethodTypes.bankAccount;
21
+ // const event = new CustomEvent('paymentMethodSelected', { detail });
22
+ // // Simulate the event
23
+ // mockComponent.paymentMethodSelectedHandler(event);
24
+ // // Assertion
25
+ // expect(mockComponent.selectedPaymentMethodType).toBe(PaymentMethodTypes.bankAccount);
26
+ // });
27
+ // // Props Testing
28
+ // it('should have the expected default properties', () => {
29
+ // const checkout = new Checkout();
30
+ // // Assert that the properties exist and have the expected default values
31
+ // expect(checkout).toHaveProperty('bankAccount', undefined);
32
+ // expect(checkout).toHaveProperty('card', undefined);
33
+ // expect(checkout).toHaveProperty('email', undefined);
34
+ // expect(checkout).toHaveProperty('iframeOrigin', undefined);
35
+ // expect(checkout).toHaveProperty('clientId', undefined);
36
+ // expect(checkout).toHaveProperty('accountId', undefined);
37
+ // expect(checkout).toHaveProperty('submitButtonText', undefined);
38
+ // });
39
+ // // Method Testing
40
+ // it('should correctly fill billing form when fillBillingForm method is called', async () => {
41
+ // // Mock child component
42
+ // const mockBillingFormRef = {
43
+ // fill: jest.fn(),
44
+ // };
45
+ // // Mock component
46
+ // const mockComponent = new Checkout();
47
+ // // Cast to any to bypass type checker and directly set private property
48
+ // (mockComponent as any).billingFormRef = mockBillingFormRef;
49
+ // // Define the fields to fill the billing form
50
+ // const fields: BillingFormFields = {
51
+ // name: 'John Doe',
52
+ // address_line1: '123 Main St',
53
+ // address_line2: 'Apt 4B',
54
+ // address_city: 'Townsville',
55
+ // address_state: 'TS',
56
+ // address_postal_code: '12345',
57
+ // };
58
+ // // Call the method
59
+ // await mockComponent.fillBillingForm(fields);
60
+ // // Check that the child component's fill method was called with the correct arguments
61
+ // expect(mockBillingFormRef.fill).toHaveBeenCalledWith(fields);
62
+ // });
63
+ // it('should submit the form correctly and trigger the "submitted" event with the correct payload when submit method is called', async () => {
64
+ // // Mock billingFormRef and paymentMethodFormRef
65
+ // const mockBillingFormRef = {
66
+ // validate: jest.fn().mockResolvedValue({ isValid: true }),
67
+ // getValues: jest.fn().mockResolvedValue({ name: 'John Doe' }),
68
+ // };
69
+ // const mockPaymentMethodFormRef = {
70
+ // validate: jest.fn().mockResolvedValue({ isValid: true }),
71
+ // tokenize: jest.fn().mockResolvedValue({ token: 'abc123' }),
72
+ // };
73
+ // // Mock component
74
+ // const mockComponent = new Checkout();
75
+ // // Cast to any to bypass type checker and directly set private properties
76
+ // (mockComponent as any).billingFormRef = mockBillingFormRef;
77
+ // (mockComponent as any).paymentMethodFormRef = mockPaymentMethodFormRef;
78
+ // // Mock event
79
+ // const mockEvent = { preventDefault: jest.fn() };
80
+ // // Mock event emitter
81
+ // const mockEmitter = { emit: jest.fn() };
82
+ // mockComponent.submitted = mockEmitter as any;
83
+ // // Call submit method
84
+ // await mockComponent.submit(mockEvent);
85
+ // // Expectations
86
+ // expect(mockEvent.preventDefault).toHaveBeenCalled();
87
+ // expect(mockBillingFormRef.validate).toHaveBeenCalled();
88
+ // expect(mockPaymentMethodFormRef.validate).toHaveBeenCalled();
89
+ // expect(mockBillingFormRef.getValues).toHaveBeenCalled();
90
+ // expect(mockPaymentMethodFormRef.tokenize).toHaveBeenCalledWith(mockComponent.clientId, { name: 'John Doe' }, mockComponent.accountId);
91
+ // expect(mockEmitter.emit).toHaveBeenCalledWith({ token: 'abc123' });
92
+ // });
93
+ // // Event Testing
94
+ // it('should fire the "submitted" event with correct data when the form is submitted', async () => {
95
+ // // Mock billingFormRef and paymentMethodFormRef
96
+ // const mockBillingFormRef = {
97
+ // validate: jest.fn().mockResolvedValue({ isValid: true }),
98
+ // getValues: jest.fn().mockResolvedValue({
99
+ // name: 'John Doe',
100
+ // address_line1: 'Address 1',
101
+ // address_line2: 'Address 2',
102
+ // address_city: 'City',
103
+ // address_state: 'State',
104
+ // address_postal_code: 'Postal Code',
105
+ // }),
106
+ // };
107
+ // const mockPaymentMethodFormRef = {
108
+ // validate: jest.fn().mockResolvedValue({ isValid: true }),
109
+ // tokenize: jest.fn().mockResolvedValue({ token: 'abc123' }),
110
+ // };
111
+ // // Mock component
112
+ // const mockComponent = new Checkout();
113
+ // // Cast to any to bypass type checker and directly set private properties
114
+ // (mockComponent as any).billingFormRef = mockBillingFormRef;
115
+ // (mockComponent as any).paymentMethodFormRef = mockPaymentMethodFormRef;
116
+ // // Mock event
117
+ // const mockEvent = { preventDefault: jest.fn() };
118
+ // // Mock event emitter
119
+ // const mockEmitter = { emit: jest.fn() };
120
+ // mockComponent.submitted = mockEmitter as any;
121
+ // // Call submit method
122
+ // await mockComponent.submit(mockEvent);
123
+ // // Define expected payload
124
+ // const expectedPayload = { token: 'abc123' };
125
+ // // Expectations
126
+ // expect(mockEmitter.emit).toHaveBeenCalledWith(expectedPayload);
127
+ // });
128
+ // // Render Testing
129
+ // it('should correctly render the child components based on the given props and state', async () => {
130
+ // // Set up new Checkout with specific props and state
131
+ // const component = new Checkout();
132
+ // component.iframeOrigin = 'https://example.com';
133
+ // component.clientId = 'abc123';
134
+ // component.accountId = 'def456';
135
+ // // Cast to any to bypass type checker and directly set private properties
136
+ // (component as any).submitButtonEnabled = true;
137
+ // (component as any).selectedPaymentMethodType = PaymentMethodTypes.card;
138
+ // (component as any).allowedPaymentMethodTypes = [PaymentMethodTypes.card, PaymentMethodTypes.bankAccount];
139
+ // // Render the component
140
+ // const { root } = await newSpecPage({
141
+ // components: [Checkout],
142
+ // html: '<justifi-checkout payment-method-form-type="card" iframe-origin="https://example.com"></justifi-checkout>',
143
+ // });
144
+ // // Assert that the rendered output is correct
145
+ // expect(root).toEqualHtml(`
146
+ // <justifi-checkout iframe-origin="https://example.com" payment-method-form-type="card">
147
+ // <mock:shadow-root>
148
+ // <form class="gy-3 row">
149
+ // <div class="col-12">
150
+ // <justifi-payment-method-form iframe-origin="https://example.com" payment-method-form-type="card"></justifi-payment-method-form>
151
+ // </div>
152
+ // <div class="col-12">
153
+ // <justifi-billing-form legend="Billing Info"></justifi-billing-form>
154
+ // </div>
155
+ // <slot name="insurance"></slot>
156
+ // <div class="col-12">
157
+ // <button class="btn btn-primary jfi-submit-button" type="submit">
158
+ // Submit
159
+ // </button>
160
+ // </div>
161
+ // </form>
162
+ // </mock:shadow-root>
163
+ // </justifi-checkout>
164
+ // `);
165
+ // });
166
+ });
@@ -0,0 +1,19 @@
1
+ export const mockCheckout = {
2
+ "id": "cho_1Kx0fKUNt2GVfHrDj5GxoO",
3
+ "type": "checkout",
4
+ "page_info": null,
5
+ "data": {
6
+ "payment_intent_id": "pi_3triuDeQOGkrdkONJwsOxD",
7
+ "account_id": "acc_323sM3WDAUnHH0fJD7re9h",
8
+ "platform_account_id": "acc_75j5yGxQUf69B9vT2hDUn9",
9
+ "payment_amount": "2413",
10
+ "payment_client_id": "test_eohVQllq0mJy34T14dsZJlHjXKr7rKyH",
11
+ "payment_description": "dptest pos mode",
12
+ "payment_methods": [],
13
+ "payment_method_group_id": null,
14
+ "payment_settings": {
15
+ "credit_card_payments": true,
16
+ "ach_payments": true
17
+ }
18
+ }
19
+ };
@@ -1,7 +1,10 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const LoadingState = () => (h("main", { part: "detail-loading-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } }, h("div", { part: "detail-loading-spinner", class: "spinner-border spinner-border-sm", role: "status" }, h("span", { class: "visually-hidden" }, "Loading..."))));
3
3
  export const ErrorState = (errorMessage) => (h("main", { part: "detail-empty-state", class: "p-4 d-flex justify-content-center text-center", style: { fontSize: '1.2rem' } }, h("div", null, errorMessage)));
4
- export const DetailSection = (props, children) => (h("div", { part: "detail-section", class: "mt-4" }, h("h5", { part: "detail-section-title" }, props.sectionTitle), h("hr", null), h("div", { class: "d-table gap-2 w-100" }, ...children)));
4
+ export const DetailSectionTitle = (props) => [
5
+ h("h5", { part: "detail-section-title", class: "mt-4" }, props.sectionTitle),
6
+ h("hr", null),
7
+ ];
5
8
  export const DetailItem = ({ title, value, }) => title && value ? (h("div", { class: "d-table-row gap-2" }, h("span", { part: "detail-section-item-title", class: "fw-bold d-table-cell px-2" }, title), h("span", { part: "detail-section-item-data", class: "flex-1 d-table-cell px-2 text-wrap", innerHTML: value }))) : null;
6
9
  export const EntityHeadInfoItem = ({ title, value, classes, }) => (h("div", { part: "detail-head-info-item", class: `d-flex flex-column ${classes}` }, h("span", { part: "detail-head-info-item-title", class: "fw-bold border-1 border-bottom ps-2 pe-2" }, title), h("span", { part: "detail-head-info-item-data", class: "pt-2 ps-2 pe-2" }, value)));
7
10
  export const EntityHeadInfo = ({ title, slot, badge }, children) => (h("div", { slot: slot, part: "detail-head", class: "p-2" }, h("div", { class: "d-flex flex-row align-items-center gap-2 mb-2" }, h("h1", { class: "m-0", part: "detail-title" }, title), badge), h("div", { part: "detail-head-info", class: "d-flex flex-row align-items-top" }, children)));
@@ -1,2 +1,3 @@
1
1
  import { h } from "@stencil/core";
2
2
  export const FormAlert = (message) => (h("div", { class: 'alert alert-danger d-flex align-items-center', role: 'alert' }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "currentColor", class: "bi bi-exclamation-triangle-fill flex-shrink-0 me-2", viewBox: "0 0 16 16", role: "img", "aria-label": "Warning:" }, h("path", { d: "M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z" })), h("div", null, message)));
3
+ export const LoadingSpinner = () => (h("div", { class: "spinner-border spinner-border-sm", role: "status" }, h("span", { class: "visually-hidden" }, "Loading...")));
@@ -0,0 +1,14 @@
1
+ export const makeGetGrossPaymentChartData = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
2
+ try {
3
+ const response = await service.fetchGrossVolumeChartData(id, authToken);
4
+ if (!response.error) {
5
+ onSuccess(response.data);
6
+ }
7
+ else {
8
+ onError(`Error trying to fetch data : ${response.error}`);
9
+ }
10
+ }
11
+ catch (error) {
12
+ onError(`Error trying to fetch data : ${error}`);
13
+ }
14
+ };