Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders\WooPayments
WooPaymentsService::has_working_account
Determine if WooPayments has a working account set up.
This is a more specific check than has_valid_account() and checks if payments are enabled for the account.
Method of the class: WooPaymentsService{}
No Hooks.
Returns
true|false. Whether WooPayments has a working account set up.
Usage
// private - for code of main (parent) class only $result = $this->has_working_account(): bool;
WooPaymentsService::has_working_account() WooPaymentsService::has working account code WC 10.8.1
private function has_working_account(): bool {
if ( ! $this->has_account() ) {
return false;
}
$account_service = $this->proxy->call_static( '\WC_Payments', 'get_account_service' );
$account_status = $account_service->get_account_status_data();
return ! empty( $account_status['paymentsEnabled'] );
}