mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Migrate Google Pay to the new script loader
This commit is contained in:
parent
07bedc4460
commit
869a47f3cd
5 changed files with 59 additions and 36 deletions
|
@ -3,7 +3,8 @@ import GooglepayButton from './GooglepayButton';
|
|||
import ContextHandlerFactory from './Context/ContextHandlerFactory';
|
||||
|
||||
class GooglepayManager {
|
||||
constructor( buttonConfig, ppcpConfig ) {
|
||||
constructor( namespace, buttonConfig, ppcpConfig ) {
|
||||
this.namespace = namespace;
|
||||
this.buttonConfig = buttonConfig;
|
||||
this.ppcpConfig = ppcpConfig;
|
||||
this.googlePayConfig = null;
|
||||
|
@ -52,7 +53,9 @@ class GooglepayManager {
|
|||
try {
|
||||
if ( ! this.googlePayConfig ) {
|
||||
// Gets GooglePay configuration of the PayPal merchant.
|
||||
this.googlePayConfig = await paypal.Googlepay().config();
|
||||
this.googlePayConfig = await window[ this.namespace ]
|
||||
.Googlepay()
|
||||
.config();
|
||||
}
|
||||
|
||||
if ( ! this.transactionInfo ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue