mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🧑💻 Add debug tool to disconnect merchant
This commit is contained in:
parent
364c1b55c5
commit
5173954776
1 changed files with 11 additions and 5 deletions
|
@ -5,6 +5,7 @@ export const addDebugTools = ( context, modules ) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dump the current state of all our Redux stores.
|
||||||
context.dumpStore = async () => {
|
context.dumpStore = async () => {
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
if ( ! console?.groupCollapsed ) {
|
if ( ! console?.groupCollapsed ) {
|
||||||
|
@ -43,10 +44,15 @@ export const addDebugTools = ( context, modules ) => {
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
context.startOnboarding = () => {
|
// Disconnect the merchant and display the onboarding wizard.
|
||||||
const onboarding = wp.data.dispatch( OnboardingStoreName );
|
context.disconnect = () => {
|
||||||
onboarding.setCompleted( false );
|
const common = wp.data.dispatch( CommonStoreName );
|
||||||
onboarding.setStep( 0 );
|
|
||||||
onboarding.persist();
|
common.disconnectMerchant();
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log( 'Disconnected from PayPal. Reloading the page...' );
|
||||||
|
|
||||||
|
window.location.reload();
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue