@Test public void test() { assertEquals(expected, paymentConfigurationTotalAmountFilter.isValid(configuration, cart)); }
@Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { double orderTotal = convertCurrency(order.getCurrency(), configuration.getTotalAmountCurrency(), order.getTotalPrice()); if (Double.isNaN(orderTotal)) { return true; } Double min = configuration.getTotalAmountMin(); if (min == null) { min = Double.MIN_VALUE; } Double max = configuration.getTotalAmountMax(); if (max == null) { max = Double.MAX_VALUE; } if (LOG.isDebugEnabled()) { LOG.debug("Processing total amount threshold with (min <= orderTotal < max): {} <= {} < {}", min, orderTotal, max); } return min <= orderTotal && orderTotal < max; }
PaymentConfigurationTotalAmountFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { double orderTotal = convertCurrency(order.getCurrency(), configuration.getTotalAmountCurrency(), order.getTotalPrice()); if (Double.isNaN(orderTotal)) { return true; } Double min = configuration.getTotalAmountMin(); if (min == null) { min = Double.MIN_VALUE; } Double max = configuration.getTotalAmountMax(); if (max == null) { max = Double.MAX_VALUE; } if (LOG.isDebugEnabled()) { LOG.debug("Processing total amount threshold with (min <= orderTotal < max): {} <= {} < {}", min, orderTotal, max); } return min <= orderTotal && orderTotal < max; } }
PaymentConfigurationTotalAmountFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { double orderTotal = convertCurrency(order.getCurrency(), configuration.getTotalAmountCurrency(), order.getTotalPrice()); if (Double.isNaN(orderTotal)) { return true; } Double min = configuration.getTotalAmountMin(); if (min == null) { min = Double.MIN_VALUE; } Double max = configuration.getTotalAmountMax(); if (max == null) { max = Double.MAX_VALUE; } if (LOG.isDebugEnabled()) { LOG.debug("Processing total amount threshold with (min <= orderTotal < max): {} <= {} < {}", min, orderTotal, max); } return min <= orderTotal && orderTotal < max; }  }
PaymentConfigurationTotalAmountFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { double orderTotal = convertCurrency(order.getCurrency(), configuration.getTotalAmountCurrency(), order.getTotalPrice()); if (Double.isNaN(orderTotal)) { return true; } Double min = configuration.getTotalAmountMin(); if (min == null) { min = Double.MIN_VALUE; } Double max = configuration.getTotalAmountMax(); if (max == null) { max = Double.MAX_VALUE; } if (LOG.isDebugEnabled()) { LOG.debug("Processing total amount threshold with (min <= orderTotal < max): {} <= {} < {}", min, orderTotal, max); } return min <= orderTotal && orderTotal < max; }  @Override boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order); @Required void setCommonI18NService(CommonI18NService commonI18NService); }
PaymentConfigurationTotalAmountFilter implements PaymentConfigurationFilter { @Override public boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order) { double orderTotal = convertCurrency(order.getCurrency(), configuration.getTotalAmountCurrency(), order.getTotalPrice()); if (Double.isNaN(orderTotal)) { return true; } Double min = configuration.getTotalAmountMin(); if (min == null) { min = Double.MIN_VALUE; } Double max = configuration.getTotalAmountMax(); if (max == null) { max = Double.MAX_VALUE; } if (LOG.isDebugEnabled()) { LOG.debug("Processing total amount threshold with (min <= orderTotal < max): {} <= {} < {}", min, orderTotal, max); } return min <= orderTotal && orderTotal < max; }  @Override boolean isValid(WirecardPaymentConfigurationModel configuration, AbstractOrderModel order); @Required void setCommonI18NService(CommonI18NService commonI18NService);  }