@justifi/webcomponents 6.5.1-rc.1 → 6.5.1-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{GooglePay-HXBAmTgL.js → GooglePay-40aEKdDF.js} +40 -9
- package/dist/cjs/bank-account-document-form-inputs_6.cjs.entry.js +1 -1
- package/dist/cjs/{business.service-DMzf08nC.js → business.service-BggHdPOV.js} +1 -1
- package/dist/cjs/{check-pkg-version-DNFRhNcW.js → check-pkg-version-DuPkU5qI.js} +2 -2
- package/dist/cjs/{checkout.service-CHNHEsrp.js → checkout.service-BUcIs9az.js} +1 -1
- package/dist/cjs/checkouts-list-core.cjs.entry.js +1 -1
- package/dist/cjs/{dispute.service-B63kcFkU.js → dispute.service-CxWqivLc.js} +1 -1
- package/dist/cjs/{get-payment-details-BN139jp0.js → get-payment-details-D_dDxsPG.js} +1 -1
- package/dist/cjs/{get-subaccounts-IgHJX5J4.js → get-subaccounts-_D9lzD5O.js} +1 -1
- package/dist/cjs/hidden-input_2.cjs.entry.js +1 -1
- package/dist/cjs/internal-tokenize-payment-method_7.cjs.entry.js +3 -3
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +1 -1
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +2 -2
- package/dist/cjs/justifi-apple-pay_8.cjs.entry.js +242 -21
- package/dist/cjs/justifi-business-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +4 -4
- package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +4 -4
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +4 -4
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +5 -5
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payment-transactions-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payments-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payout-transactions-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +5 -5
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +5 -5
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +4 -4
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +1 -1
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +5 -5
- package/dist/cjs/{package-Z2EW-l1q.js → package-C6nOTkVV.js} +1 -1
- package/dist/cjs/payment-details-core.cjs.entry.js +1 -1
- package/dist/cjs/{payment.service-eOZc1Qay.js → payment.service-wWZTmyFv.js} +1 -1
- package/dist/cjs/payments-list-core.cjs.entry.js +1 -1
- package/dist/cjs/{payout.service-QVl5N-UV.js → payout.service-CWAem5VG.js} +1 -1
- package/dist/cjs/payouts-list-core.cjs.entry.js +1 -1
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +2 -2
- package/dist/cjs/{terminal-orders-table-g2fwrh2P.js → terminal-orders-table-DBNG4K5I.js} +1 -1
- package/dist/cjs/{terminal.service-BuSFyt0j.js → terminal.service-DSlqCGxE.js} +1 -1
- package/dist/cjs/terminals-list-core.cjs.entry.js +1 -1
- package/dist/collection/api/GooglePay.js +40 -9
- package/dist/collection/api/services/google-pay.service.js +137 -9
- package/dist/collection/components/modular-checkout/sub-components/google-pay.js +100 -3
- package/dist/collection/ui-components/google-pay-button.js +1 -5
- package/dist/docs.json +1 -1
- package/dist/esm/{GooglePay-9bPcqGZ9.js → GooglePay-f7mYX17c.js} +40 -9
- package/dist/esm/bank-account-document-form-inputs_6.entry.js +1 -1
- package/dist/esm/{business.service-2j91Emgq.js → business.service-CzHfftZk.js} +1 -1
- package/dist/esm/{check-pkg-version-B8HjTYV7.js → check-pkg-version-Cqb7EhvC.js} +2 -2
- package/dist/esm/{checkout.service-D-dEMyXF.js → checkout.service-BWdnJLVG.js} +1 -1
- package/dist/esm/checkouts-list-core.entry.js +1 -1
- package/dist/esm/{dispute.service-DPumDIuV.js → dispute.service-CqX5HR5o.js} +1 -1
- package/dist/esm/{get-payment-details-CD_K6FQ3.js → get-payment-details-D0T7bd_-.js} +1 -1
- package/dist/esm/{get-subaccounts-D1eF6c0B.js → get-subaccounts-Gil-SOoF.js} +1 -1
- package/dist/esm/hidden-input_2.entry.js +1 -1
- package/dist/esm/internal-tokenize-payment-method_7.entry.js +3 -3
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +1 -1
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +2 -2
- package/dist/esm/justifi-apple-pay_8.entry.js +242 -21
- package/dist/esm/justifi-business-details.entry.js +4 -4
- package/dist/esm/justifi-business-form.entry.js +4 -4
- package/dist/esm/justifi-checkout.entry.js +3 -3
- package/dist/esm/justifi-checkouts-list-filters.entry.js +1 -1
- package/dist/esm/justifi-checkouts-list.entry.js +5 -5
- package/dist/esm/justifi-dispute-management.entry.js +4 -4
- package/dist/esm/justifi-dispute-notification_3.entry.js +4 -4
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
- package/dist/esm/justifi-order-terminals.entry.js +5 -5
- package/dist/esm/justifi-owner-form_3.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +5 -5
- package/dist/esm/justifi-payment-provisioning.entry.js +4 -4
- package/dist/esm/justifi-payment-transactions-list.entry.js +4 -4
- package/dist/esm/justifi-payments-list.entry.js +4 -4
- package/dist/esm/justifi-payout-details.entry.js +4 -4
- package/dist/esm/justifi-payout-transactions-list.entry.js +4 -4
- package/dist/esm/justifi-payouts-list.entry.js +5 -5
- package/dist/esm/justifi-refund-payment.entry.js +5 -5
- package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminal-orders-list.entry.js +4 -4
- package/dist/esm/justifi-terminals-list-filters.entry.js +1 -1
- package/dist/esm/justifi-terminals-list.entry.js +5 -5
- package/dist/esm/{package-BGHeOtXW.js → package-CzedYX3W.js} +1 -1
- package/dist/esm/payment-details-core.entry.js +1 -1
- package/dist/esm/{payment.service-BreQSu6J.js → payment.service-CWyZF34P.js} +1 -1
- package/dist/esm/payments-list-core.entry.js +1 -1
- package/dist/esm/{payout.service-DuqRe6oq.js → payout.service-CkTievFG.js} +1 -1
- package/dist/esm/payouts-list-core.entry.js +1 -1
- package/dist/esm/terminal-orders-list-core.entry.js +2 -2
- package/dist/esm/{terminal-orders-table-DSo5x2D7.js → terminal-orders-table-OX3ZvzZy.js} +1 -1
- package/dist/esm/{terminal.service-CkzrYIA_.js → terminal.service-Bu5-dhum.js} +1 -1
- package/dist/esm/terminals-list-core.entry.js +1 -1
- package/dist/module/GooglePay.js +40 -9
- package/dist/module/google-pay.js +238 -17
- package/dist/module/package.js +1 -1
- package/dist/types/api/services/google-pay.service.d.ts +1 -1
- package/dist/webcomponents/{p-d2935214.entry.js → p-0437c330.entry.js} +1 -1
- package/dist/webcomponents/{p-16812327.entry.js → p-065b24c3.entry.js} +1 -1
- package/dist/webcomponents/{p-9a795f44.entry.js → p-14cbf366.entry.js} +1 -1
- package/dist/webcomponents/{p-3c006a15.entry.js → p-1e014ee7.entry.js} +1 -1
- package/dist/webcomponents/{p-ee122560.entry.js → p-20e66fc0.entry.js} +1 -1
- package/dist/webcomponents/{p-13b55ca1.entry.js → p-22fdf7a4.entry.js} +1 -1
- package/dist/webcomponents/{p-c16dbe20.entry.js → p-25755af4.entry.js} +1 -1
- package/dist/webcomponents/{p-38e1ef4b.entry.js → p-3d3a65ca.entry.js} +1 -1
- package/dist/webcomponents/p-3f291e6b.entry.js +1 -0
- package/dist/webcomponents/{p-c4044170.entry.js → p-44011a41.entry.js} +1 -1
- package/dist/webcomponents/{p-b9d64d6b.entry.js → p-4ccd753b.entry.js} +1 -1
- package/dist/webcomponents/{p-0ca05626.entry.js → p-4f16a3ce.entry.js} +1 -1
- package/dist/webcomponents/{p-dd0d0f96.entry.js → p-50a32503.entry.js} +1 -1
- package/dist/webcomponents/{p-13ee296a.entry.js → p-57ed105e.entry.js} +1 -1
- package/dist/webcomponents/{p-b3f8d5d4.entry.js → p-5e3bc1dc.entry.js} +1 -1
- package/dist/webcomponents/{p-ea18fcd9.entry.js → p-62cfe9b6.entry.js} +1 -1
- package/dist/webcomponents/{p-af55fc0d.entry.js → p-6a075da4.entry.js} +1 -1
- package/dist/webcomponents/{p-cee402a5.entry.js → p-88074dd7.entry.js} +1 -1
- package/dist/webcomponents/{p-7dbd0618.entry.js → p-8c16e4aa.entry.js} +1 -1
- package/dist/webcomponents/{p-404b3f02.entry.js → p-8ee61443.entry.js} +1 -1
- package/dist/webcomponents/{p-c88babbe.entry.js → p-8efea1e4.entry.js} +1 -1
- package/dist/webcomponents/p-A2FbmAEt.js +1 -0
- package/dist/webcomponents/{p-Dy5btfGV.js → p-B4W3my_D.js} +1 -1
- package/dist/webcomponents/{p-CQrwlULd.js → p-BrazW3nF.js} +1 -1
- package/dist/webcomponents/{p-BN1PYSFf.js → p-CIOILVyM.js} +1 -1
- package/dist/webcomponents/{p-BKM7YeAB.js → p-CPRPR6fJ.js} +1 -1
- package/dist/webcomponents/p-CzedYX3W.js +1 -0
- package/dist/webcomponents/{p-CVhnuewz.js → p-DUs94fK3.js} +1 -1
- package/dist/webcomponents/{p-MdHYTSKO.js → p-DXnwIxTB.js} +1 -1
- package/dist/webcomponents/{p-t8p0WAW4.js → p-DeX_cIoV.js} +1 -1
- package/dist/webcomponents/{p-Cmb6PRFh.js → p-TKWqvm_A.js} +1 -1
- package/dist/webcomponents/{p-BxtmTjqW.js → p-Yp5v6wmS.js} +1 -1
- package/dist/webcomponents/{p-BVwVhXcQ.js → p-aZ8YkDMZ.js} +1 -1
- package/dist/webcomponents/{p-adddbcb7.entry.js → p-aa42e3c1.entry.js} +1 -1
- package/dist/webcomponents/{p-ba0762f9.entry.js → p-ad0f8d85.entry.js} +1 -1
- package/dist/webcomponents/{p-0b64560d.entry.js → p-b8c47cb1.entry.js} +1 -1
- package/dist/webcomponents/p-c11e6c03.entry.js +1 -0
- package/dist/webcomponents/{p-a9f75a9e.entry.js → p-c5af7149.entry.js} +1 -1
- package/dist/webcomponents/{p-13bdb5ed.entry.js → p-c7df4370.entry.js} +1 -1
- package/dist/webcomponents/p-cf9d8e1a.entry.js +1 -0
- package/dist/webcomponents/{p-def8124c.entry.js → p-d3663663.entry.js} +1 -1
- package/dist/webcomponents/{p-fe8f8a7f.entry.js → p-daedfe82.entry.js} +1 -1
- package/dist/webcomponents/{p-c249483e.entry.js → p-dd11e67b.entry.js} +1 -1
- package/dist/webcomponents/{p-1989a253.entry.js → p-e3ab5fe2.entry.js} +1 -1
- package/dist/webcomponents/{p-48cf806b.entry.js → p-e95e27af.entry.js} +1 -1
- package/dist/webcomponents/{p-3d69b6b1.entry.js → p-f66778b8.entry.js} +1 -1
- package/dist/webcomponents/{p-90d1c943.entry.js → p-ff212635.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-499dc735.entry.js +0 -1
- package/dist/webcomponents/p-BGHeOtXW.js +0 -1
- package/dist/webcomponents/p-BRbk6oSh.js +0 -1
- package/dist/webcomponents/p-c14bc83f.entry.js +0 -1
- package/dist/webcomponents/p-ed9de6ed.entry.js +0 -1
|
@@ -18,22 +18,44 @@ class GooglePayService {
|
|
|
18
18
|
* Initialize Google Pay configuration
|
|
19
19
|
*/
|
|
20
20
|
initialize(googlePayConfig) {
|
|
21
|
+
console.log('[GooglePayService] initialize: Starting initialization', {
|
|
22
|
+
config: googlePayConfig,
|
|
23
|
+
});
|
|
21
24
|
this.googlePayConfig = new GooglePayConfig(googlePayConfig);
|
|
25
|
+
console.log('[GooglePayService] initialize: Config object created', {
|
|
26
|
+
isValid: this.googlePayConfig.isValid,
|
|
27
|
+
environment: this.googlePayConfig.environment,
|
|
28
|
+
merchantId: this.googlePayConfig.merchantId,
|
|
29
|
+
});
|
|
22
30
|
if (!this.googlePayConfig.isValid) {
|
|
31
|
+
console.error('[GooglePayService] initialize: Invalid configuration');
|
|
23
32
|
throw new Error('Invalid Google Pay configuration provided');
|
|
24
33
|
}
|
|
25
34
|
// Create Google Pay client
|
|
35
|
+
console.log('[GooglePayService] initialize: Creating Google Pay client', {
|
|
36
|
+
environment: this.googlePayConfig.environment,
|
|
37
|
+
});
|
|
26
38
|
this.googlePayClient = GooglePayHelpers.createGooglePayClient(this.googlePayConfig.environment);
|
|
27
39
|
if (!this.googlePayClient) {
|
|
40
|
+
console.error('[GooglePayService] initialize: Failed to create client');
|
|
28
41
|
throw new Error('Failed to create Google Pay client');
|
|
29
42
|
}
|
|
30
|
-
|
|
43
|
+
console.log('[GooglePayService] initialize: Client created successfully', {
|
|
44
|
+
hasClient: !!this.googlePayClient,
|
|
45
|
+
});
|
|
31
46
|
}
|
|
32
47
|
/**
|
|
33
48
|
* Process Google Pay payment via API
|
|
34
49
|
*/
|
|
35
50
|
async processPayment(authToken, accountId, payload) {
|
|
51
|
+
var _a;
|
|
36
52
|
const endpoint = PROCESS_TOKEN_ENDPOINT;
|
|
53
|
+
console.log('[GooglePayService] processPayment: Starting', {
|
|
54
|
+
endpoint,
|
|
55
|
+
hasAuthToken: !!authToken,
|
|
56
|
+
accountId,
|
|
57
|
+
payload,
|
|
58
|
+
});
|
|
37
59
|
try {
|
|
38
60
|
const result = await this.api.post({
|
|
39
61
|
endpoint,
|
|
@@ -43,12 +65,20 @@ class GooglePayService {
|
|
|
43
65
|
'sub-account': accountId,
|
|
44
66
|
},
|
|
45
67
|
});
|
|
68
|
+
console.log('[GooglePayService] processPayment: API response received', {
|
|
69
|
+
hasId: !!result.id,
|
|
70
|
+
hasToken: !!((_a = result.data) === null || _a === void 0 ? void 0 : _a.token),
|
|
71
|
+
result,
|
|
72
|
+
});
|
|
73
|
+
const success = result.id && !!result.data.token;
|
|
74
|
+
console.log('[GooglePayService] processPayment: Result', { success });
|
|
46
75
|
return {
|
|
47
|
-
success
|
|
76
|
+
success,
|
|
48
77
|
data: result,
|
|
49
78
|
};
|
|
50
79
|
}
|
|
51
|
-
catch (
|
|
80
|
+
catch (error) {
|
|
81
|
+
console.error('[GooglePayService] processPayment: API error', error);
|
|
52
82
|
throw new Error('Google Pay payment processing failed');
|
|
53
83
|
}
|
|
54
84
|
}
|
|
@@ -56,21 +86,42 @@ class GooglePayService {
|
|
|
56
86
|
* Check if Google Pay is available on this device/browser
|
|
57
87
|
*/
|
|
58
88
|
isAvailable() {
|
|
59
|
-
|
|
89
|
+
const isSupported = GooglePayHelpers.isGooglePaySupported();
|
|
90
|
+
const hasClient = !!this.googlePayClient;
|
|
91
|
+
const result = isSupported && hasClient;
|
|
92
|
+
console.log('[GooglePayService] isAvailable:', {
|
|
93
|
+
isSupported,
|
|
94
|
+
hasClient,
|
|
95
|
+
result,
|
|
96
|
+
});
|
|
97
|
+
return result;
|
|
60
98
|
}
|
|
61
99
|
/**
|
|
62
100
|
* Check if the user can make payments with Google Pay
|
|
63
101
|
*/
|
|
64
102
|
async canMakePayments() {
|
|
103
|
+
console.log('[GooglePayService] canMakePayments: Checking', {
|
|
104
|
+
hasClient: !!this.googlePayClient,
|
|
105
|
+
hasConfig: !!this.googlePayConfig,
|
|
106
|
+
});
|
|
65
107
|
if (!this.googlePayClient || !this.googlePayConfig) {
|
|
108
|
+
console.warn('[GooglePayService] canMakePayments: Missing client or config');
|
|
66
109
|
return false;
|
|
67
110
|
}
|
|
68
111
|
try {
|
|
69
112
|
const baseRequest = GooglePayHelpers.createBasePaymentDataRequest();
|
|
113
|
+
console.log('[GooglePayService] canMakePayments: Calling isReadyToPay', {
|
|
114
|
+
baseRequest,
|
|
115
|
+
});
|
|
70
116
|
const response = await this.googlePayClient.isReadyToPay(baseRequest);
|
|
117
|
+
console.log('[GooglePayService] canMakePayments: Response received', {
|
|
118
|
+
result: response.result,
|
|
119
|
+
response,
|
|
120
|
+
});
|
|
71
121
|
return response.result;
|
|
72
122
|
}
|
|
73
|
-
catch (
|
|
123
|
+
catch (error) {
|
|
124
|
+
console.error('[GooglePayService] canMakePayments: Error', error);
|
|
74
125
|
return false;
|
|
75
126
|
}
|
|
76
127
|
}
|
|
@@ -79,27 +130,53 @@ class GooglePayService {
|
|
|
79
130
|
*/
|
|
80
131
|
async startPaymentSession(paymentDataRequest, authToken, accountId) {
|
|
81
132
|
var _a;
|
|
133
|
+
console.log('[GooglePayService] startPaymentSession: Starting', {
|
|
134
|
+
hasConfig: !!this.googlePayConfig,
|
|
135
|
+
hasClient: !!this.googlePayClient,
|
|
136
|
+
hasAuthToken: !!authToken,
|
|
137
|
+
accountId,
|
|
138
|
+
paymentDataRequest,
|
|
139
|
+
});
|
|
82
140
|
if (!this.googlePayConfig || !this.googlePayClient) {
|
|
141
|
+
console.error('[GooglePayService] startPaymentSession: Not initialized');
|
|
83
142
|
throw new Error('Google Pay not initialized. Call initialize() first.');
|
|
84
143
|
}
|
|
85
144
|
if (!this.isAvailable()) {
|
|
145
|
+
console.error('[GooglePayService] startPaymentSession: Not available');
|
|
86
146
|
throw new Error('Google Pay is not available on this device/browser');
|
|
87
147
|
}
|
|
88
148
|
const request = new GooglePayPaymentDataRequest(paymentDataRequest);
|
|
149
|
+
console.log('[GooglePayService] startPaymentSession: Request object created', {
|
|
150
|
+
isValid: request.isValid,
|
|
151
|
+
request,
|
|
152
|
+
});
|
|
89
153
|
if (!request.isValid) {
|
|
154
|
+
console.error('[GooglePayService] startPaymentSession: Invalid request');
|
|
90
155
|
throw new Error('Invalid payment data request provided');
|
|
91
156
|
}
|
|
92
157
|
try {
|
|
158
|
+
console.log('[GooglePayService] startPaymentSession: Loading payment data...');
|
|
93
159
|
const paymentData = await this.googlePayClient.loadPaymentData(request);
|
|
160
|
+
console.log('[GooglePayService] startPaymentSession: Payment data loaded', {
|
|
161
|
+
hasPaymentData: !!paymentData,
|
|
162
|
+
paymentMethodData: paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentMethodData,
|
|
163
|
+
});
|
|
94
164
|
// Build top-level snake_case fields from Google Pay tokenizationData
|
|
95
165
|
const tokenizationData = (_a = paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentMethodData) === null || _a === void 0 ? void 0 : _a.tokenizationData;
|
|
166
|
+
console.log('[GooglePayService] startPaymentSession: Extracted tokenization data', {
|
|
167
|
+
hasTokenizationData: !!tokenizationData,
|
|
168
|
+
tokenizationData,
|
|
169
|
+
});
|
|
96
170
|
const tokenObj = (() => {
|
|
97
171
|
if ((tokenizationData === null || tokenizationData === void 0 ? void 0 : tokenizationData.token) &&
|
|
98
172
|
typeof tokenizationData.token === 'string') {
|
|
99
173
|
try {
|
|
100
|
-
|
|
174
|
+
const parsed = JSON.parse(tokenizationData.token);
|
|
175
|
+
console.log('[GooglePayService] startPaymentSession: Parsed token', parsed);
|
|
176
|
+
return parsed;
|
|
101
177
|
}
|
|
102
178
|
catch (_e) {
|
|
179
|
+
console.warn('[GooglePayService] startPaymentSession: Failed to parse token, using raw', _e);
|
|
103
180
|
return tokenizationData;
|
|
104
181
|
}
|
|
105
182
|
}
|
|
@@ -116,8 +193,19 @@ class GooglePayService {
|
|
|
116
193
|
: undefined,
|
|
117
194
|
signedMessage: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.signedMessage,
|
|
118
195
|
};
|
|
196
|
+
console.log('[GooglePayService] startPaymentSession: Token process request created', {
|
|
197
|
+
hasProtocolVersion: !!tokenProcessRequest.protocolVersion,
|
|
198
|
+
hasSignature: !!tokenProcessRequest.signature,
|
|
199
|
+
hasSignedMessage: !!tokenProcessRequest.signedMessage,
|
|
200
|
+
hasIntermediateSigningKey: !!tokenProcessRequest.intermediateSigningKey,
|
|
201
|
+
});
|
|
202
|
+
console.log('[GooglePayService] startPaymentSession: Processing payment...');
|
|
119
203
|
const paymentResult = await this.processPayment(authToken, accountId, tokenProcessRequest);
|
|
204
|
+
console.log('[GooglePayService] startPaymentSession: Payment processed', paymentResult);
|
|
120
205
|
if (paymentResult.success) {
|
|
206
|
+
console.log('[GooglePayService] startPaymentSession: Payment successful', {
|
|
207
|
+
paymentMethodId: paymentResult.data.id,
|
|
208
|
+
});
|
|
121
209
|
return {
|
|
122
210
|
success: true,
|
|
123
211
|
paymentData: paymentData,
|
|
@@ -125,6 +213,7 @@ class GooglePayService {
|
|
|
125
213
|
};
|
|
126
214
|
}
|
|
127
215
|
else {
|
|
216
|
+
console.error('[GooglePayService] startPaymentSession: Payment processing failed');
|
|
128
217
|
return {
|
|
129
218
|
success: false,
|
|
130
219
|
error: {
|
|
@@ -135,11 +224,17 @@ class GooglePayService {
|
|
|
135
224
|
}
|
|
136
225
|
}
|
|
137
226
|
catch (error) {
|
|
227
|
+
console.error('[GooglePayService] startPaymentSession: Exception caught', error);
|
|
138
228
|
// Handle different types of errors
|
|
139
229
|
if (error && typeof error === 'object' && 'statusCode' in error) {
|
|
140
230
|
const googlePayError = error;
|
|
231
|
+
console.log('[GooglePayService] startPaymentSession: Google Pay error', {
|
|
232
|
+
statusCode: googlePayError.statusCode,
|
|
233
|
+
statusMessage: googlePayError.statusMessage,
|
|
234
|
+
});
|
|
141
235
|
switch (googlePayError.statusCode) {
|
|
142
236
|
case 'CANCELED':
|
|
237
|
+
console.log('[GooglePayService] startPaymentSession: User cancelled');
|
|
143
238
|
return {
|
|
144
239
|
success: false,
|
|
145
240
|
error: {
|
|
@@ -148,6 +243,7 @@ class GooglePayService {
|
|
|
148
243
|
},
|
|
149
244
|
};
|
|
150
245
|
case 'DEVELOPER_ERROR':
|
|
246
|
+
console.error('[GooglePayService] startPaymentSession: Developer error');
|
|
151
247
|
return {
|
|
152
248
|
success: false,
|
|
153
249
|
error: {
|
|
@@ -156,6 +252,9 @@ class GooglePayService {
|
|
|
156
252
|
},
|
|
157
253
|
};
|
|
158
254
|
default:
|
|
255
|
+
console.error('[GooglePayService] startPaymentSession: Unknown error', {
|
|
256
|
+
statusCode: googlePayError.statusCode,
|
|
257
|
+
});
|
|
159
258
|
return {
|
|
160
259
|
success: false,
|
|
161
260
|
error: {
|
|
@@ -165,6 +264,7 @@ class GooglePayService {
|
|
|
165
264
|
};
|
|
166
265
|
}
|
|
167
266
|
}
|
|
267
|
+
console.error('[GooglePayService] startPaymentSession: Generic error', error);
|
|
168
268
|
return {
|
|
169
269
|
success: false,
|
|
170
270
|
error: {
|
|
@@ -200,22 +300,43 @@ class GooglePayService {
|
|
|
200
300
|
* Prefetch payment data for faster loading
|
|
201
301
|
*/
|
|
202
302
|
prefetchPaymentData(paymentDataRequest) {
|
|
303
|
+
console.log('[GooglePayService] prefetchPaymentData: Starting', {
|
|
304
|
+
hasClient: !!this.googlePayClient,
|
|
305
|
+
paymentDataRequest,
|
|
306
|
+
});
|
|
203
307
|
if (!this.googlePayClient) {
|
|
308
|
+
console.warn('[GooglePayService] prefetchPaymentData: No client available');
|
|
204
309
|
return;
|
|
205
310
|
}
|
|
206
311
|
const request = new GooglePayPaymentDataRequest(paymentDataRequest);
|
|
312
|
+
console.log('[GooglePayService] prefetchPaymentData: Request created', {
|
|
313
|
+
isValid: request.isValid,
|
|
314
|
+
});
|
|
207
315
|
if (!request.isValid) {
|
|
316
|
+
console.warn('[GooglePayService] prefetchPaymentData: Invalid request');
|
|
208
317
|
return;
|
|
209
318
|
}
|
|
210
319
|
try {
|
|
320
|
+
console.log('[GooglePayService] prefetchPaymentData: Calling prefetchPaymentData');
|
|
211
321
|
this.googlePayClient.prefetchPaymentData(request);
|
|
322
|
+
console.log('[GooglePayService] prefetchPaymentData: Prefetch complete');
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
console.error('[GooglePayService] prefetchPaymentData: Error', error);
|
|
212
326
|
}
|
|
213
|
-
catch (_error) { }
|
|
214
327
|
}
|
|
215
328
|
/**
|
|
216
329
|
* Create a basic payment data request
|
|
217
330
|
*/
|
|
218
|
-
static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName) {
|
|
331
|
+
static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName, merchantId) {
|
|
332
|
+
var _a;
|
|
333
|
+
console.log('[GooglePayService] createPaymentDataRequest: Creating request', {
|
|
334
|
+
amount,
|
|
335
|
+
label,
|
|
336
|
+
countryCode,
|
|
337
|
+
currencyCode,
|
|
338
|
+
merchantName,
|
|
339
|
+
});
|
|
219
340
|
const request = {
|
|
220
341
|
apiVersion: 2,
|
|
221
342
|
apiVersionMinor: 0,
|
|
@@ -228,10 +349,17 @@ class GooglePayService {
|
|
|
228
349
|
totalPriceLabel: label,
|
|
229
350
|
},
|
|
230
351
|
merchantInfo: {
|
|
352
|
+
merchantId,
|
|
231
353
|
merchantName,
|
|
232
354
|
},
|
|
233
355
|
};
|
|
234
|
-
|
|
356
|
+
console.log('[GooglePayService] createPaymentDataRequest: Request created', {
|
|
357
|
+
apiVersion: request.apiVersion,
|
|
358
|
+
apiVersionMinor: request.apiVersionMinor,
|
|
359
|
+
transactionInfo: request.transactionInfo,
|
|
360
|
+
merchantInfo: request.merchantInfo,
|
|
361
|
+
allowedPaymentMethodsCount: (_a = request.allowedPaymentMethods) === null || _a === void 0 ? void 0 : _a.length,
|
|
362
|
+
});
|
|
235
363
|
return request;
|
|
236
364
|
}
|
|
237
365
|
/**
|
|
@@ -333,7 +461,7 @@ const GooglePayButton = (props) => {
|
|
|
333
461
|
props.clickHandler();
|
|
334
462
|
}
|
|
335
463
|
};
|
|
336
|
-
return (h("div", { class:
|
|
464
|
+
return (h("div", { class: "google-pay-button-container" }, h("button", Object.assign({ class: getGooglePayButtonClass(), style: getButtonStyles(), onClick: handleClick, disabled: props.disabled || props.isProcessing || !props.isAvailable, "aria-label": "Google Pay", type: "button" }, props), props.isProcessing && ProcessingSpinner(), h("div", { class: 'google-pay-button-content' }, h("svg", { width: "41", height: "17", xmlns: "http://www.w3.org/2000/svg" }, h("g", { fill: "none", "fill-rule": "evenodd" }, h("path", { d: "M19.526 2.635v4.083h2.518c.6 0 1.096-.202 1.488-.605.403-.402.605-.882.605-1.437 0-.544-.202-1.018-.605-1.422-.392-.413-.888-.62-1.488-.62h-2.518zm0 5.52v4.736h-1.504V1.198h3.99c1.013 0 1.873.337 2.582 1.012.72.675 1.08 1.497 1.08 2.466 0 .991-.36 1.819-1.08 2.482-.697.665-1.559.996-2.583.996h-2.485v.001zm7.668 2.287c0 .392.166.718.499.98.332.26.722.391 1.168.391.633 0 1.196-.234 1.692-.701.497-.469.744-1.019.744-1.65-.469-.37-1.123-.555-1.962-.555-.61 0-1.12.148-1.528.442-.409.294-.613.657-.613 1.093m1.946-5.815c1.112 0 1.989.297 2.633.89.642.594.964 1.408.964 2.442v4.932h-1.439v-1.11h-.065c-.622.914-1.45 1.372-2.486 1.372-.882 0-1.621-.262-2.215-.784-.594-.523-.891-1.176-.891-1.96 0-.828.313-1.486.94-1.976s1.463-.735 2.51-.735c.892 0 1.629.163 2.206.49v-.344c0-.522-.207-.966-.621-1.33a2.132 2.132 0 0 0-1.455-.547c-.84 0-1.504.353-1.995 1.062l-1.324-.834c.73-1.045 1.81-1.568 3.238-1.568m11.853.262l-5.02 11.53H34.42l1.864-4.034-3.302-7.496h1.635l2.387 5.749h.032l2.322-5.75z", fill: "#FFF" }), h("path", { d: "M13.448 7.134c0-.473-.04-.93-.116-1.366H6.988v2.588h3.634a3.11 3.11 0 0 1-1.344 2.042v1.68h2.169c1.27-1.17 2.001-2.9 2.001-4.944", fill: "#4285F4" }), h("path", { d: "M6.988 13.7c1.816 0 3.344-.595 4.459-1.621l-2.169-1.681c-.603.406-1.38.643-2.29.643-1.754 0-3.244-1.182-3.776-2.774H.978v1.731a6.728 6.728 0 0 0 6.01 3.703", fill: "#34A853" }), h("path", { d: "M3.212 8.267a4.034 4.034 0 0 1 0-2.572V3.964H.978A6.678 6.678 0 0 0 .261 6.98c0 1.085.26 2.11.717 3.017l2.234-1.731z", fill: "#FABB05" }), h("path", { d: "M6.988 2.921c.992 0 1.88.34 2.58 1.008v.001l1.92-1.918C10.324.928 8.804.262 6.989.262a6.728 6.728 0 0 0-6.01 3.702l2.234 1.731c.532-1.592 2.022-2.774 3.776-2.774", fill: "#E94235" }))))), h("style", null, `
|
|
337
465
|
.google-pay-button-container {
|
|
338
466
|
display: block;
|
|
339
467
|
position: relative;
|
|
@@ -346,7 +474,6 @@ const GooglePayButton = (props) => {
|
|
|
346
474
|
border: none;
|
|
347
475
|
border-radius: 4px;
|
|
348
476
|
cursor: pointer;
|
|
349
|
-
font-family: 'Google Sans', arial, sans-serif;
|
|
350
477
|
font-size: 14px;
|
|
351
478
|
font-weight: 500;
|
|
352
479
|
letter-spacing: 0.25px;
|
|
@@ -354,7 +481,6 @@ const GooglePayButton = (props) => {
|
|
|
354
481
|
outline: none;
|
|
355
482
|
padding: 0 20px;
|
|
356
483
|
position: relative;
|
|
357
|
-
transition: box-shadow 0.2s ease;
|
|
358
484
|
min-width: 140px;
|
|
359
485
|
min-height: 48px;
|
|
360
486
|
}
|
|
@@ -363,13 +489,11 @@ const GooglePayButton = (props) => {
|
|
|
363
489
|
.google-pay-button.google-pay-button-black {
|
|
364
490
|
background-color: #000;
|
|
365
491
|
color: #fff;
|
|
366
|
-
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
|
|
367
492
|
}
|
|
368
493
|
|
|
369
494
|
.google-pay-button.google-pay-button-white {
|
|
370
495
|
background-color: #fff;
|
|
371
496
|
color: #3c4043;
|
|
372
|
-
box-shadow: 0 1px 1px 0 rgba(60, 64, 67, 0.30), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
|
|
373
497
|
}
|
|
374
498
|
|
|
375
499
|
/* Button content */
|
|
@@ -537,19 +661,42 @@ const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLE
|
|
|
537
661
|
this.showSkeleton = true;
|
|
538
662
|
this.handleGooglePayClick = async () => {
|
|
539
663
|
var _a;
|
|
664
|
+
console.log('[GooglePay] handleGooglePayClick: Button clicked', {
|
|
665
|
+
isProcessing: this.isProcessing,
|
|
666
|
+
disabled: this.disabled,
|
|
667
|
+
isAvailable: this.isAvailable,
|
|
668
|
+
canMakePayments: this.canMakePayments,
|
|
669
|
+
});
|
|
540
670
|
if (this.isProcessing ||
|
|
541
671
|
this.disabled ||
|
|
542
672
|
!this.isAvailable ||
|
|
543
673
|
!this.canMakePayments) {
|
|
674
|
+
console.warn('[GooglePay] handleGooglePayClick: Payment blocked', {
|
|
675
|
+
reason: this.isProcessing ? 'isProcessing' :
|
|
676
|
+
this.disabled ? 'disabled' :
|
|
677
|
+
!this.isAvailable ? 'notAvailable' :
|
|
678
|
+
!this.canMakePayments ? 'cannotMakePayments' : 'unknown',
|
|
679
|
+
});
|
|
544
680
|
return;
|
|
545
681
|
}
|
|
546
682
|
try {
|
|
683
|
+
console.log('[GooglePay] handleGooglePayClick: Starting payment session');
|
|
547
684
|
this.isProcessing = true;
|
|
548
685
|
this.error = null;
|
|
549
686
|
this.googlePayStarted.emit();
|
|
687
|
+
console.log('[GooglePay] handleGooglePayClick: googlePayStarted event emitted');
|
|
550
688
|
const paymentDataRequest = this.createPaymentDataRequest();
|
|
689
|
+
console.log('[GooglePay] handleGooglePayClick: Starting payment session with service', {
|
|
690
|
+
hasAuthToken: !!checkoutStore.authToken,
|
|
691
|
+
accountId: checkoutStore.accountId,
|
|
692
|
+
});
|
|
551
693
|
const result = await this.googlePayService.startPaymentSession(paymentDataRequest, checkoutStore.authToken, checkoutStore.accountId);
|
|
694
|
+
console.log('[GooglePay] handleGooglePayClick: Payment session result', result);
|
|
552
695
|
if (result.success) {
|
|
696
|
+
console.log('[GooglePay] handleGooglePayClick: Payment successful', {
|
|
697
|
+
paymentMethodId: result.paymentMethodId,
|
|
698
|
+
hasPaymentData: !!result.paymentData,
|
|
699
|
+
});
|
|
553
700
|
this.googlePayCompleted.emit({
|
|
554
701
|
success: true,
|
|
555
702
|
paymentData: result.paymentData,
|
|
@@ -557,16 +704,21 @@ const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLE
|
|
|
557
704
|
});
|
|
558
705
|
}
|
|
559
706
|
else {
|
|
707
|
+
console.error('[GooglePay] handleGooglePayClick: Payment failed', {
|
|
708
|
+
error: result.error,
|
|
709
|
+
});
|
|
560
710
|
this.googlePayCompleted.emit({
|
|
561
711
|
success: false,
|
|
562
712
|
error: result.error,
|
|
563
713
|
});
|
|
564
714
|
if (((_a = result.error) === null || _a === void 0 ? void 0 : _a.code) === "USER_CANCELLED") {
|
|
715
|
+
console.log('[GooglePay] handleGooglePayClick: User cancelled payment');
|
|
565
716
|
this.googlePayCancelled.emit();
|
|
566
717
|
}
|
|
567
718
|
}
|
|
568
719
|
}
|
|
569
720
|
catch (error) {
|
|
721
|
+
console.error('[GooglePay] handleGooglePayClick: Exception during payment', error);
|
|
570
722
|
const errorMessage = error instanceof Error ? error.message : "Payment failed";
|
|
571
723
|
this.error = errorMessage;
|
|
572
724
|
this.googlePayCompleted.emit({
|
|
@@ -576,27 +728,48 @@ const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLE
|
|
|
576
728
|
}
|
|
577
729
|
finally {
|
|
578
730
|
this.isProcessing = false;
|
|
731
|
+
console.log('[GooglePay] handleGooglePayClick: Payment flow complete', {
|
|
732
|
+
isProcessing: this.isProcessing,
|
|
733
|
+
error: this.error,
|
|
734
|
+
});
|
|
579
735
|
}
|
|
580
736
|
};
|
|
581
737
|
}
|
|
582
738
|
watchConfigChange() {
|
|
739
|
+
console.log('[GooglePay] watchConfigChange: Configuration changed', {
|
|
740
|
+
merchantId: this.merchantId,
|
|
741
|
+
environment: this.environment,
|
|
742
|
+
});
|
|
583
743
|
this.initializeGooglePay();
|
|
584
744
|
}
|
|
585
745
|
componentWillLoad() {
|
|
746
|
+
console.log('[GooglePay] componentWillLoad: Initializing GooglePayService');
|
|
586
747
|
this.googlePayService = new GooglePayService();
|
|
748
|
+
console.log('[GooglePay] componentWillLoad: GooglePayService created', {
|
|
749
|
+
service: this.googlePayService,
|
|
750
|
+
});
|
|
587
751
|
}
|
|
588
752
|
componentDidLoad() {
|
|
753
|
+
console.log('[GooglePay] componentDidLoad: Setting up store subscriptions', {
|
|
754
|
+
checkoutLoaded: checkoutStore.checkoutLoaded,
|
|
755
|
+
paymentAmount: checkoutStore.paymentAmount,
|
|
756
|
+
paymentCurrency: checkoutStore.paymentCurrency,
|
|
757
|
+
paymentDescription: checkoutStore.paymentDescription,
|
|
758
|
+
});
|
|
589
759
|
const unsub = onChange("paymentAmount", () => {
|
|
760
|
+
console.log('[GooglePay] paymentAmount changed:', checkoutStore.paymentAmount);
|
|
590
761
|
this.prefetchPaymentData();
|
|
591
762
|
});
|
|
592
763
|
if (typeof unsub === 'function')
|
|
593
764
|
this.unsubscribes.push(unsub);
|
|
594
765
|
const unsubCurrency = onChange("paymentCurrency", () => {
|
|
766
|
+
console.log('[GooglePay] paymentCurrency changed:', checkoutStore.paymentCurrency);
|
|
595
767
|
this.prefetchPaymentData();
|
|
596
768
|
});
|
|
597
769
|
if (typeof unsubCurrency === 'function')
|
|
598
770
|
this.unsubscribes.push(unsubCurrency);
|
|
599
771
|
const unsubDesc = onChange("paymentDescription", () => {
|
|
772
|
+
console.log('[GooglePay] paymentDescription changed:', checkoutStore.paymentDescription);
|
|
600
773
|
this.prefetchPaymentData();
|
|
601
774
|
});
|
|
602
775
|
if (typeof unsubDesc === 'function')
|
|
@@ -645,17 +818,31 @@ const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLE
|
|
|
645
818
|
* Prefetch payment data for faster load times of the Google Pay sheet.
|
|
646
819
|
*/
|
|
647
820
|
async prefetchPaymentData() {
|
|
821
|
+
console.log('[GooglePay] prefetchPaymentData: Called', {
|
|
822
|
+
isAvailable: this.isAvailable,
|
|
823
|
+
canMakePayments: this.canMakePayments,
|
|
824
|
+
});
|
|
648
825
|
if (!this.isAvailable || !this.canMakePayments) {
|
|
826
|
+
console.warn('[GooglePay] prefetchPaymentData: Skipped - not available or cannot make payments');
|
|
649
827
|
return;
|
|
650
828
|
}
|
|
651
829
|
const paymentDataRequest = this.createPaymentDataRequest();
|
|
830
|
+
console.log('[GooglePay] prefetchPaymentData: Prefetching', { paymentDataRequest });
|
|
652
831
|
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
832
|
+
console.log('[GooglePay] prefetchPaymentData: Prefetch complete');
|
|
653
833
|
}
|
|
654
834
|
async initializeGooglePay() {
|
|
835
|
+
console.log('[GooglePay] initializeGooglePay: Starting initialization');
|
|
655
836
|
try {
|
|
656
837
|
this.isLoading = true;
|
|
657
838
|
this.error = null;
|
|
839
|
+
console.log('[GooglePay] initializeGooglePay: Checking payment amount', {
|
|
840
|
+
paymentAmount: checkoutStore.paymentAmount,
|
|
841
|
+
paymentCurrency: checkoutStore.paymentCurrency,
|
|
842
|
+
paymentDescription: checkoutStore.paymentDescription,
|
|
843
|
+
});
|
|
658
844
|
if (!checkoutStore.paymentAmount) {
|
|
845
|
+
console.error('[GooglePay] initializeGooglePay: Missing payment amount');
|
|
659
846
|
this.error = "Missing required Google Pay configuration";
|
|
660
847
|
this.isLoading = false;
|
|
661
848
|
return;
|
|
@@ -668,23 +855,39 @@ const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLE
|
|
|
668
855
|
buttonStyle: this.buttonStyle,
|
|
669
856
|
buttonSizeMode: this.buttonSizeMode,
|
|
670
857
|
};
|
|
858
|
+
console.log('[GooglePay] initializeGooglePay: Config created', googlePayConfig);
|
|
671
859
|
this.googlePayService.initialize(googlePayConfig);
|
|
860
|
+
console.log('[GooglePay] initializeGooglePay: Service initialized');
|
|
672
861
|
this.isAvailable = this.googlePayService.isAvailable();
|
|
862
|
+
console.log('[GooglePay] initializeGooglePay: Availability check', {
|
|
863
|
+
isAvailable: this.isAvailable,
|
|
864
|
+
});
|
|
673
865
|
if (!this.isAvailable) {
|
|
866
|
+
console.warn('[GooglePay] initializeGooglePay: Google Pay not available on device');
|
|
674
867
|
this.error = "Google Pay is not supported on this device";
|
|
675
868
|
this.isLoading = false;
|
|
676
869
|
return;
|
|
677
870
|
}
|
|
871
|
+
console.log('[GooglePay] initializeGooglePay: Checking canMakePayments...');
|
|
678
872
|
this.canMakePayments = await this.googlePayService.canMakePayments();
|
|
873
|
+
console.log('[GooglePay] initializeGooglePay: canMakePayments result', {
|
|
874
|
+
canMakePayments: this.canMakePayments,
|
|
875
|
+
});
|
|
679
876
|
if (!this.canMakePayments) {
|
|
877
|
+
console.warn('[GooglePay] initializeGooglePay: Cannot make payments');
|
|
680
878
|
this.error = "Google Pay is not available for payments";
|
|
681
879
|
this.isLoading = false;
|
|
682
880
|
return;
|
|
683
881
|
}
|
|
684
882
|
const paymentDataRequest = this.createPaymentDataRequest();
|
|
883
|
+
console.log('[GooglePay] initializeGooglePay: Prefetching payment data', {
|
|
884
|
+
paymentDataRequest,
|
|
885
|
+
});
|
|
685
886
|
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
887
|
+
console.log('[GooglePay] initializeGooglePay: Initialization complete');
|
|
686
888
|
}
|
|
687
889
|
catch (error) {
|
|
890
|
+
console.error('[GooglePay] initializeGooglePay: Error during initialization', error);
|
|
688
891
|
this.error =
|
|
689
892
|
error instanceof Error
|
|
690
893
|
? error.message
|
|
@@ -692,19 +895,37 @@ const GooglePay = /*@__PURE__*/ proxyCustomElement(class GooglePay extends HTMLE
|
|
|
692
895
|
}
|
|
693
896
|
finally {
|
|
694
897
|
this.isLoading = false;
|
|
898
|
+
console.log('[GooglePay] initializeGooglePay: Final state', {
|
|
899
|
+
isLoading: this.isLoading,
|
|
900
|
+
isAvailable: this.isAvailable,
|
|
901
|
+
canMakePayments: this.canMakePayments,
|
|
902
|
+
error: this.error,
|
|
903
|
+
});
|
|
695
904
|
}
|
|
696
905
|
}
|
|
697
906
|
createPaymentDataRequest() {
|
|
698
|
-
|
|
907
|
+
const request = GooglePayService.createPaymentDataRequest(checkoutStore.paymentAmount, checkoutStore.paymentDescription, this.countryCode, checkoutStore.paymentCurrency, this.merchantName, this.merchantId);
|
|
908
|
+
console.log('[GooglePay] createPaymentDataRequest: Created request', {
|
|
909
|
+
amount: checkoutStore.paymentAmount,
|
|
910
|
+
currency: checkoutStore.paymentCurrency,
|
|
911
|
+
description: checkoutStore.paymentDescription,
|
|
912
|
+
countryCode: this.countryCode,
|
|
913
|
+
merchantName: this.merchantName,
|
|
914
|
+
request,
|
|
915
|
+
});
|
|
916
|
+
return request;
|
|
699
917
|
}
|
|
700
918
|
render() {
|
|
701
919
|
const showError = !this.isLoading && !!this.error;
|
|
702
920
|
const showDeviceUnavailable = !this.isLoading && !this.error && !this.isAvailable;
|
|
703
921
|
const showPaymentsUnavailable = !this.isLoading && !this.error && this.isAvailable && !this.canMakePayments;
|
|
704
922
|
const showButton = !this.isLoading && !this.error && this.isAvailable && this.canMakePayments;
|
|
705
|
-
return (h(StyledHost, { key: '
|
|
923
|
+
return (h(StyledHost, { key: 'cf4dcfa14dd83683c0d6e811ea464968c38f38d6' }, checkoutStore.checkoutLoaded && (h("script", { key: 'e942fe8e2eb80ee0d2119e864c62d89a79d9d12a', async: true, src: 'https://pay.google.com/gp/p/js/pay.js', onLoad: () => {
|
|
924
|
+
console.log('[GooglePay] Script loaded: Google Pay JS library loaded successfully');
|
|
706
925
|
this.initializeGooglePay();
|
|
707
|
-
}
|
|
926
|
+
}, onError: (e) => {
|
|
927
|
+
console.error('[GooglePay] Script error: Failed to load Google Pay JS library', e);
|
|
928
|
+
} })), h("div", { key: '7ce1234392d3ea3abdcb1a385462cf740f4b98bb', class: 'google-pay-container' }, h(GooglePaySkeleton, { key: '3532e93f39bb69d76663c159bc6b1322a39e1361', isLoading: this.isLoading }), showError && (h("div", { key: '9e42e567d383522d03bc361008cb470fd2e2d602', class: 'google-pay-error', role: 'alert', "data-testid": 'gp-error' }, h("span", { key: '8b49d628ff8f5175d36f82e32191f1f3291e826f', class: 'error-icon' }, "\u26A0\uFE0F"), h("span", { key: 'b01e94934cd30b8dbad3127239ea625c51511d35', class: 'error-message' }, this.error))), showDeviceUnavailable && (h("div", { key: '12ad123c7516e9ce2ad1084f6b0c366e8bb5b9d5', class: 'google-pay-unavailable', "data-testid": 'gp-device-unavailable' }, h("span", { key: 'e0fa8f13423b6b545b340cc4b2b0411e833202c6', class: 'unavailable-message' }, "Google Pay is not available on this device"))), showPaymentsUnavailable && (h("div", { key: 'acb4c6661ca0aa6b944c8ed67642c4ad9effa1e5', class: 'google-pay-unavailable', "data-testid": 'gp-payments-unavailable' }, h("span", { key: '8a83dc8f5140d3ecade1fd68f69b5ebeaeb020d2', class: 'unavailable-message' }, "Google Pay is not available for payments"))), showButton && (h(GooglePayButton, { key: '46ea586c90aaa5eb909af4f1dfcb873a7ac50069', "data-testid": 'gp-button', buttonType: this.buttonType, buttonStyle: this.buttonStyle, buttonSizeMode: this.buttonSizeMode, disabled: this.disabled, isProcessing: this.isProcessing, isAvailable: this.isAvailable, clickHandler: this.handleGooglePayClick }))), h("style", { key: '8f77166ec7d772f0c51c74cdb166f9e8ae295088' }, `
|
|
708
929
|
.google-pay-container {
|
|
709
930
|
width: 100%;
|
|
710
931
|
}
|
package/dist/module/package.js
CHANGED
|
@@ -48,7 +48,7 @@ export declare class GooglePayService implements IGooglePayService {
|
|
|
48
48
|
/**
|
|
49
49
|
* Create a basic payment data request
|
|
50
50
|
*/
|
|
51
|
-
static createPaymentDataRequest(amount: number, label: string, countryCode: string, currencyCode: string, merchantName: string): IGooglePayPaymentDataRequest;
|
|
51
|
+
static createPaymentDataRequest(amount: number, label: string, countryCode: string, currencyCode: string, merchantName: string, merchantId: string): IGooglePayPaymentDataRequest;
|
|
52
52
|
/**
|
|
53
53
|
* Get current configuration
|
|
54
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as a}from"./p-DwYM91AU.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import{I as t,a as s}from"./p-
|
|
1
|
+
import{r as e,h as a}from"./p-DwYM91AU.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import{I as t,a as s}from"./p-BrazW3nF.js";import"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{f as l,p,c as o}from"./p-DKGn-ILd.js";import{e as r,s as i,p as c}from"./p-wtuY7MT2.js";import{S as d}from"./p-BP2sTIQV.js";import"./p-CZfYo5-1.js";import"./p-BYsgavgS.js";import"./p-BS7OgSQe.js";import"./p-DkoufM1t.js";const m=class{constructor(a){e(this,a),this.setParamsOnChange=(e,a)=>{l[e]=a}}componentWillLoad(){Object.entries({status:this.checkoutStatus,payment_mode:this.paymentMode}).forEach((([e,a])=>{a&&(p[e]=a)}))}get checkoutStatusOptions(){return[{label:"All",value:""},{label:"Created",value:t.created},{label:"Completed",value:t.completed},{label:"Attempted",value:t.attempted},{label:"Expired",value:t.expired}]}get checkoutPaymentModeOptions(){return[{label:"All",value:""},{label:"E-commerce",value:s.ecom},{label:"BNPL",value:s.bnpl},{label:"Apple Pay",value:s.apple_pay}]}render(){const e=Object.assign({},l);return a(d,{key:"7b00989f26aeb4b692c05fed3f092dfc93395a83"},a("table-filters-menu",{key:"3766268ec3b3648d5a6449566926b728e72b91ea",params:e,clearParams:o,part:r},a("div",{key:"a544aeeeea57c32e9a302a50709694845c112857",class:"grid-cols-2 gap-3 p-1"},a("div",{key:"f57d563a6d2f45cd76d24fa2113a36e695948d13",class:"p-2"},a("form-control-select",{key:"c6b8cd450f4fc999e254ff280f56c1b835ba0cd3",name:"status",label:"Status",options:this.checkoutStatusOptions,inputHandler:this.setParamsOnChange,defaultValue:this.checkoutStatus||l.status||"",disabled:!!this.checkoutStatus,part:i})),a("div",{key:"b901a858e318065757bc195980d46d9021552ca4",class:"p-2"},a("form-control-select",{key:"1a5d90dbc5aaa4b69fc90fdcc6b88b97675d6e44",name:"payment_mode",label:"Payment Mode",options:this.checkoutPaymentModeOptions,inputHandler:this.setParamsOnChange,defaultValue:this.paymentMode||l.payment_mode||"",disabled:!!this.paymentMode,part:c})))))}};export{m as justifi_checkouts_list_filters}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e}from"./p-DwYM91AU.js";import{T as a,a as i,b as r,c as h,d as o,e as d,f as n,g as p,h as c,i as m,j as f,k as b,l as g}from"./p-BTzt8N0l.js";import{T as u}from"./p-CZfYo5-1.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-
|
|
1
|
+
import{r as t,c as s,h as e}from"./p-DwYM91AU.js";import{T as a,a as i,b as r,c as h,d as o,e as d,f as n,g as p,h as c,i as m,j as f,k as b,l as g}from"./p-BTzt8N0l.js";import{T as u}from"./p-CZfYo5-1.js";import"./p-tGDdRx0W.js";import"./p-HXpYMWUU.js";import"./p-Cjcsf8ku.js";import"./p-BrazW3nF.js";import{p as j}from"./p-CLHwhyvu.js";import"./p-B5rtFhtR.js";import"./p-BH0Xfn-F.js";import{t as l,a as k}from"./p-aZ8YkDMZ.js";import{o as y,g as O}from"./p-BUsqF4-J.js";import"./p-wtuY7MT2.js";import"./p-B-0a8Xqm.js";import"./p-BYsgavgS.js";import"./p-BS7OgSQe.js";import"./p-DkoufM1t.js";import"./p-DOLBAxYf.js";const w=class{constructor(e){t(this,e),this.clickEvent=s(this,"click-event"),this.errorEvent=s(this,"error-event"),this.terminalOrders=[],this.loading=!0,this.paging=j,this.pagingParams={},this.handleClickPrevious=t=>{this.pagingParams={before_cursor:t},this.clickEvent.emit({name:u.previous})},this.handleClickNext=t=>{this.pagingParams={after_cursor:t},this.clickEvent.emit({name:u.next})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;if(!s)return;const e=this.terminalOrders.find((t=>t.id===s));this.clickEvent.emit({name:u.row,data:e})}}updateOnPropChange(){this.fetchData()}componentWillLoad(){this.terminalOrdersTable=new a(this.terminalOrders,this.columns,l,k),this.getTerminalOrders&&this.fetchData(),y("set",(()=>{this.pagingParams={}})),y("reset",(()=>{this.pagingParams={},this.errorMessage=""}))}fetchData(){this.loading=!0,this.getTerminalOrders({params:this.terminalOrderParams,onSuccess:async({terminalOrders:t,pagingInfo:s})=>{this.terminalOrders=t,this.paging=s,this.terminalOrdersTable.collectionData=this.terminalOrders},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e})},final:()=>{this.loading=!1}})}get terminalOrderParams(){const t=O();return Object.assign(Object.assign({},t),this.pagingParams)}get entityId(){return this.terminalOrders.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalOrdersTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e(g,{key:"6d3a77b7aac03cad0f13586b44298b26a084b06f"},e(i,{key:"69d003438f02e693471b3526b226734b8dad54ce"},e(r,{key:"24ba93e9eded23d4ecaf7d1935309710cd5826a9"},e(h,{key:"b4b41b0617db386f76d1f720fb236229dffb64d2"},this.terminalOrdersTable.columnData.map((t=>t)))),e(o,{key:"52a8e8d5e9391b4393dc492d5f10002902dc2c69"},e(d,{key:"6e6110209d6295d5d2295e2043a4383c238ec85f",columnSpan:this.terminalOrdersTable.columnKeys.length,isLoading:this.loading}),e(n,{key:"079111a8e20e8a2f0807a8fbdeabb89b8df1982c",isEmpty:this.showEmptyState,columnSpan:this.terminalOrdersTable.columnKeys.length}),e(p,{key:"48d4545d97e20acaee32c95e5d74113b139f81d4",columnSpan:this.terminalOrdersTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalOrdersTable.rowData.map(((t,s)=>e(c,{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler},t)))),this.paging&&e(m,{key:"8a3de53e20022427a6b561e7ddcf16bdbc8db1ca"},e(f,{key:"28dfdbfb12ae0f47ce81f06267d1d1e046a4dc07"},e(b,{key:"160dabe28ed5d74ed063457916c748349245ae12",colSpan:this.terminalOrdersTable.columnData.length},e("pagination-menu",{key:"80108e4d09be795de2889ca7aea805a6bae9743a",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext})}))))))}static get watchers(){return{pagingParams:["updateOnPropChange"],getTerminalOrders:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{w as terminal_orders_list_core}
|