public class WxMpCardServiceImpl extends Object implements WxMpCardService
| 构造器和说明 |
|---|
WxMpCardServiceImpl() |
public WxMpService getWxMpService()
WxMpCardServicegetWxMpService 在接口中 WxMpCardServicepublic String getCardApiTicket() throws WxErrorException
WxMpCardServicegetCardApiTicket 在接口中 WxMpCardServiceWxErrorException - 异常WxMpCardService.getCardApiTicket(boolean)public String getCardApiTicket(boolean forceRefresh) throws WxErrorException
WxMpCardService获得卡券api_ticket. 获得时会检查卡券apiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干 详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD.954-.E5.8D.A1.E5.88.B8.E6.89.A9.E5.B1.95.E5.AD.97.E6.AE.B5.E5.8F.8A.E7.AD.BE.E5.90.8D.E7.94.9F.E6.88.90.E7.AE.97.E6.B3.95
getCardApiTicket 在接口中 WxMpCardServiceforceRefresh - 强制刷新WxErrorException - 异常public WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException
WxMpCardService创建调用卡券api时所需要的签名. 详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD .954-.E5.8D.A1.E5.88.B8.E6.89.A9.E5.B1.95.E5.AD.97.E6.AE.B5.E5.8F.8A.E7.AD.BE.E5.90.8D.E7.94 .9F.E6.88.90.E7.AE.97.E6.B3.95
createCardApiSignature 在接口中 WxMpCardServiceoptionalSignParam - 参与签名的参数数组。可以为下列字段:app_id, card_id, card_type, code, openid, location_id
注意:当做wx.chooseCard调用时,必须传入app_id参与签名,否则会造成签名失败导致拉取卡券列表为空WxErrorException - 异常public String decryptCardCode(String encryptCode) throws WxErrorException
WxMpCardServicedecryptCardCode 在接口中 WxMpCardServiceencryptCode - 加密Code,通过JSSDK的chooseCard接口获得WxErrorException - 异常public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException
WxMpCardServicequeryCardCode 在接口中 WxMpCardServicecardId - 卡券ID代表一类卡券code - 单张卡券的唯一标准checkConsume - 是否校验code核销状态,填入true和false时的code异常状态返回数据不同WxErrorException - 异常public String consumeCardCode(String code) throws WxErrorException
WxMpCardServiceconsumeCardCode 在接口中 WxMpCardServicecode - 单张卡券的唯一标准WxErrorException - 异常public String consumeCardCode(String code, String cardId) throws WxErrorException
WxMpCardServiceconsumeCardCode 在接口中 WxMpCardServicecode - 单张卡券的唯一标准cardId - 当自定义Code卡券时需要传入card_idWxErrorException - 异常public void markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException
WxMpCardServicemarkCardCode 在接口中 WxMpCardServicecode - 卡券的code码cardId - 卡券的IDopenId - 用券用户的openidisMark - 是否要mark(占用)这个code,填写true或者false,表示占用或解除占用WxErrorException - 异常public String getCardDetail(String cardId) throws WxErrorException
WxMpCardServicegetCardDetail 在接口中 WxMpCardServicecardId - 卡券的IDWxErrorException - 异常public String addTestWhiteList(String openid) throws WxErrorException
WxMpCardServiceaddTestWhiteList 在接口中 WxMpCardServiceopenid - 用户的openidWxErrorException - 异常public WxMpCardCreateResult createCard(WxMpCardCreateMessage cardCreateMessage) throws WxErrorException
WxMpCardServicecreateCard 在接口中 WxMpCardServicecardCreateMessage - 请求WxErrorException - 异常public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr) throws WxErrorException
WxMpCardServicecreateQrcodeCard 在接口中 WxMpCardServicecardId - 卡券编号outerStr - 二维码标识WxErrorException - 异常public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn) throws WxErrorException
WxMpCardServicecreateQrcodeCard 在接口中 WxMpCardServicecardId - 卡券编号outerStr - 二维码标识expiresIn - 指定二维码的有效时间,范围是60 ~ 1800秒。不填默认为365天有效WxErrorException - 异常public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn, String openid, String code, boolean isUniqueCode) throws WxErrorException
WxMpCardServicecreateQrcodeCard 在接口中 WxMpCardServicecardId - 卡券编号outerStr - 用户首次领卡时,会通过 领取事件推送 给商户; 对于会员卡的二维码,用户每次扫码打开会员卡后点击任何url,会将该值拼入url中,方便开发者定位扫码来源expiresIn - 指定二维码的有效时间,范围是60 ~ 1800秒。不填默认为365天有效openid - 指定领取者的openid,只有该用户能领取。bind_openid字段为true的卡券必须填写,非指定openid不必填写。code - 卡券Code码,use_custom_code字段为true的卡券必须填写,非自定义code和导入code模式的卡券不必填写。isUniqueCode - 指定下发二维码,生成的二维码随机分配一个code,领取后不可再次扫描。填写true或false。默认false,注意填写该字段时,卡券须通过审核且库存不为0。WxErrorException - 异常public WxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateRequest request) throws WxErrorException
WxMpCardServicecreateLandingPage 在接口中 WxMpCardServicerequest - 货架创建参数WxErrorException - 异常public String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException
WxMpCardServiceunavailableCardCode 在接口中 WxMpCardServicecardId - 卡券编号code - 用户会员卡号reason - 设置为失效的原因WxErrorException - 异常public WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException
WxMpCardServicedeleteCard 在接口中 WxMpCardServicecardId - 卡券idWxErrorException - 异常Copyright © 2019. All rights reserved.