@justifi/webcomponents 6.0.0-rc.4 → 6.0.0-rc.5

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 (359) hide show
  1. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +2 -2
  2. package/dist/cjs/{check-pkg-version-BNVGE27p.js → check-pkg-version-BsodhBbK.js} +1 -1
  3. package/dist/cjs/{checkout.store-CV_fuGQw.js → checkout.store-Cn3Jj5gi.js} +1 -0
  4. package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
  5. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  6. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  7. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
  8. package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
  9. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +2 -2
  10. package/dist/cjs/form-control-number.cjs.entry.js +2 -2
  11. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  12. package/dist/cjs/form-control-select_2.cjs.entry.js +2 -2
  13. package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
  14. package/dist/cjs/justifi-apple-pay.cjs.entry.js +836 -0
  15. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +8 -8
  16. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-checkout-summary_6.cjs.entry.js +140 -34
  19. package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
  20. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  24. package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
  25. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  26. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  27. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
  28. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  29. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
  30. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  31. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
  32. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
  33. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
  34. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  35. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  36. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  37. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +2 -2
  38. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
  39. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
  40. package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
  41. package/dist/cjs/loader.cjs.js +1 -1
  42. package/dist/cjs/{package-BKILqyp3.js → package-DJaHaxMC.js} +1 -1
  43. package/dist/cjs/payment-details-core.cjs.entry.js +8 -8
  44. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  45. package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
  46. package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
  47. package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
  48. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +1 -1
  49. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  50. package/dist/cjs/terminals-list-core.cjs.entry.js +1 -1
  51. package/dist/cjs/webcomponents.cjs.js +1 -1
  52. package/dist/collection/api/ApplePay.js +119 -0
  53. package/dist/collection/api/services/apple-pay.service.js +334 -0
  54. package/dist/collection/collection-manifest.json +1 -0
  55. package/dist/collection/components/modular-checkout/modular-checkout.js +137 -32
  56. package/dist/collection/components/modular-checkout/sub-components/apple-pay-skeleton.js +10 -0
  57. package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +555 -0
  58. package/dist/collection/components/modular-checkout/sub-components/bank-account.js +2 -2
  59. package/dist/collection/components/modular-checkout/sub-components/card-form.js +2 -2
  60. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  61. package/dist/collection/components/modular-checkout/sub-components/summary.js +1 -1
  62. package/dist/collection/components/order-terminals/order-terminals.js +1 -1
  63. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  64. package/dist/collection/components/payment-details/payment-details-core.js +8 -8
  65. package/dist/collection/components/payment-transactions-list/payment-transactions-list.js +1 -1
  66. package/dist/collection/components/payments-list/payments-list-core.js +1 -1
  67. package/dist/collection/components/payments-list/payments-list-filters.js +2 -2
  68. package/dist/collection/components/payments-list/payments-list.js +1 -1
  69. package/dist/collection/components/payout-details/payout-details-core.js +3 -3
  70. package/dist/collection/components/payout-transactions-list/payout-transactions-list.js +1 -1
  71. package/dist/collection/components/payouts-list/payouts-list-core.js +1 -1
  72. package/dist/collection/components/payouts-list/payouts-list-filters.js +2 -2
  73. package/dist/collection/components/payouts-list/payouts-list.js +1 -1
  74. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +1 -1
  75. package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +2 -2
  76. package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +1 -1
  77. package/dist/collection/components/terminals-list/terminals-list-core.js +1 -1
  78. package/dist/collection/components/terminals-list/terminals-list-filters.js +1 -1
  79. package/dist/collection/components/terminals-list/terminals-list.js +1 -1
  80. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +2 -2
  81. package/dist/collection/store/checkout.store.js +1 -0
  82. package/dist/collection/ui-components/apple-pay-button.js +146 -0
  83. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  84. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  85. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  86. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  87. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  88. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  89. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  90. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  91. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  92. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  93. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  94. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  95. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  96. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  97. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  98. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  99. package/dist/docs.json +463 -1
  100. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  101. package/dist/esm/{badge-D_mzXSCQ.js → badge-D4ZXPFjL.js} +1 -1
  102. package/dist/esm/bank-account-document-form-inputs_4.entry.js +5 -5
  103. package/dist/esm/bank-account-form.entry.js +2 -2
  104. package/dist/esm/business-details-core.entry.js +3 -3
  105. package/dist/esm/{button-CeR8qVS3.js → button-C0wLsDP3.js} +1 -1
  106. package/dist/esm/card-form.entry.js +2 -2
  107. package/dist/esm/{check-pkg-version-CaWUVat7.js → check-pkg-version-D_w9UM2s.js} +1 -1
  108. package/dist/esm/{checkout.store-B60siz2l.js → checkout.store-OAv_iY1u.js} +1 -0
  109. package/dist/esm/checkouts-list-core.entry.js +5 -5
  110. package/dist/esm/{checkouts-table-CFZYoYjn.js → checkouts-table-DjGKtqoc.js} +2 -2
  111. package/dist/esm/custom-popper_2.entry.js +3 -3
  112. package/dist/esm/form-alert_5.entry.js +1 -1
  113. package/dist/esm/form-control-checkbox.entry.js +5 -5
  114. package/dist/esm/form-control-date.entry.js +4 -4
  115. package/dist/esm/{form-control-error-text-D3ZwkOv-.js → form-control-error-text-Bzfs_rxk.js} +1 -1
  116. package/dist/esm/form-control-file-v2_2.entry.js +5 -5
  117. package/dist/esm/{form-control-help-text-C39ZW65w.js → form-control-help-text-ueLctOBN.js} +1 -1
  118. package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
  119. package/dist/esm/form-control-monetary.entry.js +5 -5
  120. package/dist/esm/form-control-number-masked_2.entry.js +4 -4
  121. package/dist/esm/form-control-number.entry.js +5 -5
  122. package/dist/esm/form-control-radio.entry.js +3 -3
  123. package/dist/esm/form-control-select_2.entry.js +4 -4
  124. package/dist/esm/gross-payment-chart-core.entry.js +3 -3
  125. package/dist/esm/{header-1-E-hEi3wF.js → header-1-BMKEv9y6.js} +1 -1
  126. package/dist/esm/{header-3-Dm7M85kz.js → header-3-C3t3m27b.js} +1 -1
  127. package/dist/esm/hidden-input_2.entry.js +7 -7
  128. package/dist/esm/{insurance-state-CB4l8sOv.js → insurance-state-d4hjThzE.js} +1 -1
  129. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
  130. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
  131. package/dist/esm/justifi-additional-statement_8.entry.js +1 -1
  132. package/dist/esm/justifi-apple-pay.entry.js +834 -0
  133. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +12 -12
  134. package/dist/esm/justifi-business-details.entry.js +4 -4
  135. package/dist/esm/justifi-business-form.entry.js +6 -6
  136. package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
  137. package/dist/esm/justifi-checkout-summary_6.entry.js +144 -38
  138. package/dist/esm/justifi-checkout.entry.js +4 -4
  139. package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
  140. package/dist/esm/justifi-checkouts-list.entry.js +5 -5
  141. package/dist/esm/justifi-details.entry.js +2 -2
  142. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  143. package/dist/esm/justifi-dispute-notification_3.entry.js +5 -5
  144. package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
  145. package/dist/esm/justifi-order-terminals.entry.js +5 -5
  146. package/dist/esm/justifi-owner-form_3.entry.js +2 -2
  147. package/dist/esm/justifi-payment-details.entry.js +4 -4
  148. package/dist/esm/justifi-payment-provisioning-core.entry.js +2 -2
  149. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  150. package/dist/esm/justifi-payment-transactions-list.entry.js +6 -6
  151. package/dist/esm/justifi-payments-list-filters.entry.js +3 -3
  152. package/dist/esm/justifi-payments-list.entry.js +7 -7
  153. package/dist/esm/justifi-payout-details.entry.js +4 -4
  154. package/dist/esm/justifi-payout-transactions-list.entry.js +6 -6
  155. package/dist/esm/justifi-payouts-list-filters.entry.js +3 -3
  156. package/dist/esm/justifi-payouts-list.entry.js +7 -7
  157. package/dist/esm/justifi-refund-payment.entry.js +5 -5
  158. package/dist/esm/justifi-saved-payment-method.entry.js +1 -1
  159. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
  160. package/dist/esm/justifi-skeleton.entry.js +3 -3
  161. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
  162. package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
  163. package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
  164. package/dist/esm/justifi-terminals-list.entry.js +6 -6
  165. package/dist/esm/loader.js +1 -1
  166. package/dist/esm/{package-BF-uL8B4.js → package-78C4rMuv.js} +1 -1
  167. package/dist/esm/pagination-menu.entry.js +1 -1
  168. package/dist/esm/{parts-CfF8KKwx.js → parts-RvUQ__Pq.js} +1 -1
  169. package/dist/esm/payment-details-core.entry.js +13 -13
  170. package/dist/esm/payment-method-option.entry.js +2 -2
  171. package/dist/esm/payments-list-core.entry.js +7 -7
  172. package/dist/esm/{payments-status-XoZrlbiZ.js → payments-status-1yRdTNeS.js} +1 -1
  173. package/dist/esm/{payments-table-Dh4P9mTb.js → payments-table-8RADYkma.js} +2 -2
  174. package/dist/esm/payout-details-core.entry.js +9 -9
  175. package/dist/esm/payouts-list-core.entry.js +7 -7
  176. package/dist/esm/{payouts-status-Qm2jZG1-.js → payouts-status-BqsQVtBp.js} +1 -1
  177. package/dist/esm/{payouts-table-DMVAZp-r.js → payouts-table-DPw7yIx8.js} +2 -2
  178. package/dist/esm/{skeleton-DrHwsgs_.js → skeleton-BmTjpTYa.js} +1 -1
  179. package/dist/esm/{spinner-XBq6mVJW.js → spinner-YGDOI-CS.js} +1 -1
  180. package/dist/esm/table-filters-menu.entry.js +2 -2
  181. package/dist/esm/{table-qqt2Ew5y.js → table-ybHxxc9f.js} +2 -2
  182. package/dist/esm/terminal-orders-list-core.entry.js +6 -6
  183. package/dist/esm/{terminal-orders-table-BN4Co4T8.js → terminal-orders-table-D-xP5WuM.js} +2 -2
  184. package/dist/esm/terminal-quantity-selector.entry.js +2 -2
  185. package/dist/esm/terminals-list-core.entry.js +6 -6
  186. package/dist/esm/{terminals-table-C8LczeG_.js → terminals-table-DVAPCgEr.js} +2 -2
  187. package/dist/esm/{utils-kWaZhFAd.js → utils-DG5aMFmf.js} +1 -1
  188. package/dist/esm/webcomponents.js +1 -1
  189. package/dist/module/bank-account.js +2 -2
  190. package/dist/module/card-form2.js +2 -2
  191. package/dist/module/checkout.store.js +1 -0
  192. package/dist/module/custom-popper2.js +2 -2
  193. package/dist/module/form-control-checkbox2.js +2 -2
  194. package/dist/module/form-control-date2.js +2 -2
  195. package/dist/module/form-control-file-v22.js +1 -1
  196. package/dist/module/form-control-file2.js +2 -2
  197. package/dist/module/form-control-monetary2.js +2 -2
  198. package/dist/module/form-control-number-masked2.js +2 -2
  199. package/dist/module/form-control-number.js +2 -2
  200. package/dist/module/form-control-radio2.js +2 -2
  201. package/dist/module/form-control-text2.js +2 -2
  202. package/dist/module/form-control-textarea2.js +2 -2
  203. package/dist/module/hidden-input2.js +1 -1
  204. package/dist/module/iframe-input2.js +3 -3
  205. package/dist/module/justifi-apple-pay.d.ts +11 -0
  206. package/dist/module/justifi-apple-pay.js +877 -0
  207. package/dist/module/justifi-button2.js +1 -1
  208. package/dist/module/justifi-header2.js +1 -1
  209. package/dist/module/justifi-order-terminals.js +1 -1
  210. package/dist/module/justifi-payment-transactions-list.js +1 -1
  211. package/dist/module/justifi-payments-list-filters.js +2 -2
  212. package/dist/module/justifi-payments-list.js +1 -1
  213. package/dist/module/justifi-payout-transactions-list.js +1 -1
  214. package/dist/module/justifi-payouts-list-filters.js +2 -2
  215. package/dist/module/justifi-payouts-list.js +1 -1
  216. package/dist/module/justifi-skeleton.js +1 -1
  217. package/dist/module/justifi-terminal-orders-list-filters.js +2 -2
  218. package/dist/module/justifi-terminal-orders-list.js +1 -1
  219. package/dist/module/justifi-terminals-list-filters.js +1 -1
  220. package/dist/module/justifi-terminals-list.js +1 -1
  221. package/dist/module/modular-checkout.js +133 -27
  222. package/dist/module/package.js +1 -1
  223. package/dist/module/payment-details-core2.js +8 -8
  224. package/dist/module/payment-method-option.js +1 -1
  225. package/dist/module/payments-list-core2.js +1 -1
  226. package/dist/module/payout-details-core2.js +3 -3
  227. package/dist/module/payouts-list-core2.js +1 -1
  228. package/dist/module/summary.js +1 -1
  229. package/dist/module/terminal-orders-list-core2.js +1 -1
  230. package/dist/module/terminal-quantity-selector2.js +1 -1
  231. package/dist/module/terminals-list-core2.js +1 -1
  232. package/dist/module/tokenize-payment-method.js +2 -2
  233. package/dist/types/api/ApplePay.d.ts +196 -0
  234. package/dist/types/api/services/apple-pay.service.d.ts +66 -0
  235. package/dist/types/components/modular-checkout/modular-checkout.d.ts +9 -0
  236. package/dist/types/components/modular-checkout/sub-components/apple-pay-skeleton.d.ts +6 -0
  237. package/dist/types/components/modular-checkout/sub-components/apple-pay.d.ts +39 -0
  238. package/dist/types/components.d.ts +122 -0
  239. package/dist/types/store/checkout.store.d.ts +1 -0
  240. package/dist/types/ui-components/apple-pay-button.d.ts +17 -0
  241. package/dist/webcomponents/{p-48bccf3b.entry.js → p-03c7cee8.entry.js} +1 -1
  242. package/dist/webcomponents/{p-738e0511.entry.js → p-08a5cc2f.entry.js} +1 -1
  243. package/dist/webcomponents/{p-43d693a3.entry.js → p-0aee6da6.entry.js} +1 -1
  244. package/dist/webcomponents/{p-d7720819.entry.js → p-0e290b6e.entry.js} +1 -1
  245. package/dist/webcomponents/{p-0cab7d5d.entry.js → p-0e64cd09.entry.js} +1 -1
  246. package/dist/webcomponents/{p-9f289c31.entry.js → p-1246b999.entry.js} +1 -1
  247. package/dist/webcomponents/p-12c312a0.entry.js +1 -0
  248. package/dist/webcomponents/{p-c5dabaf4.entry.js → p-134d5029.entry.js} +1 -1
  249. package/dist/webcomponents/{p-f7e62bfa.entry.js → p-1b892b3a.entry.js} +1 -1
  250. package/dist/webcomponents/p-1c0c1d7b.entry.js +1 -0
  251. package/dist/webcomponents/p-1e206c92.entry.js +1 -0
  252. package/dist/webcomponents/p-1ea7868a.entry.js +1 -0
  253. package/dist/webcomponents/{p-84ce3bae.entry.js → p-281e36be.entry.js} +1 -1
  254. package/dist/webcomponents/p-2a0a907d.entry.js +1 -0
  255. package/dist/webcomponents/{p-98579723.entry.js → p-2ab0a2b3.entry.js} +1 -1
  256. package/dist/webcomponents/{p-7b9008f1.entry.js → p-32cecfaf.entry.js} +1 -1
  257. package/dist/webcomponents/{p-fd39af50.entry.js → p-3ffe1e2e.entry.js} +1 -1
  258. package/dist/webcomponents/p-48f42f07.entry.js +1 -0
  259. package/dist/webcomponents/{p-14d66df2.entry.js → p-4a1198ee.entry.js} +1 -1
  260. package/dist/webcomponents/{p-befda39d.entry.js → p-4a79c737.entry.js} +1 -1
  261. package/dist/webcomponents/{p-a8205044.entry.js → p-4c994761.entry.js} +1 -1
  262. package/dist/webcomponents/p-5510b57c.entry.js +1 -0
  263. package/dist/webcomponents/p-5a5f07be.entry.js +1 -0
  264. package/dist/webcomponents/p-5acd6add.entry.js +1 -0
  265. package/dist/webcomponents/{p-6e18d13f.entry.js → p-5ad70aae.entry.js} +1 -1
  266. package/dist/webcomponents/p-5afbfafb.entry.js +1 -0
  267. package/dist/webcomponents/p-6974a44c.entry.js +1 -0
  268. package/dist/webcomponents/{p-d075bd72.entry.js → p-6df132e6.entry.js} +1 -1
  269. package/dist/webcomponents/p-6f2b41f5.entry.js +1 -0
  270. package/dist/webcomponents/p-6f9755cc.entry.js +1 -0
  271. package/dist/webcomponents/p-70cd4cbd.entry.js +1 -0
  272. package/dist/webcomponents/p-7288473f.entry.js +1 -0
  273. package/dist/webcomponents/{p-79055216.entry.js → p-76a95d07.entry.js} +1 -1
  274. package/dist/webcomponents/{p-724b0361.entry.js → p-776699bd.entry.js} +1 -1
  275. package/dist/webcomponents/p-78C4rMuv.js +1 -0
  276. package/dist/webcomponents/{p-29b6f15a.entry.js → p-7b9fa1fb.entry.js} +1 -1
  277. package/dist/webcomponents/{p-518a9519.entry.js → p-9009dede.entry.js} +1 -1
  278. package/dist/webcomponents/p-98939b74.entry.js +1 -0
  279. package/dist/webcomponents/{p-BTkXk7ol.js → p-BUadwxkh.js} +1 -1
  280. package/dist/webcomponents/{p-CCME-fyU.js → p-BXKEChoo.js} +1 -1
  281. package/dist/webcomponents/p-BZzESzqz.js +1 -0
  282. package/dist/webcomponents/{p-Dvxpy_P1.js → p-BhdBpAn9.js} +1 -1
  283. package/dist/webcomponents/p-BmFoKOM3.js +1 -0
  284. package/dist/webcomponents/p-BtOB_CaO.js +1 -0
  285. package/dist/webcomponents/{p-qMrd7_Gp.js → p-C0AHrswP.js} +1 -1
  286. package/dist/webcomponents/{p-BeszVz87.js → p-CP_tg-uH.js} +1 -1
  287. package/dist/webcomponents/{p-JgbsbAhz.js → p-D48iERjQ.js} +1 -1
  288. package/dist/webcomponents/p-D7eeJWA-.js +1 -0
  289. package/dist/webcomponents/{p-CsNubTqD.js → p-DBsw4qpn.js} +1 -1
  290. package/dist/webcomponents/{p-vRhNRfmB.js → p-DKRXPZKS.js} +1 -1
  291. package/dist/webcomponents/p-DOd8HaWV.js +1 -0
  292. package/dist/webcomponents/p-DcE8SQPv.js +1 -0
  293. package/dist/webcomponents/{p-DWOKxG7j.js → p-DhRb39as.js} +1 -1
  294. package/dist/webcomponents/p-Drz6LnIw.js +1 -0
  295. package/dist/webcomponents/{p-DO3INvI2.js → p-DuXN7Akd.js} +1 -1
  296. package/dist/webcomponents/{p-Bz164TKZ.js → p-HAk7yBNq.js} +1 -1
  297. package/dist/webcomponents/{p-CfF8KKwx.js → p-RvUQ__Pq.js} +1 -1
  298. package/dist/webcomponents/p-a1483fbd.entry.js +1 -0
  299. package/dist/webcomponents/{p-53c81d62.entry.js → p-a1a8f6bd.entry.js} +1 -1
  300. package/dist/webcomponents/{p-15777cfe.entry.js → p-a406bf1a.entry.js} +1 -1
  301. package/dist/webcomponents/{p-f7345d66.entry.js → p-a4cb5604.entry.js} +1 -1
  302. package/dist/webcomponents/{p-f4f3cae8.entry.js → p-a70bc148.entry.js} +1 -1
  303. package/dist/webcomponents/{p-57143978.entry.js → p-a9d2dd5e.entry.js} +1 -1
  304. package/dist/webcomponents/{p-c5b48e8d.entry.js → p-afc83e27.entry.js} +1 -1
  305. package/dist/webcomponents/{p-3d85d046.entry.js → p-b04cc606.entry.js} +1 -1
  306. package/dist/webcomponents/{p-145bb9c4.entry.js → p-b10e34b0.entry.js} +1 -1
  307. package/dist/webcomponents/p-b41d2b8f.entry.js +1 -0
  308. package/dist/webcomponents/p-b8f63e28.entry.js +1 -0
  309. package/dist/webcomponents/{p-9c5b0b94.entry.js → p-bbbb9225.entry.js} +1 -1
  310. package/dist/webcomponents/p-bd560810.entry.js +1 -0
  311. package/dist/webcomponents/{p-413236be.entry.js → p-c029fc20.entry.js} +1 -1
  312. package/dist/webcomponents/p-c62e23c1.entry.js +1 -0
  313. package/dist/webcomponents/{p-b0bfa20f.entry.js → p-c6860f60.entry.js} +1 -1
  314. package/dist/webcomponents/{p-0e287092.entry.js → p-cbfc8269.entry.js} +1 -1
  315. package/dist/webcomponents/{p-1ffbf771.entry.js → p-d0729065.entry.js} +1 -1
  316. package/dist/webcomponents/{p-b93377a7.entry.js → p-dad15b15.entry.js} +1 -1
  317. package/dist/webcomponents/{p-0b790fa4.entry.js → p-dc245644.entry.js} +4 -4
  318. package/dist/webcomponents/{p-e81c5d79.entry.js → p-e00fd71d.entry.js} +1 -1
  319. package/dist/webcomponents/{p-e2267656.entry.js → p-e6ca1872.entry.js} +1 -1
  320. package/dist/webcomponents/{p-8f31a0c5.entry.js → p-e70a5f50.entry.js} +1 -1
  321. package/dist/webcomponents/{p-904a95e5.entry.js → p-e8a198fa.entry.js} +1 -1
  322. package/dist/webcomponents/{p-a0573ecc.entry.js → p-eca1e808.entry.js} +1 -1
  323. package/dist/webcomponents/p-fb1904d2.entry.js +1 -0
  324. package/dist/webcomponents/{p-35bbfbf8.entry.js → p-fbaf62a5.entry.js} +1 -1
  325. package/dist/webcomponents/p-fcb6e870.entry.js +1 -0
  326. package/dist/webcomponents/{p-YND5pTuF.js → p-nWGo6sHu.js} +1 -1
  327. package/dist/webcomponents/{p-BisQ61nK.js → p-wyEq9Pa1.js} +1 -1
  328. package/dist/webcomponents/webcomponents.esm.js +1 -1
  329. package/package.json +1 -1
  330. package/dist/webcomponents/p-1975406a.entry.js +0 -1
  331. package/dist/webcomponents/p-2a59547b.entry.js +0 -1
  332. package/dist/webcomponents/p-2da63719.entry.js +0 -1
  333. package/dist/webcomponents/p-4ae2a0b9.entry.js +0 -1
  334. package/dist/webcomponents/p-4b795b77.entry.js +0 -1
  335. package/dist/webcomponents/p-5477c449.entry.js +0 -1
  336. package/dist/webcomponents/p-56980ef3.entry.js +0 -1
  337. package/dist/webcomponents/p-614fcef6.entry.js +0 -1
  338. package/dist/webcomponents/p-70ff3b10.entry.js +0 -1
  339. package/dist/webcomponents/p-739d6f13.entry.js +0 -1
  340. package/dist/webcomponents/p-8a5e168d.entry.js +0 -1
  341. package/dist/webcomponents/p-9ccd19f5.entry.js +0 -1
  342. package/dist/webcomponents/p-BC8YDY7M.js +0 -1
  343. package/dist/webcomponents/p-BF-uL8B4.js +0 -1
  344. package/dist/webcomponents/p-BbYVgLcf.js +0 -1
  345. package/dist/webcomponents/p-C1fMfnu0.js +0 -1
  346. package/dist/webcomponents/p-C_CXv7AN.js +0 -1
  347. package/dist/webcomponents/p-CwZKT93w.js +0 -1
  348. package/dist/webcomponents/p-D599ZMGU.js +0 -1
  349. package/dist/webcomponents/p-a33ea645.entry.js +0 -1
  350. package/dist/webcomponents/p-ba018d57.entry.js +0 -1
  351. package/dist/webcomponents/p-bafe873d.entry.js +0 -1
  352. package/dist/webcomponents/p-be06d86a.entry.js +0 -1
  353. package/dist/webcomponents/p-cea8e40e.entry.js +0 -1
  354. package/dist/webcomponents/p-df4f2af9.entry.js +0 -1
  355. package/dist/webcomponents/p-e1ba5735.entry.js +0 -1
  356. package/dist/webcomponents/p-e4e30e84.entry.js +0 -1
  357. package/dist/webcomponents/p-f200cbda.entry.js +0 -1
  358. package/dist/webcomponents/p-f4645aef.entry.js +0 -1
  359. package/dist/webcomponents/p-zrUQD0Wr.js +0 -1
@@ -0,0 +1,334 @@
1
+ import { configState } from "../../components/config-provider/config-state";
2
+ import { ApplePaySessionStatus, ApplePayHelpers, ApplePayConfig, ApplePayPaymentRequest, } from "../ApplePay";
3
+ export class ApplePayService {
4
+ constructor() {
5
+ this.apiBaseUrl = configState.apiOrigin;
6
+ }
7
+ /**
8
+ * Set custom API base URL
9
+ */
10
+ setApiBaseUrl(url) {
11
+ this.apiBaseUrl = url;
12
+ }
13
+ /**
14
+ * Set authentication token
15
+ */
16
+ setAuthToken(authToken) {
17
+ this.authToken = authToken;
18
+ }
19
+ setAccountId(accountId) {
20
+ this.accountId = accountId;
21
+ }
22
+ /**
23
+ * Initialize Apple Pay configuration
24
+ */
25
+ initialize(applePayConfig) {
26
+ this.applePayConfig = new ApplePayConfig(applePayConfig);
27
+ if (!this.applePayConfig.isValid) {
28
+ throw new Error('Invalid Apple Pay configuration provided');
29
+ }
30
+ }
31
+ /**
32
+ * Validate merchant with Apple Pay servers via API
33
+ */
34
+ async validateMerchant(authToken) {
35
+ const endpoint = `${this.apiBaseUrl}/v1/apple_pay/merchant_session`;
36
+ console.log('=== MERCHANT VALIDATION REQUEST ===');
37
+ console.log('Endpoint:', endpoint);
38
+ console.log('Auth token present:', !!authToken);
39
+ console.log('Account ID:', this.accountId);
40
+ const response = await fetch(endpoint, {
41
+ method: 'POST',
42
+ headers: {
43
+ 'Content-Type': 'application/json',
44
+ Accept: 'application/json',
45
+ Authorization: `Bearer ${authToken}`,
46
+ 'Sub-Account': this.accountId,
47
+ },
48
+ });
49
+ console.log('Response status:', response.status);
50
+ if (!response.ok) {
51
+ const errorData = await response.text();
52
+ console.error('Backend validation failed - Raw response:', errorData);
53
+ try {
54
+ const jsonError = JSON.parse(errorData);
55
+ console.error('Backend validation failed - Parsed error:', jsonError);
56
+ }
57
+ catch (parseError) {
58
+ console.error('Could not parse error response as JSON:', parseError);
59
+ }
60
+ throw new Error(`Merchant validation failed: ${response.status}`);
61
+ }
62
+ const merchantSession = await response.json();
63
+ console.log('Merchant session received:', merchantSession);
64
+ return merchantSession;
65
+ }
66
+ /**
67
+ * Process Apple Pay payment via API (fixed to match original logic)
68
+ */
69
+ async processPayment(authToken, payload) {
70
+ const endpoint = `${this.apiBaseUrl}/v1/apple_pay/process_token`;
71
+ const body = payload;
72
+ const response = await fetch(endpoint, {
73
+ method: 'POST',
74
+ headers: {
75
+ 'Content-Type': 'application/json',
76
+ Accept: 'application/json',
77
+ Authorization: `Bearer ${authToken}`,
78
+ 'Sub-Account': this.accountId,
79
+ },
80
+ body: JSON.stringify(body),
81
+ });
82
+ const result = await response.json();
83
+ return {
84
+ success: result.id && !!result.data.token,
85
+ data: result,
86
+ };
87
+ }
88
+ /**
89
+ * Check if Apple Pay is available on this device/browser
90
+ */
91
+ isAvailable() {
92
+ return (ApplePayHelpers.isApplePaySupported() && ApplePayHelpers.canMakePayments());
93
+ }
94
+ /**
95
+ * Check if the user has an active card for the merchant
96
+ */
97
+ async canMakePaymentsWithActiveCard() {
98
+ if (!this.applePayConfig) {
99
+ throw new Error('Apple Pay not initialized. Call initialize() first.');
100
+ }
101
+ return await ApplePayHelpers.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier);
102
+ }
103
+ /**
104
+ * Start Apple Pay session
105
+ */
106
+ async startPaymentSession(paymentRequest) {
107
+ if (!this.applePayConfig) {
108
+ throw new Error('Apple Pay not initialized. Call initialize() first.');
109
+ }
110
+ // if (!this.isAvailable()) {
111
+ // throw new Error('Apple Pay is not available on this device/browser');
112
+ // }
113
+ const request = new ApplePayPaymentRequest(paymentRequest);
114
+ if (!request.isValid) {
115
+ throw new Error('Invalid payment request provided');
116
+ }
117
+ this.currentPaymentRequest = request;
118
+ return new Promise((resolve, reject) => {
119
+ try {
120
+ this.currentSession = new window.ApplePaySession(3, request);
121
+ this.setupSessionEventHandlers(resolve, reject);
122
+ this.currentSession.begin();
123
+ }
124
+ catch (error) {
125
+ reject({
126
+ success: false,
127
+ error: {
128
+ code: 'SESSION_ERROR',
129
+ message: error instanceof Error
130
+ ? error.message
131
+ : 'Failed to start Apple Pay session',
132
+ },
133
+ });
134
+ }
135
+ });
136
+ }
137
+ /**
138
+ * Abort current Apple Pay session
139
+ */
140
+ abortPaymentSession() {
141
+ if (this.currentSession) {
142
+ this.currentSession.abort();
143
+ this.currentSession = undefined;
144
+ this.currentPaymentRequest = undefined;
145
+ }
146
+ }
147
+ /**
148
+ * Setup Apple Pay session event handlers
149
+ */
150
+ setupSessionEventHandlers(resolve, reject) {
151
+ if (!this.currentSession ||
152
+ !this.applePayConfig ||
153
+ !this.currentPaymentRequest) {
154
+ return;
155
+ }
156
+ this.currentSession.onvalidatemerchant = async () => {
157
+ try {
158
+ if (!this.authToken) {
159
+ throw new Error('Authentication token not set. Call setAuthToken() first.');
160
+ }
161
+ const merchantSession = await this.validateMerchant(this.authToken);
162
+ try {
163
+ this.currentSession.completeMerchantValidation(merchantSession);
164
+ }
165
+ catch (completionError) {
166
+ console.error('Error calling completeMerchantValidation:', completionError);
167
+ throw completionError;
168
+ }
169
+ }
170
+ catch (error) {
171
+ console.error('=== MERCHANT VALIDATION ERROR ===');
172
+ console.error('Error during merchant validation:', error);
173
+ console.error('Error stack:', error.stack);
174
+ this.currentSession.abort();
175
+ reject({
176
+ success: false,
177
+ error: {
178
+ code: 'MERCHANT_VALIDATION_ERROR',
179
+ message: error instanceof Error
180
+ ? error.message
181
+ : 'Merchant validation failed',
182
+ },
183
+ });
184
+ }
185
+ };
186
+ this.currentSession.onpaymentauthorized = async (event) => {
187
+ try {
188
+ const payment = event.payment;
189
+ const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
190
+ name: this.currentPaymentRequest.total.label,
191
+ price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
192
+ description: this.currentPaymentRequest.total.label,
193
+ } });
194
+ if (!this.authToken) {
195
+ throw new Error('Authentication token not set. Call setAuthToken() first.');
196
+ }
197
+ const paymentResult = await this.processPayment(this.authToken, paymentPayload);
198
+ console.log('=== APPLE PAY PROCESS PAYMENT RESULT ===');
199
+ console.log('Payment result:', paymentResult);
200
+ console.log('Payment result data:', paymentResult.data);
201
+ console.log('Payment method ID:', paymentResult.data.id);
202
+ if (paymentResult.success) {
203
+ this.currentSession.completePayment({
204
+ status: ApplePaySessionStatus.STATUS_SUCCESS,
205
+ });
206
+ resolve({
207
+ success: true,
208
+ token: payment.token,
209
+ paymentMethodId: paymentResult.data.id,
210
+ });
211
+ }
212
+ else {
213
+ console.error('PSP reported payment failure:', paymentResult.data);
214
+ this.currentSession.completePayment({
215
+ status: ApplePaySessionStatus.STATUS_FAILURE,
216
+ });
217
+ reject({
218
+ success: false,
219
+ error: {
220
+ code: 'PAYMENT_PROCESSING_ERROR',
221
+ message: 'Payment processing failed',
222
+ },
223
+ });
224
+ }
225
+ }
226
+ catch (error) {
227
+ console.error('=== PAYMENT PROCESSING ERROR ===');
228
+ console.error('Error processing payment:', error);
229
+ console.error('Error stack:', error.stack);
230
+ this.currentSession.completePayment({
231
+ status: ApplePaySessionStatus.STATUS_FAILURE,
232
+ });
233
+ reject({
234
+ success: false,
235
+ error: {
236
+ code: 'PAYMENT_PROCESSING_ERROR',
237
+ message: error instanceof Error
238
+ ? error.message
239
+ : 'Payment processing failed',
240
+ },
241
+ });
242
+ }
243
+ finally {
244
+ this.currentSession = undefined;
245
+ this.currentPaymentRequest = undefined;
246
+ }
247
+ };
248
+ this.currentSession.onpaymentmethodselected = () => {
249
+ const paymentUpdate = {
250
+ newTotal: this.currentPaymentRequest.total,
251
+ newLineItems: this.currentPaymentRequest.lineItems || [],
252
+ };
253
+ try {
254
+ this.currentSession.completePaymentMethodSelection(paymentUpdate);
255
+ }
256
+ catch (error) {
257
+ console.error('Error completing payment method selection:', error);
258
+ this.currentSession.abort();
259
+ }
260
+ };
261
+ this.currentSession.onshippingmethodselected = () => {
262
+ this.currentSession.completeShippingMethodSelection({
263
+ status: ApplePaySessionStatus.STATUS_SUCCESS,
264
+ newTotal: this.currentPaymentRequest.total,
265
+ newLineItems: this.currentPaymentRequest.lineItems || [],
266
+ });
267
+ };
268
+ this.currentSession.oncancel = (event) => {
269
+ if (event.sessionError) {
270
+ console.error(event.sessionError);
271
+ switch (event.sessionError.code) {
272
+ case 'unknown':
273
+ console.error('Unknown error - likely merchant validation issue');
274
+ console.error('This usually means:');
275
+ console.error('1. Merchant certificate is invalid or expired');
276
+ console.error('2. Merchant identifier mismatch');
277
+ console.error('3. Backend validation endpoint issues');
278
+ break;
279
+ case 'invalidMerchantSession':
280
+ console.error('Invalid merchant session provided');
281
+ console.error('Check that the merchant session from backend is valid');
282
+ break;
283
+ case 'userCancel':
284
+ console.error('User cancelled the payment');
285
+ break;
286
+ default:
287
+ console.error('Other error code:', event.sessionError.code);
288
+ }
289
+ }
290
+ this.currentSession = undefined;
291
+ this.currentPaymentRequest = undefined;
292
+ reject({
293
+ success: false,
294
+ error: {
295
+ code: 'USER_CANCELLED',
296
+ message: 'User cancelled the Apple Pay session',
297
+ },
298
+ });
299
+ };
300
+ if ('onerror' in this.currentSession) {
301
+ this.currentSession.onerror = (error) => {
302
+ console.error('=== APPLE PAY SESSION ERROR ===');
303
+ console.error('Session error:', error);
304
+ this.currentSession = undefined;
305
+ this.currentPaymentRequest = undefined;
306
+ reject({
307
+ success: false,
308
+ error: {
309
+ code: 'SESSION_ERROR',
310
+ message: 'Apple Pay session error occurred',
311
+ },
312
+ });
313
+ };
314
+ }
315
+ }
316
+ /**
317
+ * Create a basic payment request
318
+ */
319
+ static createPaymentRequest(amount, label, countryCode = 'US', currencyCode = 'USD') {
320
+ return {
321
+ countryCode,
322
+ currencyCode,
323
+ merchantCapabilities: ApplePayHelpers.getDefaultMerchantCapabilities(),
324
+ supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
325
+ total: ApplePayHelpers.createLineItem(label, amount),
326
+ };
327
+ }
328
+ /**
329
+ * Get current configuration
330
+ */
331
+ getApplePayConfig() {
332
+ return this.applePayConfig;
333
+ }
334
+ }
@@ -73,6 +73,7 @@
73
73
  "components/gross-payment-chart/gross-payment-chart.js",
