private boolean validateCardType(String cardNumber, CreditCardType cardType) {
		CodeValidator apacheCardValidator;
		switch (cardType) {
		case VISA:
			apacheCardValidator = org.apache.commons.validator.routines.CreditCardValidator.VISA_VALIDATOR;
			break;
		case AMERICAN_EXPRESS:
			apacheCardValidator = org.apache.commons.validator.routines.CreditCardValidator.AMEX_VALIDATOR;
			break;
		case MASTERCARD:
			apacheCardValidator = org.apache.commons.validator.routines.CreditCardValidator.MASTERCARD_VALIDATOR;
			break;
		default:
			throw new ValidatorException(new FacesMessage(
					"Kartentyp wird nicht akzeptiert."));
		}

		org.apache.commons.validator.routines.CreditCardValidator validator = new org.apache.commons.validator.routines.CreditCardValidator(
				new CodeValidator[] { apacheCardValidator });

		if (validator.isValid(cardNumber)) {
			return true;
		} else {
			addMessage(new FacesMessage(
					"Der Kartentyp passt nicht zur Kartennummer"));
			return false;
		}
	}