this.payerService = payerService;
}
@Override
public void validate(final Object obj, final Errors error) {
final PayerDTO payer = (PayerDTO) obj;
ValidationUtils.rejectIfEmpty(error, "email",
"cts.validator.payer.wrong.email");
ValidationUtils.rejectIfEmpty(error, "firstname",
"cts.validator.payer.wrong.firstname");
ValidationUtils.rejectIfEmpty(error, "lastname",
"cts.validator.payer.wrong.lastname");
ValidationUtils.rejectIfEmpty(error, "password",
"cts.validator.payer.wrong.password");
try {
if (this.payerService.isPayerExists(payer.getEmail())) {
error.reject("cts.validator.payer.exists");
}
} catch (final DataNotRetrievedException e) {
LOGGER.error(e.getLocalizedMessage(), e);
}