public interface WxMpCardService
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
CARD_CODE_CONSUME |
static String |
CARD_CODE_DECRYPT |
static String |
CARD_CODE_GET |
static String |
CARD_CODE_MARK |
static String |
CARD_CODE_UNAVAILABLE
将用户的卡券设置为失效状态
|
static String |
CARD_CREATE |
static String |
CARD_DELETE
卡券删除
|
static String |
CARD_GET |
static String |
CARD_GET_TICKET |
static String |
CARD_LANDING_PAGE_CREATE |
static String |
CARD_QRCODE_CREATE |
static String |
CARD_TEST_WHITELIST |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
addTestWhiteList(String openid)
添加测试白名单
|
String |
consumeCardCode(String code)
卡券Code核销。
|
String |
consumeCardCode(String code,
String cardId)
卡券Code核销。
|
WxMpCardCreateResult |
createCard(WxMpCardCreateMessage cardCreateMessage) |
WxCardApiSignature |
createCardApiSignature(String... optionalSignParam)
创建调用卡券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
|
WxMpCardLandingPageCreateResult |
createLandingPage(WxMpCardLandingPageCreateRequest createRequest)
创建卡券货架
|
WxMpCardQrcodeCreateResult |
createQrcodeCard(String cardId,
String outerStr)
创建卡券二维码
|
WxMpCardQrcodeCreateResult |
createQrcodeCard(String cardId,
String outerStr,
int expiresIn)
创建卡券二维码
|
String |
decryptCardCode(String encryptCode)
卡券Code解码
|
WxMpCardDeleteResult |
deleteCard(String cardId)
删除卡券接口
|
String |
getCardApiTicket()
获得卡券api_ticket,不强制刷新卡券api_ticket
|
String |
getCardApiTicket(boolean forceRefresh)
获得卡券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
|
String |
getCardDetail(String cardId)
查看卡券详情接口
详见 https://mp.weixin.qq.com/wiki/14/8dd77aeaee85f922db5f8aa6386d385e.html#.E6.9F.A5.E7.9C.8B.E5.8D.A1.E5.88.B8.E8.AF.A6.E6.83.85
|
WxMpService |
getWxMpService()
得到WxMpService
|
void |
markCardCode(String code,
String cardId,
String openId,
boolean isMark)
卡券Mark接口。
|
WxMpCardResult |
queryCardCode(String cardId,
String code,
boolean checkConsume)
卡券Code查询.
|
String |
unavailableCardCode(String cardId,
String code,
String reason)
将用户的卡券设置为失效状态
详见:https://mp.weixin.qq.com/wiki?
|
WxMpService getWxMpService()
String getCardApiTicket() throws WxErrorException
WxErrorExceptiongetCardApiTicket(boolean)String getCardApiTicket(boolean forceRefresh) throws WxErrorException
获得卡券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
forceRefresh - 强制刷新WxErrorExceptionWxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException
创建调用卡券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
optionalSignParam - 参与签名的参数数组。
可以为下列字段:app_id, card_id, card_type, code, openid, location_id
注意:当做wx.chooseCard调用时,必须传入app_id参与签名,否则会造成签名失败导致拉取卡券列表为空WxErrorExceptionString decryptCardCode(String encryptCode) throws WxErrorException
encryptCode - 加密Code,通过JSSDK的chooseCard接口获得WxErrorExceptionWxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException
cardId - 卡券ID代表一类卡券code - 单张卡券的唯一标准checkConsume - 是否校验code核销状态,填入true和false时的code异常状态返回数据不同WxErrorExceptionString consumeCardCode(String code) throws WxErrorException
code - 单张卡券的唯一标准WxErrorExceptionString consumeCardCode(String code, String cardId) throws WxErrorException
code - 单张卡券的唯一标准cardId - 当自定义Code卡券时需要传入card_idWxErrorExceptionvoid markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException
code - 卡券的code码cardId - 卡券的IDopenId - 用券用户的openidisMark - 是否要mark(占用)这个code,填写true或者false,表示占用或解除占用WxErrorExceptionString getCardDetail(String cardId) throws WxErrorException
cardId - 卡券的IDWxErrorExceptionString addTestWhiteList(String openid) throws WxErrorException
openid - 用户的openidWxErrorExceptionWxMpCardCreateResult createCard(WxMpCardCreateMessage cardCreateMessage) throws WxErrorException
cardCreateMessage - WxErrorExceptionWxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr) throws WxErrorException
cardId - 卡券编号outerStr - 二维码标识WxErrorExceptionWxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn) throws WxErrorException
cardId - 卡券编号outerStr - 二维码标识expiresIn - 失效时间,单位秒,不填默认365天WxErrorExceptionWxMpCardLandingPageCreateResult createLandingPage(WxMpCardLandingPageCreateRequest createRequest) throws WxErrorException
createRequest - 货架创建参数WxErrorExceptionString unavailableCardCode(String cardId, String code, String reason) throws WxErrorException
cardId - 卡券编号code - 用户会员卡号reason - 设置为失效的原因WxErrorExceptionWxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException
cardId - WxErrorExceptionCopyright © 2019. All rights reserved.