diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 2295275b3..dc50ae7f1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -79,6 +79,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.Assert; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -1012,7 +1013,7 @@ public class RetailAppServiceImp implements RetailAppService { @Override public void sendCleanMessage(JSONObject log_clearing_detail, int client_id) { - String clearing_amount = log_clearing_detail.getBigDecimal("clearing_amount").setScale(2, BigDecimal.ROUND_HALF_DOWN).toString(); + String clearing_amount = log_clearing_detail.getBigDecimal("clearing_amount").setScale(2, RoundingMode.HALF_DOWN).toString(); String settle_date_from = DateFormatUtils.format(log_clearing_detail.getDate("settle_date_from"), "MM/dd/yyyy"); String settle_date_to = DateFormatUtils.format(log_clearing_detail.getDate("settle_date_to"), "MM/dd/yyyy"); logger.debug("sendCleanMessage-" + log_clearing_detail.getString("client_moniker") + "- " + PlatformEnvironment.getEnv().getForeignCurrency() + " " diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index 2eafe4324..196ccd952 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -510,9 +510,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider String transactionTime = DateFormatUtils.format(transaction.getDate("transaction_time"), "dd/MM/yyyy h:mm:ss a", Locale.ENGLISH); int multiply = "Credit".equals(transaction.getString("transaction_type")) ? 1 : -1; BigDecimal transactionAmount = transaction.getBigDecimal("transaction_amount").multiply(BigDecimal.valueOf(multiply)).setScale(2, - BigDecimal.ROUND_HALF_DOWN); + RoundingMode.HALF_DOWN); BigDecimal clearingAmount = transaction.getBigDecimal("clearing_amount").multiply(BigDecimal.valueOf(multiply)).setScale(2, - BigDecimal.ROUND_HALF_DOWN); + RoundingMode.HALF_DOWN); String[] values = {transaction.getString("system_transaction_id"), transaction.getString("order_id"), transaction.getString("client_id"), transaction.getString("device_id"), transaction.getString("transaction_currency"), transactionAmount.toPlainString(), transaction.getString("clearing_currency"), clearingAmount.toPlainString(), transaction.getString("channel"), transactionTime, "0"}; diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 044205045..92399242b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -129,6 +129,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.math.BigDecimal; +import java.math.RoundingMode; import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; @@ -3040,7 +3041,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (appClientBean.getCustomerSurchargeRate() <= 0) { throw new ForbiddenException("customerSurchargeRate is 0"); } - BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, BigDecimal.ROUND_HALF_DOWN); + BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, RoundingMode.HALF_DOWN); setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate); } clientInfoCacheSupport.clearClientCache(client_id);