Automattic\WooCommerce\Internal\Admin\Settings
PaymentsController::is_woopayments_account_onboarded
Check if the WooPayments account is onboarded.
Method of the class: PaymentsController{}
No Hooks.
Returns
true|false.
Usage
// private - for code of main (parent) class only $result = $this->is_woopayments_account_onboarded(): bool;
PaymentsController::is_woopayments_account_onboarded() PaymentsController::is woopayments account onboarded code WC 10.6.2
private function is_woopayments_account_onboarded(): bool {
// Sanity check: the WooPayments extension must be active.
if ( ! class_exists( '\WC_Payments' ) ) {
return false;
}
$account_data = get_option( 'wcpay_account_data', array() );
// The account ID must be present.
if ( empty( $account_data['data']['account_id'] ) ) {
return false;
}
// We consider the store to have an onboarded WooPayments account if account data in the WooPayments account cache
// contains a details_submitted = true entry. This implies that WooPayments is also connected.
if ( empty( $account_data['data']['details_submitted'] ) ) {
return false;
}
return filter_var( $account_data['data']['details_submitted'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE ) ?? false;
}