Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders

PaymentGateway::is_onboarding_started │ public │ WC 1.0

Check if the payment gateway has started the onboarding process.

Метод класса: PaymentGateway{}

Хуков нет.

Возвращает

bool. True if the payment gateway has started the onboarding process, false otherwise. If the payment gateway does not provide the information, it will infer it from having a connected account.

Использование

$PaymentGateway = new PaymentGateway();
$PaymentGateway->is_onboarding_started( $payment_gateway ): bool;
$payment_gateway(WC_Payment_Gateway) (обязательный)
The payment gateway object.

Код PaymentGateway::is_onboarding_started() WC 11.2.1

public function is_onboarding_started( WC_Payment_Gateway $payment_gateway ): bool {
	try {
		if ( method_exists( $payment_gateway, 'is_onboarding_started' ) && is_callable( array( $payment_gateway, 'is_onboarding_started' ) ) ) {
			return wc_string_to_bool( $payment_gateway->is_onboarding_started() );
		}
	} catch ( Throwable $e ) {
		// Do nothing but log so we can investigate.
		SafeGlobalFunctionProxy::wc_get_logger()->debug(
			'Failed to determine if gateway onboarding started: ' . $e->getMessage(),
			array(
				'gateway'   => $payment_gateway->id,
				'source'    => 'settings-payments',
				'exception' => $e,
			)
		);
	}

	// Fall back to inferring this from having a connected account.
	return $this->is_account_connected( $payment_gateway );
}