mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
update
This commit is contained in:
@@ -9,6 +9,7 @@ import com.huifu.adapay.model.*;
|
||||
import com.jsowell.adapay.dto.SettleAccountDTO;
|
||||
import com.jsowell.adapay.dto.UpdateAccountConfigDTO;
|
||||
import com.jsowell.adapay.dto.WithdrawDTO;
|
||||
import com.jsowell.adapay.response.BalancePaymentResponse;
|
||||
import com.jsowell.adapay.response.QueryCorpMemberResponse;
|
||||
import com.jsowell.adapay.response.QueryMemberResponse;
|
||||
import com.jsowell.adapay.vo.AdapayAccountBalanceVO;
|
||||
@@ -17,6 +18,7 @@ import com.jsowell.adapay.vo.AdapayMemberInfoVO;
|
||||
import com.jsowell.adapay.vo.AdapaySettleAccountVO;
|
||||
import com.jsowell.common.constant.Constants;
|
||||
import com.jsowell.common.enums.DelFlagEnum;
|
||||
import com.jsowell.common.enums.adapay.AdapayStatusEnum;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.AdapayUtil;
|
||||
@@ -453,7 +455,7 @@ public class AdapayMemberService {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_ADAPAY_MEMBER_IS_NULL_ERROR);
|
||||
}
|
||||
|
||||
// 提现手续费 每笔固定10元
|
||||
// 提现手续费 每笔固定5元
|
||||
BigDecimal feeAmt = new BigDecimal("5");
|
||||
|
||||
// 实际提现到账金额
|
||||
@@ -484,7 +486,7 @@ public class AdapayMemberService {
|
||||
String id = (String) settleCount.get("id");
|
||||
|
||||
// 发起支付手续费请求 inMemberId为0表示本商户
|
||||
createBalancePaymentRequest(adapayAccountBalanceVO.getAdapayMemberId(), Constants.ZERO, feeAmt.toString());
|
||||
createBalancePaymentRequest(adapayAccountBalanceVO.getAdapayMemberId(), Constants.ZERO, feeAmt.toString(), "提现手续费", "提现单号:" + id);
|
||||
|
||||
// 保存提现记录
|
||||
ClearingWithdrawInfo record = new ClearingWithdrawInfo();
|
||||
@@ -538,7 +540,7 @@ public class AdapayMemberService {
|
||||
log.info("更新企业账户param:{}", memberParams);
|
||||
Map<String, Object> member = AdapayCommon.requestAdapayFile(memberParams, file);
|
||||
log.info("更新企业账户result:{}", JSON.toJSONString(member));
|
||||
if (StringUtils.equals((String) member.get("status"), "failed")) {
|
||||
if (AdapayStatusEnum.FAILED.getValue().equals((String) member.get("status"))) {
|
||||
throw new BusinessException("", (String) member.get("error_msg"));
|
||||
}
|
||||
return null;
|
||||
@@ -549,8 +551,10 @@ public class AdapayMemberService {
|
||||
* @param outMemberId 出账用户的member_id, 若为商户本身时,请传入0
|
||||
* @param inMemberId 入账用户的member_id, 若为商户本身时,请传入0
|
||||
* @param transAmt 交易金额, 必须大于0,保留两位小数点,如0.10、100.05等
|
||||
* @param title 标题
|
||||
* @param desc 描述信息
|
||||
*/
|
||||
public void createBalancePaymentRequest(String outMemberId, String inMemberId, String transAmt) throws BaseAdaPayException {
|
||||
public BalancePaymentResponse createBalancePaymentRequest(String outMemberId, String inMemberId, String transAmt, String title, String desc) throws BaseAdaPayException {
|
||||
Map<String, Object> balanceParam = Maps.newHashMap();
|
||||
balanceParam.put("app_id", ADAPAY_APP_ID);
|
||||
balanceParam.put("adapay_func_code", "settle_accounts.balancePay");
|
||||
@@ -558,10 +562,11 @@ public class AdapayMemberService {
|
||||
balanceParam.put("out_member_id", outMemberId);
|
||||
balanceParam.put("in_member_id", inMemberId);
|
||||
balanceParam.put("trans_amt", AdapayUtil.formatAmount(transAmt));
|
||||
balanceParam.put("goods_title", "测试余额支付");
|
||||
balanceParam.put("goods_desc", "该商品信息用于测试余额支付");
|
||||
balanceParam.put("goods_title", title);
|
||||
balanceParam.put("goods_desc", desc);
|
||||
Map<String, Object> paymentResult = AdapayCommon.requestAdapay(balanceParam);
|
||||
log.info("创建余额支付param:{}, result:{}", JSON.toJSONString(balanceParam), JSON.toJSONString(paymentResult));
|
||||
return JSONObject.parseObject(JSON.toJSONString(paymentResult), BalancePaymentResponse.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user