diff --git a/src/lib/__mocks__/google-pay-mock.ts b/src/lib/__mocks__/google-pay-mock.ts index d324e53..4bb663f 100644 --- a/src/lib/__mocks__/google-pay-mock.ts +++ b/src/lib/__mocks__/google-pay-mock.ts @@ -45,9 +45,7 @@ class PaymentsClient { return document.createElement('div'); } - prefetchPaymentData(request: google.payments.api.PaymentDataRequest): void { - throw new Error('Not implemented'); - } + prefetchPaymentData(request: google.payments.api.PaymentDataRequest): void {} } window.google = { diff --git a/src/lib/button-manager.ts b/src/lib/button-manager.ts index d7e8686..ada3243 100644 --- a/src/lib/button-manager.ts +++ b/src/lib/button-manager.ts @@ -244,6 +244,8 @@ export class ButtonManager { if (!this.isMounted()) return; if (showButton) { + this.client.prefetchPaymentData(this.createLoadPaymentDataRequest(this.config)); + // remove hidden className this.setClassName( element,