1
0
mirror of synced 2025-12-24 02:57:55 +08:00

🆕 #2692【企业微信】增加家校应用-班级收款接口支持

This commit is contained in:
0katekate0
2022-06-14 09:48:27 +08:00
committed by GitHub
parent a9fe0b29d4
commit 1f3f133772
7 changed files with 184 additions and 1 deletions

View File

@@ -5,7 +5,9 @@ import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl;
import me.chanjar.weixin.cp.bean.school.WxCpCustomizeHealthInfo;
import me.chanjar.weixin.cp.bean.school.WxCpPaymentResult;
import me.chanjar.weixin.cp.bean.school.WxCpResultList;
import me.chanjar.weixin.cp.bean.school.WxCpTrade;
import me.chanjar.weixin.cp.config.WxCpConfigStorage;
import me.chanjar.weixin.cp.demo.WxCpDemoInMemoryConfigStorage;
import org.testng.annotations.Test;
@@ -44,6 +46,34 @@ public class WxCpSchoolTest {
String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
/**
* 获取学生付款结果
* https://developer.work.weixin.qq.com/document/path/94553
*/
String paymentResultStr = "{\"errcode\":0,\"errmsg\":\"ok\",\"project_name\":\"学费\",\"amount\":998,\"payment_result\":[{\"student_userid\":\"xxxx\",\"trade_state\":1,\"trade_no\":\"xxxxx\",\"payer_parent_userid\":\"zhangshan\"}]}";
WxCpPaymentResult cpPaymentResult = WxCpPaymentResult.fromJson(paymentResultStr);
log.info("cpPaymentResult:{}", cpPaymentResult.toJson());
WxCpPaymentResult paymentResult = cpService.getSchoolService().getPaymentResult("");
log.info("paymentResult:{}", paymentResult.toJson());
/**
* 获取订单详情
* https://developer.work.weixin.qq.com/document/path/94554
*/
String tradeStr = "{\n" +
"\t\"errcode\":0,\n" +
"\t\"errmsg\":\"ok\",\n" +
"\t\"transaction_id\":\"xxxxx\", \t \n" +
"\t\"pay_time\":12345\n" +
"}";
WxCpTrade wxCpTrade = WxCpTrade.fromJson(tradeStr);
log.info("wxCpTrade:{}", wxCpTrade.toJson());
WxCpTrade trade = cpService.getSchoolService().getTrade("", "");
log.info("trade:{}", trade.toJson());
/**
* 获取老师健康信息
* https://developer.work.weixin.qq.com/document/path/93744