Automattic\WooCommerce\Internal\Admin\Settings\PaymentProviders

PaymentGateway::is_in_dev_mode()publicWC 1.0

Try to determine if the payment gateway is in dev mode.

This is a best-effort attempt, as there is no standard way to determine this. Trust the true value, but don't consider a false value as definitive.

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

Хуков нет.

Возвращает

true|false. True if the payment gateway is in dev mode, false otherwise.

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

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

Код PaymentGateway::is_in_dev_mode() WC 9.6.1

public function is_in_dev_mode( WC_Payment_Gateway $payment_gateway ): bool {
	// Try various gateway methods to check if the payment gateway is in dev mode.
	if ( is_callable( array( $payment_gateway, 'is_dev_mode' ) ) ) {
		return filter_var( $payment_gateway->is_dev_mode(), FILTER_VALIDATE_BOOLEAN );
	}
	if ( is_callable( array( $payment_gateway, 'is_in_dev_mode' ) ) ) {
		return filter_var( $payment_gateway->is_in_dev_mode(), FILTER_VALIDATE_BOOLEAN );
	}

	return false;
}