query.setParameter("custEmail", emailAddress);
List<?> list = query.getResultList();
if (list.size() > 0) {
customer = (Customer) list.iterator().next();
if (!customer.getActive().equals(Constants.VALUE_YES)) {
throw new PaymentCustomerException("Customer suspended");
}
}
if (customer == null) {
customer = new Customer();