valid_modes, true ) ) { $mode = reset( $this->valid_modes ); } $this->mode = $mode; return $this; } /** * Gets the mode for Merchant for handling operations. * * @since 2.5.0 * * @return string Which mode we are using the Merchant. */ public function get_mode() { if ( null === $this->mode ) { $this->set_mode( bookit_is_sandbox_mode( static::$option_sandbox ) ? 'sandbox' : 'live' ); } return $this->mode; } /** * Determines if we are using sandbox mode. * * @since 2.5.0 * * @return bool */ public function is_sandbox() { return 'sandbox' === $this->get_mode(); } }