mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update 订单分账
This commit is contained in:
@@ -1008,8 +1008,8 @@ public class AdapayService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建交易确认请求/创建分账请求
|
||||
* 这个方法只适用于多用户分账
|
||||
* 创建交易确认请求/创建分账请求/分账主逻辑
|
||||
* 这个方法支持多用户分账
|
||||
*/
|
||||
public PaymentConfirmResponse createPaymentConfirmRequest(PaymentConfirmParam param) {
|
||||
String paymentId = param.getPaymentId(); // 支付对象id
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user