diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesRequest.java index 6e6b3846d6161bb95ec550e95d7090eb95bb3b5b..e9f0026e35525e3b9e6dfbb58ca73bc0b6c7fd83 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBatchesRequest.java @@ -72,6 +72,12 @@ public class TransferBatchesRequest implements Serializable { @SerializedName("transfer_scene_id") private String transferSceneId; + /** + * 异步接收微信支付结果通知的回调地址,通知url必须为公网可访问的url,必须为https,不能携带参数 + */ + @SerializedName("notify_url") + private String notifyUrl; + @Data @Builder(builderMethodName = "newBuilder") @AllArgsConstructor diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferNotifyResult.java new file mode 100644 index 0000000000000000000000000000000000000000..532bfa3c6ed9f4981c14a7009fcd855ce85b5ab8 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferNotifyResult.java @@ -0,0 +1,92 @@ +package com.github.binarywang.wxpay.bean.transfer; + +import com.github.binarywang.wxpay.bean.notify.OriginNotifyResponse; +import com.github.binarywang.wxpay.bean.notify.WxPayBaseNotifyV3Result; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + *
+ * 商家转账到零钱接口将转账结果通知用户 + * 文档地址:https://pay.weixin.qq.com/docs/merchant/apis/batch-transfer-to-balance/transfer-batch-callback-notice.html + *+ */ +@Data +public class TransferNotifyResult implements Serializable, WxPayBaseNotifyV3Result
* diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java index b328ded73e68c09744391b7cea5bb21b6204fcfb..e1054b56e188b34a9e131e8cf0c1a54d54ab2145 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java @@ -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 = String.format("%s/v3/transfer/batches/batch-id/%s?need_query_detail=%s&offset=%s&limit=%s&detail_status=%s",