From eb987323e1235de746769582e97cae7a499f9e67 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Thu, 24 Jul 2025 15:35:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?:art:=20=E4=BF=AE=E5=A4=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E5=8F=98=E9=87=8F=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binarywang/wxpay/bean/notify/WxPayRefundNotifyResult.java | 4 ++-- .../wxpay/bean/notify/WxPayRefundNotifyResultTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResult.java index ae86b8c854..8615a2e461 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResult.java @@ -273,7 +273,7 @@ public String toString() { * */ @XStreamAlias("refund_recv_accout") - private String refundRecvAccout; + private String refundRecvAccount; /** *
@@ -324,7 +324,7 @@ public void loadXML(Document d) {
       settlementRefundFee = readXmlInteger(d, "settlement_refund_fee");
       refundStatus = readXmlString(d, "refund_status");
       successTime = readXmlString(d, "success_time");
-      refundRecvAccout = readXmlString(d, "refund_recv_accout");
+      refundRecvAccount = readXmlString(d, "refund_recv_accout");
       refundAccount = readXmlString(d, "refund_account");
       refundRequestSource = readXmlString(d, "refund_request_source");
     }
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResultTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResultTest.java
index 963afb2618..e7a22ee6cd 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResultTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/notify/WxPayRefundNotifyResultTest.java
@@ -119,7 +119,7 @@ public void testFromXMLFastMode() throws WxPayException {
       refundNotifyResult.loadReqInfo(xmlDecryptedReqInfo);
       assertEquals(refundNotifyResult.getReqInfo().getRefundFee().intValue(), 15);
       assertEquals(refundNotifyResult.getReqInfo().getRefundStatus(), "SUCCESS");
-      assertEquals(refundNotifyResult.getReqInfo().getRefundRecvAccout(), "用户零钱");
+      assertEquals(refundNotifyResult.getReqInfo().getRefundRecvAccount(), "用户零钱");
       System.out.println(refundNotifyResult);
     } finally {
       XmlConfig.fastMode = false;

From 63194e782b0be791db43e90ce7a3a542206cc963 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 24 Jul 2025 07:42:56 +0000
Subject: [PATCH 2/4] Initial plan


From cb2ca22552c8a312a995ed88d238da06dfb44bbb Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 24 Jul 2025 07:59:25 +0000
Subject: [PATCH 3/4] Fix WeChat League API URL patterns to match official API
 specifications

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
---
 .../weixin/channel/constant/WxChannelApiUrlConstants.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
index b7d3add72a..5502ac8ebb 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/WxChannelApiUrlConstants.java
@@ -372,11 +372,11 @@ public interface League {
     /** 添加团长商品到橱窗 */
     String ADD_SUPPLIER_GOODS_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/window/add";
     /** 查询橱窗上团长商品列表 */
-    String LIST_SUPPLIER_GOODS_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/window/getall";
+    String LIST_SUPPLIER_GOODS_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/window/list/get";
     /** 从橱窗移除团长商品 */
     String REMOVE_SUPPLIER_GOODS_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/window/remove";
     /** 查询橱窗上团长商品详情 */
-    String GET_SUPPLIER_GOODS_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/window/getdetail";
+    String GET_SUPPLIER_GOODS_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/window/get";
     /** 获取达人橱窗授权链接 */
     String GET_SUPPLIER_AUTH_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/windowauth/get";
     /** 获取达人橱窗授权状态 */
@@ -384,9 +384,9 @@ public interface League {
     /** 获取团长账户余额 */
     String GET_SUPPLIER_BALANCE_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/funds/balance/get";
     /** 获取资金流水详情 */
-    String GET_SUPPLIER_BALANCE_FLOW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/funds/flowdetail/get";
+    String GET_SUPPLIER_BALANCE_FLOW_DETAIL_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/funds/flow/detail/get";
     /** 获取资金流水列表 */
-    String GET_SUPPLIER_BALANCE_FLOW_LIST_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/funds/flowlist/get";
+    String GET_SUPPLIER_BALANCE_FLOW_LIST_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/funds/flow/list/get";
     /** 获取合作商品详情 */
     String GET_SUPPLIER_ITEM_URL = "https://api.weixin.qq.com/channels/ec/league/headsupplier/item/get";
     /** 获取合作商品列表 */

From 64b8efe21fed37963b4e34b0fa553ee3ffee2664 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 24 Jul 2025 08:01:19 +0000
Subject: [PATCH 4/4] Add validation tests for League API URL pattern
 consistency

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
---
 .../channel/test/LeagueUrlPatternTest.java    | 98 +++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 weixin-java-channel/src/test/java/me/chanjar/weixin/channel/test/LeagueUrlPatternTest.java

diff --git a/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/test/LeagueUrlPatternTest.java b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/test/LeagueUrlPatternTest.java
new file mode 100644
index 0000000000..20878cc391
--- /dev/null
+++ b/weixin-java-channel/src/test/java/me/chanjar/weixin/channel/test/LeagueUrlPatternTest.java
@@ -0,0 +1,98 @@
+package me.chanjar.weixin.channel.test;
+
+import me.chanjar.weixin.channel.constant.WxChannelApiUrlConstants.League;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ * WeChat League API URL Pattern Validation Test
+ * 
+ * This test verifies that all League API URLs follow consistent patterns
+ * to avoid the 48001 error (no interface permission) mentioned in issue #3630.
+ */
+public class LeagueUrlPatternTest {
+
+    @Test
+    public void testWindowUrlPatternsAreConsistent() {
+        // Verify that window-related URLs follow consistent patterns
+        String listUrl = League.LIST_SUPPLIER_GOODS_URL;
+        String detailUrl = League.GET_SUPPLIER_GOODS_URL;
+        
+        // List URLs should end with /list/get
+        Assert.assertTrue(listUrl.endsWith("/list/get"), 
+            "LIST_SUPPLIER_GOODS_URL should end with /list/get for consistency");
+        
+        // Detail/Get URLs should end with /get (but not /list/get)
+        Assert.assertTrue(detailUrl.endsWith("/get"), 
+            "GET_SUPPLIER_GOODS_URL should end with /get");
+        Assert.assertFalse(detailUrl.contains("getdetail"), 
+            "GET_SUPPLIER_GOODS_URL should not contain 'getdetail' pattern");
+    }
+    
+    @Test 
+    public void testFlowUrlPatternsAreConsistent() {
+        // Verify that flow-related URLs follow the same pattern as other list/detail URLs
+        String flowDetailUrl = League.GET_SUPPLIER_BALANCE_FLOW_DETAIL_URL;
+        String flowListUrl = League.GET_SUPPLIER_BALANCE_FLOW_LIST_URL;
+        
+        // Flow detail URL should follow proper pattern
+        Assert.assertTrue(flowDetailUrl.contains("/flow/detail/get"), 
+            "Flow detail URL should use '/flow/detail/get' pattern");
+        Assert.assertFalse(flowDetailUrl.contains("flowdetail"), 
+            "Flow detail URL should not use 'flowdetail' pattern");
+            
+        // Flow list URL should follow proper pattern  
+        Assert.assertTrue(flowListUrl.contains("/flow/list/get"),
+            "Flow list URL should use '/flow/list/get' pattern");
+        Assert.assertFalse(flowListUrl.contains("flowlist"),
+            "Flow list URL should not use 'flowlist' pattern");
+    }
+    
+    @Test
+    public void testAllUrlsHaveCorrectBasePattern() {
+        // Verify all supplier URLs start with the correct base path
+        String expectedBase = "https://api.weixin.qq.com/channels/ec/league/headsupplier/";
+        
+        String[] supplierUrls = {
+            League.ADD_SUPPLIER_GOODS_URL,
+            League.LIST_SUPPLIER_GOODS_URL,
+            League.REMOVE_SUPPLIER_GOODS_URL,
+            League.GET_SUPPLIER_GOODS_URL,
+            League.GET_SUPPLIER_AUTH_URL,
+            League.GET_SUPPLIER_AUTH_STATUS_URL,
+            League.GET_SUPPLIER_BALANCE_URL,
+            League.GET_SUPPLIER_BALANCE_FLOW_DETAIL_URL,
+            League.GET_SUPPLIER_BALANCE_FLOW_LIST_URL,
+            League.GET_SUPPLIER_ITEM_URL,
+            League.GET_SUPPLIER_ITEM_LIST_URL,
+            League.GET_SUPPLIER_ORDER_URL,
+            League.GET_SUPPLIER_ORDER_LIST_URL, // This was the working URL mentioned in the issue
+            League.GET_SUPPLIER_SHOP_URL,
+            League.GET_SUPPLIER_SHOP_LIST_URL
+        };
+        
+        for (String url : supplierUrls) {
+            Assert.assertTrue(url.startsWith(expectedBase), 
+                "URL " + url + " should start with " + expectedBase);
+        }
+    }
+    
+    @Test
+    public void testWorkingUrlPatternIsFollowed() {
+        // The issue mentioned that GET_SUPPLIER_ORDER_LIST_URL works correctly
+        // All similar URLs should follow the same pattern
+        String workingUrl = League.GET_SUPPLIER_ORDER_LIST_URL;
+        String workingPattern = "/order/list/get";
+        
+        Assert.assertTrue(workingUrl.endsWith(workingPattern), 
+            "Working URL should end with " + workingPattern);
+            
+        // Other list URLs should follow the same pattern
+        Assert.assertTrue(League.LIST_SUPPLIER_GOODS_URL.endsWith("/list/get"),
+            "LIST_SUPPLIER_GOODS_URL should follow the same pattern as working URL");
+        Assert.assertTrue(League.GET_SUPPLIER_ITEM_LIST_URL.endsWith("/list/get"), 
+            "GET_SUPPLIER_ITEM_LIST_URL should follow the same pattern as working URL");
+        Assert.assertTrue(League.GET_SUPPLIER_SHOP_LIST_URL.endsWith("/list/get"),
+            "GET_SUPPLIER_SHOP_LIST_URL should follow the same pattern as working URL");
+    }
+}
\ No newline at end of file