:new:【微信支付】增加商家转账到零钱结果回调的解析方法

This commit is contained in:
wzkris
2024-08-30 11:23:11 +00:00
committed by Binary Wang
parent 317ccada36
commit 43d270ac78
4 changed files with 116 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package com.github.binarywang.wxpay.service;
import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.transfer.*;
import com.github.binarywang.wxpay.exception.WxPayException;
@@ -28,6 +29,17 @@ public interface TransferService {
*/
TransferBatchesResult transferBatches(TransferBatchesRequest request) throws WxPayException;
/**
* 解析商家转账结果
* 详见<a href="https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-batch-callback-notice.html"></a>
*
* @param notifyData 通知数据
* @param header 通知头部数据,不传则表示不校验头
* @return the wx transfer notify result
* @throws WxPayException the wx pay exception
*/
TransferNotifyResult parseTransferNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
/**
* <pre>
*

View File

@@ -1,5 +1,6 @@
package com.github.binarywang.wxpay.service.impl;
import com.github.binarywang.wxpay.bean.notify.SignatureHeader;
import com.github.binarywang.wxpay.bean.transfer.*;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.TransferService;
@@ -36,6 +37,11 @@ public class TransferServiceImpl implements TransferService {
return GSON.fromJson(result, TransferBatchesResult.class);
}
@Override
public TransferNotifyResult parseTransferNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
return this.payService.baseParseOrderNotifyV3Result(notifyData, header, TransferNotifyResult.class, TransferNotifyResult.DecryptNotifyResult.class);
}
@Override
public QueryTransferBatchesResult transferBatchesBatchId(QueryTransferBatchesRequest request) throws WxPayException {
String url;