@justifi/webcomponents 6.2.0-rc.1 → 6.2.0-rc.2
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.
- package/dist/cjs/{check-pkg-version-W_AFeiO6.js → check-pkg-version-DHOBcjoo.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +5 -79
- package/dist/cjs/justifi-bank-account-billing-form-simple_9.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +2 -2
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +2 -2
- package/dist/cjs/{package-BADgkv50.js → package-BacF7Q_h.js} +1 -1
- package/dist/collection/api/services/apple-pay.service.js +3 -43
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +0 -34
- package/dist/docs.json +1 -1
- package/dist/esm/{check-pkg-version-CG8qzhGl.js → check-pkg-version-D2zmagAo.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/justifi-apple-pay_8.entry.js +5 -79
- package/dist/esm/justifi-bank-account-billing-form-simple_9.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-checkouts-list.entry.js +2 -2
- package/dist/esm/justifi-dispute-management.entry.js +2 -2
- package/dist/esm/justifi-dispute-notification_3.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-order-terminals.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payment-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payout-transactions-list.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-refund-payment.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/justifi-terminal-orders-list.entry.js +2 -2
- package/dist/esm/justifi-terminals-list.entry.js +2 -2
- package/dist/esm/{package-yiqa5abX.js → package-C7cvPZSk.js} +1 -1
- package/dist/module/apple-pay.js +3 -77
- package/dist/module/package.js +1 -1
- package/dist/webcomponents/{p-5de4d9e4.entry.js → p-005a79d5.entry.js} +1 -1
- package/dist/webcomponents/{p-be0cbdf9.entry.js → p-07f7aaf6.entry.js} +1 -1
- package/dist/webcomponents/{p-164fe6d3.entry.js → p-14e26a6c.entry.js} +1 -1
- package/dist/webcomponents/{p-5fcfedb2.entry.js → p-33bf5532.entry.js} +1 -1
- package/dist/webcomponents/{p-4a0f34de.entry.js → p-3467fa38.entry.js} +1 -1
- package/dist/webcomponents/p-3af0b0ad.entry.js +1 -0
- package/dist/webcomponents/{p-fcb185fd.entry.js → p-3f7703bf.entry.js} +1 -1
- package/dist/webcomponents/{p-620ec409.entry.js → p-4180a11b.entry.js} +1 -1
- package/dist/webcomponents/{p-6190fbb7.entry.js → p-641100ac.entry.js} +1 -1
- package/dist/webcomponents/{p-b4bb6fa6.entry.js → p-694b24e5.entry.js} +1 -1
- package/dist/webcomponents/{p-af31dc6d.entry.js → p-6a247ab5.entry.js} +1 -1
- package/dist/webcomponents/{p-4e57359c.entry.js → p-6a910d9b.entry.js} +1 -1
- package/dist/webcomponents/p-C7cvPZSk.js +1 -0
- package/dist/webcomponents/{p-DfsX5bt_.js → p-CeSmGv6o.js} +1 -1
- package/dist/webcomponents/{p-81099469.entry.js → p-be53e425.entry.js} +1 -1
- package/dist/webcomponents/{p-ef8ac9f4.entry.js → p-c4fb2fe8.entry.js} +1 -1
- package/dist/webcomponents/{p-aa51c9e6.entry.js → p-c6e64ed5.entry.js} +1 -1
- package/dist/webcomponents/p-cd20dc8f.entry.js +1 -0
- package/dist/webcomponents/{p-760e739c.entry.js → p-d1e99aac.entry.js} +1 -1
- package/dist/webcomponents/{p-e2ab3f61.entry.js → p-d50f8328.entry.js} +1 -1
- package/dist/webcomponents/{p-09aaaf03.entry.js → p-d8bef4b7.entry.js} +1 -1
- package/dist/webcomponents/p-d8ef1d2b.entry.js +1 -0
- package/dist/webcomponents/{p-2ebc8539.entry.js → p-ea746fa0.entry.js} +1 -1
- package/dist/webcomponents/{p-10537b60.entry.js → p-f222426b.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-0b36f1a8.entry.js +0 -1
- package/dist/webcomponents/p-30848456.entry.js +0 -1
- package/dist/webcomponents/p-f4a1d3da.entry.js +0 -1
- package/dist/webcomponents/p-yiqa5abX.js +0 -1
|
@@ -8,7 +8,7 @@ require('./Pagination-Dediz133.js');
|
|
|
8
8
|
require('./Business-DWHy_-z9.js');
|
|
9
9
|
require('./Dispute-CruQTF6_.js');
|
|
10
10
|
var utils = require('./utils-DvUQQLmR.js');
|
|
11
|
-
var checkPkgVersion = require('./check-pkg-version-
|
|
11
|
+
var checkPkgVersion = require('./check-pkg-version-DHOBcjoo.js');
|
|
12
12
|
var checkout_store = require('./checkout.store-Bswr7kNY.js');
|
|
13
13
|
var utils$1 = require('./utils-Bab-tddY.js');
|
|
14
14
|
var insuranceState = require('./insurance-state-JbqYvJN3.js');
|
|
@@ -18,7 +18,7 @@ require('./event-types-YOY5TKUN.js');
|
|
|
18
18
|
var skeleton = require('./skeleton-BvdAh448.js');
|
|
19
19
|
require('./config-state-C7babhLh.js');
|
|
20
20
|
require('./index-CWM5ions.js');
|
|
21
|
-
require('./package-
|
|
21
|
+
require('./package-BacF7Q_h.js');
|
|
22
22
|
require('./index-C2ITzalN.js');
|
|
23
23
|
require('./dinero-BwNN_k7x.js');
|
|
24
24
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var index = require('./index-Bhtk1qkX.js');
|
|
4
4
|
var styledHost = require('./styled-host-BSooSIhA.js');
|
|
5
5
|
require('./event-types-YOY5TKUN.js');
|
|
6
|
-
var checkPkgVersion = require('./check-pkg-version-
|
|
6
|
+
var checkPkgVersion = require('./check-pkg-version-DHOBcjoo.js');
|
|
7
7
|
var terminalOrdersTable = require('./terminal-orders-table-B4ZXHj3w.js');
|
|
8
8
|
require('./config-state-C7babhLh.js');
|
|
9
9
|
require('./dinero-BwNN_k7x.js');
|
|
@@ -14,7 +14,7 @@ require('./Business-DWHy_-z9.js');
|
|
|
14
14
|
require('./Dispute-CruQTF6_.js');
|
|
15
15
|
var utils = require('./utils-DvUQQLmR.js');
|
|
16
16
|
var Api = require('./Api-CjtvTD2_.js');
|
|
17
|
-
require('./package-
|
|
17
|
+
require('./package-BacF7Q_h.js');
|
|
18
18
|
require('./parts-Pb06tUMp.js');
|
|
19
19
|
require('./utils-Bab-tddY.js');
|
|
20
20
|
require('./badge-CE3ss_OU.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Bhtk1qkX.js');
|
|
4
4
|
var ComponentError = require('./ComponentError-D4OLnOkg.js');
|
|
5
|
-
var checkPkgVersion = require('./check-pkg-version-
|
|
5
|
+
var checkPkgVersion = require('./check-pkg-version-DHOBcjoo.js');
|
|
6
6
|
var terminal_service = require('./terminal.service-BlW-CJ67.js');
|
|
7
7
|
require('./config-state-C7babhLh.js');
|
|
8
8
|
require('./dinero-BwNN_k7x.js');
|
|
@@ -15,7 +15,7 @@ var getSubaccounts = require('./get-subaccounts-C_KD197w.js');
|
|
|
15
15
|
var styledHost = require('./styled-host-BSooSIhA.js');
|
|
16
16
|
require('./event-types-YOY5TKUN.js');
|
|
17
17
|
var terminalsTable = require('./terminals-table-ByYs-pH7.js');
|
|
18
|
-
require('./package-
|
|
18
|
+
require('./package-BacF7Q_h.js');
|
|
19
19
|
require('./Api-CjtvTD2_.js');
|
|
20
20
|
require('./utils-Bab-tddY.js');
|
|
21
21
|
require('./index-CWM5ions.js');
|
|
@@ -35,7 +35,8 @@ export class ApplePayService {
|
|
|
35
35
|
'Sub-Account': accountId,
|
|
36
36
|
},
|
|
37
37
|
body: {
|
|
38
|
-
domain: window.location.host
|
|
38
|
+
domain: window.location.host,
|
|
39
|
+
display_name: this.applePayConfig.displayName
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
return response;
|
|
@@ -82,22 +83,15 @@ export class ApplePayService {
|
|
|
82
83
|
* Start Apple Pay session
|
|
83
84
|
*/
|
|
84
85
|
async startPaymentSession(paymentRequest, authToken, accountId) {
|
|
85
|
-
// Begin
|
|
86
|
-
console.groupCollapsed('[ApplePayService] startPaymentSession called');
|
|
87
|
-
console.log('[ApplePayService] raw paymentRequest:', JSON.stringify(paymentRequest, null, 2));
|
|
88
|
-
console.log('[ApplePayService] has authToken:', Boolean(authToken));
|
|
89
|
-
console.log('[ApplePayService] accountId:', accountId);
|
|
90
|
-
console.log('[ApplePayService] has config:', Boolean(this.applePayConfig));
|
|
86
|
+
// Begin session
|
|
91
87
|
if (!this.applePayConfig) {
|
|
92
88
|
console.error('[ApplePayService] Missing applePayConfig. Did you call initialize()?');
|
|
93
|
-
console.groupEnd();
|
|
94
89
|
throw new Error('Apple Pay not initialized. Call initialize() first.');
|
|
95
90
|
}
|
|
96
91
|
// if (!this.isAvailable()) {
|
|
97
92
|
// throw new Error('Apple Pay is not available on this device/browser');
|
|
98
93
|
// }
|
|
99
94
|
const request = new ApplePayPaymentRequest(paymentRequest);
|
|
100
|
-
console.log('[ApplePayService] created ApplePayPaymentRequest:', request);
|
|
101
95
|
if (!request.isValid) {
|
|
102
96
|
const missingFields = [];
|
|
103
97
|
if (!request.countryCode)
|
|
@@ -112,17 +106,14 @@ export class ApplePayService {
|
|
|
112
106
|
if (!request.total || !request.total.label || !request.total.amount)
|
|
113
107
|
missingFields.push('total');
|
|
114
108
|
console.error('[ApplePayService] Payment request is invalid. Missing/invalid:', missingFields);
|
|
115
|
-
console.groupEnd();
|
|
116
109
|
throw new Error('Invalid payment request provided');
|
|
117
110
|
}
|
|
118
111
|
this.currentPaymentRequest = request;
|
|
119
112
|
return new Promise((resolve, reject) => {
|
|
120
113
|
try {
|
|
121
|
-
console.log('[ApplePayService] About to instantiate ApplePaySession');
|
|
122
114
|
// Defensive checks for Apple Pay environment
|
|
123
115
|
if (typeof window === 'undefined' || !('ApplePaySession' in window)) {
|
|
124
116
|
console.error('[ApplePayService] ApplePaySession not available on window');
|
|
125
|
-
console.groupEnd();
|
|
126
117
|
return reject({
|
|
127
118
|
success: false,
|
|
128
119
|
error: {
|
|
@@ -132,16 +123,11 @@ export class ApplePayService {
|
|
|
132
123
|
});
|
|
133
124
|
}
|
|
134
125
|
this.currentSession = new window.ApplePaySession(3, request);
|
|
135
|
-
console.log('[ApplePayService] ApplePaySession instantiated:', this.currentSession);
|
|
136
126
|
this.setupSessionEventHandlers(resolve, reject, authToken, accountId);
|
|
137
|
-
console.log('[ApplePayService] Event handlers set. Beginning session...');
|
|
138
127
|
this.currentSession.begin();
|
|
139
|
-
console.log('[ApplePayService] Session.begin() called');
|
|
140
|
-
console.groupEnd();
|
|
141
128
|
}
|
|
142
129
|
catch (error) {
|
|
143
130
|
console.error('[ApplePayService] Exception while starting session:', error);
|
|
144
|
-
console.groupEnd();
|
|
145
131
|
reject({
|
|
146
132
|
success: false,
|
|
147
133
|
error: {
|
|
@@ -179,18 +165,14 @@ export class ApplePayService {
|
|
|
179
165
|
return;
|
|
180
166
|
}
|
|
181
167
|
this.currentSession.onvalidatemerchant = async () => {
|
|
182
|
-
console.groupCollapsed('[ApplePayService] onvalidatemerchant');
|
|
183
168
|
try {
|
|
184
|
-
console.log('[ApplePayService] accountId:', accountId);
|
|
185
169
|
if (!authToken) {
|
|
186
170
|
console.error('[ApplePayService] Missing authToken for merchant validation');
|
|
187
171
|
throw new Error('Authentication token not provided.');
|
|
188
172
|
}
|
|
189
173
|
const merchantSession = await this.validateMerchant(authToken, accountId);
|
|
190
|
-
console.log('[ApplePayService] merchantSession received');
|
|
191
174
|
try {
|
|
192
175
|
this.currentSession.completeMerchantValidation(merchantSession);
|
|
193
|
-
console.log('[ApplePayService] completeMerchantValidation called');
|
|
194
176
|
}
|
|
195
177
|
catch (completionError) {
|
|
196
178
|
console.error('Error calling completeMerchantValidation:', completionError);
|
|
@@ -214,30 +196,20 @@ export class ApplePayService {
|
|
|
214
196
|
},
|
|
215
197
|
});
|
|
216
198
|
}
|
|
217
|
-
console.groupEnd();
|
|
218
199
|
};
|
|
219
200
|
this.currentSession.onpaymentauthorized = async (event) => {
|
|
220
|
-
var _a;
|
|
221
|
-
console.groupCollapsed('[ApplePayService] onpaymentauthorized');
|
|
222
201
|
try {
|
|
223
202
|
const payment = event.payment;
|
|
224
|
-
console.log('[ApplePayService] payment payload snapshot:', {
|
|
225
|
-
hasToken: Boolean(payment === null || payment === void 0 ? void 0 : payment.token),
|
|
226
|
-
tokenType: ((_a = payment === null || payment === void 0 ? void 0 : payment.token) === null || _a === void 0 ? void 0 : _a.paymentData) ? 'paymentData' : 'raw',
|
|
227
|
-
});
|
|
228
203
|
const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
|
|
229
204
|
name: this.currentPaymentRequest.total.label,
|
|
230
205
|
price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
|
|
231
206
|
description: this.currentPaymentRequest.total.label,
|
|
232
207
|
} });
|
|
233
|
-
console.log('[ApplePayService] paymentPayload prepared');
|
|
234
208
|
const paymentResult = await this.processPayment(authToken, accountId, paymentPayload);
|
|
235
|
-
console.log('[ApplePayService] processPayment result:', paymentResult);
|
|
236
209
|
if (paymentResult.success) {
|
|
237
210
|
this.currentSession.completePayment({
|
|
238
211
|
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
239
212
|
});
|
|
240
|
-
console.log('[ApplePayService] Payment success; resolving');
|
|
241
213
|
resolve({
|
|
242
214
|
success: true,
|
|
243
215
|
token: payment.token,
|
|
@@ -278,40 +250,31 @@ export class ApplePayService {
|
|
|
278
250
|
});
|
|
279
251
|
}
|
|
280
252
|
finally {
|
|
281
|
-
console.log('[ApplePayService] Cleaning up session state');
|
|
282
253
|
this.currentSession = undefined;
|
|
283
254
|
this.currentPaymentRequest = undefined;
|
|
284
255
|
}
|
|
285
|
-
console.groupEnd();
|
|
286
256
|
};
|
|
287
257
|
this.currentSession.onpaymentmethodselected = () => {
|
|
288
|
-
console.groupCollapsed('[ApplePayService] onpaymentmethodselected');
|
|
289
258
|
const paymentUpdate = {
|
|
290
259
|
newTotal: this.currentPaymentRequest.total,
|
|
291
260
|
newLineItems: this.currentPaymentRequest.lineItems || [],
|
|
292
261
|
};
|
|
293
262
|
try {
|
|
294
263
|
this.currentSession.completePaymentMethodSelection(paymentUpdate);
|
|
295
|
-
console.log('[ApplePayService] completePaymentMethodSelection called');
|
|
296
264
|
}
|
|
297
265
|
catch (error) {
|
|
298
266
|
console.error('Error completing payment method selection:', error);
|
|
299
267
|
this.currentSession.abort();
|
|
300
268
|
}
|
|
301
|
-
console.groupEnd();
|
|
302
269
|
};
|
|
303
270
|
this.currentSession.onshippingmethodselected = () => {
|
|
304
|
-
console.groupCollapsed('[ApplePayService] onshippingmethodselected');
|
|
305
271
|
this.currentSession.completeShippingMethodSelection({
|
|
306
272
|
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
307
273
|
newTotal: this.currentPaymentRequest.total,
|
|
308
274
|
newLineItems: this.currentPaymentRequest.lineItems || [],
|
|
309
275
|
});
|
|
310
|
-
console.log('[ApplePayService] completeShippingMethodSelection called');
|
|
311
|
-
console.groupEnd();
|
|
312
276
|
};
|
|
313
277
|
this.currentSession.oncancel = (event) => {
|
|
314
|
-
console.groupCollapsed('[ApplePayService] oncancel');
|
|
315
278
|
if (event.sessionError) {
|
|
316
279
|
console.error(event.sessionError);
|
|
317
280
|
switch (event.sessionError.code) {
|
|
@@ -342,11 +305,9 @@ export class ApplePayService {
|
|
|
342
305
|
message: 'User cancelled the Apple Pay session',
|
|
343
306
|
},
|
|
344
307
|
});
|
|
345
|
-
console.groupEnd();
|
|
346
308
|
};
|
|
347
309
|
if ('onerror' in this.currentSession) {
|
|
348
310
|
this.currentSession.onerror = (error) => {
|
|
349
|
-
console.groupCollapsed('[ApplePayService] onerror');
|
|
350
311
|
console.error('=== APPLE PAY SESSION ERROR ===');
|
|
351
312
|
console.error('Session error:', error);
|
|
352
313
|
this.currentSession = undefined;
|
|
@@ -358,7 +319,6 @@ export class ApplePayService {
|
|
|
358
319
|
message: 'Apple Pay session error occurred',
|
|
359
320
|
},
|
|
360
321
|
});
|
|
361
|
-
console.groupEnd();
|
|
362
322
|
};
|
|
363
323
|
}
|
|
364
324
|
}
|
|
@@ -32,14 +32,6 @@ export class ApplePay {
|
|
|
32
32
|
this.isProcessing = true;
|
|
33
33
|
this.error = null;
|
|
34
34
|
this.applePayStarted.emit();
|
|
35
|
-
console.groupCollapsed('[ApplePay Component] handleApplePayClick');
|
|
36
|
-
console.log('[ApplePay Component] click context:', {
|
|
37
|
-
isProcessing: this.isProcessing,
|
|
38
|
-
disabled: this.disabled,
|
|
39
|
-
isAvailable: this.isAvailable,
|
|
40
|
-
canMakePayments: this.canMakePayments,
|
|
41
|
-
hasService: Boolean(this.applePayService),
|
|
42
|
-
});
|
|
43
35
|
const paymentRequest = {
|
|
44
36
|
countryCode: this.countryCode,
|
|
45
37
|
currencyCode: checkoutStore.paymentCurrency,
|
|
@@ -51,13 +43,7 @@ export class ApplePay {
|
|
|
51
43
|
supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
52
44
|
total: ApplePayHelpers.createLineItem(checkoutStore.paymentDescription, checkoutStore.paymentAmount),
|
|
53
45
|
};
|
|
54
|
-
console.log("[ApplePay Component] paymentRequest", paymentRequest);
|
|
55
|
-
console.log('[ApplePay Component] identifiers snapshot:', {
|
|
56
|
-
authTokenLength: checkoutStore.authToken ? String(checkoutStore.authToken).length : 0,
|
|
57
|
-
accountId: checkoutStore.accountId,
|
|
58
|
-
});
|
|
59
46
|
const result = await this.applePayService.startPaymentSession(paymentRequest, checkoutStore.authToken, checkoutStore.accountId);
|
|
60
|
-
console.log("[ApplePay Component] startPaymentSession result", result);
|
|
61
47
|
if (result.success) {
|
|
62
48
|
this.applePayCompleted.emit({
|
|
63
49
|
success: true,
|
|
@@ -87,7 +73,6 @@ export class ApplePay {
|
|
|
87
73
|
}
|
|
88
74
|
finally {
|
|
89
75
|
this.isProcessing = false;
|
|
90
|
-
console.groupEnd();
|
|
91
76
|
}
|
|
92
77
|
};
|
|
93
78
|
}
|
|
@@ -96,13 +81,6 @@ export class ApplePay {
|
|
|
96
81
|
this.isLoading = true;
|
|
97
82
|
this.error = null;
|
|
98
83
|
this.isConfigValid = true;
|
|
99
|
-
console.groupCollapsed('[ApplePay Component] initializeApplePay');
|
|
100
|
-
console.log('[ApplePay Component] checkout state snapshot:', {
|
|
101
|
-
paymentAmount: checkoutStore.paymentAmount,
|
|
102
|
-
paymentCurrency: checkoutStore.paymentCurrency,
|
|
103
|
-
hasAuthToken: Boolean(checkoutStore.authToken),
|
|
104
|
-
accountId: checkoutStore.accountId,
|
|
105
|
-
});
|
|
106
84
|
const hasRequiredConfig = Boolean(checkoutStore.paymentAmount) &&
|
|
107
85
|
Boolean(checkoutStore.paymentCurrency) &&
|
|
108
86
|
Boolean(checkoutStore.authToken);
|
|
@@ -117,22 +95,15 @@ export class ApplePay {
|
|
|
117
95
|
});
|
|
118
96
|
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.CONFIG_ERROR });
|
|
119
97
|
this.isLoading = false;
|
|
120
|
-
console.groupEnd();
|
|
121
98
|
return;
|
|
122
99
|
}
|
|
123
100
|
this.isAvailable = ApplePayHelpers.isApplePaySupported();
|
|
124
101
|
this.canMakePayments = ApplePayHelpers.canMakePayments();
|
|
125
|
-
console.log('[ApplePay Component] support check:', {
|
|
126
|
-
isAvailable: this.isAvailable,
|
|
127
|
-
canMakePayments: this.canMakePayments,
|
|
128
|
-
hasApplePaySessionOnWindow: typeof window !== 'undefined' && 'ApplePaySession' in window,
|
|
129
|
-
});
|
|
130
102
|
if (!this.isAvailable) {
|
|
131
103
|
this.error = "Apple Pay is not supported on this device";
|
|
132
104
|
console.error(this.error);
|
|
133
105
|
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_SUPPORTED });
|
|
134
106
|
this.isLoading = false;
|
|
135
|
-
console.groupEnd();
|
|
136
107
|
return;
|
|
137
108
|
}
|
|
138
109
|
if (!this.canMakePayments) {
|
|
@@ -140,7 +111,6 @@ export class ApplePay {
|
|
|
140
111
|
console.error(this.error);
|
|
141
112
|
this.applePayError.emit({ error: this.error, code: ApplePay.ErrorCode.NOT_AVAILABLE });
|
|
142
113
|
this.isLoading = false;
|
|
143
|
-
console.groupEnd();
|
|
144
114
|
return;
|
|
145
115
|
}
|
|
146
116
|
const applePayConfig = {
|
|
@@ -151,7 +121,6 @@ export class ApplePay {
|
|
|
151
121
|
buttonType: this.buttonType,
|
|
152
122
|
buttonStyle: this.buttonStyle,
|
|
153
123
|
};
|
|
154
|
-
console.log('[ApplePay Component] initializing service with config:', applePayConfig);
|
|
155
124
|
this.applePayService = new ApplePayService();
|
|
156
125
|
this.applePayService.initialize(applePayConfig);
|
|
157
126
|
const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
|
|
@@ -169,7 +138,6 @@ export class ApplePay {
|
|
|
169
138
|
}
|
|
170
139
|
finally {
|
|
171
140
|
this.isLoading = false;
|
|
172
|
-
console.groupEnd();
|
|
173
141
|
}
|
|
174
142
|
}
|
|
175
143
|
async isSupported() {
|
|
@@ -189,7 +157,6 @@ export class ApplePay {
|
|
|
189
157
|
render() {
|
|
190
158
|
if (!checkoutStore.applePayEnabled) {
|
|
191
159
|
// Render nothing when Apple Pay is disabled at the checkout settings level
|
|
192
|
-
console.log('[ApplePay Component] Apple Pay disabled in checkout settings; not rendering');
|
|
193
160
|
return null;
|
|
194
161
|
}
|
|
195
162
|
const isReady = !this.isLoading &&
|
|
@@ -197,7 +164,6 @@ export class ApplePay {
|
|
|
197
164
|
this.canMakePayments &&
|
|
198
165
|
this.isConfigValid;
|
|
199
166
|
return (h(StyledHost, null, checkoutStore.checkoutLoaded && (h("script", { async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
|
|
200
|
-
console.log('[ApplePay Component] Apple Pay SDK script loaded');
|
|
201
167
|
this.initializeApplePay();
|
|
202
168
|
} })), h("div", { class: 'apple-pay-container' }, h(ApplePaySkeleton, { isLoading: this.isLoading }), isReady && (h(ApplePayButton, { buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick, width: this.width, height: this.height }))), h("style", null, `
|
|
203
169
|
.apple-pay-container {
|
package/dist/docs.json
CHANGED
|
@@ -3,7 +3,7 @@ import { c as createStore } from './index-DJ9G-4S-.js';
|
|
|
3
3
|
import { i as inputInvalidAndFocused, b as inputInvalid, a as inputFocused, c as input, l as label } from './parts-Dj_zevuD.js';
|
|
4
4
|
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-BFTU3MAI.js';
|
|
5
5
|
import { F as FormControlErrorText } from './form-control-error-text-BmD6bGbR.js';
|
|
6
|
-
import { p as packageJson } from './package-
|
|
6
|
+
import { p as packageJson } from './package-C7cvPZSk.js';
|
|
7
7
|
|
|
8
8
|
const iframeInputStylesStore = createStore({
|
|
9
9
|
focused: {
|