mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +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;
|
||||
}
|
||||
|
||||
// Dump the current state of all our Redux stores.
|
||||
context.dumpStore = async () => {
|
||||
/* eslint-disable no-console */
|
||||
if ( ! console?.groupCollapsed ) {
|
||||
|
@ -43,10 +44,15 @@ export const addDebugTools = ( context, modules ) => {
|
|||
} );
|
||||
};
|
||||
|
||||
context.startOnboarding = () => {
|
||||
const onboarding = wp.data.dispatch( OnboardingStoreName );
|
||||
onboarding.setCompleted( false );
|
||||
onboarding.setStep( 0 );
|
||||
onboarding.persist();
|
||||
// Disconnect the merchant and display the onboarding wizard.
|
||||
context.disconnect = () => {
|
||||
const common = wp.data.dispatch( CommonStoreName );
|
||||
|
||||
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