Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders

Stripe::is_account_connectedpublicWC 1.0

Check if the payment gateway has a payments processor account connected.

Method of the class: Stripe{}

No Hooks.

Returns

true|false. True if the payment gateway account is connected, false otherwise. If the payment gateway does not provide the information, it will return true.

Usage

$Stripe = new Stripe();
$Stripe->is_account_connected( $payment_gateway ): bool;
$payment_gateway(WC_Payment_Gateway) (required)
The payment gateway object.

Stripe::is_account_connected() code WC 9.9.3

public function is_account_connected( WC_Payment_Gateway $payment_gateway ): bool {
	if ( class_exists( '\WC_Stripe' ) && is_callable( '\WC_Stripe::get_instance' ) ) {
		$stripe = \WC_Stripe::get_instance();
		if ( isset( $stripe->account ) &&
			class_exists( '\WC_Stripe_Account' ) &&
			defined( '\WC_Stripe_Account::STATUS_NO_ACCOUNT' ) &&
			$stripe->account instanceof \WC_Stripe_Account &&
			is_callable( array( $stripe->account, 'get_account_status' ) ) ) {

			return \WC_Stripe_Account::STATUS_NO_ACCOUNT !== $stripe->account->get_account_status();
		}
	}

	return parent::is_account_connected( $payment_gateway );
}