From 1e1daaa6bb1248ee9eaf14b541d50ca104f259cf Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 9 Apr 2020 20:10:47 -0300 Subject: [PATCH] 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 --- .../client/dashboard/task-list/tasks/payments/index.js | 2 ++ .../client/dashboard/task-list/tasks/payments/methods.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/index.js b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/index.js index e5e328c79a8..1f5972a4f0b 100644 --- a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/index.js +++ b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/index.js @@ -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, } ); diff --git a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/methods.js b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/methods.js index 76a2acdf584..ebd97a86a03 100644 --- a/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/methods.js +++ b/plugins/woocommerce-admin/client/dashboard/task-list/tasks/payments/methods.js @@ -33,6 +33,7 @@ import PayFast from './payfast'; export function getPaymentMethods( { activePlugins, countryCode, + isJetpackConnected, options, profileItems, } ) { @@ -118,7 +119,10 @@ export function getPaymentMethods( { ), before: , - visible: [ 'US' ].includes( countryCode ) && ! hasCbdIndustry, + visible: + [ 'US' ].includes( countryCode ) && + ! hasCbdIndustry && + isJetpackConnected, plugins: [ 'woocommerce-payments' ], container: , isConfigured: wcPayIsConfigured,