mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🆕 #3474 【微信支付】增加2025.1.15正式上线的商户转账新版本的相关接口
This commit is contained in:
@@ -111,4 +111,31 @@ public interface TransferService {
|
||||
*/
|
||||
TransferBatchDetailResult transferBatchesOutBatchNoDetail(String outBatchNo, String outDetailNo) throws WxPayException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
*
|
||||
* 2025.1.15 开始新接口 发起商家转账API
|
||||
*
|
||||
* 请求方式:POST(HTTPS)
|
||||
* 请求地址:<a href="https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills">请求地址</a>
|
||||
*
|
||||
* 文档地址:<a href="https://pay.weixin.qq.com/doc/v3/merchant/4012716434">发起商家转账API</a>
|
||||
* </pre>
|
||||
*
|
||||
* @param request 转账请求参数
|
||||
* @return TransferBillsResult 转账结果
|
||||
* @throws WxPayException .
|
||||
*/
|
||||
TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 2025.1.15 开始新接口 解析商家转账结果
|
||||
* 详见<a href="https://pay.weixin.qq.com/doc/v3/merchant/4012712115"></a>
|
||||
*
|
||||
* @param notifyData 通知数据
|
||||
* @param header 通知头部数据,不传则表示不校验头
|
||||
* @return the wx transfer notify result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.github.binarywang.wxpay.bean.notify.*;
|
||||
import com.github.binarywang.wxpay.bean.request.*;
|
||||
import com.github.binarywang.wxpay.bean.result.*;
|
||||
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
|
||||
import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult;
|
||||
import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants;
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
@@ -991,6 +992,17 @@ public interface WxPayService {
|
||||
*/
|
||||
WxPayTransferBatchesNotifyV3Result parseTransferBatchesNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 解析商家转账批次回调通知
|
||||
* https://pay.weixin.qq.com/doc/v3/merchant/4012712115
|
||||
*
|
||||
* @param notifyData
|
||||
* @param header
|
||||
* @return
|
||||
* @throws WxPayException
|
||||
*/
|
||||
TransferBillsNotifyResult parseTransferBillsNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 解析服务商模式退款结果通知
|
||||
* 详见https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_11.shtml
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult;
|
||||
import com.github.binarywang.wxpay.bean.request.*;
|
||||
import com.github.binarywang.wxpay.bean.result.*;
|
||||
import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum;
|
||||
import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult;
|
||||
import com.github.binarywang.wxpay.config.WxPayConfig;
|
||||
import com.github.binarywang.wxpay.config.WxPayConfigHolder;
|
||||
import com.github.binarywang.wxpay.constant.WxPayConstants;
|
||||
@@ -442,6 +443,11 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayTransferBatchesNotifyV3Result.class, WxPayTransferBatchesNotifyV3Result.DecryptNotifyResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransferBillsNotifyResult parseTransferBillsNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException {
|
||||
return this.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxPayPartnerRefundNotifyV3Result parsePartnerRefundNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException {
|
||||
return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayPartnerRefundNotifyV3Result.class, WxPayPartnerRefundNotifyV3Result.DecryptNotifyResult.class);
|
||||
|
||||
@@ -85,4 +85,20 @@ public class TransferServiceImpl implements TransferService {
|
||||
String result = this.payService.getV3(url);
|
||||
return GSON.fromJson(result, TransferBatchDetailResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException {
|
||||
String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills", this.payService.getPayBaseUrl());
|
||||
if (request.getUserName() != null && request.getUserName().length() > 0) {
|
||||
X509Certificate validCertificate = this.payService.getConfig().getVerifier().getValidCertificate();
|
||||
RsaCryptoUtil.encryptFields(request, validCertificate);
|
||||
}
|
||||
String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request));
|
||||
return GSON.fromJson(result, TransferBillsResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
|
||||
return this.payService.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user