private boolean validateDigitalWallet(SegmentTariffDto segmentTariff, PanOrderLineDto orderLine) { Double fee = segmentTariff.getFee() == null ? 0.0 : segmentTariff.getFee(); if (!isEqual(orderLine.getCost(), fee)) { return false; } if (!isEqual(orderLine.getTotal(), fee)) { return false; } if (!isEqual(orderLine.getQuantity(), 1L)) { return false; } if (!isEqual(orderLine.getDebit().equals("Y"), segmentTariff.getType().getId().equals("D"))) { return false; } return true; }
private boolean validateTraffic(SegmentTariffDto segmentTariff, PanOrderLineDto orderLine) { Double fee = segmentTariff.getFee() == null ? 0.0 : segmentTariff.getFee(); Double tdFee = segmentTariff.getTdCommissionFee() == null ? 0.0 : segmentTariff.getTdCommissionFee(); Long numOff = segmentTariff.getNumberOf() == null ? 1L : segmentTariff.getNumberOf(); if (!isEqual(orderLine.getCost(), fee * numOff)) { return false; } if (!isEqual(orderLine.getTotal(), (fee + tdFee) * numOff)) { return false; } if (!isEqual(orderLine.getQuantity(), 1L)) { return false; } if (!isEqual(orderLine.getDebit().equals("Y"), segmentTariff.getType().getId().equals("D"))) { return false; } return true; }