addErrorIfStringEmpty(errors, "creditCart", "order.error.creditCard.required", order.getCreditCard());
addErrorIfStringEmpty(errors, "expirationDate", "order.error.expirationDate.required", order.getExprDate());
addErrorIfStringEmpty(errors, "cardType", "order.error.cardType.required", order.getCardType());
Address billing = order.getBillingAddress();
addErrorIfStringEmpty(errors, "billToFirstName", "order.error.billToFirstName.required", billing.getFirstName());
addErrorIfStringEmpty(errors, "billToLastName", "order.error.billToLastName.required", billing.getLastName());
addErrorIfStringEmpty(errors, "billToAddress1", "order.error.billToAddress1.required", billing.getAddr1());
addErrorIfStringEmpty(errors, "billToCity", "order.error.billToCity.required", billing.getCity());
addErrorIfStringEmpty(errors, "billToState", "order.error.billToState.required", billing.getState());
addErrorIfStringEmpty(errors, "billToZip", "order.error.billToZip.required", billing.getZip());
addErrorIfStringEmpty(errors, "billToCountry", "order.error.billToCountry.required", billing.getCountry());
if(isShippingAddressRequired()) {
Address shipping = order.getShippingAddress();
addErrorIfStringEmpty(errors, "shipToFirstName", "order.error.shipToFirstName.required", shipping.getFirstName());
addErrorIfStringEmpty(errors, "shipToLastName", "order.error.shipToLastName.required", shipping.getLastName());
addErrorIfStringEmpty(errors, "shipToAddress1", "order.error.shipToAddress1.required", shipping.getAddr1());
addErrorIfStringEmpty(errors, "shipToCity", "order.error.shipToCity.required", shipping.getCity());
addErrorIfStringEmpty(errors, "shipToState", "order.error.shipToState.required", shipping.getState());
addErrorIfStringEmpty(errors, "shipToZip", "order.error.shipToZip.required", shipping.getZip());
addErrorIfStringEmpty(errors, "shipToCountry", "order.error.shipToCountry.required", shipping.getCountry());
}
// sets the ship address the same as the bill-to address
if(!isShippingAddressRequired() && errors.size() > 0) {
order.setShippingAddressIsBillingAddress(true);