From e1d447f370e4146c005372ee3114c74dfc015bd7 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 18 Aug 2026 11:39:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E6=97=A7=E7=89=88?= =?UTF-8?q?=E9=80=80=E6=AC=BE=E6=8F=90=E7=8E=B0=E9=80=9A=E7=9F=A5=E8=A7=A3?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wxpay/service/EcommerceService.java | 18 ++++++++++++++++++ .../LegacyEcommerceApiCompatibilityTest.java | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java index 6475bec7f..d4e344993 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java @@ -532,6 +532,15 @@ T combineTransactions(TradeTypeEnum tradeType, */ RefundNotifyResult parseRefundNotifyResult(String notifyData, SignatureHeader header) throws WxPayException; + /** + * @deprecated 从 4.8.5.B 起,请改用使用 {@link SignatureHeader} 的同名方法;5.0 将移除。 + */ + @Deprecated + default RefundNotifyResult parseRefundNotifyResult(String notifyData, + com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader header) throws WxPayException { + return parseRefundNotifyResult(notifyData, toUnifiedSignatureHeader(header)); + } + /** *
    * 提现状态变更通知回调数据处理
@@ -545,6 +554,15 @@  T combineTransactions(TradeTypeEnum tradeType,
    */
   WithdrawNotifyResult parseWithdrawNotifyResult(String notifyData, SignatureHeader header) throws WxPayException;
 
+  /**
+   * @deprecated 从 4.8.5.B 起,请改用使用 {@link SignatureHeader} 的同名方法;5.0 将移除。
+   */
+  @Deprecated
+  default WithdrawNotifyResult parseWithdrawNotifyResult(String notifyData,
+                                                         com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader header) throws WxPayException {
+    return parseWithdrawNotifyResult(notifyData, toUnifiedSignatureHeader(header));
+  }
+
   /**
    * 
    * 二级商户账户余额提现API
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/LegacyEcommerceApiCompatibilityTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/LegacyEcommerceApiCompatibilityTest.java
index ad044640f..a82dadb76 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/LegacyEcommerceApiCompatibilityTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/LegacyEcommerceApiCompatibilityTest.java
@@ -17,4 +17,12 @@ public void shouldKeepLegacyTransactionResultAndTradeTypeAvailable() {
     Assert.assertNotNull(result);
     Assert.assertEquals(TradeTypeEnum.JSAPI.name(), "JSAPI");
   }
+
+  @Test
+  public void shouldKeepLegacyRefundAndWithdrawNotificationSignatures() throws Exception {
+    Class legacyHeader = com.github.binarywang.wxpay.bean.ecommerce.SignatureHeader.class;
+
+    Assert.assertNotNull(EcommerceService.class.getMethod("parseRefundNotifyResult", String.class, legacyHeader));
+    Assert.assertNotNull(EcommerceService.class.getMethod("parseWithdrawNotifyResult", String.class, legacyHeader));
+  }
 }