Explorar el Código

#1088 微信支付结果通知内容细微调整,希望能解决部分人遇到的变态问题

master
Binary Wang hace 5 años
padre
commit
9149cd441a
Se han modificado 2 ficheros con 5 adiciones y 5 borrados
  1. +2
    -2
      weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayNotifyResponse.java
  2. +3
    -3
      weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/notify/WxPayNotifyResponseTest.java

+ 2
- 2
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/WxPayNotifyResponse.java Ver fichero

@@ -44,7 +44,7 @@ public class WxPayNotifyResponse {
WxPayNotifyResponse response = new WxPayNotifyResponse(FAIL, msg);
XStream xstream = XStreamInitializer.getInstance();
xstream.autodetectAnnotations(true);
return xstream.toXML(response);
return xstream.toXML(response).replace("\n", "").replace(" ", "");
}

/**
@@ -57,7 +57,7 @@ public class WxPayNotifyResponse {
WxPayNotifyResponse response = new WxPayNotifyResponse(SUCCESS, msg);
XStream xstream = XStreamInitializer.getInstance();
xstream.autodetectAnnotations(true);
return xstream.toXML(response);
return xstream.toXML(response).replace("\n", "").replace(" ", "");
}

}

+ 3
- 3
weixin-java-pay/src/test/java/com/github/binarywang/wxpay/bean/notify/WxPayNotifyResponseTest.java Ver fichero

@@ -15,9 +15,9 @@ public class WxPayNotifyResponseTest {
@Test
public void testSuccess() {
final String result = WxPayNotifyResponse.success("OK");
assertThat(result).isEqualTo("<xml>\n" +
" <return_code><![CDATA[SUCCESS]]></return_code>\n" +
" <return_msg><![CDATA[OK]]></return_msg>\n" +
assertThat(result).isEqualTo("<xml>" +
"<return_code><![CDATA[SUCCESS]]></return_code>" +
"<return_msg><![CDATA[OK]]></return_msg>" +
"</xml>");
}
}

Cargando…
Cancelar
Guardar