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'));
}
needs_setup should be triggered if overridden and should show Complete setup like PayPal plugin does, for example.
Nothing happens.
I am using WooCommerce Version 10.2.0-dev.
The 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.
I am overridding this public method in my woocommerce payment gateway. However, it is being ignored completely.
It looks like adding is_account_connected
in combination with needs_setup
did the trick for me. According to this logic here: PaymentGateway.php#L58, needs_setup
should evaluate to true
whereas is_account_connected
needs to evaluate to false
.