public class OrderValidatorImpl extends java.lang.Object implements OrderValidator
Modifier and Type | Field and Description |
---|---|
private SageoneConfig |
config |
private DetailedOrder |
order |
private OrderDataExtractor |
orderExtractor |
Constructor and Description |
---|
OrderValidatorImpl(SageoneConfig config,
OrderDataExtractor orderExtractor) |
Modifier and Type | Method and Description |
---|---|
private java.math.BigDecimal |
calculateLineItemsTotal(java.util.List<LineItem> productLineItems) |
private boolean |
hasSupportedCurrency(Price price) |
private boolean |
hasSupportedDestination(Address address) |
private boolean |
hasTax(LineItem item) |
private boolean |
hasValidEmail(Address address) |
private boolean |
hasValidFullName(Address address) |
private boolean |
hasValidLineitemContainer() |
void |
validate(DetailedOrder order)
Verifies the passed order by checking for
unsupported features within the order.
|
private void |
validateBillingAddress() |
private void |
validateLineItemContainer() |
private void |
validatePaymentData() |
private void |
validateProductLineItems() |
private void |
validateShippingAddress() |
private void |
validateShippingData() |
private SageoneConfig config
private DetailedOrder order
private OrderDataExtractor orderExtractor
@Inject public OrderValidatorImpl(SageoneConfig config, OrderDataExtractor orderExtractor)
public void validate(DetailedOrder order) throws UnsupportedFeatureException
OrderValidator
validate
in interface OrderValidator
order
- Order to validate.UnsupportedFeatureException
- in case
an unsupported feature was discovered in the order.private void validateBillingAddress() throws UnsupportedFeatureException
UnsupportedFeatureException
private void validateShippingAddress() throws UnsupportedFeatureException
UnsupportedFeatureException
private void validateLineItemContainer() throws UnsupportedFeatureException
UnsupportedFeatureException
private java.math.BigDecimal calculateLineItemsTotal(java.util.List<LineItem> productLineItems)
private boolean hasValidLineitemContainer()
private void validatePaymentData() throws UnsupportedFeatureException
UnsupportedFeatureException
private void validateShippingData() throws UnsupportedFeatureException
UnsupportedFeatureException
private void validateProductLineItems() throws UnsupportedFeatureException
UnsupportedFeatureException
private boolean hasValidEmail(Address address)
private boolean hasValidFullName(Address address)
private boolean hasSupportedCurrency(Price price)
private boolean hasTax(LineItem item)
private boolean hasSupportedDestination(Address address)