Visitar URL original
增加类型为微信激活会员卡时,需设置微信开卡字段接口 by yuanqixun · Pull Request #739 · binarywang/WxJava · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
增加创建卡券二维码的失效时间参数接口。
  • Loading branch information
袁启勋
袁启勋 committed Aug 30, 2018
commit 1fda901c41c4ce51981be0188c546f75cd1f1d65
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ void markCardCode(String code, String cardId, String openId, boolean isMark) thr
*/
WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr) throws WxErrorException;

/**
* 创建卡券二维码
* @param cardId 卡券编号
* @param outerStr 二维码标识
* @param expiresIn 失效时间,单位秒,不填默认365天
* @return WxMpCardQrcodeCreateResult
*/
WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr,int expiresIn) throws WxErrorException;

/**
* 创建卡券货架
* @param createRequest 货架创建参数
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,29 @@ public String addTestWhiteList(String openid) throws WxErrorException {

/**
* 创建卡券二维码
*
* @param cardId
* @param outerStr
* @return
*/
public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr) throws WxErrorException {
return createQrcodeCard(cardId, outerStr, 0);
}

/**
* 创建卡券二维码
* @param cardId 卡券编号
* @param outerStr 二维码标识
* @param expiresIn 失效时间,单位秒,不填默认365天
* @return
* @throws WxErrorException
*/
public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn) throws WxErrorException {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("action_name", "QR_CARD");
jsonObject.addProperty("expire_seconds", 1800);
if (expiresIn > 0) {
jsonObject.addProperty("expire_seconds", expiresIn);
}
JsonObject actionInfoJson = new JsonObject();
JsonObject cardJson = new JsonObject();
cardJson.addProperty("card_id", cardId);
Expand All @@ -276,13 +291,14 @@ public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerSt

/**
* 创建卡券货架接口
*
* @param request
* @return
* @throws WxErrorException
*/
@Override
public WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateRequest request) throws WxErrorException {
String response = this.wxMpService.post(CARD_LANDING_PAGE_CREAET,GSON.toJson(request));
String response = this.wxMpService.post(CARD_LANDING_PAGE_CREAET, GSON.toJson(request));
return WxMpCardLandingPageCreateResult.fromJson(response);
}
}