mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Remove console logs
This commit is contained in:
parent
5f6447d786
commit
1eb754a13b
2 changed files with 3 additions and 13 deletions
|
@ -8,9 +8,6 @@ const GooglepayButton = ( { namespace, buttonConfig, ppcpConfig } ) => {
|
||||||
const [ buttonHtml, setButtonHtml ] = useState( '' );
|
const [ buttonHtml, setButtonHtml ] = useState( '' );
|
||||||
const [ buttonElement, setButtonElement ] = useState( null );
|
const [ buttonElement, setButtonElement ] = useState( null );
|
||||||
const [ componentFrame, setComponentFrame ] = useState( null );
|
const [ componentFrame, setComponentFrame ] = useState( null );
|
||||||
|
|
||||||
const buttonLoader = '<div>Loading Google Pay...</div>';
|
|
||||||
|
|
||||||
const isPayPalLoaded = usePayPalScript( namespace, ppcpConfig );
|
const isPayPalLoaded = usePayPalScript( namespace, ppcpConfig );
|
||||||
|
|
||||||
const isGooglepayLoaded = useGooglepayScript(
|
const isGooglepayLoaded = useGooglepayScript(
|
||||||
|
@ -46,7 +43,7 @@ const GooglepayButton = ( { namespace, buttonConfig, ppcpConfig } ) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={ setButtonElement }
|
ref={ setButtonElement }
|
||||||
dangerouslySetInnerHTML={ { __html: buttonHtml || buttonLoader } }
|
dangerouslySetInnerHTML={ { __html: buttonHtml } }
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,11 +29,6 @@ const useGooglepayApiToGenerateButton = (
|
||||||
environment: 'TEST',
|
environment: 'TEST',
|
||||||
} );
|
} );
|
||||||
|
|
||||||
console.log( 'paymentsClient', paymentsClient );
|
|
||||||
|
|
||||||
console.log( 'googlepayConfig', googlepayConfig );
|
|
||||||
console.log( 'buttonStyles?.Default', buttonStyles?.Default );
|
|
||||||
|
|
||||||
const googlePayButtonOptions = {
|
const googlePayButtonOptions = {
|
||||||
allowedPaymentMethods: googlepayConfig.allowedPaymentMethods,
|
allowedPaymentMethods: googlepayConfig.allowedPaymentMethods,
|
||||||
buttonColor: buttonConfig.buttonColor || 'black',
|
buttonColor: buttonConfig.buttonColor || 'black',
|
||||||
|
@ -44,13 +39,11 @@ const useGooglepayApiToGenerateButton = (
|
||||||
|
|
||||||
const button = paymentsClient.createButton( {
|
const button = paymentsClient.createButton( {
|
||||||
...googlePayButtonOptions,
|
...googlePayButtonOptions,
|
||||||
onClick: () => {
|
onClick: ( event ) => {
|
||||||
console.log( 'Google Pay button clicked' );
|
event.preventDefault();
|
||||||
},
|
},
|
||||||
} );
|
} );
|
||||||
|
|
||||||
console.log( 'Google Pay Button options', googlePayButtonOptions );
|
|
||||||
|
|
||||||
setGooglepayButton( button );
|
setGooglepayButton( button );
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue