private void buy(String[] commandString, Player player) throws CommandException {
        if (commandString.length >= 3) {
            CargoEnum cargoEnum = CargoEnum.toCargoEnum(commandString[2]);
            if (cargoEnum != null) {
                Station station = player.getCurrentStar().getStation();
                int amountToBuy = getAmount(commandString[1], player.getWallet().getCredits(),
                        station.getTransactionPrice(cargoEnum), player.getShip().getCargoHold().get()
                                .getRemainingCargoSpace(), cargoEnum.getSize(), station.getShip().getCargoHold().get()
                                .getCargoAmount(cargoEnum));
                int validationCode = TransactionManager.validateBuyFromStationTransaction(player, station, cargoEnum,
                        amountToBuy);
                switch (validationCode) {
                case 0:
                    TransactionManager.performBuyFromStationTransaction(player, station, cargoEnum, amountToBuy);
                    break;
                case 1:
                    // gui.displayError(ErrorEnum.PLAYER_NO_CARGO_SPACE);
                    throw new CommandException("<" + player.getName() + "> has insufficient cargo space");
                case 2:
                    throw new CommandException("<" + station.getName() + "> has insufficient cargo");
                case 3:
                    throw new CommandException("<" + player.getName() + "> has insufficient funds");
                }
                displayDockCargo(player);
            }
        } else {
            throw new CommandException("Not enough input");
        }
    }