@justifi/webcomponents 6.0.0-rc.16 → 6.0.0-rc.17

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 (87) hide show
  1. package/dist/cjs/{check-pkg-version-DfzaKEDg.js → check-pkg-version-rUX0NaZj.js} +1 -1
  2. package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
  3. package/dist/cjs/justifi-apple-pay.cjs.entry.js +338 -6
  4. package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +2 -2
  5. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-checkout-summary_7.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  13. package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  19. package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
  20. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  21. package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
  22. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  23. package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
  24. package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
  25. package/dist/cjs/{package-CHNXn8wx.js → package-CwkrMpTG.js} +1 -1
  26. package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +4 -3
  27. package/dist/docs.json +1 -1
  28. package/dist/esm/{check-pkg-version-Cz8T6Ux8.js → check-pkg-version-h58ZAK8T.js} +1 -1
  29. package/dist/esm/hidden-input_2.entry.js +1 -1
  30. package/dist/esm/justifi-apple-pay.entry.js +338 -6
  31. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +2 -2
  32. package/dist/esm/justifi-business-details.entry.js +2 -2
  33. package/dist/esm/justifi-business-form.entry.js +2 -2
  34. package/dist/esm/justifi-checkout-summary_7.entry.js +2 -2
  35. package/dist/esm/justifi-checkout.entry.js +2 -2
  36. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  37. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  38. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  39. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  40. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  41. package/dist/esm/justifi-payment-details.entry.js +2 -2
  42. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  43. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  44. package/dist/esm/justifi-payments-list.entry.js +2 -2
  45. package/dist/esm/justifi-payout-details.entry.js +2 -2
  46. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  47. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  48. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  49. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  50. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  51. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  52. package/dist/esm/{package-BiTF1__F.js → package-fZXUzneK.js} +1 -1
  53. package/dist/module/justifi-apple-pay.js +335 -3
  54. package/dist/module/package.js +1 -1
  55. package/dist/webcomponents/p-27abb8bb.entry.js +1 -0
  56. package/dist/webcomponents/{p-3a34e4f9.entry.js → p-2c9b0770.entry.js} +1 -1
  57. package/dist/webcomponents/{p-2b47ddd8.entry.js → p-2fe09e28.entry.js} +1 -1
  58. package/dist/webcomponents/p-3c8b5121.entry.js +1 -0
  59. package/dist/webcomponents/{p-a53710c4.entry.js → p-46495601.entry.js} +1 -1
  60. package/dist/webcomponents/p-6f7b4979.entry.js +1 -0
  61. package/dist/webcomponents/{p-e7921c1f.entry.js → p-71d52066.entry.js} +1 -1
  62. package/dist/webcomponents/{p-225da0b5.entry.js → p-76c4740e.entry.js} +1 -1
  63. package/dist/webcomponents/{p-3d94c845.entry.js → p-7bc1a2c2.entry.js} +1 -1
  64. package/dist/webcomponents/{p-ce272d8a.entry.js → p-835c0438.entry.js} +1 -1
  65. package/dist/webcomponents/{p-07c3c25e.entry.js → p-8883f4e1.entry.js} +1 -1
  66. package/dist/webcomponents/{p-b9ab3803.entry.js → p-8f11dc84.entry.js} +1 -1
  67. package/dist/webcomponents/{p-BcAsEqa5.js → p-CliUh8zt.js} +1 -1
  68. package/dist/webcomponents/{p-eabaeaf6.entry.js → p-ad79606e.entry.js} +1 -1
  69. package/dist/webcomponents/{p-73dd0306.entry.js → p-b86e5c2b.entry.js} +1 -1
  70. package/dist/webcomponents/{p-f6e3f1ca.entry.js → p-bc246ce5.entry.js} +1 -1
  71. package/dist/webcomponents/{p-69bf5e32.entry.js → p-e1501f53.entry.js} +1 -1
  72. package/dist/webcomponents/{p-0913a57b.entry.js → p-e4259408.entry.js} +1 -1
  73. package/dist/webcomponents/p-e5f2fb41.entry.js +1 -0
  74. package/dist/webcomponents/p-edc2851f.entry.js +1 -0
  75. package/dist/webcomponents/{p-0bba0dd0.entry.js → p-f0b5df73.entry.js} +1 -1
  76. package/dist/webcomponents/{p-a65d751d.entry.js → p-f6745365.entry.js} +1 -1
  77. package/dist/webcomponents/p-fZXUzneK.js +1 -0
  78. package/dist/webcomponents/{p-995c2cbf.entry.js → p-fc8c3b96.entry.js} +1 -1
  79. package/dist/webcomponents/{p-c3cfcd4b.entry.js → p-febb61e3.entry.js} +1 -1
  80. package/dist/webcomponents/webcomponents.esm.js +1 -1
  81. package/package.json +1 -1
  82. package/dist/webcomponents/p-099e96ba.entry.js +0 -1
  83. package/dist/webcomponents/p-3caee9d2.entry.js +0 -1
  84. package/dist/webcomponents/p-4abf0877.entry.js +0 -1
  85. package/dist/webcomponents/p-5a3fc339.entry.js +0 -1
  86. package/dist/webcomponents/p-BiTF1__F.js +0 -1
  87. package/dist/webcomponents/p-a7712cea.entry.js +0 -1
