public static int validateInstallFromStationTransaction(Player player, Station station, String componentName) {
        int result = -1;
        CargoHoldComponent stationHold = station.getShip().getCargoHold().get();
        CargoHoldComponent playerHold = player.getShip().getCargoHold().get();
        if (stationHold.doesComponentExist(componentName)) {
            ShipComponent component = stationHold.getComponentExist(componentName);
            if (player.getWallet().getCredits() >= component.getPrice()) {
                boolean enoughPlayerCargo = true;
                boolean enoughStationCargo = true;
                for (CargoEnum cargoEnum : component.getMaterials()) {
                    if (!playerHold.canRemoveCargo(cargoEnum, component.getMaterialPrice(cargoEnum))) {
                        enoughPlayerCargo = false;
                        break;
                    }
                    if (!stationHold.canAddCargo(cargoEnum, component.getMaterialPrice(cargoEnum))) {
                        enoughStationCargo = false;
                        break;
                    }
                }

                if (enoughPlayerCargo && enoughStationCargo) {
                    result = 0;
                } else if (!enoughPlayerCargo) {
                    result = 1;
                } else if (!enoughStationCargo) {
                    result = 4;
                }
            } else {
                result = 2;
            }
        } else {
            result = 3;
        }

        return result;
    }