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

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 (90) hide show
  1. package/dist/cjs/{check-pkg-version-DfzaKEDg.js → check-pkg-version-BIRpFWjW.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 +341 -35
  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 +3 -4
  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-BVAhjheJ.js} +1 -1
  26. package/dist/collection/components/modular-checkout/modular-checkout.js +1 -2
  27. package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +8 -35
  28. package/dist/docs.json +1 -1
  29. package/dist/esm/{check-pkg-version-Cz8T6Ux8.js → check-pkg-version-DHG-pLKx.js} +1 -1
  30. package/dist/esm/hidden-input_2.entry.js +1 -1
  31. package/dist/esm/justifi-apple-pay.entry.js +341 -35
  32. package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +2 -2
  33. package/dist/esm/justifi-business-details.entry.js +2 -2
  34. package/dist/esm/justifi-business-form.entry.js +2 -2
  35. package/dist/esm/justifi-checkout-summary_7.entry.js +3 -4
  36. package/dist/esm/justifi-checkout.entry.js +2 -2
  37. package/dist/esm/justifi-checkouts-list.entry.js +2 -2
  38. package/dist/esm/justifi-dispute-management.entry.js +2 -2
  39. package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
  40. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  41. package/dist/esm/justifi-order-terminals.entry.js +2 -2
  42. package/dist/esm/justifi-payment-details.entry.js +2 -2
  43. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  44. package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
  45. package/dist/esm/justifi-payments-list.entry.js +2 -2
  46. package/dist/esm/justifi-payout-details.entry.js +2 -2
  47. package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
  48. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  49. package/dist/esm/justifi-refund-payment.entry.js +2 -2
  50. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  51. package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
  52. package/dist/esm/justifi-terminals-list.entry.js +2 -2
  53. package/dist/esm/{package-BiTF1__F.js → package-D34B0fIu.js} +1 -1
  54. package/dist/module/justifi-apple-pay.js +338 -32
  55. package/dist/module/modular-checkout.js +1 -2
  56. package/dist/module/package.js +1 -1
  57. package/dist/webcomponents/{p-c3cfcd4b.entry.js → p-00ce804c.entry.js} +1 -1
  58. package/dist/webcomponents/{p-2b47ddd8.entry.js → p-1a00ae1a.entry.js} +1 -1
  59. package/dist/webcomponents/p-387951b7.entry.js +1 -0
  60. package/dist/webcomponents/{p-3d94c845.entry.js → p-39caca63.entry.js} +1 -1
  61. package/dist/webcomponents/{p-3a34e4f9.entry.js → p-43929b3f.entry.js} +1 -1
  62. package/dist/webcomponents/{p-0913a57b.entry.js → p-52453823.entry.js} +1 -1
  63. package/dist/webcomponents/{p-a65d751d.entry.js → p-5d604178.entry.js} +1 -1
  64. package/dist/webcomponents/{p-995c2cbf.entry.js → p-5fbcf154.entry.js} +1 -1
  65. package/dist/webcomponents/{p-07c3c25e.entry.js → p-611a013a.entry.js} +1 -1
  66. package/dist/webcomponents/p-66b1a1be.entry.js +1 -0
  67. package/dist/webcomponents/p-857ed314.entry.js +1 -0
  68. package/dist/webcomponents/{p-225da0b5.entry.js → p-8e3be834.entry.js} +1 -1
  69. package/dist/webcomponents/{p-eabaeaf6.entry.js → p-9080a91c.entry.js} +1 -1
  70. package/dist/webcomponents/{p-ce272d8a.entry.js → p-91110a56.entry.js} +1 -1
  71. package/dist/webcomponents/{p-f6e3f1ca.entry.js → p-91753cd0.entry.js} +1 -1
  72. package/dist/webcomponents/{p-a53710c4.entry.js → p-95279d6b.entry.js} +1 -1
  73. package/dist/webcomponents/p-D34B0fIu.js +1 -0
  74. package/dist/webcomponents/{p-BcAsEqa5.js → p-DWOdLN23.js} +1 -1
  75. package/dist/webcomponents/p-ad6df3f2.entry.js +1 -0
  76. package/dist/webcomponents/p-b37c187c.entry.js +1 -0
  77. package/dist/webcomponents/{p-e7921c1f.entry.js → p-b4cb8091.entry.js} +1 -1
  78. package/dist/webcomponents/{p-3caee9d2.entry.js → p-ccc932f5.entry.js} +1 -1
  79. package/dist/webcomponents/{p-0bba0dd0.entry.js → p-cef742c4.entry.js} +1 -1
  80. package/dist/webcomponents/{p-b9ab3803.entry.js → p-dd481752.entry.js} +1 -1
  81. package/dist/webcomponents/p-eab855aa.entry.js +1 -0
  82. package/dist/webcomponents/webcomponents.esm.js +1 -1
  83. package/package.json +1 -1
  84. package/dist/webcomponents/p-099e96ba.entry.js +0 -1
  85. package/dist/webcomponents/p-4abf0877.entry.js +0 -1
  86. package/dist/webcomponents/p-5a3fc339.entry.js +0 -1
  87. package/dist/webcomponents/p-69bf5e32.entry.js +0 -1
  88. package/dist/webcomponents/p-73dd0306.entry.js +0 -1
  89. package/dist/webcomponents/p-BiTF1__F.js +0 -1
  90. package/dist/webcomponents/p-a7712cea.entry.js +0 -1
