Commit e36cb7bc by 程裕兵

feat:get fee rate

parent 3da35aea
......@@ -75,8 +75,6 @@ public class PayConvert {
MerchantVO merchant) {
setSubChannel(params);
Long id = IdWorker.getId();
BigDecimal feeRate = getFeeRate(params, merchant);
BigDecimal fee = FeeUtil.calPayFee(feeRate, params.getTransAmount());
return StudioCashierRecord.builder()
.id(id)
.transNo(id.toString())
......@@ -92,9 +90,6 @@ public class PayConvert {
.channelNo(merchant.getChannelNo())
.subChannel(params.getSubChannel().getCode())
.transAmount(params.getTransAmount())
.feeRate(feeRate)
.fee(fee)
.actualAmount(MoneyUtil.subtract(params.getTransAmount(), fee))
.transState(BrandCashierTransStateEnum.PAY_INIT.getCode())
.buyerName(params.getBuyerName())
.buyerPhone(params.getBuyerPhone())
......
......@@ -41,6 +41,7 @@ import com.jiejing.fitness.finance.service.rpc.PayRpcService;
import com.jiejing.fitness.finance.service.rpc.StudioRpcService;
import com.jiejing.fitness.finance.service.utils.DingUtil;
import com.jiejing.fitness.finance.service.utils.FeeUtil;
import com.jiejing.fitness.finance.service.utils.MoneyUtil;
import com.jiejing.paycenter.api.pay.PayApi;
import com.jiejing.paycenter.common.enums.common.PayChannelEnums;
import com.jiejing.paycenter.common.enums.common.TransStateEnums;
......@@ -170,7 +171,7 @@ public class PayServiceImpl implements PayService {
PayRequest request = PayConvert.convert(params, record);
record.setFeeRate(payRpcService.getFeeRate(request));
record.setFee(FeeUtil.calPayFee(record.getFeeRate(), params.getTransAmount()));
record.setActualAmount(MoneyUtil.subtract(params.getTransAmount(), record.getFee()));
studioCashierRecordRpService.insert(record);
return payRpcService.pay(request);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment