Update WooCommercePayments task `is_supported` method to use default suggestions (#50585)

* Update WooCommercePayments task is_supported to use default suggestions

* Add changelog
This commit is contained in:
Chi-Hsuan Huang 2024-08-14 09:38:50 +08:00 committed by GitHub
parent bb7dbf9e3c
commit 9fcd59d3d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Update WooCommercePayments task is_supported to use default suggestions

View File

@ -7,6 +7,7 @@ use Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task;
use Automattic\WooCommerce\Admin\PluginsHelper; use Automattic\WooCommerce\Admin\PluginsHelper;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\Init as Suggestions; use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\Init as Suggestions;
use Automattic\WooCommerce\Internal\Admin\WCPayPromotion\Init as WCPayPromotionInit; use Automattic\WooCommerce\Internal\Admin\WCPayPromotion\Init as WCPayPromotionInit;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\DefaultPaymentGateways;
/** /**
* WooCommercePayments Task * WooCommercePayments Task
@ -179,11 +180,11 @@ class WooCommercePayments extends Task {
* @return bool * @return bool
*/ */
public static function is_supported() { public static function is_supported() {
$suggestions = Suggestions::get_suggestions(); $suggestions = Suggestions::get_suggestions( DefaultPaymentGateways::get_all() );
$suggestion_plugins = array_merge( $suggestion_plugins = array_merge(
...array_filter( ...array_filter(
array_column( $suggestions, 'plugins' ), array_column( $suggestions, 'plugins' ),
function( $plugins ) { function ( $plugins ) {
return is_array( $plugins ); return is_array( $plugins );
} }
) )