@justifi/webcomponents 6.0.0-rc.19 → 6.0.0-rc.20
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-CZry3Gab.js → check-pkg-version-DS_8EVX4.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-apple-pay.cjs.entry.js +116 -6
- 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-summary_7.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-DpTrT68q.js → package-XG0rW7xm.js} +1 -1
- package/dist/collection/api/services/apple-pay.service.js +80 -2
- package/dist/collection/components/modular-checkout/sub-components/apple-pay.js +36 -4
- package/dist/docs.json +1 -1
- package/dist/esm/{check-pkg-version-BzAwEptg.js → check-pkg-version-DhRpS7Qc.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/justifi-apple-pay.entry.js +116 -6
- 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-summary_7.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-CbHGNIID.js → package-BF0mIfcQ.js} +1 -1
- package/dist/module/justifi-apple-pay.js +116 -6
- package/dist/module/package.js +1 -1
- package/dist/webcomponents/{p-1c8c3381.entry.js → p-12175e07.entry.js} +1 -1
- package/dist/webcomponents/{p-237c1c0b.entry.js → p-20733148.entry.js} +1 -1
- package/dist/webcomponents/{p-8b34e550.entry.js → p-319b4126.entry.js} +1 -1
- package/dist/webcomponents/{p-e5db299f.entry.js → p-53739e78.entry.js} +1 -1
- package/dist/webcomponents/p-58c766c8.entry.js +1 -0
- package/dist/webcomponents/{p-5da2d93a.entry.js → p-62a4a2c2.entry.js} +1 -1
- package/dist/webcomponents/{p-a5011c78.entry.js → p-664501b7.entry.js} +1 -1
- package/dist/webcomponents/{p-719e2cf9.entry.js → p-6c7f08c8.entry.js} +1 -1
- package/dist/webcomponents/{p-92bb3f7d.entry.js → p-6cf48f04.entry.js} +1 -1
- package/dist/webcomponents/{p-0b5d6f75.entry.js → p-7922acee.entry.js} +1 -1
- package/dist/webcomponents/{p-8252f34e.entry.js → p-8e0228df.entry.js} +1 -1
- package/dist/webcomponents/{p-ea781366.entry.js → p-927ecf5d.entry.js} +1 -1
- package/dist/webcomponents/{p-fd6d55e9.entry.js → p-95a3e104.entry.js} +1 -1
- package/dist/webcomponents/{p-c3a768f2.entry.js → p-95e33bcc.entry.js} +1 -1
- package/dist/webcomponents/{p-cec23474.entry.js → p-988ae9e9.entry.js} +1 -1
- package/dist/webcomponents/{p-c50cfde3.entry.js → p-9c1d5a55.entry.js} +1 -1
- package/dist/webcomponents/{p-323d2109.entry.js → p-9ed62efb.entry.js} +1 -1
- package/dist/webcomponents/p-BF0mIfcQ.js +1 -0
- package/dist/webcomponents/{p-z8xlfetB.js → p-VSSGd2zP.js} +1 -1
- package/dist/webcomponents/p-a54281e8.entry.js +1 -0
- package/dist/webcomponents/{p-d692a782.entry.js → p-d8f9f287.entry.js} +1 -1
- package/dist/webcomponents/{p-346148d1.entry.js → p-d9d371e1.entry.js} +1 -1
- package/dist/webcomponents/p-ed53b213.entry.js +1 -0
- package/dist/webcomponents/{p-9149e6d8.entry.js → p-fa31c907.entry.js} +1 -1
- package/dist/webcomponents/{p-eb5e4a05.entry.js → p-ff685149.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-36329825.entry.js +0 -1
- package/dist/webcomponents/p-476c43ef.entry.js +0 -1
- package/dist/webcomponents/p-7fcc31f6.entry.js +0 -1
- package/dist/webcomponents/p-CbHGNIID.js +0 -1
|
@@ -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-
|
|
5
|
+
var checkPkgVersion = require('./check-pkg-version-DS_8EVX4.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-
|
|
19
|
+
require('./package-XG0rW7xm.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-
|
|
17
|
+
var checkPkgVersion = require('./check-pkg-version-DS_8EVX4.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-
|
|
27
|
+
require('./package-XG0rW7xm.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-
|
|
11
|
+
var checkPkgVersion = require('./check-pkg-version-DS_8EVX4.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-
|
|
23
|
+
require('./package-XG0rW7xm.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-
|
|
6
|
+
var checkPkgVersion = require('./check-pkg-version-DS_8EVX4.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-
|
|
17
|
+
require('./package-XG0rW7xm.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-
|
|
5
|
+
var checkPkgVersion = require('./check-pkg-version-DS_8EVX4.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-
|
|
18
|
+
require('./package-XG0rW7xm.js');
|
|
19
19
|
require('./Api-DyimBzKT.js');
|
|
20
20
|
require('./utils-ChCUZgUy.js');
|
|
21
21
|
require('./index-B32W0A3m.js');
|
|
@@ -70,24 +70,66 @@ export class ApplePayService {
|
|
|
70
70
|
* Start Apple Pay session
|
|
71
71
|
*/
|
|
72
72
|
async startPaymentSession(paymentRequest, authToken, accountId) {
|
|
73
|
+
// Begin verbose diagnostics for easier debugging in the field
|
|
74
|
+
console.groupCollapsed('[ApplePayService] startPaymentSession called');
|
|
75
|
+
console.log('[ApplePayService] raw paymentRequest:', JSON.stringify(paymentRequest, null, 2));
|
|
76
|
+
console.log('[ApplePayService] has authToken:', Boolean(authToken));
|
|
77
|
+
console.log('[ApplePayService] accountId:', accountId);
|
|
78
|
+
console.log('[ApplePayService] has config:', Boolean(this.applePayConfig));
|
|
73
79
|
if (!this.applePayConfig) {
|
|
80
|
+
console.error('[ApplePayService] Missing applePayConfig. Did you call initialize()?');
|
|
81
|
+
console.groupEnd();
|
|
74
82
|
throw new Error('Apple Pay not initialized. Call initialize() first.');
|
|
75
83
|
}
|
|
76
84
|
// if (!this.isAvailable()) {
|
|
77
85
|
// throw new Error('Apple Pay is not available on this device/browser');
|
|
78
86
|
// }
|
|
79
87
|
const request = new ApplePayPaymentRequest(paymentRequest);
|
|
88
|
+
console.log('[ApplePayService] created ApplePayPaymentRequest:', request);
|
|
80
89
|
if (!request.isValid) {
|
|
90
|
+
const missingFields = [];
|
|
91
|
+
if (!request.countryCode)
|
|
92
|
+
missingFields.push('countryCode');
|
|
93
|
+
if (!request.currencyCode)
|
|
94
|
+
missingFields.push('currencyCode');
|
|
95
|
+
if (!request.merchantCapabilities ||
|
|
96
|
+
request.merchantCapabilities.length === 0)
|
|
97
|
+
missingFields.push('merchantCapabilities');
|
|
98
|
+
if (!request.supportedNetworks || request.supportedNetworks.length === 0)
|
|
99
|
+
missingFields.push('supportedNetworks');
|
|
100
|
+
if (!request.total || !request.total.label || !request.total.amount)
|
|
101
|
+
missingFields.push('total');
|
|
102
|
+
console.error('[ApplePayService] Payment request is invalid. Missing/invalid:', missingFields);
|
|
103
|
+
console.groupEnd();
|
|
81
104
|
throw new Error('Invalid payment request provided');
|
|
82
105
|
}
|
|
83
106
|
this.currentPaymentRequest = request;
|
|
84
107
|
return new Promise((resolve, reject) => {
|
|
85
108
|
try {
|
|
109
|
+
console.log('[ApplePayService] About to instantiate ApplePaySession');
|
|
110
|
+
// Defensive checks for Apple Pay environment
|
|
111
|
+
if (typeof window === 'undefined' || !('ApplePaySession' in window)) {
|
|
112
|
+
console.error('[ApplePayService] ApplePaySession not available on window');
|
|
113
|
+
console.groupEnd();
|
|
114
|
+
return reject({
|
|
115
|
+
success: false,
|
|
116
|
+
error: {
|
|
117
|
+
code: 'APPLE_PAY_UNAVAILABLE',
|
|
118
|
+
message: 'ApplePaySession API is not available in this environment',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
}
|
|
86
122
|
this.currentSession = new window.ApplePaySession(3, request);
|
|
123
|
+
console.log('[ApplePayService] ApplePaySession instantiated:', this.currentSession);
|
|
87
124
|
this.setupSessionEventHandlers(resolve, reject, authToken, accountId);
|
|
125
|
+
console.log('[ApplePayService] Event handlers set. Beginning session...');
|
|
88
126
|
this.currentSession.begin();
|
|
127
|
+
console.log('[ApplePayService] Session.begin() called');
|
|
128
|
+
console.groupEnd();
|
|
89
129
|
}
|
|
90
130
|
catch (error) {
|
|
131
|
+
console.error('[ApplePayService] Exception while starting session:', error);
|
|
132
|
+
console.groupEnd();
|
|
91
133
|
reject({
|
|
92
134
|
success: false,
|
|
93
135
|
error: {
|
|
@@ -117,16 +159,26 @@ export class ApplePayService {
|
|
|
117
159
|
if (!this.currentSession ||
|
|
118
160
|
!this.applePayConfig ||
|
|
119
161
|
!this.currentPaymentRequest) {
|
|
162
|
+
console.error('[ApplePayService] setupSessionEventHandlers called without required state', {
|
|
163
|
+
hasSession: Boolean(this.currentSession),
|
|
164
|
+
hasConfig: Boolean(this.applePayConfig),
|
|
165
|
+
hasPaymentRequest: Boolean(this.currentPaymentRequest),
|
|
166
|
+
});
|
|
120
167
|
return;
|
|
121
168
|
}
|
|
122
169
|
this.currentSession.onvalidatemerchant = async () => {
|
|
170
|
+
console.groupCollapsed('[ApplePayService] onvalidatemerchant');
|
|
123
171
|
try {
|
|
172
|
+
console.log('[ApplePayService] accountId:', accountId);
|
|
124
173
|
if (!authToken) {
|
|
174
|
+
console.error('[ApplePayService] Missing authToken for merchant validation');
|
|
125
175
|
throw new Error('Authentication token not provided.');
|
|
126
176
|
}
|
|
127
177
|
const merchantSession = await this.validateMerchant(authToken, accountId);
|
|
178
|
+
console.log('[ApplePayService] merchantSession received');
|
|
128
179
|
try {
|
|
129
180
|
this.currentSession.completeMerchantValidation(merchantSession);
|
|
181
|
+
console.log('[ApplePayService] completeMerchantValidation called');
|
|
130
182
|
}
|
|
131
183
|
catch (completionError) {
|
|
132
184
|
console.error('Error calling completeMerchantValidation:', completionError);
|
|
@@ -136,7 +188,9 @@ export class ApplePayService {
|
|
|
136
188
|
catch (error) {
|
|
137
189
|
console.error('=== MERCHANT VALIDATION ERROR ===');
|
|
138
190
|
console.error('Error during merchant validation:', error);
|
|
139
|
-
|
|
191
|
+
if (error && error.stack) {
|
|
192
|
+
console.error('Error stack:', error.stack);
|
|
193
|
+
}
|
|
140
194
|
this.currentSession.abort();
|
|
141
195
|
reject({
|
|
142
196
|
success: false,
|
|
@@ -148,20 +202,30 @@ export class ApplePayService {
|
|
|
148
202
|
},
|
|
149
203
|
});
|
|
150
204
|
}
|
|
205
|
+
console.groupEnd();
|
|
151
206
|
};
|
|
152
207
|
this.currentSession.onpaymentauthorized = async (event) => {
|
|
208
|
+
var _a;
|
|
209
|
+
console.groupCollapsed('[ApplePayService] onpaymentauthorized');
|
|
153
210
|
try {
|
|
154
211
|
const payment = event.payment;
|
|
212
|
+
console.log('[ApplePayService] payment payload snapshot:', {
|
|
213
|
+
hasToken: Boolean(payment === null || payment === void 0 ? void 0 : payment.token),
|
|
214
|
+
tokenType: ((_a = payment === null || payment === void 0 ? void 0 : payment.token) === null || _a === void 0 ? void 0 : _a.paymentData) ? 'paymentData' : 'raw',
|
|
215
|
+
});
|
|
155
216
|
const paymentPayload = Object.assign(Object.assign({}, payment.token), { product_details: {
|
|
156
217
|
name: this.currentPaymentRequest.total.label,
|
|
157
218
|
price: ApplePayHelpers.parseAmount(this.currentPaymentRequest.total.amount),
|
|
158
219
|
description: this.currentPaymentRequest.total.label,
|
|
159
220
|
} });
|
|
221
|
+
console.log('[ApplePayService] paymentPayload prepared');
|
|
160
222
|
const paymentResult = await this.processPayment(authToken, accountId, paymentPayload);
|
|
223
|
+
console.log('[ApplePayService] processPayment result:', paymentResult);
|
|
161
224
|
if (paymentResult.success) {
|
|
162
225
|
this.currentSession.completePayment({
|
|
163
226
|
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
164
227
|
});
|
|
228
|
+
console.log('[ApplePayService] Payment success; resolving');
|
|
165
229
|
resolve({
|
|
166
230
|
success: true,
|
|
167
231
|
token: payment.token,
|
|
@@ -185,7 +249,9 @@ export class ApplePayService {
|
|
|
185
249
|
catch (error) {
|
|
186
250
|
console.error('=== PAYMENT PROCESSING ERROR ===');
|
|
187
251
|
console.error('Error processing payment:', error);
|
|
188
|
-
|
|
252
|
+
if (error && error.stack) {
|
|
253
|
+
console.error('Error stack:', error.stack);
|
|
254
|
+
}
|
|
189
255
|
this.currentSession.completePayment({
|
|
190
256
|
status: ApplePaySessionStatus.STATUS_FAILURE,
|
|
191
257
|
});
|
|
@@ -200,31 +266,40 @@ export class ApplePayService {
|
|
|
200
266
|
});
|
|
201
267
|
}
|
|
202
268
|
finally {
|
|
269
|
+
console.log('[ApplePayService] Cleaning up session state');
|
|
203
270
|
this.currentSession = undefined;
|
|
204
271
|
this.currentPaymentRequest = undefined;
|
|
205
272
|
}
|
|
273
|
+
console.groupEnd();
|
|
206
274
|
};
|
|
207
275
|
this.currentSession.onpaymentmethodselected = () => {
|
|
276
|
+
console.groupCollapsed('[ApplePayService] onpaymentmethodselected');
|
|
208
277
|
const paymentUpdate = {
|
|
209
278
|
newTotal: this.currentPaymentRequest.total,
|
|
210
279
|
newLineItems: this.currentPaymentRequest.lineItems || [],
|
|
211
280
|
};
|
|
212
281
|
try {
|
|
213
282
|
this.currentSession.completePaymentMethodSelection(paymentUpdate);
|
|
283
|
+
console.log('[ApplePayService] completePaymentMethodSelection called');
|
|
214
284
|
}
|
|
215
285
|
catch (error) {
|
|
216
286
|
console.error('Error completing payment method selection:', error);
|
|
217
287
|
this.currentSession.abort();
|
|
218
288
|
}
|
|
289
|
+
console.groupEnd();
|
|
219
290
|
};
|
|
220
291
|
this.currentSession.onshippingmethodselected = () => {
|
|
292
|
+
console.groupCollapsed('[ApplePayService] onshippingmethodselected');
|
|
221
293
|
this.currentSession.completeShippingMethodSelection({
|
|
222
294
|
status: ApplePaySessionStatus.STATUS_SUCCESS,
|
|
223
295
|
newTotal: this.currentPaymentRequest.total,
|
|
224
296
|
newLineItems: this.currentPaymentRequest.lineItems || [],
|
|
225
297
|
});
|
|
298
|
+
console.log('[ApplePayService] completeShippingMethodSelection called');
|
|
299
|
+
console.groupEnd();
|
|
226
300
|
};
|
|
227
301
|
this.currentSession.oncancel = (event) => {
|
|
302
|
+
console.groupCollapsed('[ApplePayService] oncancel');
|
|
228
303
|
if (event.sessionError) {
|
|
229
304
|
console.error(event.sessionError);
|
|
230
305
|
switch (event.sessionError.code) {
|
|
@@ -255,9 +330,11 @@ export class ApplePayService {
|
|
|
255
330
|
message: 'User cancelled the Apple Pay session',
|
|
256
331
|
},
|
|
257
332
|
});
|
|
333
|
+
console.groupEnd();
|
|
258
334
|
};
|
|
259
335
|
if ('onerror' in this.currentSession) {
|
|
260
336
|
this.currentSession.onerror = (error) => {
|
|
337
|
+
console.groupCollapsed('[ApplePayService] onerror');
|
|
261
338
|
console.error('=== APPLE PAY SESSION ERROR ===');
|
|
262
339
|
console.error('Session error:', error);
|
|
263
340
|
this.currentSession = undefined;
|
|
@@ -269,6 +346,7 @@ export class ApplePayService {
|
|
|
269
346
|
message: 'Apple Pay session error occurred',
|
|
270
347
|
},
|
|
271
348
|
});
|
|
349
|
+
console.groupEnd();
|
|
272
350
|
};
|
|
273
351
|
}
|
|
274
352
|
}
|
|
@@ -30,6 +30,14 @@ export class ApplePay {
|
|
|
30
30
|
this.isProcessing = true;
|
|
31
31
|
this.error = null;
|
|
32
32
|
this.applePayStarted.emit();
|
|
33
|
+
console.groupCollapsed('[ApplePay Component] handleApplePayClick');
|
|
34
|
+
console.log('[ApplePay Component] click context:', {
|
|
35
|
+
isProcessing: this.isProcessing,
|
|
36
|
+
disabled: this.disabled,
|
|
37
|
+
isAvailable: this.isAvailable,
|
|
38
|
+
canMakePayments: this.canMakePayments,
|
|
39
|
+
hasService: Boolean(this.applePayService),
|
|
40
|
+
});
|
|
33
41
|
const paymentRequest = {
|
|
34
42
|
countryCode: this.countryCode,
|
|
35
43
|
currencyCode: checkoutStore.paymentCurrency,
|
|
@@ -37,9 +45,13 @@ export class ApplePay {
|
|
|
37
45
|
supportedNetworks: ApplePayHelpers.getDefaultSupportedNetworks(),
|
|
38
46
|
total: ApplePayHelpers.createLineItem(checkoutStore.paymentDescription, checkoutStore.paymentAmount),
|
|
39
47
|
};
|
|
40
|
-
console.log("paymentRequest", paymentRequest);
|
|
48
|
+
console.log("[ApplePay Component] paymentRequest", paymentRequest);
|
|
49
|
+
console.log('[ApplePay Component] identifiers snapshot:', {
|
|
50
|
+
authTokenLength: checkoutStore.authToken ? String(checkoutStore.authToken).length : 0,
|
|
51
|
+
accountId: checkoutStore.accountId,
|
|
52
|
+
});
|
|
41
53
|
const result = await this.applePayService.startPaymentSession(paymentRequest, checkoutStore.authToken, checkoutStore.accountId);
|
|
42
|
-
console.log("result", result);
|
|
54
|
+
console.log("[ApplePay Component] startPaymentSession result", result);
|
|
43
55
|
if (result.success) {
|
|
44
56
|
this.applePayCompleted.emit({
|
|
45
57
|
success: true,
|
|
@@ -69,6 +81,7 @@ export class ApplePay {
|
|
|
69
81
|
}
|
|
70
82
|
finally {
|
|
71
83
|
this.isProcessing = false;
|
|
84
|
+
console.groupEnd();
|
|
72
85
|
}
|
|
73
86
|
};
|
|
74
87
|
}
|
|
@@ -77,6 +90,13 @@ export class ApplePay {
|
|
|
77
90
|
this.isLoading = true;
|
|
78
91
|
this.error = null;
|
|
79
92
|
this.isConfigValid = true;
|
|
93
|
+
console.groupCollapsed('[ApplePay Component] initializeApplePay');
|
|
94
|
+
console.log('[ApplePay Component] checkout state snapshot:', {
|
|
95
|
+
paymentAmount: checkoutStore.paymentAmount,
|
|
96
|
+
paymentCurrency: checkoutStore.paymentCurrency,
|
|
97
|
+
hasAuthToken: Boolean(checkoutStore.authToken),
|
|
98
|
+
accountId: checkoutStore.accountId,
|
|
99
|
+
});
|
|
80
100
|
const hasRequiredConfig = Boolean(checkoutStore.paymentAmount) &&
|
|
81
101
|
Boolean(checkoutStore.paymentCurrency) &&
|
|
82
102
|
Boolean(checkoutStore.authToken);
|
|
@@ -87,18 +107,26 @@ export class ApplePay {
|
|
|
87
107
|
paymentAmount: checkoutStore.paymentAmount,
|
|
88
108
|
paymentCurrency: checkoutStore.paymentCurrency,
|
|
89
109
|
hasAuthToken: Boolean(checkoutStore.authToken),
|
|
110
|
+
accountId: checkoutStore.accountId,
|
|
90
111
|
});
|
|
91
112
|
this.applePayError.emit({ error: this.error });
|
|
92
113
|
this.isLoading = false;
|
|
114
|
+
console.groupEnd();
|
|
93
115
|
return;
|
|
94
116
|
}
|
|
95
117
|
this.isAvailable = ApplePayHelpers.isApplePaySupported();
|
|
96
118
|
this.canMakePayments = ApplePayHelpers.canMakePayments();
|
|
119
|
+
console.log('[ApplePay Component] support check:', {
|
|
120
|
+
isAvailable: this.isAvailable,
|
|
121
|
+
canMakePayments: this.canMakePayments,
|
|
122
|
+
hasApplePaySessionOnWindow: typeof window !== 'undefined' && 'ApplePaySession' in window,
|
|
123
|
+
});
|
|
97
124
|
if (!this.isAvailable) {
|
|
98
125
|
this.error = "Apple Pay is not supported on this device";
|
|
99
126
|
console.error(this.error);
|
|
100
127
|
this.applePayError.emit({ error: this.error });
|
|
101
128
|
this.isLoading = false;
|
|
129
|
+
console.groupEnd();
|
|
102
130
|
return;
|
|
103
131
|
}
|
|
104
132
|
if (!this.canMakePayments) {
|
|
@@ -106,6 +134,7 @@ export class ApplePay {
|
|
|
106
134
|
console.error(this.error);
|
|
107
135
|
this.applePayError.emit({ error: this.error });
|
|
108
136
|
this.isLoading = false;
|
|
137
|
+
console.groupEnd();
|
|
109
138
|
return;
|
|
110
139
|
}
|
|
111
140
|
const applePayConfig = {
|
|
@@ -116,6 +145,7 @@ export class ApplePay {
|
|
|
116
145
|
buttonType: this.buttonType,
|
|
117
146
|
buttonStyle: this.buttonStyle,
|
|
118
147
|
};
|
|
148
|
+
console.log('[ApplePay Component] initializing service with config:', applePayConfig);
|
|
119
149
|
this.applePayService = new ApplePayService();
|
|
120
150
|
this.applePayService.initialize(applePayConfig);
|
|
121
151
|
const hasActiveCard = await this.applePayService.canMakePaymentsWithActiveCard();
|
|
@@ -133,6 +163,7 @@ export class ApplePay {
|
|
|
133
163
|
}
|
|
134
164
|
finally {
|
|
135
165
|
this.isLoading = false;
|
|
166
|
+
console.groupEnd();
|
|
136
167
|
}
|
|
137
168
|
}
|
|
138
169
|
async isSupported() {
|
|
@@ -154,9 +185,10 @@ export class ApplePay {
|
|
|
154
185
|
this.isAvailable &&
|
|
155
186
|
this.canMakePayments &&
|
|
156
187
|
this.isConfigValid;
|
|
157
|
-
return (h(StyledHost, { key: '
|
|
188
|
+
return (h(StyledHost, { key: 'a50061a2a487a9cddb9e9296ca508cd632cdf832' }, checkoutStore.checkoutLoaded && (h("script", { key: 'eb9a9479294c125b0db7bccd5e90c99ea9e03bbf', async: true, src: 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js', onLoad: () => {
|
|
189
|
+
console.log('[ApplePay Component] Apple Pay SDK script loaded');
|
|
158
190
|
this.initializeApplePay();
|
|
159
|
-
} })), h("div", { key: '
|
|
191
|
+
} })), h("div", { key: '901b1f84625bb6c5652612f364312250f7ebb779', class: 'apple-pay-container' }, h(ApplePaySkeleton, { key: '87b38d500738e1cdb1bb166f02e29845de30eae1', isReady: isReady }), isReady && (h(ApplePayButton, { key: '18fa731162b597740ee6b15b7737668efed9c162', buttonType: this.buttonType, buttonStyle: this.buttonStyle, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleApplePayClick }))), h("style", { key: '9d71379ac48b89babae91012ea22de91f4fb1b58' }, `
|
|
160
192
|
.apple-pay-container {
|
|
161
193
|
width: 100%;
|
|
162
194
|
}
|
package/dist/docs.json
CHANGED
|
@@ -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-
|
|
6
|
+
import { p as packageJson } from './package-BF0mIfcQ.js';
|
|
7
7
|
|
|
8
8
|
const iframeInputStylesStore = createStore({
|
|
9
9
|
focused: {
|