From 87324141db379e09f52f1c1d85d3e323f6586823 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 7 Nov 2019 17:39:06 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90R=E3=80=91=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E8=B4=B9=E7=8E=87fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/merchants/core/impls/ClientManagerImpl.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 73cd2b7c9..28b988311 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.78 + 1.2.79 UTF-8 1.4.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 d1539284d..35a789bf4 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 @@ -2724,7 +2724,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } else { BigDecimal rate_value = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value"); if (customer_surcharge_rate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0 - || customer_surcharge_rate.compareTo(rate_value) < 0) { + || customer_surcharge_rate.compareTo(rate_value) <= 0) { throw new ForbiddenException("Invalid Range"); } clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account, clientMoniker, customer_surcharge_rate)); @@ -4237,10 +4237,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } if (appClientBean.getCustomerSurchargeRate() != null) { - if (appClientBean.getCustomerSurchargeRate() <= 0) { - throw new ForbiddenException("customerSurchargeRate is 0"); - } BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, RoundingMode.HALF_DOWN); + BigDecimal rateValue = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value"); + if (customerSurchargeRate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0 + || customerSurchargeRate.compareTo(rateValue) <= 0) { + throw new ForbiddenException("Invalid Range"); + } setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate); } clientInfoCacheSupport.clearClientCache(client_id);