@@ -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) {
@@ -295,6 +627,7 @@ const ApplePay = class {
295
627
  supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
296
628
  total: ApplePayHelpers.createLineItem(checkoutStore.paymentDescription, checkoutStore.paymentAmount),
297
629
  };
630
+ console.log("paymentRequest", paymentRequest);
298
631
  const result = await this.applePayService.startPaymentSession(paymentRequest, checkoutStore.authToken, checkoutStore.accountId);
299
632
  if (result.success) {
300
633
  this.applePayCompleted.emit({
@@ -328,29 +661,7 @@ const ApplePay = class {
328
661
  }
329
662
  };
330
663
  }
331
- // private unsubscribeCheckoutLoaded?: () => void;
332
- // componentWillLoad() {
333
- // this.unsubscribeCheckoutLoaded = onChange("checkoutLoaded", (loaded) => {
334
- // this.applePayService = new ApplePayService();
335
- // console.log("checkoutLoaded", loaded);
336
- // if (loaded) {
337
- // this.initializeApplePay();
338
- // }
339
- // });
340
- // }
341
- // disconnectedCallback() {
342
- // this.unsubscribeCheckoutLoaded?.();
343
- // this.unsubscribeCheckoutLoaded = undefined;
344
- // }
345
- // @Watch("merchantIdentifier")
346
- // @Watch("buttonType")
347
- // @Watch("buttonStyle")
348
- // @Watch("disabled")
349
- // watchPropsChange() {
350
- // this.initializeApplePay();
351
- // }
352
664
  async initializeApplePay() {
353
- console.log("initializeApplePay", checkoutStore.checkoutLoaded);
354
665
  try {
355
666
  this.isLoading = true;
356
667
  this.error = null;
@@ -359,9 +670,9 @@ const ApplePay = class {
359
670
  Boolean(checkoutStore.paymentCurrency) &&
360
671
  Boolean(checkoutStore.authToken);
361
672
  if (!hasRequiredConfig) {
362
- this.error = "Missing required Apple Pay configuration blabla blabla 2";
673
+ this.error = "Missing required Apple Pay configuration";
363
674
  this.isConfigValid = false;
364
- console.error("Apple Pay config error: missing required values blabla blabla 2", {
675
+ console.error("Apple Pay config error: missing required values", {
365
676
  paymentAmount: checkoutStore.paymentAmount,
366
677
  paymentCurrency: checkoutStore.paymentCurrency,
367
678
  hasAuthToken: Boolean(checkoutStore.authToken),
@@ -394,6 +705,7 @@ const ApplePay = class {
394
705
  buttonType: this.buttonType,
395
706
  buttonStyle: this.buttonStyle,
396
707
  };
708
+ this.applePayService = new ApplePayService();
397
709
  this.applePayService.initialize(applePayConfig);
398
710
  const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
399
711
  if (!hasActiveCard) {
@@ -427,19 +739,13 @@ const ApplePay = class {
427
739
  this.applePayCancelled.emit();
428
740
  }
429
741
  render() {
430
- // const shouldHide =
431
- // !this.isLoading &&
432
- // (!this.isConfigValid || !this.isAvailable || !this.canMakePayments || !checkoutStore.checkoutLoaded);
433
- // if (shouldHide) {
434
- // return null;
435
- // }
436
742
  const isReady = !this.isLoading &&
437
743
  this.isAvailable &&
438
744
  this.canMakePayments &&
439
745
  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: () => {
746
+ return (h(StyledHost, { key: '89555e4ca332762a2212d1ef447c9890fa9dc154' }, checkoutStore.checkoutLoaded && (h("script", { key: '0770cdfd74b354262215f651713e92cc3a4cc2a0', async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
441
747
  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' }, `
748
+ } })), h("div", { key: '8e97c5c22626c24d81b7fe1114b35808f3ba0758', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: '8c3859ab8a7b5c215366667692c84841c34a96de', isReady: isReady }), isReady && (h(ApplePayButton, { key: 'ab9e158a240c81530f693a6272c974a0c62fe317', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '4182e97979dcb25b9e5e0f13fa176037fe0300e0' }, `
443
749
  .apple-pay-container {
444
750
  width: 100%;
445
751
  }
@@ -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-DHG-pLKx.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-D34B0fIu.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-DHG-pLKx.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-D34B0fIu.js';
21
21
 
22
22
  const BusinessDetails = class {
23
23
  constructor(hostRef) {
@@ -9,7 +9,7 @@ import './Refund-CVh70dXA.js';
9
9
  import './Pagination-CLHwhyvu.js';
10
10
  import { B as Business, b as BusinessFormServerErrors } from './Business-BCoP0TAV.js';
11
11
  import './Dispute-BH0Xfn-F.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-DHG-pLKx.js';
13
13
  import { B as Button } from './button-CpllL0At.js';
14
14
  import { S as StyledHost } from './styled-host-CTAGIN84.js';
15
15
  import { H as Header1 } from './header-1-3M9If0gM.js';
@@ -25,7 +25,7 @@ import './business-form-options-CgssATyg.js';
25
25
  import './index-B_KxSZIF.js';
26
26
  import './utils-BscIVFn8.js';
27
27
  import './helpers-Mu7LQT-w.js';
28
- import './package-BiTF1__F.js';
28
+ import './package-D34B0fIu.js';
29
29
  import './Api-DAWuvzbl.js';
30
30
  import './parts-RvUQ__Pq.js';
31
31
  import './utils-BeQLScSm.js';
@@ -7,7 +7,7 @@ import './event-types-CZfYo5-1.js';
7
7
  import { H as Header1 } from './header-1-3M9If0gM.js';
8
8
  import { H as Header2, b as insuranceValuesOn, h as hasInsuranceValueChanged, i as insuranceValues } from './insurance-state-CTalqbNa.js';
9
9
  import { H as Header3 } from './header-3-CWa41YWq.js';
10
- import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-Cz8T6Ux8.js';
10
+ import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-DHG-pLKx.js';
11
11
  import './config-state-DZeVYerv.js';
12
12
  import './dinero-HXpYMWUU.js';
13
13
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes, b as ComponentErrorMessages } from './ComponentError-Cjcsf8ku.js';
@@ -21,7 +21,7 @@ import { A as Api } from './Api-DAWuvzbl.js';
21
21
  import { a as PAYMENT_MODE, b as PAYMENT_METHOD_TYPES, P as PAYMENT_METHODS } from './index-CbL73B6U.js';
22
22
  import { C as CardBrandLabels } from './payment-method-option-utils-lUHAQVFl.js';
23
23
  import './index-B_KxSZIF.js';
24
- import './package-BiTF1__F.js';
24
+ import './package-D34B0fIu.js';
25
25
  import './helpers-Mu7LQT-w.js';
26
26
  import './state-options-BX8GieXu.js';
27
27
 
@@ -319,7 +319,6 @@ const ModularCheckout = class {
319
319
  checkoutStore.selectedPaymentMethod = paymentMethod;
320
320
  checkoutStore.paymentToken = paymentMethod.id || undefined;
321
321
  }
322
- // getAvailablePaymentMethods removed in favor of checkout-changed event
323
322
  // if validation fails, the error will be emitted by the component
324
323
  async validate() {
325
324
  const promises = [];
@@ -467,7 +466,7 @@ const ModularCheckout = class {
467
466
  });
468
467
  }
469
468
  render() {
470
- return h(Host, { key: '7ee5bc2bb0a8c1ed497440c7b1f90d1a2fb3c8bb' });
469
+ return h(Host, { key: '2cbac33c57dd2cad327f156a4630b1dba9bf3252' });
471
470
  }
472
471
  get hostEl() { return getElement(this); }
473
472
  };
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-Bn7inNWG.js';
2
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
2
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-DHG-pLKx.js';
3
3
  import './config-state-DZeVYerv.js';
4
4
  import './dinero-HXpYMWUU.js';
5
5
  import './ComponentError-Cjcsf8ku.js';
@@ -12,7 +12,7 @@ import { d as checkoutSummary } from './parts-RvUQ__Pq.js';
12
12
  import { S as StyledHost } from './styled-host-CTAGIN84.js';
13
13
  import './event-types-CZfYo5-1.js';
14
14
  import { P as PAYMENT_METHODS } from './index-CbL73B6U.js';
15
- import './package-BiTF1__F.js';
15
+ import './package-D34B0fIu.js';
16
16
  import './Api-DAWuvzbl.js';
17
17
  import './utils-BscIVFn8.js';
18
18
  import './index-B_KxSZIF.js';
@@ -7,7 +7,7 @@ import './Pagination-CLHwhyvu.js';
7
7
  import './Business-BCoP0TAV.js';
8
8
  import './Dispute-BH0Xfn-F.js';
9
9
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-DHG-pLKx.js';
11
11
  import { C as CheckoutService } from './checkout.service-Bbgi1I6V.js';
12
12
  import { m as makeGetSubAccounts, S as SubAccountService } from './get-subaccounts-9UMbyFiT.js';
13
13
  import { S as StyledHost } from './styled-host-CTAGIN84.js';
@@ -17,7 +17,7 @@ import './index-B_KxSZIF.js';
17
17
  import './utils-BscIVFn8.js';
18
18
  import './helpers-Mu7LQT-w.js';
19
19
  import './state-options-BX8GieXu.js';
20
- import './package-BiTF1__F.js';
20
+ import './package-D34B0fIu.js';
21
21
  import './Api-DAWuvzbl.js';
22
22
  import './badge-DSYSJcRy.js';
23
23
  import './parts-RvUQ__Pq.js';
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-Bn7inNWG.js';
2
2
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
3
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
3
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-DHG-pLKx.js';
4
4
  import { D as Dispute } from './Dispute-BH0Xfn-F.js';
5
5
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
6
6
  import { D as DisputeService } from './dispute.service-CrZsNDW8.js';
7
- import './package-BiTF1__F.js';
7
+ import './package-D34B0fIu.js';
8
8
  import './Api-DAWuvzbl.js';
9
9
  import './config-state-DZeVYerv.js';
10
10
  import './index-B_KxSZIF.js';
@@ -9,7 +9,7 @@ import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './Compone
9
9
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
10
10
  import { D as DisputeService } from './dispute.service-CrZsNDW8.js';
11
11
  import { D as DisputeManagementClickActions } from './event-types-Bg2SZArf.js';
12
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
12
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-DHG-pLKx.js';
13
13
  import './dinero-HXpYMWUU.js';
14
14
  import './Api-DAWuvzbl.js';
15
15
  import './config-state-DZeVYerv.js';
@@ -20,7 +20,7 @@ import './Pagination-CLHwhyvu.js';
20
20
  import './Business-BCoP0TAV.js';
21
21
  import './helpers-Mu7LQT-w.js';
22
22
  import './state-options-BX8GieXu.js';
23
- import './package-BiTF1__F.js';
23
+ import './package-D34B0fIu.js';
24
24
 
25
25
  const makeUpdateDisputeResponse = ({ authToken, disputeId, service }) => async ({ payload, onSuccess, onError, final = () => { } }) => {
26
26
  var _a;
@@ -7,7 +7,7 @@ import './Business-BCoP0TAV.js';
7
7
  import './Dispute-BH0Xfn-F.js';
8
8
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
9
9
  import { E as ErrorState } from './utils-Dg6gMUTv.js';
10
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
10
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-DHG-pLKx.js';
11
11
  import './config-state-DZeVYerv.js';
12
12
  import './index-B_KxSZIF.js';
13
13
  import './utils-BscIVFn8.js';
@@ -15,7 +15,7 @@ import './dinero-HXpYMWUU.js';
15
15
  import './helpers-Mu7LQT-w.js';
16
16
  import './state-options-BX8GieXu.js';
17
17
  import './parts-RvUQ__Pq.js';
18
- import './package-BiTF1__F.js';
18
+ import './package-D34B0fIu.js';
19
19
 
20
20
  const api = Api();
21
21
  class ReportsService {
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent } from './index-Bn7inNWG.js'
2
2
  import { al as heading5, ai as heading4, ae as buttonPrimary, z as text } from './parts-RvUQ__Pq.js';
3
3
  import { S as StyledHost } from './styled-host-CTAGIN84.js';
4
4
  import './event-types-CZfYo5-1.js';
5
- import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cz8T6Ux8.js';
5
+ import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-DHG-pLKx.js';
6
6
  import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
7
7
  import { B as BusinessService } from './business.service-cQrH5BqF.js';
8
8
  import { B as Business } from './Business-BCoP0TAV.js';
@@ -16,7 +16,7 @@ import './Dispute-BH0Xfn-F.js';
16
16
  import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
17
17
  import { T as TerminalService } from './terminal.service-E6dZlM43.js';
18
18
  import { k as formatPhoneNumber } from './utils-BscIVFn8.js';
19
- import './package-BiTF1__F.js';
19
+ import './package-D34B0fIu.js';
20
20
  import './Api-DAWuvzbl.js';
21
21
  import './helpers-Mu7LQT-w.js';
22
22
  import './state-options-BX8GieXu.js';
@@ -3,7 +3,7 @@ import { P as PaymentService } from './payment.service-TxyxCg0E.js';
3
3
  import { m as makeGetPaymentDetails } from './get-payment-details-0VzpMNY9.js';
4
4
  import { E as ErrorState } from './utils-Dg6gMUTv.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-DHG-pLKx.js';
7
7
  import './Api-DAWuvzbl.js';
8
8
  import './config-state-DZeVYerv.js';
9
9
  import './index-B_KxSZIF.js';
@@ -17,7 +17,7 @@ import './helpers-Mu7LQT-w.js';
17
17
  import './state-options-BX8GieXu.js';
18
18
  import './utils-BeQLScSm.js';
19
19
  import './parts-RvUQ__Pq.js';
20
- import './package-BiTF1__F.js';
20
+ import './package-D34B0fIu.js';
21
21
 
22
22
  const PaymentDetails = class {
23
23
  constructor(hostRef) {