@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-DwYM91AU.js';
|
|
2
2
|
import { A as Api } from './Api-DX-IWyBw.js';
|
|
3
|
-
import { A as ApplePayConfig, o as ApplePayHelpers, p as ApplePayPaymentRequest, q as ApplePaySessionStatus, r as ApplePayButtonStyle, s as ApplePayButtonType, c as checkoutStore, t as ApplePayMerchantCapability, G as GooglePayConfig, u as GooglePayHelpers, v as GooglePayPaymentDataRequest, w as GooglePayButtonSizeMode, x as GooglePayButtonStyle, y as GooglePayButtonType, z as GooglePayEnvironment, B as onChange, D as onAnyChange, I as ICheckoutStatus, F as getAvailablePaymentMethodTypes, H as getCheckoutState } from './GooglePay-
|
|
3
|
+
import { A as ApplePayConfig, o as ApplePayHelpers, p as ApplePayPaymentRequest, q as ApplePaySessionStatus, r as ApplePayButtonStyle, s as ApplePayButtonType, c as checkoutStore, t as ApplePayMerchantCapability, G as GooglePayConfig, u as GooglePayHelpers, v as GooglePayPaymentDataRequest, w as GooglePayButtonSizeMode, x as GooglePayButtonStyle, y as GooglePayButtonType, z as GooglePayEnvironment, B as onChange, D as onAnyChange, I as ICheckoutStatus, F as getAvailablePaymentMethodTypes, H as getCheckoutState } from './GooglePay-f7mYX17c.js';
|
|
4
4
|
import { S as StyledHost } from './styled-host-DhOcKWqZ.js';
|
|
5
5
|
import './event-types-CZfYo5-1.js';
|
|
6
6
|
import { S as Skeleton } from './skeleton-BmRZRW5K.js';
|
|
@@ -10,7 +10,7 @@ import { P as PAYMENT_METHODS, a as PaymentMethod, b as PAYMENT_MODE } from './i
|
|
|
10
10
|
import { H as Header1 } from './header-1-CPF3S2CC.js';
|
|
11
11
|
import { H as Header2, b as insuranceValuesOn, h as hasInsuranceValueChanged, i as insuranceValues } from './insurance-state-DRe0g_wf.js';
|
|
12
12
|
import { H as Header3 } from './header-3-Cah707hu.js';
|
|
13
|
-
import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-
|
|
13
|
+
import { J as JustifiAnalytics, c as checkPkgVersion } from './check-pkg-version-Cqb7EhvC.js';
|
|
14
14
|
import './config-state-C2NXATwF.js';
|
|
15
15
|
import './dinero-HXpYMWUU.js';
|
|
16
16
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes, b as ComponentErrorMessages } from './ComponentError-Cjcsf8ku.js';
|
|
@@ -18,10 +18,10 @@ import './Pagination-CLHwhyvu.js';
|
|
|
18
18
|
import './Business-B5rtFhtR.js';
|
|
19
19
|
import './Dispute-BH0Xfn-F.js';
|
|
20
20
|
import { g as getErrorCode, a as getErrorMessage } from './utils-BeQLScSm.js';
|
|
21
|
-
import { C as CheckoutService } from './checkout.service-
|
|
21
|
+
import { C as CheckoutService } from './checkout.service-BWdnJLVG.js';
|
|
22
22
|
import { C as CardBrandLabels } from './payment-method-option-utils-lUHAQVFl.js';
|
|
23
23
|
import './index-B-fWxE5e.js';
|
|
24
|
-
import './package-
|
|
24
|
+
import './package-CzedYX3W.js';
|
|
25
25
|
|
|
26
26
|
// Centralized error codes for Apple Pay service
|
|
27
27
|
var ApplePayServiceErrorCode;
|
|
@@ -715,22 +715,44 @@ class GooglePayService {
|
|
|
715
715
|
* Initialize Google Pay configuration
|
|
716
716
|
*/
|
|
717
717
|
initialize(googlePayConfig) {
|
|
718
|
+
console.log('[GooglePayService] initialize: Starting initialization', {
|
|
719
|
+
config: googlePayConfig,
|
|
720
|
+
});
|
|
718
721
|
this.googlePayConfig = new GooglePayConfig(googlePayConfig);
|
|
722
|
+
console.log('[GooglePayService] initialize: Config object created', {
|
|
723
|
+
isValid: this.googlePayConfig.isValid,
|
|
724
|
+
environment: this.googlePayConfig.environment,
|
|
725
|
+
merchantId: this.googlePayConfig.merchantId,
|
|
726
|
+
});
|
|
719
727
|
if (!this.googlePayConfig.isValid) {
|
|
728
|
+
console.error('[GooglePayService] initialize: Invalid configuration');
|
|
720
729
|
throw new Error('Invalid Google Pay configuration provided');
|
|
721
730
|
}
|
|
722
731
|
// Create Google Pay client
|
|
732
|
+
console.log('[GooglePayService] initialize: Creating Google Pay client', {
|
|
733
|
+
environment: this.googlePayConfig.environment,
|
|
734
|
+
});
|
|
723
735
|
this.googlePayClient = GooglePayHelpers.createGooglePayClient(this.googlePayConfig.environment);
|
|
724
736
|
if (!this.googlePayClient) {
|
|
737
|
+
console.error('[GooglePayService] initialize: Failed to create client');
|
|
725
738
|
throw new Error('Failed to create Google Pay client');
|
|
726
739
|
}
|
|
727
|
-
|
|
740
|
+
console.log('[GooglePayService] initialize: Client created successfully', {
|
|
741
|
+
hasClient: !!this.googlePayClient,
|
|
742
|
+
});
|
|
728
743
|
}
|
|
729
744
|
/**
|
|
730
745
|
* Process Google Pay payment via API
|
|
731
746
|
*/
|
|
732
747
|
async processPayment(authToken, accountId, payload) {
|
|
748
|
+
var _a;
|
|
733
749
|
const endpoint = PROCESS_TOKEN_ENDPOINT;
|
|
750
|
+
console.log('[GooglePayService] processPayment: Starting', {
|
|
751
|
+
endpoint,
|
|
752
|
+
hasAuthToken: !!authToken,
|
|
753
|
+
accountId,
|
|
754
|
+
payload,
|
|
755
|
+
});
|
|
734
756
|
try {
|
|
735
757
|
const result = await this.api.post({
|
|
736
758
|
endpoint,
|
|
@@ -740,12 +762,20 @@ class GooglePayService {
|
|
|
740
762
|
'sub-account': accountId,
|
|
741
763
|
},
|
|
742
764
|
});
|
|
765
|
+
console.log('[GooglePayService] processPayment: API response received', {
|
|
766
|
+
hasId: !!result.id,
|
|
767
|
+
hasToken: !!((_a = result.data) === null || _a === void 0 ? void 0 : _a.token),
|
|
768
|
+
result,
|
|
769
|
+
});
|
|
770
|
+
const success = result.id && !!result.data.token;
|
|
771
|
+
console.log('[GooglePayService] processPayment: Result', { success });
|
|
743
772
|
return {
|
|
744
|
-
success
|
|
773
|
+
success,
|
|
745
774
|
data: result,
|
|
746
775
|
};
|
|
747
776
|
}
|
|
748
|
-
catch (
|
|
777
|
+
catch (error) {
|
|
778
|
+
console.error('[GooglePayService] processPayment: API error', error);
|
|
749
779
|
throw new Error('Google Pay payment processing failed');
|
|
750
780
|
}
|
|
751
781
|
}
|
|
@@ -753,21 +783,42 @@ class GooglePayService {
|
|
|
753
783
|
* Check if Google Pay is available on this device/browser
|
|
754
784
|
*/
|
|
755
785
|
isAvailable() {
|
|
756
|
-
|
|
786
|
+
const isSupported = GooglePayHelpers.isGooglePaySupported();
|
|
787
|
+
const hasClient = !!this.googlePayClient;
|
|
788
|
+
const result = isSupported && hasClient;
|
|
789
|
+
console.log('[GooglePayService] isAvailable:', {
|
|
790
|
+
isSupported,
|
|
791
|
+
hasClient,
|
|
792
|
+
result,
|
|
793
|
+
});
|
|
794
|
+
return result;
|
|
757
795
|
}
|
|
758
796
|
/**
|
|
759
797
|
* Check if the user can make payments with Google Pay
|
|
760
798
|
*/
|
|
761
799
|
async canMakePayments() {
|
|
800
|
+
console.log('[GooglePayService] canMakePayments: Checking', {
|
|
801
|
+
hasClient: !!this.googlePayClient,
|
|
802
|
+
hasConfig: !!this.googlePayConfig,
|
|
803
|
+
});
|
|
762
804
|
if (!this.googlePayClient || !this.googlePayConfig) {
|
|
805
|
+
console.warn('[GooglePayService] canMakePayments: Missing client or config');
|
|
763
806
|
return false;
|
|
764
807
|
}
|
|
765
808
|
try {
|
|
766
809
|
const baseRequest = GooglePayHelpers.createBasePaymentDataRequest();
|
|
810
|
+
console.log('[GooglePayService] canMakePayments: Calling isReadyToPay', {
|
|
811
|
+
baseRequest,
|
|
812
|
+
});
|
|
767
813
|
const response = await this.googlePayClient.isReadyToPay(baseRequest);
|
|
814
|
+
console.log('[GooglePayService] canMakePayments: Response received', {
|
|
815
|
+
result: response.result,
|
|
816
|
+
response,
|
|
817
|
+
});
|
|
768
818
|
return response.result;
|
|
769
819
|
}
|
|
770
|
-
catch (
|
|
820
|
+
catch (error) {
|
|
821
|
+
console.error('[GooglePayService] canMakePayments: Error', error);
|
|
771
822
|
return false;
|
|
772
823
|
}
|
|
773
824
|
}
|
|
@@ -776,27 +827,53 @@ class GooglePayService {
|
|
|
776
827
|
*/
|
|
777
828
|
async startPaymentSession(paymentDataRequest, authToken, accountId) {
|
|
778
829
|
var _a;
|
|
830
|
+
console.log('[GooglePayService] startPaymentSession: Starting', {
|
|
831
|
+
hasConfig: !!this.googlePayConfig,
|
|
832
|
+
hasClient: !!this.googlePayClient,
|
|
833
|
+
hasAuthToken: !!authToken,
|
|
834
|
+
accountId,
|
|
835
|
+
paymentDataRequest,
|
|
836
|
+
});
|
|
779
837
|
if (!this.googlePayConfig || !this.googlePayClient) {
|
|
838
|
+
console.error('[GooglePayService] startPaymentSession: Not initialized');
|
|
780
839
|
throw new Error('Google Pay not initialized. Call initialize() first.');
|
|
781
840
|
}
|
|
782
841
|
if (!this.isAvailable()) {
|
|
842
|
+
console.error('[GooglePayService] startPaymentSession: Not available');
|
|
783
843
|
throw new Error('Google Pay is not available on this device/browser');
|
|
784
844
|
}
|
|
785
845
|
const request = new GooglePayPaymentDataRequest(paymentDataRequest);
|
|
846
|
+
console.log('[GooglePayService] startPaymentSession: Request object created', {
|
|
847
|
+
isValid: request.isValid,
|
|
848
|
+
request,
|
|
849
|
+
});
|
|
786
850
|
if (!request.isValid) {
|
|
851
|
+
console.error('[GooglePayService] startPaymentSession: Invalid request');
|
|
787
852
|
throw new Error('Invalid payment data request provided');
|
|
788
853
|
}
|
|
789
854
|
try {
|
|
855
|
+
console.log('[GooglePayService] startPaymentSession: Loading payment data...');
|
|
790
856
|
const paymentData = await this.googlePayClient.loadPaymentData(request);
|
|
857
|
+
console.log('[GooglePayService] startPaymentSession: Payment data loaded', {
|
|
858
|
+
hasPaymentData: !!paymentData,
|
|
859
|
+
paymentMethodData: paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentMethodData,
|
|
860
|
+
});
|
|
791
861
|
// Build top-level snake_case fields from Google Pay tokenizationData
|
|
792
862
|
const tokenizationData = (_a = paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentMethodData) === null || _a === void 0 ? void 0 : _a.tokenizationData;
|
|
863
|
+
console.log('[GooglePayService] startPaymentSession: Extracted tokenization data', {
|
|
864
|
+
hasTokenizationData: !!tokenizationData,
|
|
865
|
+
tokenizationData,
|
|
866
|
+
});
|
|
793
867
|
const tokenObj = (() => {
|
|
794
868
|
if ((tokenizationData === null || tokenizationData === void 0 ? void 0 : tokenizationData.token) &&
|
|
795
869
|
typeof tokenizationData.token === 'string') {
|
|
796
870
|
try {
|
|
797
|
-
|
|
871
|
+
const parsed = JSON.parse(tokenizationData.token);
|
|
872
|
+
console.log('[GooglePayService] startPaymentSession: Parsed token', parsed);
|
|
873
|
+
return parsed;
|
|
798
874
|
}
|
|
799
875
|
catch (_e) {
|
|
876
|
+
console.warn('[GooglePayService] startPaymentSession: Failed to parse token, using raw', _e);
|
|
800
877
|
return tokenizationData;
|
|
801
878
|
}
|
|
802
879
|
}
|
|
@@ -813,8 +890,19 @@ class GooglePayService {
|
|
|
813
890
|
: undefined,
|
|
814
891
|
signedMessage: tokenObj === null || tokenObj === void 0 ? void 0 : tokenObj.signedMessage,
|
|
815
892
|
};
|
|
893
|
+
console.log('[GooglePayService] startPaymentSession: Token process request created', {
|
|
894
|
+
hasProtocolVersion: !!tokenProcessRequest.protocolVersion,
|
|
895
|
+
hasSignature: !!tokenProcessRequest.signature,
|
|
896
|
+
hasSignedMessage: !!tokenProcessRequest.signedMessage,
|
|
897
|
+
hasIntermediateSigningKey: !!tokenProcessRequest.intermediateSigningKey,
|
|
898
|
+
});
|
|
899
|
+
console.log('[GooglePayService] startPaymentSession: Processing payment...');
|
|
816
900
|
const paymentResult = await this.processPayment(authToken, accountId, tokenProcessRequest);
|
|
901
|
+
console.log('[GooglePayService] startPaymentSession: Payment processed', paymentResult);
|
|
817
902
|
if (paymentResult.success) {
|
|
903
|
+
console.log('[GooglePayService] startPaymentSession: Payment successful', {
|
|
904
|
+
paymentMethodId: paymentResult.data.id,
|
|
905
|
+
});
|
|
818
906
|
return {
|
|
819
907
|
success: true,
|
|
820
908
|
paymentData: paymentData,
|
|
@@ -822,6 +910,7 @@ class GooglePayService {
|
|
|
822
910
|
};
|
|
823
911
|
}
|
|
824
912
|
else {
|
|
913
|
+
console.error('[GooglePayService] startPaymentSession: Payment processing failed');
|
|
825
914
|
return {
|
|
826
915
|
success: false,
|
|
827
916
|
error: {
|
|
@@ -832,11 +921,17 @@ class GooglePayService {
|
|
|
832
921
|
}
|
|
833
922
|
}
|
|
834
923
|
catch (error) {
|
|
924
|
+
console.error('[GooglePayService] startPaymentSession: Exception caught', error);
|
|
835
925
|
// Handle different types of errors
|
|
836
926
|
if (error && typeof error === 'object' && 'statusCode' in error) {
|
|
837
927
|
const googlePayError = error;
|
|
928
|
+
console.log('[GooglePayService] startPaymentSession: Google Pay error', {
|
|
929
|
+
statusCode: googlePayError.statusCode,
|
|
930
|
+
statusMessage: googlePayError.statusMessage,
|
|
931
|
+
});
|
|
838
932
|
switch (googlePayError.statusCode) {
|
|
839
933
|
case 'CANCELED':
|
|
934
|
+
console.log('[GooglePayService] startPaymentSession: User cancelled');
|
|
840
935
|
return {
|
|
841
936
|
success: false,
|
|
842
937
|
error: {
|
|
@@ -845,6 +940,7 @@ class GooglePayService {
|
|
|
845
940
|
},
|
|
846
941
|
};
|
|
847
942
|
case 'DEVELOPER_ERROR':
|
|
943
|
+
console.error('[GooglePayService] startPaymentSession: Developer error');
|
|
848
944
|
return {
|
|
849
945
|
success: false,
|
|
850
946
|
error: {
|
|
@@ -853,6 +949,9 @@ class GooglePayService {
|
|
|
853
949
|
},
|
|
854
950
|
};
|
|
855
951
|
default:
|
|
952
|
+
console.error('[GooglePayService] startPaymentSession: Unknown error', {
|
|
953
|
+
statusCode: googlePayError.statusCode,
|
|
954
|
+
});
|
|
856
955
|
return {
|
|
857
956
|
success: false,
|
|
858
957
|
error: {
|
|
@@ -862,6 +961,7 @@ class GooglePayService {
|
|
|
862
961
|
};
|
|
863
962
|
}
|
|
864
963
|
}
|
|
964
|
+
console.error('[GooglePayService] startPaymentSession: Generic error', error);
|
|
865
965
|
return {
|
|
866
966
|
success: false,
|
|
867
967
|
error: {
|
|
@@ -897,22 +997,43 @@ class GooglePayService {
|
|
|
897
997
|
* Prefetch payment data for faster loading
|
|
898
998
|
*/
|
|
899
999
|
prefetchPaymentData(paymentDataRequest) {
|
|
1000
|
+
console.log('[GooglePayService] prefetchPaymentData: Starting', {
|
|
1001
|
+
hasClient: !!this.googlePayClient,
|
|
1002
|
+
paymentDataRequest,
|
|
1003
|
+
});
|
|
900
1004
|
if (!this.googlePayClient) {
|
|
1005
|
+
console.warn('[GooglePayService] prefetchPaymentData: No client available');
|
|
901
1006
|
return;
|
|
902
1007
|
}
|
|
903
1008
|
const request = new GooglePayPaymentDataRequest(paymentDataRequest);
|
|
1009
|
+
console.log('[GooglePayService] prefetchPaymentData: Request created', {
|
|
1010
|
+
isValid: request.isValid,
|
|
1011
|
+
});
|
|
904
1012
|
if (!request.isValid) {
|
|
1013
|
+
console.warn('[GooglePayService] prefetchPaymentData: Invalid request');
|
|
905
1014
|
return;
|
|
906
1015
|
}
|
|
907
1016
|
try {
|
|
1017
|
+
console.log('[GooglePayService] prefetchPaymentData: Calling prefetchPaymentData');
|
|
908
1018
|
this.googlePayClient.prefetchPaymentData(request);
|
|
1019
|
+
console.log('[GooglePayService] prefetchPaymentData: Prefetch complete');
|
|
1020
|
+
}
|
|
1021
|
+
catch (error) {
|
|
1022
|
+
console.error('[GooglePayService] prefetchPaymentData: Error', error);
|
|
909
1023
|
}
|
|
910
|
-
catch (_error) { }
|
|
911
1024
|
}
|
|
912
1025
|
/**
|
|
913
1026
|
* Create a basic payment data request
|
|
914
1027
|
*/
|
|
915
|
-
static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName) {
|
|
1028
|
+
static createPaymentDataRequest(amount, label, countryCode = 'US', currencyCode = 'USD', merchantName, merchantId) {
|
|
1029
|
+
var _a;
|
|
1030
|
+
console.log('[GooglePayService] createPaymentDataRequest: Creating request', {
|
|
1031
|
+
amount,
|
|
1032
|
+
label,
|
|
1033
|
+
countryCode,
|
|
1034
|
+
currencyCode,
|
|
1035
|
+
merchantName,
|
|
1036
|
+
});
|
|
916
1037
|
const request = {
|
|
917
1038
|
apiVersion: 2,
|
|
918
1039
|
apiVersionMinor: 0,
|
|
@@ -925,10 +1046,17 @@ class GooglePayService {
|
|
|
925
1046
|
totalPriceLabel: label,
|
|
926
1047
|
},
|
|
927
1048
|
merchantInfo: {
|
|
1049
|
+
merchantId,
|
|
928
1050
|
merchantName,
|
|
929
1051
|
},
|
|
930
1052
|
};
|
|
931
|
-
|
|
1053
|
+
console.log('[GooglePayService] createPaymentDataRequest: Request created', {
|
|
1054
|
+
apiVersion: request.apiVersion,
|
|
1055
|
+
apiVersionMinor: request.apiVersionMinor,
|
|
1056
|
+
transactionInfo: request.transactionInfo,
|
|
1057
|
+
merchantInfo: request.merchantInfo,
|
|
1058
|
+
allowedPaymentMethodsCount: (_a = request.allowedPaymentMethods) === null || _a === void 0 ? void 0 : _a.length,
|
|
1059
|
+
});
|
|
932
1060
|
return request;
|
|
933
1061
|
}
|
|
934
1062
|
/**
|
|
@@ -1030,7 +1158,7 @@ const GooglePayButton = (props) => {
|
|
|
1030
1158
|
props.clickHandler();
|
|
1031
1159
|
}
|
|
1032
1160
|
};
|
|
1033
|
-
return (h("div", { class:
|
|
1161
|
+
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, `
|
|
1034
1162
|
.google-pay-button-container {
|
|
1035
1163
|
display: block;
|
|
1036
1164
|
position: relative;
|
|
@@ -1043,7 +1171,6 @@ const GooglePayButton = (props) => {
|
|
|
1043
1171
|
border: none;
|
|
1044
1172
|
border-radius: 4px;
|
|
1045
1173
|
cursor: pointer;
|
|
1046
|
-
font-family: 'Google Sans', arial, sans-serif;
|
|
1047
1174
|
font-size: 14px;
|
|
1048
1175
|
font-weight: 500;
|
|
1049
1176
|
letter-spacing: 0.25px;
|
|
@@ -1051,7 +1178,6 @@ const GooglePayButton = (props) => {
|
|
|
1051
1178
|
outline: none;
|
|
1052
1179
|
padding: 0 20px;
|
|
1053
1180
|
position: relative;
|
|
1054
|
-
transition: box-shadow 0.2s ease;
|
|
1055
1181
|
min-width: 140px;
|
|
1056
1182
|
min-height: 48px;
|
|
1057
1183
|
}
|
|
@@ -1060,13 +1186,11 @@ const GooglePayButton = (props) => {
|
|
|
1060
1186
|
.google-pay-button.google-pay-button-black {
|
|
1061
1187
|
background-color: #000;
|
|
1062
1188
|
color: #fff;
|
|
1063
|
-
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
|
|
1064
1189
|
}
|
|
1065
1190
|
|
|
1066
1191
|
.google-pay-button.google-pay-button-white {
|
|
1067
1192
|
background-color: #fff;
|
|
1068
1193
|
color: #3c4043;
|
|
1069
|
-
box-shadow: 0 1px 1px 0 rgba(60, 64, 67, 0.30), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
|
|
1070
1194
|
}
|
|
1071
1195
|
|
|
1072
1196
|
/* Button content */
|
|
@@ -1230,19 +1354,42 @@ const GooglePay = class {
|
|
|
1230
1354
|
this.showSkeleton = true;
|
|
1231
1355
|
this.handleGooglePayClick = async () => {
|
|
1232
1356
|
var _a;
|
|
1357
|
+
console.log('[GooglePay] handleGooglePayClick: Button clicked', {
|
|
1358
|
+
isProcessing: this.isProcessing,
|
|
1359
|
+
disabled: this.disabled,
|
|
1360
|
+
isAvailable: this.isAvailable,
|
|
1361
|
+
canMakePayments: this.canMakePayments,
|
|
1362
|
+
});
|
|
1233
1363
|
if (this.isProcessing ||
|
|
1234
1364
|
this.disabled ||
|
|
1235
1365
|
!this.isAvailable ||
|
|
1236
1366
|
!this.canMakePayments) {
|
|
1367
|
+
console.warn('[GooglePay] handleGooglePayClick: Payment blocked', {
|
|
1368
|
+
reason: this.isProcessing ? 'isProcessing' :
|
|
1369
|
+
this.disabled ? 'disabled' :
|
|
1370
|
+
!this.isAvailable ? 'notAvailable' :
|
|
1371
|
+
!this.canMakePayments ? 'cannotMakePayments' : 'unknown',
|
|
1372
|
+
});
|
|
1237
1373
|
return;
|
|
1238
1374
|
}
|
|
1239
1375
|
try {
|
|
1376
|
+
console.log('[GooglePay] handleGooglePayClick: Starting payment session');
|
|
1240
1377
|
this.isProcessing = true;
|
|
1241
1378
|
this.error = null;
|
|
1242
1379
|
this.googlePayStarted.emit();
|
|
1380
|
+
console.log('[GooglePay] handleGooglePayClick: googlePayStarted event emitted');
|
|
1243
1381
|
const paymentDataRequest = this.createPaymentDataRequest();
|
|
1382
|
+
console.log('[GooglePay] handleGooglePayClick: Starting payment session with service', {
|
|
1383
|
+
hasAuthToken: !!checkoutStore.authToken,
|
|
1384
|
+
accountId: checkoutStore.accountId,
|
|
1385
|
+
});
|
|
1244
1386
|
const result = await this.googlePayService.startPaymentSession(paymentDataRequest, checkoutStore.authToken, checkoutStore.accountId);
|
|
1387
|
+
console.log('[GooglePay] handleGooglePayClick: Payment session result', result);
|
|
1245
1388
|
if (result.success) {
|
|
1389
|
+
console.log('[GooglePay] handleGooglePayClick: Payment successful', {
|
|
1390
|
+
paymentMethodId: result.paymentMethodId,
|
|
1391
|
+
hasPaymentData: !!result.paymentData,
|
|
1392
|
+
});
|
|
1246
1393
|
this.googlePayCompleted.emit({
|
|
1247
1394
|
success: true,
|
|
1248
1395
|
paymentData: result.paymentData,
|
|
@@ -1250,16 +1397,21 @@ const GooglePay = class {
|
|
|
1250
1397
|
});
|
|
1251
1398
|
}
|
|
1252
1399
|
else {
|
|
1400
|
+
console.error('[GooglePay] handleGooglePayClick: Payment failed', {
|
|
1401
|
+
error: result.error,
|
|
1402
|
+
});
|
|
1253
1403
|
this.googlePayCompleted.emit({
|
|
1254
1404
|
success: false,
|
|
1255
1405
|
error: result.error,
|
|
1256
1406
|
});
|
|
1257
1407
|
if (((_a = result.error) === null || _a === void 0 ? void 0 : _a.code) === "USER_CANCELLED") {
|
|
1408
|
+
console.log('[GooglePay] handleGooglePayClick: User cancelled payment');
|
|
1258
1409
|
this.googlePayCancelled.emit();
|
|
1259
1410
|
}
|
|
1260
1411
|
}
|
|
1261
1412
|
}
|
|
1262
1413
|
catch (error) {
|
|
1414
|
+
console.error('[GooglePay] handleGooglePayClick: Exception during payment', error);
|
|
1263
1415
|
const errorMessage = error instanceof Error ? error.message : "Payment failed";
|
|
1264
1416
|
this.error = errorMessage;
|
|
1265
1417
|
this.googlePayCompleted.emit({
|
|
@@ -1269,27 +1421,48 @@ const GooglePay = class {
|
|
|
1269
1421
|
}
|
|
1270
1422
|
finally {
|
|
1271
1423
|
this.isProcessing = false;
|
|
1424
|
+
console.log('[GooglePay] handleGooglePayClick: Payment flow complete', {
|
|
1425
|
+
isProcessing: this.isProcessing,
|
|
1426
|
+
error: this.error,
|
|
1427
|
+
});
|
|
1272
1428
|
}
|
|
1273
1429
|
};
|
|
1274
1430
|
}
|
|
1275
1431
|
watchConfigChange() {
|
|
1432
|
+
console.log('[GooglePay] watchConfigChange: Configuration changed', {
|
|
1433
|
+
merchantId: this.merchantId,
|
|
1434
|
+
environment: this.environment,
|
|
1435
|
+
});
|
|
1276
1436
|
this.initializeGooglePay();
|
|
1277
1437
|
}
|
|
1278
1438
|
componentWillLoad() {
|
|
1439
|
+
console.log('[GooglePay] componentWillLoad: Initializing GooglePayService');
|
|
1279
1440
|
this.googlePayService = new GooglePayService();
|
|
1441
|
+
console.log('[GooglePay] componentWillLoad: GooglePayService created', {
|
|
1442
|
+
service: this.googlePayService,
|
|
1443
|
+
});
|
|
1280
1444
|
}
|
|
1281
1445
|
componentDidLoad() {
|
|
1446
|
+
console.log('[GooglePay] componentDidLoad: Setting up store subscriptions', {
|
|
1447
|
+
checkoutLoaded: checkoutStore.checkoutLoaded,
|
|
1448
|
+
paymentAmount: checkoutStore.paymentAmount,
|
|
1449
|
+
paymentCurrency: checkoutStore.paymentCurrency,
|
|
1450
|
+
paymentDescription: checkoutStore.paymentDescription,
|
|
1451
|
+
});
|
|
1282
1452
|
const unsub = onChange("paymentAmount", () => {
|
|
1453
|
+
console.log('[GooglePay] paymentAmount changed:', checkoutStore.paymentAmount);
|
|
1283
1454
|
this.prefetchPaymentData();
|
|
1284
1455
|
});
|
|
1285
1456
|
if (typeof unsub === 'function')
|
|
1286
1457
|
this.unsubscribes.push(unsub);
|
|
1287
1458
|
const unsubCurrency = onChange("paymentCurrency", () => {
|
|
1459
|
+
console.log('[GooglePay] paymentCurrency changed:', checkoutStore.paymentCurrency);
|
|
1288
1460
|
this.prefetchPaymentData();
|
|
1289
1461
|
});
|
|
1290
1462
|
if (typeof unsubCurrency === 'function')
|
|
1291
1463
|
this.unsubscribes.push(unsubCurrency);
|
|
1292
1464
|
const unsubDesc = onChange("paymentDescription", () => {
|
|
1465
|
+
console.log('[GooglePay] paymentDescription changed:', checkoutStore.paymentDescription);
|
|
1293
1466
|
this.prefetchPaymentData();
|
|
1294
1467
|
});
|
|
1295
1468
|
if (typeof unsubDesc === 'function')
|
|
@@ -1338,17 +1511,31 @@ const GooglePay = class {
|
|
|
1338
1511
|
* Prefetch payment data for faster load times of the Google Pay sheet.
|
|
1339
1512
|
*/
|
|
1340
1513
|
async prefetchPaymentData() {
|
|
1514
|
+
console.log('[GooglePay] prefetchPaymentData: Called', {
|
|
1515
|
+
isAvailable: this.isAvailable,
|
|
1516
|
+
canMakePayments: this.canMakePayments,
|
|
1517
|
+
});
|
|
1341
1518
|
if (!this.isAvailable || !this.canMakePayments) {
|
|
1519
|
+
console.warn('[GooglePay] prefetchPaymentData: Skipped - not available or cannot make payments');
|
|
1342
1520
|
return;
|
|
1343
1521
|
}
|
|
1344
1522
|
const paymentDataRequest = this.createPaymentDataRequest();
|
|
1523
|
+
console.log('[GooglePay] prefetchPaymentData: Prefetching', { paymentDataRequest });
|
|
1345
1524
|
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
1525
|
+
console.log('[GooglePay] prefetchPaymentData: Prefetch complete');
|
|
1346
1526
|
}
|
|
1347
1527
|
async initializeGooglePay() {
|
|
1528
|
+
console.log('[GooglePay] initializeGooglePay: Starting initialization');
|
|
1348
1529
|
try {
|
|
1349
1530
|
this.isLoading = true;
|
|
1350
1531
|
this.error = null;
|
|
1532
|
+
console.log('[GooglePay] initializeGooglePay: Checking payment amount', {
|
|
1533
|
+
paymentAmount: checkoutStore.paymentAmount,
|
|
1534
|
+
paymentCurrency: checkoutStore.paymentCurrency,
|
|
1535
|
+
paymentDescription: checkoutStore.paymentDescription,
|
|
1536
|
+
});
|
|
1351
1537
|
if (!checkoutStore.paymentAmount) {
|
|
1538
|
+
console.error('[GooglePay] initializeGooglePay: Missing payment amount');
|
|
1352
1539
|
this.error = "Missing required Google Pay configuration";
|
|
1353
1540
|
this.isLoading = false;
|
|
1354
1541
|
return;
|
|
@@ -1361,23 +1548,39 @@ const GooglePay = class {
|
|
|
1361
1548
|
buttonStyle: this.buttonStyle,
|
|
1362
1549
|
buttonSizeMode: this.buttonSizeMode,
|
|
1363
1550
|
};
|
|
1551
|
+
console.log('[GooglePay] initializeGooglePay: Config created', googlePayConfig);
|
|
1364
1552
|
this.googlePayService.initialize(googlePayConfig);
|
|
1553
|
+
console.log('[GooglePay] initializeGooglePay: Service initialized');
|
|
1365
1554
|
this.isAvailable = this.googlePayService.isAvailable();
|
|
1555
|
+
console.log('[GooglePay] initializeGooglePay: Availability check', {
|
|
1556
|
+
isAvailable: this.isAvailable,
|
|
1557
|
+
});
|
|
1366
1558
|
if (!this.isAvailable) {
|
|
1559
|
+
console.warn('[GooglePay] initializeGooglePay: Google Pay not available on device');
|
|
1367
1560
|
this.error = "Google Pay is not supported on this device";
|
|
1368
1561
|
this.isLoading = false;
|
|
1369
1562
|
return;
|
|
1370
1563
|
}
|
|
1564
|
+
console.log('[GooglePay] initializeGooglePay: Checking canMakePayments...');
|
|
1371
1565
|
this.canMakePayments = await this.googlePayService.canMakePayments();
|
|
1566
|
+
console.log('[GooglePay] initializeGooglePay: canMakePayments result', {
|
|
1567
|
+
canMakePayments: this.canMakePayments,
|
|
1568
|
+
});
|
|
1372
1569
|
if (!this.canMakePayments) {
|
|
1570
|
+
console.warn('[GooglePay] initializeGooglePay: Cannot make payments');
|
|
1373
1571
|
this.error = "Google Pay is not available for payments";
|
|
1374
1572
|
this.isLoading = false;
|
|
1375
1573
|
return;
|
|
1376
1574
|
}
|
|
1377
1575
|
const paymentDataRequest = this.createPaymentDataRequest();
|
|
1576
|
+
console.log('[GooglePay] initializeGooglePay: Prefetching payment data', {
|
|
1577
|
+
paymentDataRequest,
|
|
1578
|
+
});
|
|
1378
1579
|
this.googlePayService.prefetchPaymentData(paymentDataRequest);
|
|
1580
|
+
console.log('[GooglePay] initializeGooglePay: Initialization complete');
|
|
1379
1581
|
}
|
|
1380
1582
|
catch (error) {
|
|
1583
|
+
console.error('[GooglePay] initializeGooglePay: Error during initialization', error);
|
|
1381
1584
|
this.error =
|
|
1382
1585
|
error instanceof Error
|
|
1383
1586
|
? error.message
|
|
@@ -1385,19 +1588,37 @@ const GooglePay = class {
|
|
|
1385
1588
|
}
|
|
1386
1589
|
finally {
|
|
1387
1590
|
this.isLoading = false;
|
|
1591
|
+
console.log('[GooglePay] initializeGooglePay: Final state', {
|
|
1592
|
+
isLoading: this.isLoading,
|
|
1593
|
+
isAvailable: this.isAvailable,
|
|
1594
|
+
canMakePayments: this.canMakePayments,
|
|
1595
|
+
error: this.error,
|
|
1596
|
+
});
|
|
1388
1597
|
}
|
|
1389
1598
|
}
|
|
1390
1599
|
createPaymentDataRequest() {
|
|
1391
|
-
|
|
1600
|
+
const request = GooglePayService.createPaymentDataRequest(checkoutStore.paymentAmount, checkoutStore.paymentDescription, this.countryCode, checkoutStore.paymentCurrency, this.merchantName, this.merchantId);
|
|
1601
|
+
console.log('[GooglePay] createPaymentDataRequest: Created request', {
|
|
1602
|
+
amount: checkoutStore.paymentAmount,
|
|
1603
|
+
currency: checkoutStore.paymentCurrency,
|
|
1604
|
+
description: checkoutStore.paymentDescription,
|
|
1605
|
+
countryCode: this.countryCode,
|
|
1606
|
+
merchantName: this.merchantName,
|
|
1607
|
+
request,
|
|
1608
|
+
});
|
|
1609
|
+
return request;
|
|
1392
1610
|
}
|
|
1393
1611
|
render() {
|
|
1394
1612
|
const showError = !this.isLoading && !!this.error;
|
|
1395
1613
|
const showDeviceUnavailable = !this.isLoading && !this.error && !this.isAvailable;
|
|
1396
1614
|
const showPaymentsUnavailable = !this.isLoading && !this.error && this.isAvailable && !this.canMakePayments;
|
|
1397
1615
|
const showButton = !this.isLoading && !this.error && this.isAvailable && this.canMakePayments;
|
|
1398
|
-
return (h(StyledHost, { key: '
|
|
1616
|
+
return (h(StyledHost, { key: 'cf4dcfa14dd83683c0d6e811ea464968c38f38d6' }, checkoutStore.checkoutLoaded && (h("script", { key: 'e942fe8e2eb80ee0d2119e864c62d89a79d9d12a', async: true, src: 'https://pay.google.com/gp/p/js/pay.js', onLoad: () => {
|
|
1617
|
+
console.log('[GooglePay] Script loaded: Google Pay JS library loaded successfully');
|
|
1399
1618
|
this.initializeGooglePay();
|
|
1400
|
-
}
|
|
1619
|
+
}, onError: (e) => {
|
|
1620
|
+
console.error('[GooglePay] Script error: Failed to load Google Pay JS library', e);
|
|
1621
|
+
} })), 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' }, `
|
|
1401
1622
|
.google-pay-container {
|
|
1402
1623
|
width: 100%;
|
|
1403
1624
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-DwYM91AU.js';
|
|
2
2
|
import { E as ErrorState } from './utils-BX7Rjm1M.js';
|
|
3
|
-
import { B as BusinessService } from './business.service-
|
|
3
|
+
import { B as BusinessService } from './business.service-CzHfftZk.js';
|
|
4
4
|
import { m as makeGetBusiness } from './get-business-Xt7B5dSo.js';
|
|
5
5
|
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './ComponentError-Cjcsf8ku.js';
|
|
6
|
-
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-
|
|
6
|
+
import { c as checkPkgVersion, J as JustifiAnalytics } from './check-pkg-version-Cqb7EhvC.js';
|
|
7
7
|
import './parts-wtuY7MT2.js';
|
|
8
8
|
import './Api-DX-IWyBw.js';
|
|
9
9
|
import './config-state-C2NXATwF.js';
|
|
10
10
|
import './index-B-fWxE5e.js';
|
|
11
11
|
import './utils-CIaHqjQt.js';
|
|
12
12
|
import './dinero-HXpYMWUU.js';
|
|
13
|
-
import './GooglePay-
|
|
13
|
+
import './GooglePay-f7mYX17c.js';
|
|
14
14
|
import './Dispute-BH0Xfn-F.js';
|
|
15
15
|
import './index-DkoufM1t.js';
|
|
16
16
|
import './Pagination-CLHwhyvu.js';
|
|
17
17
|
import './Business-B5rtFhtR.js';
|
|
18
18
|
import './utils-BeQLScSm.js';
|
|
19
|
-
import './package-
|
|
19
|
+
import './package-CzedYX3W.js';
|
|
20
20
|
|
|
21
21
|
const BusinessDetails = class {
|
|
22
22
|
constructor(hostRef) {
|