mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
♻️ Unify function- and hook names
This commit is contained in:
parent
6052756268
commit
69d169533d
4 changed files with 13 additions and 13 deletions
|
@ -40,7 +40,7 @@ const AdvancedOptionsForm = () => {
|
|||
|
||||
const { isSandboxMode, setSandboxMode } = useSandboxConnection();
|
||||
const {
|
||||
handleConnectViaIdAndSecret,
|
||||
handleDirectAuthentication,
|
||||
isManualConnectionMode,
|
||||
setManualConnectionMode,
|
||||
clientId,
|
||||
|
@ -83,10 +83,10 @@ const AdvancedOptionsForm = () => {
|
|||
|
||||
const handleManualConnect = useCallback(
|
||||
() =>
|
||||
handleConnectViaIdAndSecret( {
|
||||
handleDirectAuthentication( {
|
||||
validation: validateManualConnectionForm,
|
||||
} ),
|
||||
[ handleConnectViaIdAndSecret, validateManualConnectionForm ]
|
||||
[ handleDirectAuthentication, validateManualConnectionForm ]
|
||||
);
|
||||
|
||||
useEffect( () => {
|
||||
|
|
|
@ -173,11 +173,11 @@ export const productionOnboardingUrl = function* ( products = [] ) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Side effect. Initiates a manual connection attempt using the provided client ID and secret.
|
||||
* Side effect. Initiates a direct connection attempt using the provided client ID and secret.
|
||||
*
|
||||
* @return {Action} The action.
|
||||
*/
|
||||
export const connectViaIdAndSecret = function* () {
|
||||
export const connectViaSecret = function* () {
|
||||
const { clientId, clientSecret, useSandbox } =
|
||||
yield select( STORE_NAME ).persistentData();
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ const useHooks = () => {
|
|||
setClientSecret,
|
||||
sandboxOnboardingUrl,
|
||||
productionOnboardingUrl,
|
||||
connectViaIdAndSecret,
|
||||
connectViaSecret,
|
||||
} = useDispatch( STORE_NAME );
|
||||
|
||||
// Transient accessors.
|
||||
|
@ -79,7 +79,7 @@ const useHooks = () => {
|
|||
},
|
||||
sandboxOnboardingUrl,
|
||||
productionOnboardingUrl,
|
||||
connectViaIdAndSecret,
|
||||
connectViaSecret,
|
||||
merchant,
|
||||
wooSettings,
|
||||
};
|
||||
|
@ -105,7 +105,7 @@ export const useAuthentication = () => {
|
|||
setClientId,
|
||||
clientSecret,
|
||||
setClientSecret,
|
||||
connectViaIdAndSecret,
|
||||
connectViaSecret,
|
||||
} = useHooks();
|
||||
|
||||
return {
|
||||
|
@ -115,7 +115,7 @@ export const useAuthentication = () => {
|
|||
setClientId,
|
||||
clientSecret,
|
||||
setClientSecret,
|
||||
connectViaIdAndSecret,
|
||||
connectViaSecret,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -214,7 +214,7 @@ export const useDirectAuthentication = () => {
|
|||
useConnectionBase();
|
||||
const { withActivity } = CommonHooks.useBusyState();
|
||||
const {
|
||||
connectViaIdAndSecret,
|
||||
connectViaSecret,
|
||||
isManualConnectionMode,
|
||||
setManualConnectionMode,
|
||||
clientId,
|
||||
|
@ -223,7 +223,7 @@ export const useDirectAuthentication = () => {
|
|||
setClientSecret,
|
||||
} = CommonHooks.useAuthentication();
|
||||
|
||||
const handleConnectViaIdAndSecret = async ( { validation } = {} ) => {
|
||||
const handleDirectAuthentication = async ( { validation } = {} ) => {
|
||||
return withActivity(
|
||||
ACTIVITIES.CONNECT_MANUAL,
|
||||
'Connecting manually via Client ID and Secret',
|
||||
|
@ -237,7 +237,7 @@ export const useDirectAuthentication = () => {
|
|||
}
|
||||
}
|
||||
|
||||
const res = await connectViaIdAndSecret();
|
||||
const res = await connectViaSecret();
|
||||
|
||||
if ( res.success ) {
|
||||
await handleCompleted();
|
||||
|
@ -251,7 +251,7 @@ export const useDirectAuthentication = () => {
|
|||
};
|
||||
|
||||
return {
|
||||
handleConnectViaIdAndSecret,
|
||||
handleDirectAuthentication,
|
||||
isManualConnectionMode,
|
||||
setManualConnectionMode,
|
||||
clientId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue