@justifi/webcomponents 6.0.6-rc.2 → 6.0.6-rc.3

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 (426) hide show
  1. package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +2 -2
  2. package/dist/cjs/bank-account-form.cjs.entry.js +2 -2
  3. package/dist/cjs/card-form.cjs.entry.js +2 -2
  4. package/dist/cjs/{check-pkg-version-BXAxVT0S.js → check-pkg-version-D2O-HBMD.js} +1 -1
  5. package/dist/cjs/{checkout.store-CS7dpzYF.js → checkout.store-Bswr7kNY.js} +4 -0
  6. package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
  7. package/dist/cjs/custom-popper_2.cjs.entry.js +2 -2
  8. package/dist/cjs/form-control-checkbox.cjs.entry.js +2 -2
  9. package/dist/cjs/form-control-date.cjs.entry.js +2 -2
  10. package/dist/cjs/form-control-file-v2_2.cjs.entry.js +3 -3
  11. package/dist/cjs/form-control-monetary.cjs.entry.js +2 -2
  12. package/dist/cjs/form-control-number-masked_2.cjs.entry.js +2 -2
  13. package/dist/cjs/form-control-number.cjs.entry.js +2 -2
  14. package/dist/cjs/form-control-radio.cjs.entry.js +2 -2
  15. package/dist/cjs/form-control-select_2.cjs.entry.js +4 -4
  16. package/dist/cjs/gross-payment-chart-core.cjs.entry.js +1 -1
  17. package/dist/cjs/hidden-input_2.cjs.entry.js +5 -5
  18. package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +8 -8
  19. package/dist/cjs/{justifi-checkout-summary_7.cjs.entry.js → justifi-apple-pay_8.cjs.entry.js} +882 -15
  20. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +11 -11
  21. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-checkout.cjs.entry.js +4 -4
  24. package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
  25. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +3 -3
  26. package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +1 -1
  27. package/dist/cjs/justifi-dispute-management.cjs.entry.js +3 -3
  28. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +5 -5
  29. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  30. package/dist/cjs/justifi-order-terminals.cjs.entry.js +3 -3
  31. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  32. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  33. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +3 -3
  34. package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +2 -2
  35. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
  36. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  37. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +3 -3
  38. package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
  40. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  41. package/dist/cjs/justifi-saved-payment-method.cjs.entry.js +1 -1
  42. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  43. package/dist/cjs/justifi-skeleton.cjs.entry.js +1 -1
  44. package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +2 -2
  45. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +3 -3
  46. package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
  47. package/dist/cjs/justifi-terminals-list.cjs.entry.js +3 -3
  48. package/dist/cjs/loader.cjs.js +1 -1
  49. package/dist/cjs/{package-D8-S3yHl.js → package-B8AreocB.js} +1 -1
  50. package/dist/cjs/pagination-menu.cjs.entry.js +3 -3
  51. package/dist/cjs/payment-details-core.cjs.entry.js +8 -8
  52. package/dist/cjs/payment-method-option.cjs.entry.js +1 -1
  53. package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
  54. package/dist/cjs/payout-details-core.cjs.entry.js +3 -3
  55. package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
  56. package/dist/cjs/table-filters-menu.cjs.entry.js +1 -1
  57. package/dist/cjs/terminal-orders-list-core.cjs.entry.js +1 -1
  58. package/dist/cjs/terminal-quantity-selector.cjs.entry.js +1 -1
  59. package/dist/cjs/terminals-list-core.cjs.entry.js +1 -1
  60. package/dist/cjs/webcomponents.cjs.js +1 -1
  61. package/dist/collection/api/services/apple-pay.service.js +0 -3
  62. package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +2 -2
  63. package/dist/collection/components/checkout/card-form/card-form.js +2 -2
  64. package/dist/collection/components/checkout/checkout.js +1 -1
  65. package/dist/collection/components/checkout/save-new-payment-method.js +1 -1
  66. package/dist/collection/components/checkout/saved-payment-method.js +1 -1
  67. package/dist/collection/components/checkouts-list/checkouts-list-core.js +1 -1
  68. package/dist/collection/components/checkouts-list/checkouts-list-filters.js +1 -1
  69. package/dist/collection/components/checkouts-list/checkouts-list.js +1 -1
  70. package/dist/collection/components/dispute-management/dispute-management-core.js +1 -1
  71. package/dist/collection/components/dispute-management/dispute-management.js +1 -1
  72. package/dist/collection/components/dispute-management/dispute-notification.js +1 -1
  73. package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +1 -1
  74. package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +1 -1
  75. package/dist/collection/components/dispute-management/dispute-response/customer-details.js +1 -1
  76. package/dist/collection/components/dispute-management/dispute-response/dispute-response-core.js +1 -1
  77. package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +1 -1
  78. package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +1 -1
  79. package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +1 -1
  80. package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +1 -1
  81. package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +1 -1
  82. package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +1 -1
  83. package/dist/collection/components/filters/table-filters-menu.js +1 -1
  84. package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +1 -1
  85. package/dist/collection/components/modular-checkout/modular-checkout.js +7 -6
  86. package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +49 -2
  87. package/dist/collection/components/modular-checkout/sub-components/bank-account-billing-form-simple.js +1 -1
  88. package/dist/collection/components/modular-checkout/sub-components/bank-account.js +2 -2
  89. package/dist/collection/components/modular-checkout/sub-components/card-billing-form-simple.js +1 -1
  90. package/dist/collection/components/modular-checkout/sub-components/card-form.js +2 -2
  91. package/dist/collection/components/modular-checkout/sub-components/payment-method-option.js +1 -1
  92. package/dist/collection/components/modular-checkout/sub-components/summary.js +1 -1
  93. package/dist/collection/components/order-terminals/order-terminals.js +1 -1
  94. package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +1 -1
  95. package/dist/collection/components/payment-details/payment-details-core.js +8 -8
  96. package/dist/collection/components/payment-transactions-list/payment-transactions-list.js +1 -1
  97. package/dist/collection/components/payments-list/payments-list-core.js +1 -1
  98. package/dist/collection/components/payments-list/payments-list-filters.js +2 -2
  99. package/dist/collection/components/payments-list/payments-list.js +1 -1
  100. package/dist/collection/components/payout-details/payout-details-core.js +3 -3
  101. package/dist/collection/components/payout-transactions-list/payout-transactions-list.js +1 -1
  102. package/dist/collection/components/payouts-list/payouts-list-core.js +1 -1
  103. package/dist/collection/components/payouts-list/payouts-list-filters.js +2 -2
  104. package/dist/collection/components/payouts-list/payouts-list.js +1 -1
  105. package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +1 -1
  106. package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +2 -2
  107. package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +1 -1
  108. package/dist/collection/components/terminals-list/terminals-list-core.js +1 -1
  109. package/dist/collection/components/terminals-list/terminals-list-filters.js +1 -1
  110. package/dist/collection/components/terminals-list/terminals-list.js +1 -1
  111. package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +1 -1
  112. package/dist/collection/store/checkout.store.js +4 -0
  113. package/dist/collection/ui-components/apple-pay-button.js +4 -7
  114. package/dist/collection/ui-components/custom-popper/custom-popper.js +2 -2
  115. package/dist/collection/ui-components/form/form-control-checkbox.js +2 -2
  116. package/dist/collection/ui-components/form/form-control-date.js +2 -2
  117. package/dist/collection/ui-components/form/form-control-file-v2.js +1 -1
  118. package/dist/collection/ui-components/form/form-control-file.js +2 -2
  119. package/dist/collection/ui-components/form/form-control-monetary.js +2 -2
  120. package/dist/collection/ui-components/form/form-control-number-masked.js +2 -2
  121. package/dist/collection/ui-components/form/form-control-number.js +2 -2
  122. package/dist/collection/ui-components/form/form-control-radio.js +2 -2
  123. package/dist/collection/ui-components/form/form-control-select.js +2 -2
  124. package/dist/collection/ui-components/form/form-control-text.js +2 -2
  125. package/dist/collection/ui-components/form/form-control-textarea.js +2 -2
  126. package/dist/collection/ui-components/form/hidden-input.js +1 -1
  127. package/dist/collection/ui-components/form/iframe-input.js +3 -3
  128. package/dist/collection/ui-components/pagination-menu/pagination-menu.js +3 -3
  129. package/dist/collection/ui-components/shadow-dom-components/justifi-button.js +1 -1
  130. package/dist/collection/ui-components/shadow-dom-components/justifi-header.js +1 -1
  131. package/dist/collection/ui-components/shadow-dom-components/justifi-skeleton.js +1 -1
  132. package/dist/docs.json +69 -3
  133. package/dist/esm/additional-questions-details_5.entry.js +2 -2
  134. package/dist/esm/{badge-BYEj23zk.js → badge-CtdO-tEY.js} +1 -1
  135. package/dist/esm/bank-account-document-form-inputs_4.entry.js +5 -5
  136. package/dist/esm/bank-account-form.entry.js +4 -4
  137. package/dist/esm/business-details-core.entry.js +3 -3
  138. package/dist/esm/{button-BQetT-FB.js → button-DtTaQHMK.js} +1 -1
  139. package/dist/esm/card-form.entry.js +4 -4
  140. package/dist/esm/{check-pkg-version-DdZIl21c.js → check-pkg-version-f6satvrI.js} +1 -1
  141. package/dist/esm/{checkout.store-CWAkbFJL.js → checkout.store-4nUf2OuT.js} +4 -0
  142. package/dist/esm/checkouts-list-core.entry.js +6 -6
  143. package/dist/esm/{checkouts-table-D7-slfUE.js → checkouts-table-B6gGDtOr.js} +2 -2
  144. package/dist/esm/custom-popper_2.entry.js +3 -3
  145. package/dist/esm/form-alert_5.entry.js +1 -1
  146. package/dist/esm/form-control-checkbox.entry.js +5 -5
  147. package/dist/esm/form-control-date.entry.js +4 -4
  148. package/dist/esm/{form-control-error-text-DU4UNQlE.js → form-control-error-text-bprS-t9d.js} +1 -1
  149. package/dist/esm/form-control-file-v2_2.entry.js +5 -5
  150. package/dist/esm/{form-control-help-text-DDLwbCDl.js → form-control-help-text-Bvnp-IAG.js} +1 -1
  151. package/dist/esm/form-control-monetary-provisioning.entry.js +3 -3
  152. package/dist/esm/form-control-monetary.entry.js +5 -5
  153. package/dist/esm/form-control-number-masked_2.entry.js +4 -4
  154. package/dist/esm/form-control-number.entry.js +5 -5
  155. package/dist/esm/form-control-radio.entry.js +3 -3
  156. package/dist/esm/form-control-select_2.entry.js +6 -6
  157. package/dist/esm/gross-payment-chart-core.entry.js +4 -4
  158. package/dist/esm/{header-1-CIfsspQD.js → header-1-C1Hnxki8.js} +1 -1
  159. package/dist/esm/{header-3-0vgSYspf.js → header-3-Bq8fpjm-.js} +1 -1
  160. package/dist/esm/hidden-input_2.entry.js +7 -7
  161. package/dist/esm/{insurance-state-QGyiPZ_-.js → insurance-state-CVme82j7.js} +1 -1
  162. package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +3 -3
  163. package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
  164. package/dist/esm/justifi-additional-statement_8.entry.js +9 -9
  165. package/dist/esm/{justifi-checkout-summary_7.entry.js → justifi-apple-pay_8.entry.js} +886 -20
  166. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +15 -15
  167. package/dist/esm/justifi-business-details.entry.js +4 -4
  168. package/dist/esm/justifi-business-form.entry.js +6 -6
  169. package/dist/esm/justifi-business-representative-form-inputs.entry.js +1 -1
  170. package/dist/esm/justifi-checkout.entry.js +5 -5
  171. package/dist/esm/justifi-checkouts-list-filters.entry.js +2 -2
  172. package/dist/esm/justifi-checkouts-list.entry.js +6 -6
  173. package/dist/esm/justifi-details.entry.js +2 -2
  174. package/dist/esm/justifi-dispute-management-core.entry.js +1 -1
  175. package/dist/esm/justifi-dispute-management.entry.js +3 -3
  176. package/dist/esm/justifi-dispute-notification_3.entry.js +8 -8
  177. package/dist/esm/justifi-gross-payment-chart.entry.js +4 -4
  178. package/dist/esm/justifi-order-terminals.entry.js +5 -5
  179. package/dist/esm/justifi-owner-form_3.entry.js +2 -2
  180. package/dist/esm/justifi-payment-details.entry.js +4 -4
  181. package/dist/esm/justifi-payment-provisioning-core.entry.js +2 -2
  182. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  183. package/dist/esm/justifi-payment-transactions-list.entry.js +6 -6
  184. package/dist/esm/justifi-payments-list-filters.entry.js +3 -3
  185. package/dist/esm/justifi-payments-list.entry.js +7 -7
  186. package/dist/esm/justifi-payout-details.entry.js +4 -4
  187. package/dist/esm/justifi-payout-transactions-list.entry.js +6 -6
  188. package/dist/esm/justifi-payouts-list-filters.entry.js +3 -3
  189. package/dist/esm/justifi-payouts-list.entry.js +7 -7
  190. package/dist/esm/justifi-refund-payment.entry.js +5 -5
  191. package/dist/esm/justifi-saved-payment-method.entry.js +2 -2
  192. package/dist/esm/justifi-season-interruption-insurance.entry.js +6 -6
  193. package/dist/esm/justifi-skeleton.entry.js +3 -3
  194. package/dist/esm/justifi-terminal-orders-list-filters.entry.js +3 -3
  195. package/dist/esm/justifi-terminal-orders-list.entry.js +6 -6
  196. package/dist/esm/justifi-terminals-list-filters.entry.js +2 -2
  197. package/dist/esm/justifi-terminals-list.entry.js +6 -6
  198. package/dist/esm/loader.js +1 -1
  199. package/dist/esm/{package-DlT1rYmL.js → package-DOrxxtCs.js} +1 -1
  200. package/dist/esm/pagination-menu.entry.js +4 -4
  201. package/dist/esm/{parts-DS3KdLWS.js → parts-xDbRW9xn.js} +1 -1
  202. package/dist/esm/payment-details-core.entry.js +13 -13
  203. package/dist/esm/payment-method-option.entry.js +2 -2
  204. package/dist/esm/payments-list-core.entry.js +7 -7
  205. package/dist/esm/{payments-status-DpKZIq0D.js → payments-status-cvtVmtY5.js} +1 -1
  206. package/dist/esm/{payments-table-BhUsDP9C.js → payments-table-D_BlyU1F.js} +2 -2
  207. package/dist/esm/payout-details-core.entry.js +9 -9
  208. package/dist/esm/payouts-list-core.entry.js +7 -7
  209. package/dist/esm/{payouts-status-CZxWiR6g.js → payouts-status-D-vjrqBb.js} +1 -1
  210. package/dist/esm/{payouts-table-C6bACVT_.js → payouts-table-Clj8YGLV.js} +2 -2
  211. package/dist/esm/{skeleton-CtxvPKqv.js → skeleton-B8EUwt4b.js} +1 -1
  212. package/dist/esm/{spinner-DSSWDOaz.js → spinner-CYXkn1fh.js} +1 -1
  213. package/dist/esm/{table-C7Sw1Lk-.js → table-Bj20uWfu.js} +2 -2
  214. package/dist/esm/table-filters-menu.entry.js +3 -3
  215. package/dist/esm/terminal-orders-list-core.entry.js +6 -6
  216. package/dist/esm/{terminal-orders-table-Cdv_O1iI.js → terminal-orders-table-DzBpIW8i.js} +2 -2
  217. package/dist/esm/terminal-quantity-selector.entry.js +2 -2
  218. package/dist/esm/terminals-list-core.entry.js +6 -6
  219. package/dist/esm/{terminals-table-BBUVz5oU.js → terminals-table-BMS5tazC.js} +2 -2
  220. package/dist/esm/{utils-DkhVjdbQ.js → utils-DRwofES0.js} +1 -1
  221. package/dist/esm/webcomponents.js +1 -1
  222. package/dist/module/additional-statement.js +1 -1
  223. package/dist/{esm/justifi-apple-pay.entry.js → module/apple-pay.js} +68 -33
  224. package/dist/module/bank-account-billing-form-simple.js +1 -1
  225. package/dist/module/bank-account-form.js +2 -2
  226. package/dist/module/bank-account.js +2 -2
  227. package/dist/module/cancellation-policy.js +1 -1
  228. package/dist/module/card-billing-form-simple.js +1 -1
  229. package/dist/module/card-form.js +2 -2
  230. package/dist/module/card-form2.js +2 -2
  231. package/dist/module/checkout.store.js +4 -0
  232. package/dist/module/checkouts-list-core2.js +1 -1
  233. package/dist/module/custom-popper2.js +2 -2
  234. package/dist/module/customer-details.js +1 -1
  235. package/dist/module/dispute-management-core.js +1 -1
  236. package/dist/module/dispute-notification.js +1 -1
  237. package/dist/module/dispute-response-core.js +1 -1
  238. package/dist/module/dispute-response.js +1 -1
  239. package/dist/module/duplicate-charge.js +1 -1
  240. package/dist/module/electronic-evidence.js +1 -1
  241. package/dist/module/form-control-checkbox2.js +2 -2
  242. package/dist/module/form-control-date2.js +2 -2
  243. package/dist/module/form-control-file-v22.js +1 -1
  244. package/dist/module/form-control-file2.js +2 -2
  245. package/dist/module/form-control-monetary2.js +2 -2
  246. package/dist/module/form-control-number-masked2.js +2 -2
  247. package/dist/module/form-control-number.js +2 -2
  248. package/dist/module/form-control-radio2.js +2 -2
  249. package/dist/module/form-control-select2.js +2 -2
  250. package/dist/module/form-control-text2.js +2 -2
  251. package/dist/module/form-control-textarea2.js +2 -2
  252. package/dist/module/gross-payment-chart-core2.js +1 -1
  253. package/dist/module/hidden-input2.js +1 -1
  254. package/dist/module/iframe-input2.js +3 -3
  255. package/dist/module/justifi-apple-pay.js +1 -907
  256. package/dist/module/justifi-button2.js +1 -1
  257. package/dist/module/justifi-checkout.js +25 -19
  258. package/dist/module/justifi-checkouts-list-filters.js +1 -1
  259. package/dist/module/justifi-checkouts-list.js +1 -1
  260. package/dist/module/justifi-dispute-management.js +1 -1
  261. package/dist/module/justifi-header2.js +1 -1
  262. package/dist/module/justifi-order-terminals.js +1 -1
  263. package/dist/module/justifi-payment-transactions-list.js +1 -1
  264. package/dist/module/justifi-payments-list-filters.js +2 -2
  265. package/dist/module/justifi-payments-list.js +1 -1
  266. package/dist/module/justifi-payout-transactions-list.js +1 -1
  267. package/dist/module/justifi-payouts-list-filters.js +2 -2
  268. package/dist/module/justifi-payouts-list.js +1 -1
  269. package/dist/module/justifi-saved-payment-method.js +1 -1
  270. package/dist/module/justifi-skeleton.js +1 -1
  271. package/dist/module/justifi-terminal-orders-list-filters.js +2 -2
  272. package/dist/module/justifi-terminal-orders-list.js +1 -1
  273. package/dist/module/justifi-terminals-list-filters.js +1 -1
  274. package/dist/module/justifi-terminals-list.js +1 -1
  275. package/dist/module/modular-checkout.js +7 -6
  276. package/dist/module/package.js +1 -1
  277. package/dist/module/pagination-menu2.js +3 -3
  278. package/dist/module/payment-details-core2.js +8 -8
  279. package/dist/module/payment-method-option.js +1 -1
  280. package/dist/module/payments-list-core2.js +1 -1
  281. package/dist/module/payout-details-core2.js +3 -3
  282. package/dist/module/payouts-list-core2.js +1 -1
  283. package/dist/module/product-or-service.js +1 -1
  284. package/dist/module/refund-policy.js +1 -1
  285. package/dist/module/save-new-payment-method.js +1 -1
  286. package/dist/module/shipping-details.js +1 -1
  287. package/dist/module/summary.js +1 -1
  288. package/dist/module/table-filters-menu2.js +1 -1
  289. package/dist/module/terminal-orders-list-core2.js +1 -1
  290. package/dist/module/terminal-quantity-selector2.js +1 -1
  291. package/dist/module/terminals-list-core2.js +1 -1
  292. package/dist/module/tokenize-payment-method.js +1 -1
  293. package/dist/types/api/Checkout.d.ts +2 -0
  294. package/dist/types/components/modular-checkout/sub-components/apple-pay.d.ts +2 -0
  295. package/dist/types/components.d.ts +16 -0
  296. package/dist/types/store/checkout.store.d.ts +1 -0
  297. package/dist/webcomponents/{p-8696cf1e.entry.js → p-0217783c.entry.js} +3 -3
  298. package/dist/webcomponents/p-02fdd7f5.entry.js +1 -0
  299. package/dist/webcomponents/p-0af5269e.entry.js +1 -0
  300. package/dist/webcomponents/{p-b3517f18.entry.js → p-0cac8468.entry.js} +1 -1
  301. package/dist/webcomponents/{p-368aad3e.entry.js → p-0cf71cbd.entry.js} +1 -1
  302. package/dist/webcomponents/{p-8e6ae277.entry.js → p-0eb69f41.entry.js} +1 -1
  303. package/dist/webcomponents/{p-064578b9.entry.js → p-17abfc00.entry.js} +1 -1
  304. package/dist/webcomponents/{p-96cc471a.entry.js → p-24817d58.entry.js} +1 -1
  305. package/dist/webcomponents/p-28625e07.entry.js +1 -0
  306. package/dist/webcomponents/{p-f7977891.entry.js → p-293c4517.entry.js} +1 -1
  307. package/dist/webcomponents/p-2d300faa.entry.js +1 -0
  308. package/dist/webcomponents/p-2dfbbc7a.entry.js +1 -0
  309. package/dist/webcomponents/p-328117e4.entry.js +1 -0
  310. package/dist/webcomponents/{p-72e0698c.entry.js → p-32978110.entry.js} +1 -1
  311. package/dist/webcomponents/{p-2b1b815a.entry.js → p-37a93597.entry.js} +1 -1
  312. package/dist/webcomponents/{p-4941bcaf.entry.js → p-38668717.entry.js} +1 -1
  313. package/dist/webcomponents/{p-32b0593d.entry.js → p-3ff3bb90.entry.js} +1 -1
  314. package/dist/webcomponents/{p-188f921f.entry.js → p-447b55c0.entry.js} +1 -1
  315. package/dist/webcomponents/p-451c8e1b.entry.js +1 -0
  316. package/dist/webcomponents/p-47997bc2.entry.js +1 -0
  317. package/dist/webcomponents/{p-9f35781b.entry.js → p-50701f16.entry.js} +1 -1
  318. package/dist/webcomponents/{p-4633e577.entry.js → p-51ac9f40.entry.js} +1 -1
  319. package/dist/webcomponents/p-526b7442.entry.js +1 -0
  320. package/dist/webcomponents/p-5aae36f3.entry.js +1 -0
  321. package/dist/webcomponents/p-5bd3d86e.entry.js +1 -0
  322. package/dist/webcomponents/{p-25dffee2.entry.js → p-63ad8ebd.entry.js} +1 -1
  323. package/dist/webcomponents/p-6472b6db.entry.js +1 -0
  324. package/dist/webcomponents/p-6df72e0f.entry.js +1 -0
  325. package/dist/webcomponents/p-705dba52.entry.js +1 -0
  326. package/dist/webcomponents/{p-4c7b6e72.entry.js → p-78cb62a8.entry.js} +1 -1
  327. package/dist/webcomponents/{p-789e86ef.entry.js → p-7f018623.entry.js} +1 -1
  328. package/dist/webcomponents/{p-924a25d4.entry.js → p-80b2cdec.entry.js} +1 -1
  329. package/dist/webcomponents/p-88fcb530.entry.js +1 -0
  330. package/dist/webcomponents/{p-a871b38b.entry.js → p-8be7fbf6.entry.js} +1 -1
  331. package/dist/webcomponents/p-8ca21fab.entry.js +1 -0
  332. package/dist/webcomponents/{p-5ca7a03f.entry.js → p-8f84883e.entry.js} +1 -1
  333. package/dist/webcomponents/{p-6de344f8.entry.js → p-96694f7d.entry.js} +1 -1
  334. package/dist/webcomponents/p-9ad7d724.entry.js +1 -0
  335. package/dist/webcomponents/{p-1162b2fc.entry.js → p-9ed7b13f.entry.js} +1 -1
  336. package/dist/webcomponents/{p-B7TpAe2k.js → p-B6IWa9Ph.js} +1 -1
  337. package/dist/webcomponents/{p-BIKX2tSN.js → p-BBx_EQqR.js} +1 -1
  338. package/dist/webcomponents/p-BoQ6_4Ks.js +1 -0
  339. package/dist/webcomponents/{p-SWI5-Jo-.js → p-C0wTyoTh.js} +1 -1
  340. package/dist/webcomponents/{p-YXBIe5uT.js → p-C9EQ459H.js} +1 -1
  341. package/dist/webcomponents/{p-7663hWTF.js → p-CCmDcLao.js} +1 -1
  342. package/dist/webcomponents/{p-CqFjmIng.js → p-CH8Y3GSr.js} +1 -1
  343. package/dist/webcomponents/{p-BbbgFMaz.js → p-ClvhB3WW.js} +1 -1
  344. package/dist/webcomponents/{p-53MvfN19.js → p-CmBCj61h.js} +1 -1
  345. package/dist/webcomponents/{p-Cqe5a-d3.js → p-Cq_f4KEI.js} +1 -1
  346. package/dist/webcomponents/p-D0Peuz-m.js +1 -0
  347. package/dist/webcomponents/p-D6BImiVi.js +1 -0
  348. package/dist/webcomponents/p-DGsXKF67.js +1 -0
  349. package/dist/webcomponents/p-DOrxxtCs.js +1 -0
  350. package/dist/webcomponents/p-NAjz1Xfo.js +1 -0
  351. package/dist/webcomponents/p-RQzxYnz_.js +1 -0
  352. package/dist/webcomponents/p-T2yENPvU.js +1 -0
  353. package/dist/webcomponents/{p-2bb49747.entry.js → p-a09695c4.entry.js} +1 -1
  354. package/dist/webcomponents/p-a5fc94fe.entry.js +1 -0
  355. package/dist/webcomponents/p-abbe97eb.entry.js +1 -0
  356. package/dist/webcomponents/{p-f1915a72.entry.js → p-ae8ae5bb.entry.js} +1 -1
  357. package/dist/webcomponents/{p-b82b685d.entry.js → p-aeb22aa2.entry.js} +1 -1
  358. package/dist/webcomponents/p-au49QgoI.js +1 -0
  359. package/dist/webcomponents/{p-79a55ed5.entry.js → p-b608add9.entry.js} +1 -1
  360. package/dist/webcomponents/p-bb53e2e9.entry.js +1 -0
  361. package/dist/webcomponents/p-bc099dd0.entry.js +1 -0
  362. package/dist/webcomponents/{p-341eb162.entry.js → p-be5c5154.entry.js} +1 -1
  363. package/dist/webcomponents/{p-bcc7ebb5.entry.js → p-bf5593bb.entry.js} +1 -1
  364. package/dist/webcomponents/p-c12d0453.entry.js +1 -0
  365. package/dist/webcomponents/{p-9b14089f.entry.js → p-c644a9f1.entry.js} +1 -1
  366. package/dist/webcomponents/{p-fc5eeb40.entry.js → p-c9cfab30.entry.js} +1 -1
  367. package/dist/webcomponents/{p-22b3b0c2.entry.js → p-cc5c6425.entry.js} +1 -1
  368. package/dist/webcomponents/{p-507ab3f1.entry.js → p-cf26936c.entry.js} +1 -1
  369. package/dist/webcomponents/{p-263ee88e.entry.js → p-d0a2035f.entry.js} +1 -1
  370. package/dist/webcomponents/p-d1bceac6.entry.js +1 -0
  371. package/dist/webcomponents/p-d2b922cc.entry.js +1 -0
  372. package/dist/webcomponents/{p-4b1a3cf6.entry.js → p-d4476052.entry.js} +1 -1
  373. package/dist/webcomponents/{p-62fab960.entry.js → p-de95bf57.entry.js} +1 -1
  374. package/dist/webcomponents/p-e6be4e19.entry.js +1 -0
  375. package/dist/webcomponents/p-ec9514f8.entry.js +1 -0
  376. package/dist/webcomponents/p-edfeb034.entry.js +1 -0
  377. package/dist/webcomponents/{p-a4a57240.entry.js → p-f705fc49.entry.js} +1 -1
  378. package/dist/webcomponents/{p-7c7666ad.entry.js → p-fbc5fc6d.entry.js} +1 -1
  379. package/dist/webcomponents/p-ffefa09c.entry.js +1 -0
  380. package/dist/webcomponents/p-h5pyZngT.js +1 -0
  381. package/dist/webcomponents/{p-f6_r41aD.js → p-hbWSMN3O.js} +1 -1
  382. package/dist/webcomponents/p-wQgEEOq_.js +1 -0
  383. package/dist/webcomponents/{p-DS3KdLWS.js → p-xDbRW9xn.js} +1 -1
  384. package/dist/webcomponents/webcomponents.esm.js +1 -1
  385. package/package.json +1 -1
  386. package/dist/cjs/justifi-apple-pay.cjs.entry.js +0 -879
  387. package/dist/webcomponents/p-065999a7.entry.js +0 -1
  388. package/dist/webcomponents/p-145a2370.entry.js +0 -1
  389. package/dist/webcomponents/p-185550b1.entry.js +0 -1
  390. package/dist/webcomponents/p-20c42901.entry.js +0 -1
  391. package/dist/webcomponents/p-38f4b133.entry.js +0 -1
  392. package/dist/webcomponents/p-3cd7efc1.entry.js +0 -1
  393. package/dist/webcomponents/p-49998d80.entry.js +0 -1
  394. package/dist/webcomponents/p-59b4454a.entry.js +0 -1
  395. package/dist/webcomponents/p-6217eb14.entry.js +0 -1
  396. package/dist/webcomponents/p-7bdaf07c.entry.js +0 -1
  397. package/dist/webcomponents/p-7c4a3118.entry.js +0 -1
  398. package/dist/webcomponents/p-7fc37722.entry.js +0 -1
  399. package/dist/webcomponents/p-8948b298.entry.js +0 -1
  400. package/dist/webcomponents/p-97ea8a2a.entry.js +0 -1
  401. package/dist/webcomponents/p-98ae711c.entry.js +0 -1
  402. package/dist/webcomponents/p-BBzXThAT.js +0 -1
  403. package/dist/webcomponents/p-BCE-dTDp.js +0 -1
  404. package/dist/webcomponents/p-Baf5crBG.js +0 -1
  405. package/dist/webcomponents/p-C4AUlhx6.js +0 -1
  406. package/dist/webcomponents/p-D5KZeFMv.js +0 -1
  407. package/dist/webcomponents/p-DFEINx3E.js +0 -1
  408. package/dist/webcomponents/p-DlT1rYmL.js +0 -1
  409. package/dist/webcomponents/p-DrrHSa75.js +0 -1
  410. package/dist/webcomponents/p-DszoS3BO.js +0 -1
  411. package/dist/webcomponents/p-SPYUZxQ9.js +0 -1
  412. package/dist/webcomponents/p-a3a2f508.entry.js +0 -1
  413. package/dist/webcomponents/p-a44c1cae.entry.js +0 -1
  414. package/dist/webcomponents/p-a6008498.entry.js +0 -1
  415. package/dist/webcomponents/p-a9e7b25b.entry.js +0 -1
  416. package/dist/webcomponents/p-b2816bb2.entry.js +0 -1
  417. package/dist/webcomponents/p-b57ba0c7.entry.js +0 -1
  418. package/dist/webcomponents/p-b701fcf0.entry.js +0 -1
  419. package/dist/webcomponents/p-bcc22295.entry.js +0 -1
  420. package/dist/webcomponents/p-cf37b3bb.entry.js +0 -1
  421. package/dist/webcomponents/p-d55e5756.entry.js +0 -1
  422. package/dist/webcomponents/p-db03d37a.entry.js +0 -1
  423. package/dist/webcomponents/p-dce78317.entry.js +0 -1
  424. package/dist/webcomponents/p-e1e13e85.entry.js +0 -1
  425. package/dist/webcomponents/p-f605af1c.entry.js +0 -1
  426. package/dist/webcomponents/p-iT-AQTXJ.js +0 -1
@@ -1,879 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-Bhtk1qkX.js');
4
- var Api = require('./Api-CjtvTD2_.js');
5
- var styledHost = require('./styled-host-BSooSIhA.js');
6
- require('./event-types-YOY5TKUN.js');
7
- var skeleton = require('./skeleton-BvdAh448.js');
8
- var checkout_store = require('./checkout.store-CS7dpzYF.js');
9
- require('./config-state-C7babhLh.js');
10
- require('./index-CWM5ions.js');
11
- require('./utils-Bab-tddY.js');
12
- require('./dinero-BwNN_k7x.js');
13
- require('./parts-Pb06tUMp.js');
14
- require('./index-C2ITzalN.js');
15
-
16
- var ApplePaySessionStatus;
17
- (function (ApplePaySessionStatus) {
18
- ApplePaySessionStatus["STATUS_SUCCESS"] = "STATUS_SUCCESS";
19
- ApplePaySessionStatus["STATUS_FAILURE"] = "STATUS_FAILURE";
20
- })(ApplePaySessionStatus || (ApplePaySessionStatus = {}));
21
- var ApplePayButtonType;
22
- (function (ApplePayButtonType) {
23
- ApplePayButtonType["PLAIN"] = "plain";
24
- ApplePayButtonType["BUY"] = "buy";
25
- ApplePayButtonType["SET_UP"] = "set-up";
26
- ApplePayButtonType["DONATE"] = "donate";
27
- ApplePayButtonType["CHECK_OUT"] = "check-out";
28
- ApplePayButtonType["BOOK"] = "book";
29
- ApplePayButtonType["SUBSCRIBE"] = "subscribe";
30
- })(ApplePayButtonType || (ApplePayButtonType = {}));
31
- var ApplePayButtonStyle;
32
- (function (ApplePayButtonStyle) {
33
- ApplePayButtonStyle["BLACK"] = "black";
34
- ApplePayButtonStyle["WHITE"] = "white";
35
- ApplePayButtonStyle["WHITE_OUTLINE"] = "white-outline";
36
- })(ApplePayButtonStyle || (ApplePayButtonStyle = {}));
37
- var ApplePayMerchantCapability;
38
- (function (ApplePayMerchantCapability) {
39
- ApplePayMerchantCapability["SUPPORTS_3DS"] = "supports3DS";
40
- ApplePayMerchantCapability["SUPPORTS_EMV"] = "supportsEMV";
41
- ApplePayMerchantCapability["SUPPORTS_CREDIT"] = "supportsCredit";
42
- ApplePayMerchantCapability["SUPPORTS_DEBIT"] = "supportsDebit";
43
- })(ApplePayMerchantCapability || (ApplePayMerchantCapability = {}));
44
- class ApplePayConfig {
45
- constructor(data) {
46
- this.merchantIdentifier = data.merchantIdentifier;
47
- this.displayName = data.displayName;
48
- this.initiative = data.initiative;
49
- this.initiativeContext = data.initiativeContext;
50
- this.buttonType = data.buttonType || ApplePayButtonType.PLAIN;
51
- this.buttonStyle = data.buttonStyle || ApplePayButtonStyle.BLACK;
52
- this.buttonLocale = data.buttonLocale || 'en-US';
53
- }
54
- get isValid() {
55
- return !!(this.merchantIdentifier &&
56
- this.displayName &&
57
- this.initiative &&
58
- this.initiativeContext);
59
- }
60
- }
61
- class ApplePayPaymentRequest {
62
- constructor(data) {
63
- this.countryCode = data.countryCode;
64
- this.currencyCode = data.currencyCode;
65
- this.merchantCapabilities = data.merchantCapabilities;
66
- this.supportedNetworks = data.supportedNetworks;
67
- this.total = data.total;
68
- this.lineItems = data.lineItems;
69
- this.shippingMethods = data.shippingMethods;
70
- this.applicationData = data.applicationData;
71
- this.supportedCountries = data.supportedCountries;
72
- }
73
- get isValid() {
74
- var _a, _b, _c, _d;
75
- return !!(this.countryCode &&
76
- this.currencyCode &&
77
- ((_a = this.merchantCapabilities) === null || _a === void 0 ? void 0 : _a.length) &&
78
- ((_b = this.supportedNetworks) === null || _b === void 0 ? void 0 : _b.length) &&
79
- ((_c = this.total) === null || _c === void 0 ? void 0 : _c.label) &&
80
- ((_d = this.total) === null || _d === void 0 ? void 0 : _d.amount));
81
- }
82
- }
83
- class ApplePayHelpers {
84
- static isApplePaySupported() {
85
- var _a;
86
- return (typeof window !== 'undefined' &&
87
- 'ApplePaySession' in window &&
88
- ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.supportsVersion(3)));
89
- }
90
- static canMakePayments() {
91
- var _a;
92
- if (!this.isApplePaySupported()) {
93
- return false;
94
- }
95
- return ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePayments()) || false;
96
- }
97
- static async canMakePaymentsWithActiveCard(merchantIdentifier) {
98
- var _a;
99
- if (!this.isApplePaySupported()) {
100
- return false;
101
- }
102
- try {
103
- return ((await ((_a = window.ApplePaySession) === null || _a === void 0 ? void 0 : _a.canMakePaymentsWithActiveCard(merchantIdentifier))) || false);
104
- }
105
- catch (error) {
106
- console.error('Error checking Apple Pay active card:', error);
107
- return false;
108
- }
109
- }
110
- static formatAmount(amount) {
111
- return (amount / 100).toFixed(2);
112
- }
113
- static parseAmount(amount) {
114
- return Math.round(parseFloat(amount) * 100);
115
- }
116
- static createLineItem(label, amount, type = 'final') {
117
- return {
118
- label,
119
- amount: this.formatAmount(amount),
120
- type,
121
- };
122
- }
123
- static getDefaultSupportedNetworks() {
124
- return ['amex', 'discover', 'masterCard', 'visa'];
125
- }
126
- static getDefaultMerchantCapabilities() {
127
- return [
128
- ApplePayMerchantCapability.SUPPORTS_3DS,
129
- ApplePayMerchantCapability.SUPPORTS_EMV,
130
- ApplePayMerchantCapability.SUPPORTS_CREDIT,
131
- ApplePayMerchantCapability.SUPPORTS_DEBIT,
132
- ];
133
- }
134
- }
135
-
136
- // Centralized error codes for Apple Pay service
137
- var ApplePayServiceErrorCode;
138
- (function (ApplePayServiceErrorCode) {
139
- ApplePayServiceErrorCode["UNAVAILABLE"] = "UNAVAILABLE";
140
- ApplePayServiceErrorCode["SESSION_ERROR"] = "SESSION_ERROR";
141
- ApplePayServiceErrorCode["MERCHANT_VALIDATION_ERROR"] = "MERCHANT_VALIDATION_ERROR";
142
- ApplePayServiceErrorCode["PAYMENT_PROCESSING_ERROR"] = "PAYMENT_PROCESSING_ERROR";
143
- ApplePayServiceErrorCode["USER_CANCELLED"] = "USER_CANCELLED";
144
- })(ApplePayServiceErrorCode || (ApplePayServiceErrorCode = {}));
145
- class ApplePayService {
146
- constructor() {
147
- this.api = Api.Api();
148
- }
149
- /**
150
- * Initialize Apple Pay configuration
151
- */
152
- initialize(applePayConfig) {
153
- this.applePayConfig = new ApplePayConfig(applePayConfig);
154
- if (!this.applePayConfig.isValid) {
155
- throw new Error('Invalid Apple Pay configuration provided');
156
- }
157
- }
158
- /**
159
- * Validate merchant with Apple Pay servers via API
160
- */
161
- async validateMerchant(authToken, accountId) {
162
- const endpoint = 'apple_pay/merchant_session';
163
- try {
164
- const response = await this.api.post({
165
- endpoint,
166
- authToken,
167
- headers: {
168
- 'Sub-Account': accountId,
169
- },
170
- body: {
171
- domain: window.location.host
172
- }
173
- });
174
- return response;
175
- }
176
- catch (error) {
177
- console.error('Backend validation failed:', error);
178
- throw new Error('Merchant validation failed');
179
- }
180
- }
181
- /**
182
- * Process Apple Pay payment via API (fixed to match original logic)
183
- */
184
- async processPayment(authToken, accountId, payload) {
185
- const endpoint = 'apple_pay/process_token';
186
- const result = await this.api.post({
187
- endpoint,
188
- authToken,
189
- body: payload,
190
- headers: {
191
- 'Sub-Account': accountId,
192
- },
193
- });
194
- return {
195
- success: result.id && !!result.data.token,
196
- data: result,
197
- };
198
- }
199
- /**
200
- * Check if Apple Pay is available on this device/browser
201
- */
202
- isAvailable() {
203
- return (ApplePayHelpers.isApplePaySupported() && ApplePayHelpers.canMakePayments());
204
- }
205
- /**
206
- * Check if the user has an active card for the merchant
207
- */
208
- async canMakePaymentsWithActiveCard() {
209
- if (!this.applePayConfig) {
210
- throw new Error('Apple Pay not initialized. Call initialize() first.');
211
- }
212
- return await ApplePayHelpers.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier);
213
- }
214
- /**
215
- * Start Apple Pay session
216
- */
217
- async startPaymentSession(paymentRequest, authToken, accountId) {
218
- // Begin verbose diagnostics for easier debugging in the field
219
- console.groupCollapsed('[ApplePayService] startPaymentSession called');
220
- console.log('[ApplePayService] raw paymentRequest:', JSON.stringify(paymentRequest, null, 2));
221
- console.log('[ApplePayService] has authToken:', Boolean(authToken));
222
- console.log('[ApplePayService] accountId:', accountId);
223
- console.log('[ApplePayService] has config:', Boolean(this.applePayConfig));
224
- if (!this.applePayConfig) {
225
- console.error('[ApplePayService] Missing applePayConfig. Did you call initialize()?');
226
- console.groupEnd();
227
- throw new Error('Apple Pay not initialized. Call initialize() first.');
228
- }
229
- // if (!this.isAvailable()) {
230
- // throw new Error('Apple Pay is not available on this device/browser');
231
- // }
232
- const request = new ApplePayPaymentRequest(paymentRequest);
233
- console.log('[ApplePayService] created ApplePayPaymentRequest:', request);
234
- if (!request.isValid) {
235
- const missingFields = [];
236
- if (!request.countryCode)
237
- missingFields.push('countryCode');
238
- if (!request.currencyCode)
239
- missingFields.push('currencyCode');
240
- if (!request.merchantCapabilities ||
241
- request.merchantCapabilities.length === 0)
242
- missingFields.push('merchantCapabilities');
243
- if (!request.supportedNetworks || request.supportedNetworks.length === 0)
244
- missingFields.push('supportedNetworks');
245
- if (!request.total || !request.total.label || !request.total.amount)
246
- missingFields.push('total');
247
- console.error('[ApplePayService] Payment request is invalid. Missing/invalid:', missingFields);
248
- console.groupEnd();
249
- throw new Error('Invalid payment request provided');
250
- }
251
- this.currentPaymentRequest = request;
252
- return new Promise((resolve, reject) => {
253
- try {
254
- console.log('[ApplePayService] About to instantiate ApplePaySession');
255
- // Defensive checks for Apple Pay environment
256
- if (typeof window === 'undefined' || !('ApplePaySession' in window)) {
257
- console.error('[ApplePayService] ApplePaySession not available on window');
258
- console.groupEnd();
259
- return reject({
260
- success: false,
261
- error: {
262
- code: ApplePayServiceErrorCode.UNAVAILABLE,
263
- message: 'ApplePaySession API is not available in this environment',
264
- },
265
- });
266
- }
267
- this.currentSession = new window.ApplePaySession(3, request);
268
- console.log('[ApplePayService] ApplePaySession instantiated:', this.currentSession);
269
- this.setupSessionEventHandlers(resolve, reject, authToken, accountId);
270
- console.log('[ApplePayService] Event handlers set. Beginning session...');
271
- this.currentSession.begin();
272
- console.log('[ApplePayService] Session.begin() called');
273
- console.groupEnd();
274
- }
275
- catch (error) {
276
- console.error('[ApplePayService] Exception while starting session:', error);
277
- console.groupEnd();
278
- reject({
279
- success: false,
280
- error: {
281
- code: ApplePayServiceErrorCode.SESSION_ERROR,
282
- message: error instanceof Error
283
- ? error.message
284
- : 'Failed to start Apple Pay session',
285
- },
286
- });
287
- }
288
- });
289
- }
290
- /**
291
- * Abort current Apple Pay session
292
- */
293
- abortPaymentSession() {
294
- if (this.currentSession) {
295
- this.currentSession.abort();
296
- this.currentSession = undefined;
297
- this.currentPaymentRequest = undefined;
298
- }
299
- }
300
- /**
301
- * Setup Apple Pay session event handlers
302
- */
303
- setupSessionEventHandlers(resolve, reject, authToken, accountId) {
304
- if (!this.currentSession ||
305
- !this.applePayConfig ||
306
- !this.currentPaymentRequest) {
307
- console.error('[ApplePayService] setupSessionEventHandlers called without required state', {
308
- hasSession: Boolean(this.currentSession),
309
- hasConfig: Boolean(this.applePayConfig),
310
- hasPaymentRequest: Boolean(this.currentPaymentRequest),
311
- });
312
- return;
313
- }
314
- this.currentSession.onvalidatemerchant = async () => {
315
- console.groupCollapsed('[ApplePayService] onvalidatemerchant');
316
- try {
317
- console.log('[ApplePayService] accountId:', accountId);
318
- if (!authToken) {
319
- console.error('[ApplePayService] Missing authToken for merchant validation');
320
- throw new Error('Authentication token not provided.');
321
- }
322
- const merchantSession = await this.validateMerchant(authToken, accountId);
323
- console.log('[ApplePayService] merchantSession received');
324
- try {
325
- this.currentSession.completeMerchantValidation(merchantSession);
326
- console.log('[ApplePayService] completeMerchantValidation called');
327
- }
328
- catch (completionError) {
329
- console.error('Error calling completeMerchantValidation:', completionError);
330
- throw completionError;
331
- }
332
- }
333
- catch (error) {
334
- console.error('=== MERCHANT VALIDATION ERROR ===');
335
- console.error('Error during merchant validation:', error);
336
- if (error && error.stack) {
337
- console.error('Error stack:', error.stack);
338
- }
339
- this.currentSession.abort();
340
- reject({
341
- success: false,
342
- error: {
343
- code: ApplePayServiceErrorCode.MERCHANT_VALIDATION_ERROR,
344
- message: error instanceof Error
345
- ? error.message
346
- : 'Merchant validation failed',
347
- },
348
- });
349
- }
350
- console.groupEnd();
351
- };
352
- this.currentSession.onpaymentauthorized = async (event) => {
353
- var _a;
354
- console.groupCollapsed('[ApplePayService] onpaymentauthorized');
355
- try {
356
- const payment = event.payment;
357
- console.log('[ApplePayService] payment payload snapshot:', {
358
- hasToken: Boolean(payment === null || payment === void 0 ? void 0 : payment.token),
359
- tokenType: ((_a = payment === null || payment === void 0 ? void 0 : payment.token) === null || _a === void 0 ? void 0 : _a.paymentData) ? 'paymentData' : 'raw',
360
- });
361
- const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
362
- name: this.currentPaymentRequest.total.label,
363
- price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
364
- description: this.currentPaymentRequest.total.label,
365
- } });
366
- console.log('[ApplePayService] paymentPayload prepared');
367
- const paymentResult = await this.processPayment(authToken, accountId, paymentPayload);
368
- console.log('[ApplePayService] processPayment result:', paymentResult);
369
- if (paymentResult.success) {
370
- this.currentSession.completePayment({
371
- status: ApplePaySessionStatus.STATUS_SUCCESS,
372
- });
373
- console.log('[ApplePayService] Payment success; resolving');
374
- resolve({
375
- success: true,
376
- token: payment.token,
377
- paymentMethodId: paymentResult.data.id,
378
- });
379
- }
380
- else {
381
- console.error('PSP reported payment failure:', paymentResult.data);
382
- this.currentSession.completePayment({
383
- status: ApplePaySessionStatus.STATUS_FAILURE,
384
- });
385
- reject({
386
- success: false,
387
- error: {
388
- code: ApplePayServiceErrorCode.PAYMENT_PROCESSING_ERROR,
389
- message: 'Payment processing failed',
390
- },
391
- });
392
- }
393
- }
394
- catch (error) {
395
- console.error('=== PAYMENT PROCESSING ERROR ===');
396
- console.error('Error processing payment:', error);
397
- if (error && error.stack) {
398
- console.error('Error stack:', error.stack);
399
- }
400
- this.currentSession.completePayment({
401
- status: ApplePaySessionStatus.STATUS_FAILURE,
402
- });
403
- reject({
404
- success: false,
405
- error: {
406
- code: ApplePayServiceErrorCode.PAYMENT_PROCESSING_ERROR,
407
- message: error instanceof Error
408
- ? error.message
409
- : 'Payment processing failed',
410
- },
411
- });
412
- }
413
- finally {
414
- console.log('[ApplePayService] Cleaning up session state');
415
- this.currentSession = undefined;
416
- this.currentPaymentRequest = undefined;
417
- }
418
- console.groupEnd();
419
- };
420
- this.currentSession.onpaymentmethodselected = () => {
421
- console.groupCollapsed('[ApplePayService] onpaymentmethodselected');
422
- const paymentUpdate = {
423
- newTotal: this.currentPaymentRequest.total,
424
- newLineItems: this.currentPaymentRequest.lineItems || [],
425
- };
426
- try {
427
- this.currentSession.completePaymentMethodSelection(paymentUpdate);
428
- console.log('[ApplePayService] completePaymentMethodSelection called');
429
- }
430
- catch (error) {
431
- console.error('Error completing payment method selection:', error);
432
- this.currentSession.abort();
433
- }
434
- console.groupEnd();
435
- };
436
- this.currentSession.onshippingmethodselected = () => {
437
- console.groupCollapsed('[ApplePayService] onshippingmethodselected');
438
- this.currentSession.completeShippingMethodSelection({
439
- status: ApplePaySessionStatus.STATUS_SUCCESS,
440
- newTotal: this.currentPaymentRequest.total,
441
- newLineItems: this.currentPaymentRequest.lineItems || [],
442
- });
443
- console.log('[ApplePayService] completeShippingMethodSelection called');
444
- console.groupEnd();
445
- };
446
- this.currentSession.oncancel = (event) => {
447
- console.groupCollapsed('[ApplePayService] oncancel');
448
- if (event.sessionError) {
449
- console.error(event.sessionError);
450
- switch (event.sessionError.code) {
451
- case 'unknown':
452
- console.error('Unknown error - likely merchant validation issue');
453
- console.error('This usually means:');
454
- console.error('1. Merchant certificate is invalid or expired');
455
- console.error('2. Merchant identifier mismatch');
456
- console.error('3. Backend validation endpoint issues');
457
- break;
458
- case 'invalidMerchantSession':
459
- console.error('Invalid merchant session provided');
460
- console.error('Check that the merchant session from backend is valid');
461
- break;
462
- case 'userCancel':
463
- console.error('User cancelled the payment');
464
- break;
465
- default:
466
- console.error('Other error code:', event.sessionError.code);
467
- }
468
- }
469
- this.currentSession = undefined;
470
- this.currentPaymentRequest = undefined;
471
- reject({
472
- success: false,
473
- error: {
474
- code: ApplePayServiceErrorCode.USER_CANCELLED,
475
- message: 'User cancelled the Apple Pay session',
476
- },
477
- });
478
- console.groupEnd();
479
- };
480
- if ('onerror' in this.currentSession) {
481
- this.currentSession.onerror = (error) => {
482
- console.groupCollapsed('[ApplePayService] onerror');
483
- console.error('=== APPLE PAY SESSION ERROR ===');
484
- console.error('Session error:', error);
485
- this.currentSession = undefined;
486
- this.currentPaymentRequest = undefined;
487
- reject({
488
- success: false,
489
- error: {
490
- code: ApplePayServiceErrorCode.SESSION_ERROR,
491
- message: 'Apple Pay session error occurred',
492
- },
493
- });
494
- console.groupEnd();
495
- };
496
- }
497
- }
498
- /**
499
- * Create a basic payment request
500
- */
501
- static createPaymentRequest(amount, label, countryCode = 'US', currencyCode = 'USD') {
502
- return {
503
- countryCode,
504
- currencyCode,
505
- merchantCapabilities: ApplePayHelpers.getDefaultMerchantCapabilities(),
506
- supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
507
- total: ApplePayHelpers.createLineItem(label, amount),
508
- };
509
- }
510
- /**
511
- * Get current configuration
512
- */
513
- getApplePayConfig() {
514
- return this.applePayConfig;
515
- }
516
- }
517
-
518
- const ApplePaySkeleton = (props) => {
519
- const { isLoading } = props;
520
- if (!isLoading) {
521
- return null;
522
- }
523
- return (index.h("div", { class: 'container-fluid p-0' }, index.h("div", { class: 'row mb-3' }, index.h("div", { class: 'col-12 align-content-center' }, index.h(skeleton.Skeleton, { height: '44px', width: '100%', styles: { borderRadius: "8px" } })))));
524
- };
525
-
526
- const ProcessingSpinner = () => (index.h("div", { class: 'processing-overlay' }, index.h("div", { class: 'spinner' }), index.h("span", null, "Processing...")));
527
- const ApplePayButton = (props) => {
528
- const getApplePayButtonClass = () => {
529
- let classes = "apple-pay-button";
530
- switch (props.buttonStyle) {
531
- case ApplePayButtonStyle.WHITE:
532
- classes += " apple-pay-button-white";
533
- break;
534
- case ApplePayButtonStyle.WHITE_OUTLINE:
535
- classes += " apple-pay-button-white-outline";
536
- break;
537
- case ApplePayButtonStyle.BLACK:
538
- default:
539
- classes += " apple-pay-button-black";
540
- break;
541
- }
542
- switch (props.buttonType) {
543
- case ApplePayButtonType.BUY:
544
- classes += " apple-pay-button-type-buy";
545
- break;
546
- case ApplePayButtonType.DONATE:
547
- classes += " apple-pay-button-type-donate";
548
- break;
549
- case ApplePayButtonType.PLAIN:
550
- default:
551
- classes += " apple-pay-button-type-plain";
552
- break;
553
- }
554
- if (props.disabled || props.isProcessing || !props.isAvailable) {
555
- classes += " disabled";
556
- }
557
- return classes;
558
- };
559
- const getButtonStyles = () => {
560
- return {
561
- width: props.width || "200px",
562
- height: props.height || "48px",
563
- };
564
- };
565
- const handleClick = () => {
566
- if (!props.disabled &&
567
- !props.isProcessing &&
568
- props.isAvailable &&
569
- props.clickHandler) {
570
- props.clickHandler();
571
- }
572
- };
573
- return (index.h("div", { class: 'apple-pay-button-container' }, index.h("button", Object.assign({ class: getApplePayButtonClass(), style: getButtonStyles(), onClick: handleClick, disabled: props.disabled || props.isProcessing || !props.isAvailable, "aria-label": 'Pay with Apple Pay', type: 'button' }, props), props.isProcessing && ProcessingSpinner()), index.h("style", null, `
574
- .apple-pay-button-container {
575
- display: inline-block;
576
- position: relative;
577
- }
578
-
579
- /* Apple Pay CSS classes - these are the official Apple Pay button styles */
580
- .apple-pay-button {
581
- display: inline-block;
582
- -webkit-appearance: -apple-pay-button;
583
- -apple-pay-button-type: plain; /* default */
584
- -apple-pay-button-style: black; /* default */
585
- border-radius: 8px;
586
- cursor: pointer;
587
- border: none;
588
- outline: none;
589
- transition: opacity 0.2s ease;
590
- position: relative;
591
- }
592
-
593
- /* Button styles */
594
- .apple-pay-button.apple-pay-button-black {
595
- -apple-pay-button-style: black;
596
- }
597
-
598
- .apple-pay-button.apple-pay-button-white {
599
- -apple-pay-button-style: white;
600
- }
601
-
602
- .apple-pay-button.apple-pay-button-white-outline {
603
- -apple-pay-button-style: white-outline;
604
- }
605
-
606
- /* Button types */
607
- .apple-pay-button.apple-pay-button-type-plain {
608
- -apple-pay-button-type: plain;
609
- }
610
-
611
- .apple-pay-button.apple-pay-button-type-buy {
612
- -apple-pay-button-type: buy;
613
- }
614
-
615
- .apple-pay-button.apple-pay-button-type-donate {
616
- -apple-pay-button-type: donate;
617
- }
618
-
619
- /* Hover and disabled states */
620
- .apple-pay-button:hover:not(.disabled) {
621
- opacity: 0.9;
622
- }
623
-
624
- .apple-pay-button.disabled {
625
- opacity: 0.5;
626
- cursor: not-allowed;
627
- }
628
-
629
- /* Processing overlay */
630
- .processing-overlay {
631
- position: absolute;
632
- top: 0;
633
- left: 0;
634
- right: 0;
635
- bottom: 0;
636
- display: flex;
637
- align-items: center;
638
- justify-content: center;
639
- gap: 8px;
640
- background: rgba(0, 0, 0, 0.8);
641
- color: white;
642
- border-radius: 8px;
643
- font-size: 14px;
644
- font-weight: 500;
645
- }
646
-
647
- .spinner {
648
- width: 16px;
649
- height: 16px;
650
- border: 2px solid rgba(255, 255, 255, 0.3);
651
- border-top: 2px solid #fff;
652
- border-radius: 50%;
653
- animation: spin 1s linear infinite;
654
- }
655
-
656
- @keyframes spin {
657
- 0% { transform: rotate(0deg); }
658
- 100% { transform: rotate(360deg); }
659
- }
660
-
661
- /* Responsive design */
662
- @media (max-width: 480px) {
663
- .apple-pay-button {
664
- width: 100% !important;
665
- min-width: 200px;
666
- }
667
- }
668
- `)));
669
- };
670
-
671
- const ApplePay = class {
672
- constructor(hostRef) {
673
- index.registerInstance(this, hostRef);
674
- this.applePayStarted = index.createEvent(this, "applePayStarted");
675
- this.applePayCompleted = index.createEvent(this, "applePayCompleted");
676
- this.applePayCancelled = index.createEvent(this, "applePayCancelled");
677
- this.applePayError = index.createEvent(this, "applePayError");
678
- this.countryCode = "US";
679
- this.merchantIdentifier = "merchant.com.staging-justifi.checkout-dev";
680
- this.merchantDisplayName = "JustiFi Checkout";
681
- this.initiativeContext = "dev-checkout.justifi-staging.com";
682
- this.buttonType = ApplePayButtonType.PLAIN;
683
- this.buttonStyle = ApplePayButtonStyle.BLACK;
684
- this.disabled = false;
685
- this.showSkeleton = true;
686
- this.isLoading = true;
687
- this.isProcessing = false;
688
- this.isAvailable = false;
689
- this.canMakePayments = false;
690
- this.isConfigValid = true;
691
- this.error = null;
692
- this.handleApplePayClick = async () => {
693
- var _a, _b;
694
- if (this.isProcessing || this.disabled || !this.isAvailable) {
695
- return;
696
- }
697
- try {
698
- this.isProcessing = true;
699
- this.error = null;
700
- this.applePayStarted.emit();
701
- console.groupCollapsed('[ApplePay Component] handleApplePayClick');
702
- console.log('[ApplePay Component] click context:', {
703
- isProcessing: this.isProcessing,
704
- disabled: this.disabled,
705
- isAvailable: this.isAvailable,
706
- canMakePayments: this.canMakePayments,
707
- hasService: Boolean(this.applePayService),
708
- });
709
- const paymentRequest = {
710
- countryCode: this.countryCode,
711
- currencyCode: checkout_store.checkoutStore.paymentCurrency,
712
- merchantCapabilities: [
713
- ApplePayMerchantCapability.SUPPORTS_3DS,
714
- ApplePayMerchantCapability.SUPPORTS_CREDIT,
715
- ApplePayMerchantCapability.SUPPORTS_DEBIT,
716
- ],
717
- supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
718
- total: ApplePayHelpers.createLineItem(checkout_store.checkoutStore.paymentDescription, checkout_store.checkoutStore.paymentAmount),
719
- };
720
- console.log("[ApplePay Component] paymentRequest", paymentRequest);
721
- console.log('[ApplePay Component] identifiers snapshot:', {
722
- authTokenLength: checkout_store.checkoutStore.authToken ? String(checkout_store.checkoutStore.authToken).length : 0,
723
- accountId: checkout_store.checkoutStore.accountId,
724
- });
725
- const result = await this.applePayService.startPaymentSession(paymentRequest, checkout_store.checkoutStore.authToken, checkout_store.checkoutStore.accountId);
726
- console.log("[ApplePay Component] startPaymentSession result", result);
727
- if (result.success) {
728
- this.applePayCompleted.emit({
729
- success: true,
730
- token: result.token,
731
- paymentMethodId: result.paymentMethodId,
732
- });
733
- }
734
- else {
735
- this.applePayCompleted.emit({
736
- success: false,
737
- error: result.error,
738
- });
739
- this.applePayError.emit({
740
- error: ((_a = result.error) === null || _a === void 0 ? void 0 : _a.message) || "Payment failed",
741
- code: ((_b = result.error) === null || _b === void 0 ? void 0 : _b.code) || ApplePay.ErrorCode.PAYMENT_FAILED,
742
- });
743
- }
744
- }
745
- catch (error) {
746
- const errorMessage = error instanceof Error ? error.message : "Payment failed";
747
- this.error = errorMessage;
748
- this.applePayError.emit({ error: errorMessage, code: ApplePay.ErrorCode.PAYMENT_FAILED });
749
- this.applePayCompleted.emit({
750
- success: false,
751
- error: errorMessage,
752
- });
753
- }
754
- finally {
755
- this.isProcessing = false;
756
- console.groupEnd();
757
- }
758
- };
759
- }
760
- async initializeApplePay() {
761
- try {
762
- this.isLoading = true;
763
- this.error = null;
764
- this.isConfigValid = true;
765
- console.groupCollapsed('[ApplePay Component] initializeApplePay');
766
- console.log('[ApplePay Component] checkout state snapshot:', {
767
- paymentAmount: checkout_store.checkoutStore.paymentAmount,
768
- paymentCurrency: checkout_store.checkoutStore.paymentCurrency,
769
- hasAuthToken: Boolean(checkout_store.checkoutStore.authToken),
770
- accountId: checkout_store.checkoutStore.accountId,
771
- });
772
- const hasRequiredConfig = Boolean(checkout_store.checkoutStore.paymentAmount) &&
773
- Boolean(checkout_store.checkoutStore.paymentCurrency) &&
774
- Boolean(checkout_store.checkoutStore.authToken);
775
- if (!hasRequiredConfig) {
776
- this.error = "Missing required Apple Pay configuration";
777
- this.isConfigValid = false;
778
- console.error("Apple Pay config error: missing required values", {
779
- paymentAmount: checkout_store.checkoutStore.paymentAmount,
780
- paymentCurrency: checkout_store.checkoutStore.paymentCurrency,
781
- hasAuthToken: Boolean(checkout_store.checkoutStore.authToken),
782
- accountId: checkout_store.checkoutStore.accountId,
783
- });
784
- this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.CONFIG_ERROR });
785
- this.isLoading = false;
786
- console.groupEnd();
787
- return;
788
- }
789
- this.isAvailable = ApplePayHelpers.isApplePaySupported();
790
- this.canMakePayments = ApplePayHelpers.canMakePayments();
791
- console.log('[ApplePay Component] support check:', {
792
- isAvailable: this.isAvailable,
793
- canMakePayments: this.canMakePayments,
794
- hasApplePaySessionOnWindow: typeof window !== 'undefined' && 'ApplePaySession' in window,
795
- });
796
- if (!this.isAvailable) {
797
- this.error = "Apple Pay is not supported on this device";
798
- console.error(this.error);
799
- this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_SUPPORTED });
800
- this.isLoading = false;
801
- console.groupEnd();
802
- return;
803
- }
804
- if (!this.canMakePayments) {
805
- this.error = "Apple Pay is not available";
806
- console.error(this.error);
807
- this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_AVAILABLE });
808
- this.isLoading = false;
809
- console.groupEnd();
810
- return;
811
- }
812
- const applePayConfig = {
813
- merchantIdentifier: this.merchantIdentifier,
814
- displayName: this.merchantDisplayName,
815
- initiative: "web",
816
- initiativeContext: this.initiativeContext,
817
- buttonType: this.buttonType,
818
- buttonStyle: this.buttonStyle,
819
- };
820
- console.log('[ApplePay Component] initializing service with config:', applePayConfig);
821
- this.applePayService = new ApplePayService();
822
- this.applePayService.initialize(applePayConfig);
823
- const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
824
- if (!hasActiveCard) {
825
- console.warn("No Apple Pay cards available, but continuing...");
826
- }
827
- }
828
- catch (error) {
829
- console.error("Apple Pay initialization error:", error);
830
- this.error =
831
- error instanceof Error
832
- ? error.message
833
- : "Failed to initialize Apple Pay";
834
- this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.INITIALIZATION_ERROR });
835
- }
836
- finally {
837
- this.isLoading = false;
838
- console.groupEnd();
839
- }
840
- }
841
- async isSupported() {
842
- return this.isAvailable && this.canMakePayments;
843
- }
844
- async getPaymentMethods() {
845
- if (!this.isAvailable) {
846
- return [];
847
- }
848
- return ApplePayHelpers.getDefaultSupportedNetworks();
849
- }
850
- async abort() {
851
- this.applePayService.abortPaymentSession();
852
- this.isProcessing = false;
853
- this.applePayCancelled.emit();
854
- }
855
- render() {
856
- const isReady = !this.isLoading &&
857
- this.isAvailable &&
858
- this.canMakePayments &&
859
- this.isConfigValid;
860
- return (index.h(styledHost.StyledHost, { key: '6ffd1642666316916be6c263d6e79c44fb2d26cf' }, checkout_store.checkoutStore.checkoutLoaded && (index.h("script", { key: 'd3cea0c2fea2b9e51fd926f581dce118a7b0cc00', async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
861
- console.log('[ApplePay Component] Apple Pay SDK script loaded');
862
- this.initializeApplePay();
863
- } })), index.h("div", { key: '4a2ee3cb9a98746be1a10c3836833bb408d0896b', class: 'apple-pay-container' }, index.h(ApplePaySkeleton, { key: 'e804a3d42e4632d224a780c2313da4fd40a35281', isLoading: this.isLoading }), isReady && (index.h(ApplePayButton, { key: '82c8caa32e8857797dc3071a7404d9418fcd2274', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), index.h("style", { key: '022d4942b34097987ca8fe956bb6e02174a488b9' }, `
864
- .apple-pay-container {
865
- width: 100%;
866
- }
867
- `)));
868
- }
869
- };
870
- // Centralized error codes for the Apple Pay component layer
871
- ApplePay.ErrorCode = {
872
- CONFIG_ERROR: 'CONFIG_ERROR',
873
- NOT_SUPPORTED: 'NOT_SUPPORTED',
874
- NOT_AVAILABLE: 'NOT_AVAILABLE',
875
- INITIALIZATION_ERROR: 'INITIALIZATION_ERROR',
876
- PAYMENT_FAILED: 'PAYMENT_FAILED',
877
- };
878
-
879
- exports.justifi_apple_pay = ApplePay;