Add GooglePay context handler classes

This commit is contained in:
Pedro Silva 2023-08-28 17:19:07 +01:00
parent 6a205d1413
commit 4a1d369ad2
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
11 changed files with 494 additions and 159 deletions

View file

@ -2,6 +2,7 @@ import {useEffect, useState} from '@wordpress/element';
import {registerExpressPaymentMethod, registerPaymentMethod} from '@woocommerce/blocks-registry';
import {paypalAddressToWc, paypalOrderToWcAddresses} from "./Helper/Address";
import {loadPaypalScript} from '../../../ppcp-button/resources/js/modules/Helper/ScriptLoading'
import buttonModuleWatcher from "../../../ppcp-button/resources/js/modules/ButtonModuleWatcher";
const config = wc.wcSettings.getSetting('ppcp-gateway_data');
@ -28,6 +29,7 @@ const PayPalComponent = ({
if (!loaded) {
loadPaypalScript(config.scriptData, () => {
setLoaded(true);
buttonModuleWatcher.registerContextBootstrap(config.scriptData.context, this);
});
}
}, [loaded]);