2.4.5: hotfix-transaction fee config

master
Yixian 3 years ago
parent 1142976984
commit e2f1ca5d7c

@ -2115,11 +2115,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
newConfig.put("rate_value", config.getBigDecimal(rateKey));
newConfig.put("rate_name", channel);
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()) {
return;
}
@ -2149,10 +2144,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientRateMapper.saveRate(newConfig);
}
} 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);
} 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);
} else {
clientRateMapper.saveRate(newConfig);

Loading…
Cancel
Save