static public function isValidState($state, $throwException = true)
    {
        if (in_array($state, static::getStates(), true)) {
            return true;
        }

        if ($throwException) {
            throw new InvalidArgumentException("Invalid payment states '$state'.");
        }

        return false;
    }