Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders
PaymentGateway::is_account_connected
Check if the payment gateway has a payments processor account connected.
Method of the class: PaymentGateway{}
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
$PaymentGateway = new PaymentGateway(); $PaymentGateway->is_account_connected( $payment_gateway ): bool;
- $payment_gateway(WC_Payment_Gateway) (required)
- The payment gateway object.
PaymentGateway::is_account_connected() PaymentGateway::is account connected code WC 9.9.3
public function is_account_connected( WC_Payment_Gateway $payment_gateway ): bool { if ( is_callable( array( $payment_gateway, 'is_account_connected' ) ) ) { return filter_var( $payment_gateway->is_account_connected(), FILTER_VALIDATE_BOOLEAN ); } if ( is_callable( array( $payment_gateway, 'is_connected' ) ) ) { return filter_var( $payment_gateway->is_connected(), FILTER_VALIDATE_BOOLEAN ); } // Fall back to assuming that it is connected. This is the safest option. return true; }