Add custom modal data to data store

This commit is contained in:
Emili Castells Guasch 2025-01-23 10:54:10 +01:00
parent 381b46f444
commit 88201efa3e
3 changed files with 31 additions and 2 deletions

View file

@ -56,6 +56,14 @@ const useHooks = () => {
const pui = usePersistent( 'ppcp-pay-upon-invoice-gateway' );
const oxxo = usePersistent( 'ppcp-oxxo-gateway' );
// Custom modal data.
const paypalShowLogo = usePersistent( 'paypalShowLogo' );
const threeDSecure = usePersistent( 'threeDSecure' );
const fastlaneCardholderName = usePersistent( 'fastlaneCardholderName' );
const fastlaneDisplayWatermark = usePersistent(
'fastlaneDisplayWatermark'
);
return {
persist,
isReady,
@ -78,6 +86,10 @@ const useHooks = () => {
multibanco,
pui,
oxxo,
paypalShowLogo,
threeDSecure,
fastlaneCardholderName,
fastlaneDisplayWatermark,
};
};
@ -107,6 +119,10 @@ export const usePaymentMethods = () => {
multibanco,
pui,
oxxo,
paypalShowLogo,
threeDSecure,
fastlaneCardholderName,
fastlaneDisplayWatermark,
} = useHooks();
const paymentMethods = [
@ -128,6 +144,10 @@ export const usePaymentMethods = () => {
multibanco,
pui,
oxxo,
paypalShowLogo,
threeDSecure,
fastlaneCardholderName,
fastlaneDisplayWatermark,
];
return {

View file

@ -37,6 +37,10 @@ const defaultPersistent = Object.freeze( {
'ppcp-multibanco': {},
'ppcp-pay-upon-invoice-gateway': {},
'ppcp-oxxo-gateway': {},
paypalShowLogo: false,
threeDSecure: 'no-3d-secure',
fastlaneCardholderName: false,
fastlaneDisplayWatermark: false,
} );
// Reducer logic.