|
|
@ -2115,11 +2115,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
newConfig.put("rate_value", config.getBigDecimal(rateKey));
|
|
|
|
newConfig.put("rate_value", config.getBigDecimal(rateKey));
|
|
|
|
newConfig.put("rate_name", channel);
|
|
|
|
newConfig.put("rate_name", channel);
|
|
|
|
newConfig.put("pay_type", config.getString("pay_type"));
|
|
|
|
newConfig.put("pay_type", config.getString("pay_type"));
|
|
|
|
BigDecimal transactionFeeDecimal = config.getBigDecimal("transaction_fee");
|
|
|
|
|
|
|
|
TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator(channel))
|
|
|
|
|
|
|
|
.map(calculator -> calculator.convertTransactionFee(transactionFeeDecimal))
|
|
|
|
|
|
|
|
.orElse(TransactionFee.ZERO);
|
|
|
|
|
|
|
|
newConfig.put("transaction_fee", transFee.storeValue());
|
|
|
|
|
|
|
|
if (!clientRateMapper.listClientRatesForSaving(clientId, config.getDate("active_time"), config.getDate("expiry_time"), config.getBigDecimal("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) {
|
|
|
|
if (!clientRateMapper.listClientRatesForSaving(clientId, config.getDate("active_time"), config.getDate("expiry_time"), config.getBigDecimal("rate_value"), config.getInteger("clean_days"), channel).isEmpty()) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2149,10 +2144,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if ("ApsInStore".equalsIgnoreCase(channel)) {
|
|
|
|
} else if ("ApsInStore".equalsIgnoreCase(channel)) {
|
|
|
|
newConfig.put("transaction_fee", newConfig.getFloatValue("retail_service_fee_value"));
|
|
|
|
BigDecimal transactionFeeDecimal = config.getBigDecimal("retail_service_fee_value");
|
|
|
|
|
|
|
|
TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator("ApsInStore"))
|
|
|
|
|
|
|
|
.map(calculator -> calculator.convertTransactionFee(transactionFeeDecimal))
|
|
|
|
|
|
|
|
.orElse(TransactionFee.ZERO);
|
|
|
|
|
|
|
|
newConfig.put("transaction_fee", transFee.storeValue());
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
} else if ("ApsCashier".equalsIgnoreCase(channel)) {
|
|
|
|
} else if ("ApsCashier".equalsIgnoreCase(channel)) {
|
|
|
|
newConfig.put("transaction_fee", newConfig.getFloatValue("online_service_fee_value"));
|
|
|
|
BigDecimal transactionFeeDecimal = config.getBigDecimal("online_service_fee_value");
|
|
|
|
|
|
|
|
TransactionFee transFee = Optional.ofNullable(paymentApi.channelCalculator("ApsCashier"))
|
|
|
|
|
|
|
|
.map(calculator -> calculator.convertTransactionFee(transactionFeeDecimal))
|
|
|
|
|
|
|
|
.orElse(TransactionFee.ZERO);
|
|
|
|
|
|
|
|
newConfig.put("transaction_fee", transFee.storeValue());
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|
clientRateMapper.saveRate(newConfig);
|
|
|
|