update 订单分账

This commit is contained in:
Guoqs
2024-11-18 16:38:18 +08:00
parent 3b22644497
commit a40472e4ba
2 changed files with 20 additions and 6 deletions

View File

@@ -1008,8 +1008,8 @@ public class AdapayService {
}
/**
* 创建交易确认请求/创建分账请求
* 这个方法只适用于多用户分账
* 创建交易确认请求/创建分账请求/分账主逻辑
* 这个方法支持多用户分账
*/
public PaymentConfirmResponse createPaymentConfirmRequest(PaymentConfirmParam param) {
String paymentId = param.getPaymentId(); // 支付对象id

View File

@@ -7,6 +7,7 @@ import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.jsowell.adapay.common.DivMember;
import com.jsowell.adapay.dto.PaymentConfirmParam;
import com.jsowell.adapay.dto.QueryConfirmReverseDTO;
import com.jsowell.adapay.dto.QueryPaymentConfirmDTO;
import com.jsowell.adapay.operation.PaymentReverseOperation;
@@ -1409,9 +1410,16 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
String paymentId = vo.getPaymentId();
BigDecimal deductionAmount = vo.getDeductionAmount();
PaymentConfirmParam param = PaymentConfirmParam.builder()
.paymentId(paymentId)
.divMemberList(divMemberList)
.confirmAmt(confirmAmt)
.orderCode(orderCode)
.wechatAppId(wechatAppId)
.build();
// 延时分账使用确认交易API
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequestMultiuser(paymentId,
divMemberList, deductionAmount, orderCode, wechatAppId);
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(param);
if (paymentConfirmResponse != null && paymentConfirmResponse.isNotFailed()) {
confirmAmt = confirmAmt.add(new BigDecimal(paymentConfirmResponse.getConfirm_amt()));
@@ -1612,9 +1620,15 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
// 校验订单是否分账 状态为非交易完成的时候,进行分账处理
if (!AdapayStatusEnum.SUCCEEDED.getValue().equals(result.getStatus())) {
PaymentConfirmParam param = PaymentConfirmParam.builder()
.paymentId(paymentId)
.divMemberList(divMemberList)
.confirmAmt(settleAmount)
.orderCode(orderCode)
.wechatAppId(wechatAppId)
.build();
// 调汇付的分账接口 确认交易
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequestMultiuser(paymentId,
divMemberList, settleAmount, orderCode, wechatAppId);
PaymentConfirmResponse paymentConfirmResponse = adapayService.createPaymentConfirmRequest(param);
// 分账接口返回的信息
result = new OrderSplitResult();