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

@ -26,11 +26,11 @@ const GooglePayComponent = () => {
const [paypalLoaded, setPaypalLoaded] = useState(false);
const [googlePayLoaded, setGooglePayLoaded] = useState(false);
const manager = new GooglepayManager(buttonConfig, ppcpConfig);
const bootstrap = function () {
const manager = new GooglepayManager(buttonConfig, ppcpConfig);
manager.init();
};
useEffect(() => {
@ -43,7 +43,7 @@ const GooglePayComponent = () => {
loadPaypalScript(ppcpConfig, () => {
setPaypalLoaded(true);
});
});
}, []);
useEffect(() => {
if (!bootstrapped && paypalLoaded && googlePayLoaded) {