Skip to content

Commit

Permalink
feat: add prefetchPaymentData integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Soc Sieng committed Jun 19, 2020
1 parent 407217a commit 7b0e4dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/__mocks__/google-pay-mock.ts
Expand Up @@ -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 = {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/button-manager.ts
Expand Up @@ -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,
Expand Down

0 comments on commit 7b0e4dd

Please sign in to comment.