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"; /** 获取合作商品列表 */ 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 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;