@@ -10,7 +10,7 @@ require('./Pagination-Dediz133.js');
10
10
  require('./Business-DCRzZf0w.js');
11
11
  require('./Dispute-CruQTF6_.js');
12
12
  var utils = require('./utils-DvUQQLmR.js');
13
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
13
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
14
14
  var styledHost = require('./styled-host-BfVJlAsJ.js');
15
15
  require('./event-types-YOY5TKUN.js');
16
16
  var paymentsTable = require('./payments-table-BE8u0-i0.js');
@@ -19,7 +19,7 @@ require('./utils-ChCUZgUy.js');
19
19
  require('./index-B32W0A3m.js');
20
20
  require('./helpers-B5OCqlIM.js');
21
21
  require('./state-options-CIT9xdTz.js');
22
- require('./package-CHNXn8wx.js');
22
+ require('./package-CwkrMpTG.js');
23
23
  require('./payments-status-DXRh_ekP.js');
24
24
  require('./badge-CcJ9H85-.js');
25
25
  require('./parts-9jMf1erK.js');
@@ -11,7 +11,7 @@ require('./Business-DCRzZf0w.js');
11
11
  require('./Dispute-CruQTF6_.js');
12
12
  var utils = require('./utils-DvUQQLmR.js');
13
13
  var utils$1 = require('./utils-Bzyj4qWe.js');
14
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
14
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
15
15
  var getPayoutCsv = require('./get-payout-csv-DE_D9y08.js');
16
16
  require('./Api-DyimBzKT.js');
17
17
  require('./utils-ChCUZgUy.js');
@@ -19,7 +19,7 @@ require('./index-B32W0A3m.js');
19
19
  require('./helpers-B5OCqlIM.js');
20
20
  require('./state-options-CIT9xdTz.js');
21
21
  require('./parts-9jMf1erK.js');
22
- require('./package-CHNXn8wx.js');
22
+ require('./package-CwkrMpTG.js');
23
23
 
24
24
  const makeGetPayoutDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
25
25
  var _a;
@@ -8,7 +8,7 @@ var Refund = require('./Refund-BefKONu4.js');
8
8
  var Pagination = require('./Pagination-Dediz133.js');
9
9
  require('./Business-DCRzZf0w.js');
10
10
  require('./Dispute-CruQTF6_.js');
11
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
11
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
12
12
  var utils = require('./utils-DvUQQLmR.js');
13
13
  var payout_service = require('./payout.service-6Cl_yXXQ.js');
14
14
  var table = require('./table-Ccdrt0v_.js');
@@ -19,7 +19,7 @@ var parts = require('./parts-9jMf1erK.js');
19
19
  require('./index-B32W0A3m.js');
20
20
  require('./helpers-B5OCqlIM.js');
21
21
  require('./state-options-CIT9xdTz.js');
22
- require('./package-CHNXn8wx.js');
22
+ require('./package-CwkrMpTG.js');
23
23
  require('./Api-DyimBzKT.js');
24
24
  require('./spinner-jmeA44Ee.js');
25
25
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-C9hBD-32.js');
4
4
  var ComponentError = require('./ComponentError-D4OLnOkg.js');
5
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
5
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
6
6
  var payout_service = require('./payout.service-6Cl_yXXQ.js');
7
7
  require('./config-state-BBOZIS8x.js');
8
8
  require('./dinero-BwNN_k7x.js');
@@ -16,7 +16,7 @@ var getSubaccounts = require('./get-subaccounts-Bnfv2tEN.js');
16
16
  var styledHost = require('./styled-host-BfVJlAsJ.js');
17
17
  require('./event-types-YOY5TKUN.js');
18
18
  var payoutsTable = require('./payouts-table-BbydhJUr.js');
19
- require('./package-CHNXn8wx.js');
19
+ require('./package-CwkrMpTG.js');
20
20
  require('./Api-DyimBzKT.js');
