mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Update /utils/utils.ts
- Remove irrelevant functionality - Relevant updates in spec file
This commit is contained in:
parent
8334352104
commit
965744ef9f
2 changed files with 4 additions and 15 deletions
|
@ -20,7 +20,6 @@ const percyConfig: PercyConfig = {
|
||||||
test.beforeAll( async ( { utils } ) => {
|
test.beforeAll( async ( { utils } ) => {
|
||||||
await utils.configureStore( storeConfigDefault );
|
await utils.configureStore( storeConfigDefault );
|
||||||
await utils.configurePcp( {
|
await utils.configurePcp( {
|
||||||
clearPCPDB: true,
|
|
||||||
disconnectMerchant: true,
|
disconnectMerchant: true,
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -24,7 +24,7 @@ import {
|
||||||
subscriptionsPlugin,
|
subscriptionsPlugin,
|
||||||
wpDebuggingPlugin,
|
wpDebuggingPlugin,
|
||||||
pcpPlugin,
|
pcpPlugin,
|
||||||
PcpMerchant,
|
Pcp,
|
||||||
} from '../resources';
|
} from '../resources';
|
||||||
import { getCustomerStorageStateName } from './helpers';
|
import { getCustomerStorageStateName } from './helpers';
|
||||||
|
|
||||||
|
@ -151,12 +151,7 @@ export class Utils {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
connectMerchant = async (
|
connectMerchant = async ( merchant: Pcp.Merchant ) => {};
|
||||||
merchant: PcpMerchant,
|
|
||||||
options = {
|
|
||||||
enablePayUponInvoice: false,
|
|
||||||
}
|
|
||||||
) => {};
|
|
||||||
|
|
||||||
disconnectMerchant = async () => {};
|
disconnectMerchant = async () => {};
|
||||||
|
|
||||||
|
@ -242,7 +237,7 @@ export class Utils {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
configurePcp = async ( data ) => {
|
configurePcp = async ( data: Pcp.Admin.Config ) => {
|
||||||
if (
|
if (
|
||||||
! ( await this.requestUtils.isPluginInstalled( pcpPlugin.slug ) )
|
! ( await this.requestUtils.isPluginInstalled( pcpPlugin.slug ) )
|
||||||
) {
|
) {
|
||||||
|
@ -251,17 +246,12 @@ export class Utils {
|
||||||
await this.requestUtils.activatePlugin( pcpPlugin.slug );
|
await this.requestUtils.activatePlugin( pcpPlugin.slug );
|
||||||
|
|
||||||
if ( data.merchant ) {
|
if ( data.merchant ) {
|
||||||
if ( data.clearPCPDB ) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( data.disconnectMerchant ) {
|
if ( data.disconnectMerchant ) {
|
||||||
await this.disconnectMerchant();
|
await this.disconnectMerchant();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.connectMerchant( data.merchant, {
|
await this.connectMerchant( data.merchant );
|
||||||
enablePayUponInvoice: data.enablePayUponInvoice || false,
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue