mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-04-30 04:45:43 +08:00
卡券核销的API增加参数重载的方法,增强兼容性
This commit is contained in:
parent
3e2ebb06f4
commit
8e02ea23af
@ -852,13 +852,24 @@ public interface WxMpService {
|
||||
*/
|
||||
public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume)
|
||||
throws WxErrorException;
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* 卡券Code核销。核销失败会抛出异常
|
||||
*
|
||||
* @param code 单张卡券的唯一标准
|
||||
* @return 调用返回的JSON字符串。
|
||||
* <br>可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public String consumeCardCode(String code) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 卡券Code核销。核销失败会抛出异常
|
||||
*
|
||||
* @param code 单张卡券的唯一标准
|
||||
* @param cardId 当自定义Code卡券时需要传入card_id
|
||||
* @return 调用返回的JSON字符串。
|
||||
* <br>可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
|
||||
* <br>可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public String consumeCardCode(String code, String cardId) throws WxErrorException;
|
||||
|
@ -1159,6 +1159,22 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
* 卡券Code核销。核销失败会抛出异常
|
||||
*
|
||||
* @param code 单张卡券的唯一标准
|
||||
* @return 调用返回的JSON字符串。
|
||||
* <br>可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
@Override
|
||||
public String consumeCardCode(String code) throws WxErrorException {
|
||||
return consumeCardCode(code, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 卡券Code核销。核销失败会抛出异常
|
||||
*
|
||||
* @param code 单张卡券的唯一标准
|
||||
* @param cardId 当自定义Code卡券时需要传入card_id
|
||||
* @return 调用返回的JSON字符串。
|
||||
* <br>可用 com.google.gson.JsonParser#parse 等方法直接取JSON串中的errcode等信息。
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
@Override
|
||||
@ -1168,7 +1184,7 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
param.addProperty("code", code);
|
||||
|
||||
if (cardId != null && !"".equals(cardId)) {
|
||||
param.addProperty("card_id", cardId);
|
||||
param.addProperty("card_id", cardId);
|
||||
}
|
||||
|
||||
String responseContent = post(url, param.toString());
|
||||
|
Loading…
Reference in New Issue
Block a user