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

View File

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