mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-11-03 13:51:44 +08:00
1、增加卡券的api_ticket,区分jsapi_ticket,二者的获取逻辑不同;
2、增加小程序审核事件及审核事件推送消息SuccTime和Reason两个字段; 3、增加开放平台获取会员卡开卡插件参数接口。 4、增加开放平台手机端预授权接口实现;
This commit is contained in:
@ -2,6 +2,7 @@ package me.chanjar.weixin.mp.api.impl;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import me.chanjar.weixin.mp.api.WxMpCardService;
|
||||
import me.chanjar.weixin.mp.api.WxMpMemberCardService;
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
import me.chanjar.weixin.mp.api.test.ApiTestModule;
|
||||
import me.chanjar.weixin.mp.bean.card.*;
|
||||
@ -22,12 +23,12 @@ public class WxMpMemberCardServiceImplTest {
|
||||
|
||||
@Inject
|
||||
protected WxMpService wxService;
|
||||
private String cardId = "p2iQk1g2d03JXhVRDY5fZRVr236A";
|
||||
private String cardId = "p2iQk1uwOUYlzHm4s-UYdZnABW88";
|
||||
private String code = "435223630779";
|
||||
private String openId = "o2iQk1u5X-XIJkatmAK1Q8VVuS90";
|
||||
|
||||
@Test
|
||||
public void createMemberCard()throws Exception{
|
||||
public void createMemberCard() throws Exception {
|
||||
// String json = "{\"card\":{\"card_type\":\"MEMBER_CARD\",\"member_card\":{\"advanced_info\":{\"business_service\":\"BIZ_SERVICE_FREE_PARK,BIZ_SERVICE_WITH_PET,BIZ_SERVICE_FREE_WIFI\",\"text_image_list\":[{\"image_url\":\"http://mmbiz.qpic.cn/mmbiz_jpg/upuF1LhUF8LjCLCFcQicgEiazFeonwDllGkENppDhyqhR8bz5BiaJkPT7e6bPVcfBx5cAOLro2N3U989n8WJltkjQ/0\",\"text\":\"8月8日随机免单\"}]},\"auto_activate\":false,\"background_pic_url\":\"http://mmbiz.qpic.cn/mmbiz_jpg/upuF1LhUF8LjCLCFcQicgEiazFeonwDllGl6ibk4v5iaJDAbs7dGJU7iclOJ6nh7Hnz6ZsfDL8tGEeQVJyuhKsMFxUQ/0\",\"base_info\":{\"bind_openid\":false,\"brand_name\":\"商户名称\",\"can_give_friend\":false,\"can_share\":false,\"center_sub_title\":\"点击进入\",\"center_title\":\"商城首页\",\"center_url\":\"http://www.baidu.com\",\"code_type\":\"CODE_TYPE_QRCODE\",\"color\":\"Color090\",\"date_info\":{\"type\":\"DATE_TYPE_PERMANENT\"},\"description\":\"使用须知\",\"need_push_on_view\":false,\"notice\":\"测试会员卡\",\"service_phone\":\"4008803016\",\"title\":\"终生铂金卡\",\"use_all_locations\":true,\"use_custom_code\":false},\"prerogative\":\"享有特权说明\",\"supply_balance\":true,\"supply_bonus\":true,\"wx_activate\":false}}}";
|
||||
// WxMpMemberCardCreateMessage createMessage = WxMpMemberCardCreateMessage.fromJson(json);
|
||||
|
||||
@ -105,10 +106,11 @@ public class WxMpMemberCardServiceImplTest {
|
||||
|
||||
/**
|
||||
* 测试添加测试openid白名单
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testAddTestWhiteList()throws Exception {
|
||||
public void testAddTestWhiteList() throws Exception {
|
||||
WxMpCardService cardService = this.wxService.getCardService();
|
||||
String response = cardService.addTestWhiteList(openId);
|
||||
System.out.println(response);
|
||||
@ -116,28 +118,38 @@ public class WxMpMemberCardServiceImplTest {
|
||||
|
||||
/**
|
||||
* 测试创建会员卡投放二维码
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testCreateQrcodeMemberCard()throws Exception{
|
||||
public void testCreateQrcodeMemberCard() throws Exception {
|
||||
WxMpCardService cardService = this.wxService.getCardService();
|
||||
WxMpCardQrcodeCreateResult response = cardService.createQrcodeCard(cardId,"test");
|
||||
WxMpCardQrcodeCreateResult response = cardService.createQrcodeCard(cardId, "test");
|
||||
System.out.println(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试创建货架接口
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
public void testCreateLandingPage()throws Exception{
|
||||
public void testCreateLandingPage() throws Exception {
|
||||
WxMpCardService cardService = this.wxService.getCardService();
|
||||
WxMpCardLandingPageCreateRequest request = new WxMpCardLandingPageCreateRequest();
|
||||
request.setBanner("http://mmbiz.qpic.cn/mmbiz_jpg/upuF1LhUF8LjCLCFcQicgEiazFeonwDllGl6ibk4v5iaJDAbs7dGJU7iclOJ6nh7Hnz6ZsfDL8tGEeQVJyuhKsMFxUQ/0");
|
||||
request.setTitle("会员卡1");
|
||||
request.setScene(CardSceneType.SCENE_H5.name());
|
||||
request.addCard(cardId,"http://mmbiz.qpic.cn/mmbiz_jpg/upuF1LhUF8LjCLCFcQicgEiazFeonwDllGl6ibk4v5iaJDAbs7dGJU7iclOJ6nh7Hnz6ZsfDL8tGEeQVJyuhKsMFxUQ/0");
|
||||
request.addCard(cardId, "http://mmbiz.qpic.cn/mmbiz_jpg/upuF1LhUF8LjCLCFcQicgEiazFeonwDllGl6ibk4v5iaJDAbs7dGJU7iclOJ6nh7Hnz6ZsfDL8tGEeQVJyuhKsMFxUQ/0");
|
||||
WxMpCardLandingPageCreateResult response = cardService.createLandingPage(request);
|
||||
System.out.println(response);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetActivateUrl() throws Exception {
|
||||
WxMpMemberCardService memberCardService = this.wxService.getMemberCardService();
|
||||
ActivatePluginParam response = memberCardService.getActivatePluginParam(cardId, "test");
|
||||
System.out.println(response);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user