Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders

Payoneer::is_in_test_modepublicWC 1.0

Try to determine if the payment gateway is in test 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.

Method of the class: Payoneer{}

No Hooks.

Returns

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

Usage

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

Payoneer::is_in_test_mode() code WC 10.7.0

public function is_in_test_mode( WC_Payment_Gateway $payment_gateway ): bool {
	try {
		return ! wc_string_to_bool( $payment_gateway->get_option( 'live_mode' ) );
	} catch ( Throwable $e ) {
		// Do nothing but log so we can investigate.
		SafeGlobalFunctionProxy::wc_get_logger()->debug(
			'Failed to determine if gateway is in test mode: ' . $e->getMessage(),
			array(
				'gateway'   => $payment_gateway->id,
				'source'    => 'settings-payments',
				'exception' => $e,
			)
		);
	}

	return parent::is_in_test_mode( $payment_gateway );
}