diff --git a/yudao-module-pay/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/AbstractWxPayClient.java b/yudao-module-pay/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/AbstractWxPayClient.java index 1c1dafc640..5eb6d85351 100644 --- a/yudao-module-pay/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/AbstractWxPayClient.java +++ b/yudao-module-pay/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/weixin/AbstractWxPayClient.java @@ -24,6 +24,8 @@ import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult; import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyV3Result; import com.github.binarywang.wxpay.bean.request.*; import com.github.binarywang.wxpay.bean.result.*; +import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesRequest; +import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesResult; import com.github.binarywang.wxpay.bean.transfer.TransferBatchesRequest; import com.github.binarywang.wxpay.bean.transfer.TransferBatchesResult; import com.github.binarywang.wxpay.config.WxPayConfig; @@ -484,9 +486,28 @@ public abstract class AbstractWxPayClient extends AbstractPayClient Objects.equals("SUCCESS", detail.getDetailStatus()))) { + return PayTransferRespDTO.successOf(transferBatch.getBatchId(), parseDateV3(transferBatch.getUpdateTime()), + transferBatch.getOutBatchNo(), response); + } + if (response.getTransferDetailList().stream().anyMatch(detail -> Objects.equals("FAIL", detail.getDetailStatus()))) { + return PayTransferRespDTO.closedOf(transferBatch.getBatchStatus(), transferBatch.getCloseReason(), + transferBatch.getOutBatchNo(), response); + } + } + if (Objects.equals("CLOSED", transferBatch.getBatchStatus())) { + return PayTransferRespDTO.closedOf(transferBatch.getBatchStatus(), transferBatch.getCloseReason(), + transferBatch.getOutBatchNo(), response); + } + return PayTransferRespDTO.dealingOf(transferBatch.getBatchId(), transferBatch.getOutBatchNo(), response); } // ========== 各种工具方法 ==========