Added check to show WC Pay option only when Jetpack is connected (https://github.com/woocommerce/woocommerce-admin/pull/4105)

* Added check to show WC Pay option only when Jetpack is connected

A verification was added to the Setup Checklist payment step, to show WC Pay option only when Jetpack is connected

* Changed the solution approach

Co-authored-by: Fernando Marichal <contacto@fernandomarichal.com>
This commit is contained in:
Fernando 2020-04-09 20:10:47 -03:00 committed by GitHub
parent 866487ee27
commit 1e1daaa6bb
2 changed files with 7 additions and 1 deletions

View File

@ -352,6 +352,7 @@ export default compose(
getActivePlugins, getActivePlugins,
getOptions, getOptions,
getUpdateOptionsError, getUpdateOptionsError,
isJetpackConnected,
isUpdateOptionsRequesting, isUpdateOptionsRequesting,
} = select( 'wc-api' ); } = select( 'wc-api' );
@ -378,6 +379,7 @@ export default compose(
const methods = getPaymentMethods( { const methods = getPaymentMethods( {
activePlugins, activePlugins,
countryCode, countryCode,
isJetpackConnected: isJetpackConnected(),
options, options,
profileItems, profileItems,
} ); } );

View File

@ -33,6 +33,7 @@ import PayFast from './payfast';
export function getPaymentMethods( { export function getPaymentMethods( {
activePlugins, activePlugins,
countryCode, countryCode,
isJetpackConnected,
options, options,
profileItems, profileItems,
} ) { } ) {
@ -118,7 +119,10 @@ export function getPaymentMethods( {
</Fragment> </Fragment>
), ),
before: <WCPayIcon />, before: <WCPayIcon />,
visible: [ 'US' ].includes( countryCode ) && ! hasCbdIndustry, visible:
[ 'US' ].includes( countryCode ) &&
! hasCbdIndustry &&
isJetpackConnected,
plugins: [ 'woocommerce-payments' ], plugins: [ 'woocommerce-payments' ],
container: <WCPay />, container: <WCPay />,
isConfigured: wcPayIsConfigured, isConfigured: wcPayIsConfigured,