Sfoglia il codice sorgente

引入配置方法,使得微信支付能够支持仿真测试环境 #119

master
Binary Wang 8 anni fa
parent
commit
9e0fcb34d0
3 ha cambiato i file con 8 aggiunte e 3 eliminazioni
  1. +3
    -1
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpPayServiceImpl.java
  2. +4
    -1
      weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpPayServiceImplTest.java
  3. +1
    -1
      weixin-java-mp/src/test/resources/testng.xml

+ 3
- 1
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpPayServiceImpl.java Vedi File

@@ -445,7 +445,9 @@ public class WxMpPayServiceImpl implements WxMpPayService {
public String createSign(Map<String, String> params, String signKey) {
if(this.getConfig().useSandboxForWxPay()){
//使用仿真测试环境
return "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456";
//TODO 目前测试发现,以下两行代码都会出问题,所以暂不建议使用这个仿真测试环境
signKey = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456";
//return "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456";
}

SortedMap<String, String> sortedMap = new TreeMap<>(params);


+ 4
- 1
weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpPayServiceImplTest.java Vedi File

@@ -73,7 +73,10 @@ public class WxMpPayServiceImplTest {
*/
@Test
public void testRefundQuery() throws Exception {
WxPayRefundQueryResult result = this.wxService.getPayService().refundQuery("1", "", "", "");
WxPayRefundQueryResult result;

result = this.wxService.getPayService().refundQuery("1", "", "", "");
System.err.println(result);
result = this.wxService.getPayService().refundQuery("", "2", "", "");
System.err.println(result);
result = this.wxService.getPayService().refundQuery("", "", "3", "");


+ 1
- 1
weixin-java-mp/src/test/resources/testng.xml Vedi File

@@ -7,7 +7,7 @@
<class name="me.chanjar.weixin.mp.api.WxMpBaseAPITest" />
<class name="me.chanjar.weixin.mp.api.WxMpMassMessageAPITest" />
<class name="me.chanjar.weixin.mp.api.impl.WxMpUserServiceImplTest" />
<class name="me.chanjar.weixin.mp.api.impl.WxMpQrCodeServiceImplTest" />
<class name="me.chanjar.weixin.mp.api.impl.WxMpQrcodeServiceImplTest" />
<class name="me.chanjar.weixin.mp.api.WxMpShortUrlAPITest" />
<class name="me.chanjar.weixin.mp.api.WxMpMessageRouterTest" />
<class name="me.chanjar.weixin.mp.api.WxMpJsAPITest" />


Caricamento…
Annulla
Salva