74
74
  "components/insurance/season-interruption/season-interruption-insurance.js",
75
75
  "components/modular-checkout/modular-checkout.js",
76
+ "components/modular-checkout/sub-components/apple-pay.js",
76
77
  "components/modular-checkout/sub-components/bank-account.js",
77
78
  "components/modular-checkout/sub-components/card-form.js",
78
79
  "components/modular-checkout/sub-components/payment-method-option.js",
@@ -1,14 +1,51 @@
1
- import { h, Host } from "@stencil/core";
1
+ import { h, Host, } from "@stencil/core";
2
2
  import { checkoutStore, onChange } from "../../store/checkout.store";
3
3
  import JustifiAnalytics from "../../api/Analytics";
4
4
  import { checkPkgVersion } from "../../utils/check-pkg-version";
5
- import { ComponentErrorCodes, ComponentErrorMessages, ComponentErrorSeverity, ICheckoutStatus } from "../../api";
6
- import { makeCheckoutComplete, makeGetCheckout } from "../../actions/checkout/checkout-actions";
5
+ import { ComponentErrorCodes, ComponentErrorMessages, ComponentErrorSeverity, ICheckoutStatus, } from "../../api";
6
+ import { makeCheckoutComplete, makeGetCheckout, } from "../../actions/checkout/checkout-actions";
7
7
  import { CheckoutService } from "../../api/services/checkout.service";
