diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java index 562a32e28..ef3fff173 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java @@ -1008,8 +1008,8 @@ public class AdapayService { } /** - * 创建交易确认请求/创建分账请求 - * 这个方法只适用于多用户分账 + * 创建交易确认请求/创建分账请求/分账主逻辑 + * 这个方法支持多用户分账 */ public PaymentConfirmResponse createPaymentConfirmRequest(PaymentConfirmParam param) { String paymentId = param.getPaymentId(); // 支付对象id diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java index 7e7818036..0fef77d78 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/OrderBasicInfoServiceImpl.java @@ -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();