21
21
  require('./utils-ChCUZgUy.js');
22
22
  require('./index-B32W0A3m.js');
@@ -14,7 +14,7 @@ var styledHost = require('./styled-host-BfVJlAsJ.js');
14
14
  require('./event-types-YOY5TKUN.js');
15
15
  var payment_service = require('./payment.service-aR96UW5e.js');
16
16
  var getPaymentDetails = require('./get-payment-details-BfgRmNL4.js');
17
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
17
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
18
18
  var utils$1 = require('./utils-DvUQQLmR.js');
19
19
  var Api = require('./Api-DyimBzKT.js');
20
20
  var skeleton = require('./skeleton-C7DQRD6r.js');
@@ -24,7 +24,7 @@ require('./index-B32W0A3m.js');
24
24
  require('./helpers-B5OCqlIM.js');
25
25
  require('./state-options-CIT9xdTz.js');
26
26
  require('./parts-9jMf1erK.js');
27
- require('./package-CHNXn8wx.js');
27
+ require('./package-CwkrMpTG.js');
28
28
 
29
29
  const amountValidation = (maxAmount) => {
30
30
  const max = +maxAmount;
@@ -8,7 +8,7 @@ require('./Pagination-Dediz133.js');
8
8
  require('./Business-DCRzZf0w.js');
9
9
  require('./Dispute-CruQTF6_.js');
10
10
  var utils = require('./utils-DvUQQLmR.js');
11
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
11
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
12
12
  var checkout_store = require('./checkout.store-DJEc-So8.js');
13
13
  var utils$1 = require('./utils-ChCUZgUy.js');
14
14
  var insuranceState = require('./insurance-state-d2thhXUX.js');
@@ -20,7 +20,7 @@ require('./config-state-BBOZIS8x.js');
20
20
  require('./index-B32W0A3m.js');
21
21
  require('./helpers-B5OCqlIM.js');
22
22
  require('./state-options-CIT9xdTz.js');
23
- require('./package-CHNXn8wx.js');
23
+ require('./package-CwkrMpTG.js');
24
24
  require('./dinero-BwNN_k7x.js');
25
25
  require('./index-D-dD-aC2.js');
26
26
 
@@ -3,7 +3,7 @@
3
3
  var index = require('./index-C9hBD-32.js');
4
4
  var styledHost = require('./styled-host-BfVJlAsJ.js');
5
5
  require('./event-types-YOY5TKUN.js');
6
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
6
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
7
7
  var terminalOrdersTable = require('./terminal-orders-table-B4HjERrK.js');
8
8
  require('./config-state-BBOZIS8x.js');
9
9
  require('./dinero-BwNN_k7x.js');
@@ -14,7 +14,7 @@ require('./Business-DCRzZf0w.js');
14
14
  require('./Dispute-CruQTF6_.js');
15
15
  var utils = require('./utils-DvUQQLmR.js');
16
16
  var Api = require('./Api-DyimBzKT.js');
17
- require('./package-CHNXn8wx.js');
17
+ require('./package-CwkrMpTG.js');
18
18
  require('./parts-9jMf1erK.js');
19
19
  require('./utils-ChCUZgUy.js');
20
20
  require('./badge-CcJ9H85-.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-C9hBD-32.js');
4
4
  var ComponentError = require('./ComponentError-D4OLnOkg.js');
5
- var checkPkgVersion = require('./check-pkg-version-DfzaKEDg.js');
5
+ var checkPkgVersion = require('./check-pkg-version-rUX0NaZj.js');
6
6
  var terminal_service = require('./terminal.service-D1FAYZzd.js');
7
7
  require('./config-state-BBOZIS8x.js');
8
8
  require('./dinero-BwNN_k7x.js');
@@ -15,7 +15,7 @@ var getSubaccounts = require('./get-subaccounts-Bnfv2tEN.js');
15
15
  var styledHost = require('./styled-host-BfVJlAsJ.js');
16
16
  require('./event-types-YOY5TKUN.js');
17
17
  var terminalsTable = require('./terminals-table-C79Xc4FI.js');
18
- require('./package-CHNXn8wx.js');
18
+ require('./package-CwkrMpTG.js');
19
19
  require('./Api-DyimBzKT.js');
20
20
  require('./utils-ChCUZgUy.js');
21
21
  require('./index-B32W0A3m.js');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const name = "@justifi/webcomponents";
4
- const version = "6.0.0-rc.16";
4
+ const version = "6.0.0-rc.17";
5
5
  var packageJson = {
6
6
  name: name,
7
7
  version: version};
@@ -1,6 +1,7 @@
1
1
  import { h,
2
2
  // Watch,
3
3
  } from "@stencil/core";
4
+ import { ApplePayService } from "../../../api/services/apple-pay.service";
4
5
  import { ApplePayButtonType, ApplePayButtonStyle, ApplePayHelpers, } from "../../../api/ApplePay";
5
6
  import { StyledHost } from "../../../ui-components";
6
7
  import ApplePaySkeleton from "./apple-pay-skeleton";
@@ -74,7 +75,6 @@ export class ApplePay {
74
75
  // private unsubscribeCheckoutLoaded?: () => void;
75
76
  // componentWillLoad() {
76
77
  // this.unsubscribeCheckoutLoaded = onChange("checkoutLoaded", (loaded) => {
77
- // this.applePayService = new ApplePayService();
78
78
  // console.log("checkoutLoaded", loaded);
79
79
  // if (loaded) {
80
80
  // this.initializeApplePay();
@@ -137,6 +137,7 @@ export class ApplePay {
137
137
  buttonType: this.buttonType,
138
138
  buttonStyle: this.buttonStyle,
139
139
  };
140
+ this.applePayService = new ApplePayService();
140
141
  this.applePayService.initialize(applePayConfig);
141
142
  const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
142
143
  if (!hasActiveCard) {
@@ -180,9 +181,9 @@ export class ApplePay {
180
181
  this.isAvailable &&
181
182
  this.canMakePayments &&
182
183
  this.isConfigValid;
183
- return (h(StyledHost, { key: 'ea33bc759d2849cf013cb6f98367c8d78c799acb' }, checkoutStore.checkoutLoaded && (h("script", { key: '9ed6140223a8788ca194a8978a9ca8e1e30eb10e', async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
184
+ return (h(StyledHost, { key: 'ac97a93a1351ec6b3cf148377721b8f019aafd77' }, checkoutStore.checkoutLoaded && (h("script", { key: '2d4c928c3228a273bef756cce4c4ac05182e7efa', async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
184
185
  this.initializeApplePay();
185
- } })), h("div", { key: '6501d8cb4c4119eadf9112db4fca876437138bcc', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: '1aee83e3deac0d0f68d2788f65401a1d7c48047f', isReady: isReady }), isReady && (h(ApplePayButton, { key: 'eb05dde5789f5f1bb83e75127c222996a38c8fef', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '8060bf6771c12f47d482f0a774e4fd6547e50a2e' }, `
186
+ } })), h("div", { key: '8890def5a313a29e42b358c55f3209ef30054d54', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: 'a531fbe89a491a911a0aa6ff42a80458e63030b5', isReady: isReady }), isReady && (h(ApplePayButton, { key: '77e0b5e8cff57ee4dd2956671b14dc9c90101326', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '3ad594d30382388cf5defc050e5f2e5a17017c7b' }, `
186
187
  .apple-pay-container {
187
188
  width: 100%;
188
189
  }
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2025-09-02T23:18:44",
2
+ "timestamp": "2025-09-02T23:32:50",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.36.3",
@@ -1,4 +1,4 @@
1
- import { p as packageJson } from './package-BiTF1__F.js';
1
+ import { p as packageJson } from './package-fZXUzneK.js';
2
2
  import { A as Api } from './Api-DAWuvzbl.js';
3
3
  import './ComponentError-Cjcsf8ku.js';
4
4
  import './Refund-CVh70dXA.js';
@@ -3,7 +3,7 @@ import { c as createStore } from './index-B_KxSZIF.js';
3
3
  import { i as inputInvalidAndFocused, b as inputInvalid, a as inputFocused, c as input, l as label } from './parts-RvUQ__Pq.js';
4
4
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers-BFTU3MAI.js';
5
5
  import { F as FormControlErrorText } from './form-control-error-text-R7U07nTg.js';
6
- import { p as packageJson } from './package-BiTF1__F.js';
6
+ import { p as packageJson } from './package-fZXUzneK.js';
7
7
 
8
8
  const iframeInputStylesStore = createStore({
9
9
  focused: {
@@ -1,15 +1,16 @@
1
1
  import { h, r as registerInstance, c as createEvent } from './index-Bn7inNWG.js';
2
+ import { A as Api } from './Api-DAWuvzbl.js';
2
3
  import { S as StyledHost } from './styled-host-CTAGIN84.js';
3
4
  import './event-types-CZfYo5-1.js';
4
5
  import { S as Skeleton } from './skeleton-qMb0_Cjy.js';
5
6
  import { c as checkoutStore } from './checkout.store-OD-OX5On.js';
6
- import './parts-RvUQ__Pq.js';
7
- import './index-B_KxSZIF.js';
8
7
  import './config-state-DZeVYerv.js';
8
+ import './index-B_KxSZIF.js';
9
+ import './utils-BscIVFn8.js';
9
10
  import './dinero-HXpYMWUU.js';
11
+ import './parts-RvUQ__Pq.js';
10
12
  import './ComponentError-Cjcsf8ku.js';
11
13
  import './Refund-CVh70dXA.js';
12
- import './utils-BscIVFn8.js';
13
14
  import './Dispute-BH0Xfn-F.js';
14
15
  import './Pagination-CLHwhyvu.js';
15
16
  import './Business-BCoP0TAV.js';
@@ -45,6 +46,45 @@ var ApplePayMerchantCapability;
45
46
  ApplePayMerchantCapability["SUPPORTS_CREDIT"] = "supportsCredit";
46
47
  ApplePayMerchantCapability["SUPPORTS_DEBIT"] = "supportsDebit";
47
48
  })(ApplePayMerchantCapability || (ApplePayMerchantCapability = {}));
49
+ class ApplePayConfig {
50
+ constructor(data) {
51
+ this.merchantIdentifier = data.merchantIdentifier;
52
+ this.displayName = data.displayName;
53
+ this.initiative = data.initiative;
54
+ this.initiativeContext = data.initiativeContext;
55
+ this.buttonType = data.buttonType || ApplePayButtonType.PLAIN;
56
+ this.buttonStyle = data.buttonStyle || ApplePayButtonStyle.BLACK;
57
+ this.buttonLocale = data.buttonLocale || 'en-US';
58
+ }
59
+ get isValid() {
60
+ return !!(this.merchantIdentifier &&
61
+ this.displayName &&
62
+ this.initiative &&
63
+ this.initiativeContext);
64
+ }
65
+ }
66
+ class ApplePayPaymentRequest {
67
+ constructor(data) {
68
+ this.countryCode = data.countryCode;
69
+ this.currencyCode = data.currencyCode;
70
+ this.merchantCapabilities = data.merchantCapabilities;
71
+ this.supportedNetworks = data.supportedNetworks;
72
+ this.total = data.total;
73
+ this.lineItems = data.lineItems;
74
+ this.shippingMethods = data.shippingMethods;
75
+ this.applicationData = data.applicationData;
76
+ this.supportedCountries = data.supportedCountries;
77
+ }
78
+ get isValid() {
79
+ var _a, _b, _c, _d;
80
+ return !!(this.countryCode &&
81
+ this.currencyCode &&
82
+ ((_a = this.merchantCapabilities) === null || _a === void 0 ? void 0 : _a.length) &&
83
+ ((_b = this.supportedNetworks) === null || _b === void 0 ? void 0 : _b.length) &&
84
+ ((_c = this.total) === null || _c === void 0 ? void 0 : _c.label) &&
85
+ ((_d = this.total) === null || _d === void 0 ? void 0 : _d.amount));
86
+ }
87
+ }
48
88
  class ApplePayHelpers {
49
89
  static isApplePaySupported() {
50
90
  var _a;
@@ -98,6 +138,298 @@ class ApplePayHelpers {
98
138
  }
99
139
  }
100
140
 
141
+ class ApplePayService {
142
+ constructor() {
143
+ this.api = Api();
144
+ }
145
+ /**
146
+ * Initialize Apple Pay configuration
147
+ */
148
+ initialize(applePayConfig) {
149
+ this.applePayConfig = new ApplePayConfig(applePayConfig);
150
+ if (!this.applePayConfig.isValid) {
151
+ throw new Error('Invalid Apple Pay configuration provided');
152
+ }
153
+ }
154
+ /**
155
+ * Validate merchant with Apple Pay servers via API
156
+ */
157
+ async validateMerchant(authToken, accountId) {
158
+ const endpoint = 'apple_pay/merchant_session';
159
+ try {
160
+ const response = await this.api.post({
161
+ endpoint,
162
+ authToken,
163
+ headers: {
164
+ 'Sub-Account': accountId,
165
+ },
166
+ });
167
+ return response;
168
+ }
169
+ catch (error) {
170
+ console.error('Backend validation failed:', error);
171
+ throw new Error('Merchant validation failed');
172
+ }
173
+ }
174
+ /**
175
+ * Process Apple Pay payment via API (fixed to match original logic)
176
+ */
177
+ async processPayment(authToken, accountId, payload) {
178
+ const endpoint = 'apple_pay/process_token';
179
+ const result = await this.api.post({
180
+ endpoint,
181
+ authToken,
182
+ body: payload,
183
+ headers: {
184
+ 'Sub-Account': accountId,
185
+ },
186
+ });
187
+ return {
188
+ success: result.id && !!result.data.token,
189
+ data: result,
190
+ };
191
+ }
192
+ /**
193
+ * Check if Apple Pay is available on this device/browser
194
+ */
195
+ isAvailable() {
196
+ return (ApplePayHelpers.isApplePaySupported() && ApplePayHelpers.canMakePayments());
197
+ }
198
+ /**
199
+ * Check if the user has an active card for the merchant
200
+ */
201
+ async canMakePaymentsWithActiveCard() {
202
+ if (!this.applePayConfig) {
203
+ throw new Error('Apple Pay not initialized. Call initialize() first.');
204
+ }
205
+ return await ApplePayHelpers.canMakePaymentsWithActiveCard(this.applePayConfig.merchantIdentifier);
206
+ }
207
+ /**
208
+ * Start Apple Pay session
209
+ */
210
+ async startPaymentSession(paymentRequest, authToken, accountId) {
211
+ if (!this.applePayConfig) {
212
+ throw new Error('Apple Pay not initialized. Call initialize() first.');
213
+ }
214
+ // if (!this.isAvailable()) {
215
+ // throw new Error('Apple Pay is not available on this device/browser');
216
+ // }
217
+ const request = new ApplePayPaymentRequest(paymentRequest);
218
+ if (!request.isValid) {
219
+ throw new Error('Invalid payment request provided');
220
+ }
221
+ this.currentPaymentRequest = request;
222
+ return new Promise((resolve, reject) => {
223
+ try {
224
+ this.currentSession = new window.ApplePaySession(3, request);
225
+ this.setupSessionEventHandlers(resolve, reject, authToken, accountId);
226
+ this.currentSession.begin();
227
+ }
228
+ catch (error) {
229
+ reject({
230
+ success: false,
231
+ error: {
232
+ code: 'SESSION_ERROR',
233
+ message: error instanceof Error
234
+ ? error.message
235
+ : 'Failed to start Apple Pay session',
236
+ },
237
+ });
238
+ }
239
+ });
240
+ }
241
+ /**
242
+ * Abort current Apple Pay session
243
+ */
244
+ abortPaymentSession() {
245
+ if (this.currentSession) {
246
+ this.currentSession.abort();
247
+ this.currentSession = undefined;
248
+ this.currentPaymentRequest = undefined;
249
+ }
250
+ }
251
+ /**
252
+ * Setup Apple Pay session event handlers
253
+ */
254
+ setupSessionEventHandlers(resolve, reject, authToken, accountId) {
255
+ if (!this.currentSession ||
256
+ !this.applePayConfig ||
257
+ !this.currentPaymentRequest) {
258
+ return;
259
+ }
260
+ this.currentSession.onvalidatemerchant = async () => {
261
+ try {
262
+ if (!authToken) {
263
+ throw new Error('Authentication token not provided.');
264
+ }
265
+ const merchantSession = await this.validateMerchant(authToken, accountId);
266
+ try {
267
+ this.currentSession.completeMerchantValidation(merchantSession);
268
+ }
269
+ catch (completionError) {
270
+ console.error('Error calling completeMerchantValidation:', completionError);
271
+ throw completionError;
272
+ }
273
+ }
274
+ catch (error) {
275
+ console.error('=== MERCHANT VALIDATION ERROR ===');
276
+ console.error('Error during merchant validation:', error);
277
+ console.error('Error stack:', error.stack);
278
+ this.currentSession.abort();
279
+ reject({
280
+ success: false,
281
+ error: {
282
+ code: 'MERCHANT_VALIDATION_ERROR',
283
+ message: error instanceof Error
284
+ ? error.message
285
+ : 'Merchant validation failed',
286
+ },
287
+ });
288
+ }
289
+ };
290
+ this.currentSession.onpaymentauthorized = async (event) => {
291
+ try {
292
+ const payment = event.payment;
293
+ const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
294
+ name: this.currentPaymentRequest.total.label,
295
+ price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
296
+ description: this.currentPaymentRequest.total.label,
297
+ } });
298
+ const paymentResult = await this.processPayment(authToken, accountId, paymentPayload);
299
+ if (paymentResult.success) {
300
+ this.currentSession.completePayment({
301
+ status: ApplePaySessionStatus.STATUS_SUCCESS,
302
+ });
303
+ resolve({
304
+ success: true,
305
+ token: payment.token,
306
+ paymentMethodId: paymentResult.data.id,
307
+ });
308
+ }
309
+ else {
310
+ console.error('PSP reported payment failure:', paymentResult.data);
311
+ this.currentSession.completePayment({
312
+ status: ApplePaySessionStatus.STATUS_FAILURE,
313
+ });
314
+ reject({
315
+ success: false,
316
+ error: {
317
+ code: 'PAYMENT_PROCESSING_ERROR',
318
+ message: 'Payment processing failed',
319
+ },
320
+ });
321
+ }
322
+ }
323
+ catch (error) {
324
+ console.error('=== PAYMENT PROCESSING ERROR ===');
325
+ console.error('Error processing payment:', error);
326
+ console.error('Error stack:', error.stack);
327
+ this.currentSession.completePayment({
328
+ status: ApplePaySessionStatus.STATUS_FAILURE,
329
+ });
330
+ reject({
331
+ success: false,
332
+ error: {
333
+ code: 'PAYMENT_PROCESSING_ERROR',
334
+ message: error instanceof Error
335
+ ? error.message
336
+ : 'Payment processing failed',
337
+ },
338
+ });
339
+ }
340
+ finally {
341
+ this.currentSession = undefined;
342
+ this.currentPaymentRequest = undefined;
343
+ }
344
+ };
345
+ this.currentSession.onpaymentmethodselected = () => {
346
+ const paymentUpdate = {
347
+ newTotal: this.currentPaymentRequest.total,
348
+ newLineItems: this.currentPaymentRequest.lineItems || [],
349
+ };
350
+ try {
351
+ this.currentSession.completePaymentMethodSelection(paymentUpdate);
352
+ }
353
+ catch (error) {
354
+ console.error('Error completing payment method selection:', error);
355
+ this.currentSession.abort();
356
+ }
357
+ };
358
+ this.currentSession.onshippingmethodselected = () => {
359
+ this.currentSession.completeShippingMethodSelection({
360
+ status: ApplePaySessionStatus.STATUS_SUCCESS,
361
+ newTotal: this.currentPaymentRequest.total,
362
+ newLineItems: this.currentPaymentRequest.lineItems || [],
363
+ });
364
+ };
365
+ this.currentSession.oncancel = (event) => {
366
+ if (event.sessionError) {
367
+ console.error(event.sessionError);
368
+ switch (event.sessionError.code) {
369
+ case 'unknown':
370
+ console.error('Unknown error - likely merchant validation issue');
371
+ console.error('This usually means:');
372
+ console.error('1. Merchant certificate is invalid or expired');
373
+ console.error('2. Merchant identifier mismatch');
374
+ console.error('3. Backend validation endpoint issues');
375
+ break;
376
+ case 'invalidMerchantSession':
377
+ console.error('Invalid merchant session provided');
378
+ console.error('Check that the merchant session from backend is valid');
379
+ break;
380
+ case 'userCancel':
381
+ console.error('User cancelled the payment');
382
+ break;
383
+ default:
384
+ console.error('Other error code:', event.sessionError.code);
385
+ }
386
+ }
387
+ this.currentSession = undefined;
388
+ this.currentPaymentRequest = undefined;
389
+ reject({
390
+ success: false,
391
+ error: {
392
+ code: 'USER_CANCELLED',
393
+ message: 'User cancelled the Apple Pay session',
394
+ },
395
+ });
396
+ };
397
+ if ('onerror' in this.currentSession) {
398
+ this.currentSession.onerror = (error) => {
399
+ console.error('=== APPLE PAY SESSION ERROR ===');
400
+ console.error('Session error:', error);
401
+ this.currentSession = undefined;
402
+ this.currentPaymentRequest = undefined;
403
+ reject({
404
+ success: false,
405
+ error: {
406
+ code: 'SESSION_ERROR',
407
+ message: 'Apple Pay session error occurred',
408
+ },
409
+ });
410
+ };
411
+ }
412
+ }
413
+ /**
414
+ * Create a basic payment request
415
+ */
416
+ static createPaymentRequest(amount, label, countryCode = 'US', currencyCode = 'USD') {
417
+ return {
418
+ countryCode,
419
+ currencyCode,
420
+ merchantCapabilities: ApplePayHelpers.getDefaultMerchantCapabilities(),
421
+ supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
422
+ total: ApplePayHelpers.createLineItem(label, amount),
423
+ };
424
+ }
425
+ /**
426
+ * Get current configuration
427
+ */
428
+ getApplePayConfig() {
429
+ return this.applePayConfig;
430
+ }
431
+ }
432
+
101
433
  const ApplePaySkeleton = (props) => {
102
434
  const { isReady } = props;
103
435
  if (isReady) {
@@ -331,7 +663,6 @@ const ApplePay = class {
331
663
  // private unsubscribeCheckoutLoaded?: () => void;
332
664
  // componentWillLoad() {
333
665
  // this.unsubscribeCheckoutLoaded = onChange("checkoutLoaded", (loaded) => {
334
- // this.applePayService = new ApplePayService();
335
666
  // console.log("checkoutLoaded", loaded);
336
667
  // if (loaded) {
337
668
  // this.initializeApplePay();
@@ -394,6 +725,7 @@ const ApplePay = class {
394
725
  buttonType: this.buttonType,
395
726
  buttonStyle: this.buttonStyle,
396
727
  };
728
+ this.applePayService = new ApplePayService();
397
729
  this.applePayService.initialize(applePayConfig);
398
730
  const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
399
731
  if (!hasActiveCard) {
@@ -437,9 +769,9 @@ const ApplePay = class {
437
769
  this.isAvailable &&
438
770
  this.canMakePayments &&
439
771
  this.isConfigValid;
440
- return (h(StyledHost, { key: 'ea33bc759d2849cf013cb6f98367c8d78c799acb' }, checkoutStore.checkoutLoaded && (h("script", { key: '9ed6140223a8788ca194a8978a9ca8e1e30eb10e', async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
772
+ return (h(StyledHost, { key: 'ac97a93a1351ec6b3cf148377721b8f019aafd77' }, checkoutStore.checkoutLoaded && (h("script", { key: '2d4c928c3228a273bef756cce4c4ac05182e7efa', async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
441
773
  this.initializeApplePay();
442
- } })), h("div", { key: '6501d8cb4c4119eadf9112db4fca876437138bcc', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: '1aee83e3deac0d0f68d2788f65401a1d7c48047f', isReady: isReady }), isReady && (h(ApplePayButton, { key: 'eb05dde5789f5f1bb83e75127c222996a38c8fef', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '8060bf6771c12f47d482f0a774e4fd6547e50a2e' }, `
774
+ } })), h("div", { key: '8890def5a313a29e42b358c55f3209ef30054d54', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: 'a531fbe89a491a911a0aa6ff42a80458e63030b5', isReady: isReady }), isReady && (h(ApplePayButton, { key: '77e0b5e8cff57ee4dd2956671b14dc9c90101326', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '3ad594d30382388cf5defc050e5f2e5a17017c7b' }, `
443
775
  .apple-pay-container {
444
776
  width: 100%;
445
777
  }
@@ -5,7 +5,7 @@ import { r as radioListItem, av as billingForm } from './parts-RvUQ__Pq.js';
5
5
  import { S as StyledHost } from './styled-host-CTAGIN84.js';
6
6
  import './event-types-CZfYo5-1.js';
7
7
  import { S as Skeleton } from './skeleton-qMb0_Cjy.js';
8
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
8
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-h58ZAK8T.js';
9
9
  import { w as waitForConfig, c as configState } from './config-state-DZeVYerv.js';
10
10
  import { H as Header3 } from './header-3-CWa41YWq.js';
11
11
  import { n as numberOnlyHandler } from './utils-BnjCmwMr.js';
@@ -16,7 +16,7 @@ import './_commonjsHelpers-BFTU3MAI.js';
16
16
  import './business-form-options-CgssATyg.js';
17
17
  import './Business-BCoP0TAV.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
- import './package-BiTF1__F.js';
19
+ import './package-fZXUzneK.js';
20
20
  import './Api-DAWuvzbl.js';
21
21
  import './utils-BscIVFn8.js';
22
22
  import './dinero-HXpYMWUU.js';
@@ -3,7 +3,7 @@ import { E as ErrorState } from './utils-Dg6gMUTv.js';
3
3
  import { B as BusinessService } from './business.service-cQrH5BqF.js';
4
4
  import { m as makeGetBusiness } from './get-business-Crb6P-iI.js';
5
5
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
6
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
6
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-h58ZAK8T.js';
7
7
  import './parts-RvUQ__Pq.js';
8
8
  import './Api-DAWuvzbl.js';
9
9
  import './config-state-DZeVYerv.js';
@@ -17,7 +17,7 @@ import './Business-BCoP0TAV.js';
17
17
  import './helpers-Mu7LQT-w.js';
18
18
  import './state-options-BX8GieXu.js';
19
19
  import './utils-BeQLScSm.js';
20
- import './package-BiTF1__F.js';
20
+ import './package-fZXUzneK.js';
21
21
 
22
22
  const BusinessDetails = class {
23
23
  constructor(hostRef) {