1
0
mirror of synced 2025-12-28 22:31:14 +08:00

🆕 #2501【微信支付】增加V3版本回调通知应答

This commit is contained in:
0katekate0
2022-08-16 19:46:27 +08:00
committed by GitHub
parent c84b46a55b
commit 6472484b32
3 changed files with 89 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package com.github.binarywang.wxpay.bean.notify;
import lombok.extern.slf4j.Slf4j;
import org.testng.annotations.Test;
import static org.assertj.core.api.Assertions.assertThat;
@@ -10,8 +11,12 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author <a href="https://github.com/binarywang">Binary Wang</a>
* @date 2019-06-30
*/
@Slf4j
public class WxPayNotifyResponseTest {
/**
* V2版本
*/
@Test
public void testSuccess() {
final String result = WxPayNotifyResponse.success("OK");
@@ -38,4 +43,23 @@ public class WxPayNotifyResponseTest {
"<return_msg><![CDATA[500]]></return_msg>" +
"</xml>");
}
/**
* V3版本
* https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_5.shtml
*/
@Test
public void testV3Fail() {
final String result = WxPayNotifyV3Response.fail("失败");
log.info(result);
assertThat(result).isNotEmpty();
}
@Test
public void testV3Success() {
final String result = WxPayNotifyV3Response.success("成功");
log.info(result);
assertThat(result).isNotEmpty();
}
}