创建余额支付请求

This commit is contained in:
2023-07-29 16:43:16 +08:00
parent 3ee5d726b8
commit 8b0427035b
3 changed files with 71 additions and 0 deletions

View File

@@ -453,6 +453,12 @@ public class AdapayMemberService {
log.info("取现接口返回参数" + JSON.toJSONString(settleCount));
}
/**
* 更新汇付会员信息
* @param dto
* @return
* @throws BaseAdaPayException
*/
public Map<String, Object> updateAdapayMember(SettleAccountDTO dto) throws BaseAdaPayException {
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(dto.getMerchantId());
if (adapayMemberAccount == null) {
@@ -487,4 +493,24 @@ public class AdapayMemberService {
}
return null;
}
/**
* 创建余额支付请求
* @param outMemberId 出账用户的member_id 若为商户本身时请传入0
* @param inMemberId 入账用户的member_id 若为商户本身时请传入0
* @param transAmt 交易金额, 必须大于0保留两位小数点如0.10、100.05等
*/
public void createBalancePaymentRequest(String outMemberId, String inMemberId, String transAmt) throws BaseAdaPayException {
Map<String, Object> balanceParam = Maps.newHashMap();
balanceParam.put("app_id", ADAPAY_APP_ID);
balanceParam.put("adapay_func_code", "settle_accounts.balancePay");
balanceParam.put("order_no", IdUtils.fastSimpleUUID());
balanceParam.put("out_member_id", outMemberId);
balanceParam.put("in_member_id", "0");
balanceParam.put("trans_amt", AdapayUtil.formatAmount(transAmt));
balanceParam.put("goods_title", "测试余额支付");
balanceParam.put("goods_desc", "该商品信息用于测试余额支付");
Map<String, Object> paymentResult = AdapayCommon.requestAdapay(balanceParam);
log.info("创建余额支付param:{}, result:{}", JSON.toJSONString(balanceParam), JSON.toJSONString(paymentResult));
}
}