mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
✨ New state props for client ID and secret
This commit is contained in:
parent
e20a6fdbce
commit
52d04c7347
4 changed files with 57 additions and 0 deletions
|
@ -7,6 +7,8 @@ export const useOnboardingDetails = () => {
|
|||
setSandboxMode,
|
||||
setManualConnectionMode,
|
||||
persist,
|
||||
setClientId,
|
||||
setClientSecret,
|
||||
} = useDispatch( STORE_NAME );
|
||||
|
||||
// Transient accessors.
|
||||
|
@ -14,6 +16,15 @@ export const useOnboardingDetails = () => {
|
|||
return select( STORE_NAME ).getTransientData().isSaving;
|
||||
}, [] );
|
||||
|
||||
const clientId = useSelect( ( select ) => {
|
||||
return select( STORE_NAME ).getTransientData().clientId;
|
||||
}, [] );
|
||||
|
||||
const clientSecret = useSelect( ( select ) => {
|
||||
return select( STORE_NAME ).getTransientData().clientSecret;
|
||||
}, [] );
|
||||
|
||||
// Persistent accessors.
|
||||
const onboardingStep = useSelect( ( select ) => {
|
||||
return select( STORE_NAME ).getPersistentData().step || 0;
|
||||
}, [] );
|
||||
|
@ -36,6 +47,10 @@ export const useOnboardingDetails = () => {
|
|||
isSaving,
|
||||
isSandboxMode,
|
||||
isManualConnectionMode,
|
||||
clientId,
|
||||
setClientId,
|
||||
clientSecret,
|
||||
setClientSecret,
|
||||
setOnboardingStep: ( step ) =>
|
||||
setDetailAndPersist( setOnboardingStep, step ),
|
||||
setSandboxMode: ( state ) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue