Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders
NexiCheckout::is_nexi_in_sandbox_mode
Check if the Nexi Checkout payment gateway is in test/sandbox mode.
There are two different environments: test/sandbox and production.
Метод класса: NexiCheckout{}
Хуков нет.
Возвращает
?true|false. True if the payment gateway is in sandbox mode, false otherwise. Null if the environment could not be determined.
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_nexi_in_sandbox_mode( $payment_gateway ): ?bool;
- $payment_gateway(WC_Payment_Gateway) (обязательный)
- The payment gateway object.
Код NexiCheckout::is_nexi_in_sandbox_mode() NexiCheckout::is nexi in sandbox mode WC 11.0.1
private function is_nexi_in_sandbox_mode( WC_Payment_Gateway $payment_gateway ): ?bool {
try {
return \wc_string_to_bool( $payment_gateway->get_option( 'test_mode' ) );
} catch ( Throwable $e ) {
// Do nothing but log so we can investigate.
SafeGlobalFunctionProxy::wc_get_logger()->debug(
'Failed to determine if gateway is in sandbox mode: ' . $e->getMessage(),
array(
'gateway' => $payment_gateway->id,
'source' => 'settings-payments',
'exception' => $e,
)
);
}
// Let the caller know that we couldn't determine the environment.
return null;
}