mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +08:00
Add custom modal data to data store
This commit is contained in:
parent
381b46f444
commit
88201efa3e
3 changed files with 31 additions and 2 deletions
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue