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