8
- import { insuranceValues, insuranceValuesOn, hasInsuranceValueChanged } from "../insurance/insurance-state";
8
+ import { insuranceValues, insuranceValuesOn, hasInsuranceValueChanged, } from "../insurance/insurance-state";
9
9
  export class ModularCheckout {
10
10
  constructor() {
11
11
  this.savePaymentMethod = false;
12
+ this.handleApplePayCompleted = (event) => {
13
+ const { success, token, paymentMethodId, error } = event.detail;
14
+ console.log('=== APPLE PAY COMPLETED EVENT ===');
15
+ console.log('Event detail:', event.detail);
16
+ console.log('Payment Method ID received:', paymentMethodId);
17
+ if (success && token) {
18
+ this.applePayToken = token;
19
+ this.applePayPaymentMethodId = paymentMethodId;
20
+ console.log('=== STORED PAYMENT METHOD ID ===');
21
+ console.log('Stored paymentMethodId:', this.applePayPaymentMethodId);
22
+ // Complete the checkout with Apple Pay token
23
+ this.submitCheckoutWithApplePay();
24
+ }
25
+ else {
26
+ console.error("Apple Pay completed but failed:", error);
27
+ this.errorEvent.emit({
28
+ message: (error === null || error === void 0 ? void 0 : error.message) || "Apple Pay payment failed",
29
+ errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
30
+ severity: ComponentErrorSeverity.ERROR,
31
+ });
32
+ }
33
+ };
34
+ this.handleApplePayError = (event) => {
35
+ const { error } = event.detail;
36
+ console.error("Apple Pay error:", error);
37
+ this.errorEvent.emit({
38
+ message: error || "Apple Pay error occurred",
39
+ errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
40
+ severity: ComponentErrorSeverity.ERROR,
41
+ });
42
+ };
43
+ this.handleApplePayCancelled = () => {
44
+ console.log("Apple Pay cancelled by user");
45
+ // Reset the token if cancelled
46
+ this.applePayToken = undefined;
47
+ this.applePayPaymentMethodId = undefined;
48
+ };
12
49
  }
13
50
  savePaymentMethodChanged(newValue) {
14
51
  checkoutStore.savePaymentMethod = newValue;
@@ -16,20 +53,21 @@ export class ModularCheckout {
16
53
  connectedCallback() {
17
54
  this.observer = new MutationObserver(() => {
18
55
  this.queryFormRefs();
56
+ this.setupApplePayListeners(); // set up again listeners when DOM changes
19
57
  });
20
58
  this.observer.observe(this.hostEl, {
21
59
  childList: true,
22
- subtree: true
60
+ subtree: true,
23
61
  });
24
62
  checkoutStore.checkoutId = this.checkoutId;
25
63
  const config = {
26
64
  authToken: this.authToken,
27
65
  checkoutId: this.checkoutId,
28
- service: new CheckoutService()
66
+ service: new CheckoutService(),
29
67
  };
30
68
  this.getCheckout = makeGetCheckout(config);
31
69
  this.completeCheckout = makeCheckoutComplete(config);
32
- onChange('selectedPaymentMethod', (newValue) => {
70
+ onChange("selectedPaymentMethod", (newValue) => {
33
71
  this.paymentMethodChangedEvent.emit(newValue);
34
72
  });
35
73
  }
@@ -48,7 +86,7 @@ export class ModularCheckout {
48
86
  checkoutStore.savePaymentMethod = this.savePaymentMethod;
49
87
  this.fetchCheckout();
50
88
  // Refresh the checkout data when insurance values actually change (not on initial load)
51
- insuranceValuesOn('set', (key) => {
89
+ insuranceValuesOn("set", (key) => {
52
90
  const value = insuranceValues[key];
53
91
  if (value !== undefined && hasInsuranceValueChanged(key, value)) {
54
92
  this.fetchCheckout();
@@ -57,10 +95,12 @@ export class ModularCheckout {
57
95
  }
58
96
  componentDidLoad() {
59
97
  this.queryFormRefs();
98
+ this.setupApplePayListeners();
60
99
  }
61
100
  disconnectedCallback() {
62
101
  var _a;
63
102
  (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
103
+ this.removeApplePayListeners();
64
104
  }
65
105
  fetchCheckout() {
66
106
  if (this.getCheckout) {
@@ -90,7 +130,7 @@ export class ModularCheckout {
90
130
  errorCode: ComponentErrorCodes.FETCH_ERROR,
91
131
  severity: ComponentErrorSeverity.ERROR,
92
132
  });
93
- }
133
+ },
94
134
  });
95
135
  }
96
136
  }
@@ -106,21 +146,76 @@ export class ModularCheckout {
106
146
  checkoutStore.bnplProviderClientId = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _a === void 0 ? void 0 : _a.provider_client_id;
107
147
  checkoutStore.bnplProviderMode = (_b = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _b === void 0 ? void 0 : _b.provider_mode;
108
148
  checkoutStore.bnplProviderApiVersion = (_c = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _c === void 0 ? void 0 : _c.provider_api_version;
109
- checkoutStore.bnplProviderCheckoutUrl = (_d = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _d === void 0 ? void 0 : _d.provider_checkout_url;
149
+ checkoutStore.bnplProviderCheckoutUrl =
150
+ (_d = checkout === null || checkout === void 0 ? void 0 : checkout.bnpl) === null || _d === void 0 ? void 0 : _d.provider_checkout_url;
110
151
  }
111
152
  queryFormRefs() {
112
- this.paymentMethodFormRef = this.hostEl.querySelector('justifi-card-form, justifi-bank-account-form');
113
- this.billingFormRef = this.hostEl.querySelector('justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full');
114
- this.insuranceFormRef = this.hostEl.querySelector('justifi-season-interruption-insurance');
115
- this.sezzlePaymentMethodRef = this.hostEl.querySelector('justifi-sezzle-payment-method');
153
+ this.paymentMethodFormRef = this.hostEl.querySelector("justifi-card-form, justifi-bank-account-form");
154
+ this.billingFormRef = this.hostEl.querySelector("justifi-billing-form, justifi-bank-account-billing-form-simple, justifi-card-billing-form-simple, justifi-billing-form-full");
155
+ this.insuranceFormRef = this.hostEl.querySelector("justifi-season-interruption-insurance");
156
+ this.sezzlePaymentMethodRef = this.hostEl.querySelector("justifi-sezzle-payment-method");
157
+ this.applePayRef = this.hostEl.querySelector("justifi-apple-pay");
158
+ }
159
+ setupApplePayListeners() {
160
+ if (this.applePayRef) {
161
+ this.applePayRef.addEventListener("applePayCompleted", this.handleApplePayCompleted);
162
+ this.applePayRef.addEventListener("applePayError", this.handleApplePayError);
163
+ this.applePayRef.addEventListener("applePayCancelled", this.handleApplePayCancelled);
164
+ }
165
+ }
166
+ removeApplePayListeners() {
167
+ if (this.applePayRef) {
168
+ this.applePayRef.removeEventListener("applePayCompleted", this.handleApplePayCompleted);
169
+ this.applePayRef.removeEventListener("applePayError", this.handleApplePayError);
170
+ this.applePayRef.removeEventListener("applePayCancelled", this.handleApplePayCancelled);
171
+ }
172
+ }
173
+ async submitCheckoutWithApplePay() {
174
+ if (!this.applePayToken) {
175
+ this.errorEvent.emit({
176
+ message: "No Apple Pay token available",
177
+ errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
178
+ severity: ComponentErrorSeverity.ERROR,
179
+ });
180
+ return;
181
+ }
182
+ console.log('=== SUBMITTING CHECKOUT WITH APPLE PAY ===');
183
+ console.log('Payment method ID to send:', this.applePayPaymentMethodId);
184
+ const payment = {
185
+ payment_mode: "apple_pay",
186
+ payment_token: this.applePayPaymentMethodId,
187
+ };
188
+ console.log('=== CHECKOUT COMPLETE PAYLOAD ===');
189
+ console.log('Payment object:', payment);
190
+ this.completeCheckout({
191
+ payment,
192
+ onSuccess: ({ checkout }) => {
193
+ console.log('=== CHECKOUT COMPLETE SUCCESS ===');
194
+ console.log('Checkout result:', checkout);
195
+ this.submitEvent.emit({
196
+ checkout,
197
+ message: "Apple Pay checkout completed successfully",
198
+ });
199
+ },
200
+ onError: (error) => {
201
+ console.error('=== CHECKOUT COMPLETE ERROR ===');
202
+ console.error('Error:', error);
203
+ this.errorEvent.emit({
204
+ message: error.message,
205
+ errorCode: ComponentErrorCodes.COMPLETE_CHECKOUT_ERROR,
206
+ severity: ComponentErrorSeverity.ERROR,
207
+ });
208
+ },
209
+ });
116
210
  }
117
211
  async tokenizePaymentMethod(tokenizeArgs) {
118
212
  var _a, _b, _c;
119
- const billingInfoValues = (_b = await ((_a = this.billingFormRef) === null || _a === void 0 ? void 0 : _a.getValues())) !== null && _b !== void 0 ? _b : {};
213
+ const billingInfoValues = (_b = (await ((_a = this.billingFormRef) === null || _a === void 0 ? void 0 : _a.getValues()))) !== null && _b !== void 0 ? _b : {};
120
214
  const combinedBillingInfo = Object.assign(Object.assign({}, tokenizeArgs), billingInfoValues);
121
215
  const paymentMethodMetadata = Object.assign({ accountId: checkoutStore.accountId, payment_method_group_id: undefined }, combinedBillingInfo);
122
216
  if (checkoutStore.savePaymentMethod) {
123
- paymentMethodMetadata.payment_method_group_id = checkoutStore.paymentMethodGroupId;
217
+ paymentMethodMetadata.payment_method_group_id =
218
+ checkoutStore.paymentMethodGroupId;
124
219
  }
125
220
  return (_c = this.paymentMethodFormRef) === null || _c === void 0 ? void 0 : _c.tokenize({
126
221
  clientId: this.authToken,
@@ -129,6 +224,10 @@ export class ModularCheckout {
129
224
  });
130
225
  }
131
226
  async getPaymentMethod(submitCheckoutArgs) {
227
+ // If Apple Pay token is available, return a placeholder since we handle it differently
228
+ if (this.applePayToken) {
229
+ return "apple_pay_token";
230
+ }
132
231
  // If we have a payment token from the store (set by tokenize-payment-method), use it
133
232
  if (checkoutStore.paymentToken) {
134
233
  return checkoutStore.paymentToken;
@@ -150,34 +249,41 @@ export class ModularCheckout {
150
249
  }
151
250
  async validate() {
152
251
  var _a, _b;
153
- console.log('billing information form', this.billingFormRef);
154
- console.log('payment method form', this.paymentMethodFormRef);
155
- console.log('insurance form', this.insuranceFormRef);
156
- console.log('sezzle payment method', this.sezzlePaymentMethodRef);
252
+ // If Apple Pay token is available, validation is already complete
253
+ if (this.applePayToken) {
254
+ return true;
255
+ }
157
256
  const promises = [
158
257
  (_a = this.paymentMethodFormRef) === null || _a === void 0 ? void 0 : _a.validate(),
159
- (_b = this.billingFormRef) === null || _b === void 0 ? void 0 : _b.validate()
258
+ (_b = this.billingFormRef) === null || _b === void 0 ? void 0 : _b.validate(),
160
259
  ];
161
260
  if (this.insuranceFormRef) {
162
261
  promises.push(this.insuranceFormRef.validate());
163
262
  }
164
263
  const validationResults = await Promise.all(promises);
165
- return validationResults.every(result => (result === null || result === void 0 ? void 0 : result.isValid) !== false);
264
+ return validationResults.every((result) => (result === null || result === void 0 ? void 0 : result.isValid) !== false);
166
265
  }
167
266
  async submitCheckout(submitCheckoutArgs) {
168
267
  var _a;
268
+ // If Apple Pay token is available, use Apple Pay flow
269
+ if (this.applePayToken) {
270
+ await this.submitCheckoutWithApplePay();
271
+ return;
272
+ }
169
273
  const isValid = await this.validate();
170
274
  if (!isValid) {
171
275
  this.errorEvent.emit({
172
- message: 'Please fill in all required fields.',
276
+ message: "Please fill in all required fields.",
173
277
  errorCode: ComponentErrorCodes.VALIDATION_ERROR,
174
278
  severity: ComponentErrorSeverity.ERROR,
175
279
  });
176
280
  return;
177
281
  }
178
282
  let payment;
179
- if (checkoutStore.selectedPaymentMethod === 'sezzle') {
180
- const insuranceValidation = this.insuranceFormRef ? await this.insuranceFormRef.validate() : { isValid: true };
283
+ if (checkoutStore.selectedPaymentMethod === "sezzle") {
284
+ const insuranceValidation = this.insuranceFormRef
285
+ ? await this.insuranceFormRef.validate()
286
+ : { isValid: true };
181
287
  const sezzleResult = await this.sezzlePaymentMethodRef.resolvePaymentMethod(insuranceValidation);
182
288
  if (sezzleResult.error) {
183
289
  this.errorEvent.emit({
@@ -187,9 +293,9 @@ export class ModularCheckout {
187
293
  });
188
294
  return;
189
295
  }
190
- else if (((_a = sezzleResult.bnpl) === null || _a === void 0 ? void 0 : _a.status) === 'success') {
296
+ else if (((_a = sezzleResult.bnpl) === null || _a === void 0 ? void 0 : _a.status) === "success") {
191
297
  payment = {
192
- payment_mode: 'bnpl',
298
+ payment_mode: "bnpl",
193
299
  payment_token: undefined,
194
300
  };
195
301
  }
@@ -198,15 +304,14 @@ export class ModularCheckout {
198
304
  const paymentMethod = await this.getPaymentMethod(submitCheckoutArgs);
199
305
  if (!paymentMethod) {
200
306
  this.errorEvent.emit({
201
- message: 'Payment method tokenization failed.',
307
+ message: "Payment method tokenization failed.",
202
308
  errorCode: ComponentErrorCodes.TOKENIZE_ERROR,
203
309
  severity: ComponentErrorSeverity.ERROR,
204
310
  });
205
311
  return;
206
312
  }
207
- ;
208
313
  payment = {
209
- payment_mode: 'ecom',
314
+ payment_mode: "ecom",
210
315
  payment_token: paymentMethod,
211
316
  };
212
317
  }
@@ -215,7 +320,7 @@ export class ModularCheckout {
215
320
  onSuccess: ({ checkout }) => {
216
321
  this.submitEvent.emit({
217
322
  checkout,
218
- message: 'Checkout completed successfully',
323
+ message: "Checkout completed successfully",
219
324
  });
220
325
  },
221
326
  onError: (error) => {
@@ -231,7 +336,7 @@ export class ModularCheckout {
231
336
  checkoutStore.selectedPaymentMethod = paymentMethodId;
232
337
  }
233
338
  render() {
234
- return (h(Host, { key: '240891d53dfb817bb39cbeb1e9a96ab885933a47' }));
339
+ return h(Host, { key: '5831cf966bbdf5236cfcb9a58652908c4a020138' });
235
340
  }
236
341
  static get is() { return "justifi-modular-checkout"; }
237
342
  static get properties() {
@@ -0,0 +1,10 @@
1
+ import { h } from "@stencil/core";
2
+ import { Skeleton } from "../../../ui-components";
3
+ const ApplePaySkeleton = (props) => {
4
+ const { isReady } = props;
5
+ if (isReady) {
6
+ return null;
7
+ }
8
+ return (h("div", { class: 'container-fluid p-0' }, h("div", { class: 'row mb-3' }, h("div", { class: 'col-12 align-content-center' }, h(Skeleton, { height: '44px', width: '100%', styles: { borderRadius: "8px" } })))));
9
+ };
10
+ export default ApplePaySkeleton;