Prerequisites
- [x] I have carried out troubleshooting steps and I believe I have found a bug.
- [x] I have searched for similar bugs in both open and closed issues and cannot find a duplicate.
Describe the bug
needs_setup is never even used if I override it for my WC_Payment_Gateway_CC payment gateway.
Please, let me know if this is deprecated.
public function needs_setup(): bool {
WC_MyGateway_Logger::logg('DEBUG: ' . $this->id . ' ' . $this->plugin_id); // never reached
return empty($this->get_option('account_id'));
}
Expected behavior
needs_setup should be triggered if overridden and should show Complete setup like PayPal plugin does, for example.
Actual behavior
Nothing happens.
Steps to reproduce
I am using WooCommerce Version 10.2.0-dev.
WordPress Environment
WordPress EnvironmentThe System Status Report is found in your WordPress admin under WooCommerce > Status. Please select “Get system report”, then “Copy for GitHub”, and then paste it here.
Isolating the problem
- [x] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
- [x] This bug happens with a default WordPress theme active, or Storefront.
- [x] I can reproduce this bug consistently using the steps above.
I am overridding this public method in my woocommerce payment gateway. However, it is being ignored completely.
needs_setupis called in the back office when the payment gateway is added or removed in "WooCommerce" -> "Settings" -> "Payments".