public class WxMpCardServiceImpl extends Object implements WxMpCardService
构造器和说明 |
---|
WxMpCardServiceImpl() |
限定符和类型 | 方法和说明 |
---|---|
String |
addTestWhiteList(String openid)
添加测试白名单.
|
WxMpCardCodeCheckcodeResult |
cardCodeCheckcode(String cardId,
List<String> codeList)
核查code接口
|
WxMpCardCodeDepositResult |
cardCodeDeposit(String cardId,
List<String> codeList)
导入自定义code(仅对自定义code商户)
|
WxMpCardCodeDepositCountResult |
cardCodeDepositCount(String cardId)
查询导入code数目接口
|
void |
cardCodeUpdate(String cardId,
String oldCode,
String newCode)
更改Code接口
https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Managing_Coupons_Vouchers_and_Cards.html#6
|
void |
cardModifyStock(String cardId,
Integer changeValue)
修改库存接口
https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Managing_Coupons_Vouchers_and_Cards.html#5
|
WxMpCardMpnewsGethtmlResult |
cardMpnewsGethtml(String cardId)
图文消息群发卡券获取内嵌html
|
void |
cardPaycellSet(String cardId,
Boolean isOpen)
设置买单接口
https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Create_a_Coupon_Voucher_or_Card.html#12
|
void |
cardSelfConsumeCellSet(String cardId,
Boolean isOpen,
Boolean needVerifyCod,
Boolean needRemarkAmount)
设置自助核销
https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Create_a_Coupon_Voucher_or_Card.html#14
|
String |
consumeCardCode(String code)
卡券Code核销。
|
String |
consumeCardCode(String code,
String cardId)
卡券Code核销。
|
WxMpCardCreateResult |
createCard(WxMpCardCreateRequest cardCreateMessage)
创建卡券.
|
WxCardApiSignature |
createCardApiSignature(String... optionalSignParam)
创建调用卡券api时所需要的签名.
|
WxMpCardLandingPageCreateResult |
createLandingPage(WxMpCardLandingPageCreateRequest request)
创建卡券货架.
|
WxMpCardQrcodeCreateResult |
createQrcodeCard(String cardId,
String outerStr)
创建卡券二维码.
|
WxMpCardQrcodeCreateResult |
createQrcodeCard(String cardId,
String outerStr,
int expiresIn)
创建卡券二维码.
|
WxMpCardQrcodeCreateResult |
createQrcodeCard(String cardId,
String outerStr,
int expiresIn,
String openid,
String code,
boolean isUniqueCode)
创建卡券二维码.
|
String |
decryptCardCode(String encryptCode)
卡券Code解码.
|
WxMpCardDeleteResult |
deleteCard(String cardId)
删除卡券接口.
|
String |
getCardApiTicket()
获得卡券api_ticket,不强制刷新卡券api_ticket.
|
String |
getCardApiTicket(boolean forceRefresh)
获得卡券api_ticket.
|
String |
getCardDetail(String cardId)
查看卡券详情接口.
|
WxUserCardListResult |
getUserCardList(String openId,
String cardId)
获取用户已领取卡券接口
https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Managing_Coupons_Vouchers_and_Cards.html#1
|
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)
将用户的卡券设置为失效状态.
|
public WxMpService getWxMpService()
WxMpCardService
getWxMpService
在接口中 WxMpCardService
public String getCardApiTicket() throws WxErrorException
WxMpCardService
getCardApiTicket
在接口中 WxMpCardService
WxErrorException
- 异常#getCardApiTicket(boolean)#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
在接口中 WxMpCardService
forceRefresh
- 强制刷新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
在接口中 WxMpCardService
optionalSignParam
- 参与签名的参数数组。可以为下列字段:app_id, card_id, card_type, code, openid, location_id 注意:当做wx.chooseCard调用时,必须传入app_id参与签名,否则会造成签名失败导致拉取卡券列表为空WxErrorException
- 异常public String decryptCardCode(String encryptCode) throws WxErrorException
WxMpCardService
decryptCardCode
在接口中 WxMpCardService
encryptCode
- 加密Code,通过JSSDK的chooseCard接口获得WxErrorException
- 异常public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException
WxMpCardService
queryCardCode
在接口中 WxMpCardService
cardId
- 卡券ID代表一类卡券code
- 单张卡券的唯一标准checkConsume
- 是否校验code核销状态,填入true和false时的code异常状态返回数据不同WxErrorException
- 异常public String consumeCardCode(String code) throws WxErrorException
WxMpCardService
consumeCardCode
在接口中 WxMpCardService
code
- 单张卡券的唯一标准WxErrorException
- 异常public String consumeCardCode(String code, String cardId) throws WxErrorException
WxMpCardService
consumeCardCode
在接口中 WxMpCardService
code
- 单张卡券的唯一标准cardId
- 当自定义Code卡券时需要传入card_idWxErrorException
- 异常public void markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException
WxMpCardService
markCardCode
在接口中 WxMpCardService
code
- 卡券的code码cardId
- 卡券的IDopenId
- 用券用户的openidisMark
- 是否要mark(占用)这个code,填写true或者false,表示占用或解除占用WxErrorException
- 异常public String getCardDetail(String cardId) throws WxErrorException
WxMpCardService
getCardDetail
在接口中 WxMpCardService
cardId
- 卡券的IDWxErrorException
- 异常public String addTestWhiteList(String openid) throws WxErrorException
WxMpCardService
addTestWhiteList
在接口中 WxMpCardService
openid
- 用户的openidWxErrorException
- 异常public WxMpCardCreateResult createCard(WxMpCardCreateRequest cardCreateMessage) throws WxErrorException
WxMpCardService
createCard
在接口中 WxMpCardService
cardCreateMessage
- 请求WxErrorException
- 异常public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr) throws WxErrorException
WxMpCardService
createQrcodeCard
在接口中 WxMpCardService
cardId
- 卡券编号outerStr
- 二维码标识WxErrorException
- 异常public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn) throws WxErrorException
WxMpCardService
createQrcodeCard
在接口中 WxMpCardService
cardId
- 卡券编号outerStr
- 二维码标识expiresIn
- 指定二维码的有效时间,范围是60 ~ 1800秒。不填默认为365天有效WxErrorException
- 异常public WxMpCardQrcodeCreateResult createQrcodeCard(String cardId, String outerStr, int expiresIn, String openid, String code, boolean isUniqueCode) throws WxErrorException
WxMpCardService
createQrcodeCard
在接口中 WxMpCardService
cardId
- 卡券编号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
WxMpCardService
createLandingPage
在接口中 WxMpCardService
request
- 货架创建参数WxErrorException
- 异常public String unavailableCardCode(String cardId, String code, String reason) throws WxErrorException
WxMpCardService
unavailableCardCode
在接口中 WxMpCardService
cardId
- 卡券编号code
- 用户会员卡号reason
- 设置为失效的原因WxErrorException
- 异常public WxMpCardDeleteResult deleteCard(String cardId) throws WxErrorException
WxMpCardService
deleteCard
在接口中 WxMpCardService
cardId
- 卡券idWxErrorException
- 异常public WxMpCardCodeDepositResult cardCodeDeposit(String cardId, List<String> codeList) throws WxErrorException
WxMpCardService
cardCodeDeposit
在接口中 WxMpCardService
cardId
- 卡券idcodeList
- 需导入微信卡券后台的自定义code,上限为100个。WxErrorException
- the wx error exceptionpublic WxMpCardCodeDepositCountResult cardCodeDepositCount(String cardId) throws WxErrorException
WxMpCardService
cardCodeDepositCount
在接口中 WxMpCardService
cardId
- 卡券idWxErrorException
- the wx error exceptionpublic WxMpCardCodeCheckcodeResult cardCodeCheckcode(String cardId, List<String> codeList) throws WxErrorException
WxMpCardService
cardCodeCheckcode
在接口中 WxMpCardService
cardId
- 卡券idcodeList
- 已经微信卡券后台的自定义code,上限为100个WxErrorException
- the wx error exceptionpublic WxMpCardMpnewsGethtmlResult cardMpnewsGethtml(String cardId) throws WxErrorException
WxMpCardService
cardMpnewsGethtml
在接口中 WxMpCardService
cardId
- 卡券idWxErrorException
- the wx error exceptionpublic void cardModifyStock(String cardId, Integer changeValue) throws WxErrorException
WxMpCardService
cardModifyStock
在接口中 WxMpCardService
cardId
- 卡券IDchangeValue
- 库存变更值,负值为减少库存WxErrorException
- the wx error exceptionpublic void cardCodeUpdate(String cardId, String oldCode, String newCode) throws WxErrorException
WxMpCardService
cardCodeUpdate
在接口中 WxMpCardService
cardId
- 卡券IDoldCode
- 需变更的Code码newCode
- 变更后的有效Code码WxErrorException
- the wx error exceptionpublic void cardPaycellSet(String cardId, Boolean isOpen) throws WxErrorException
WxMpCardService
cardPaycellSet
在接口中 WxMpCardService
cardId
- 卡券IDisOpen
- 是否开启买单功能,填true/falseWxErrorException
- the wx error exceptionpublic void cardSelfConsumeCellSet(String cardId, Boolean isOpen, Boolean needVerifyCod, Boolean needRemarkAmount) throws WxErrorException
WxMpCardService
cardSelfConsumeCellSet
在接口中 WxMpCardService
cardId
- 卡券IDisOpen
- 是否开启自助核销功能needVerifyCod
- 用户核销时是否需要输入验证码, 填true/false, 默认为falseneedRemarkAmount
- 用户核销时是否需要备注核销金额, 填true/false, 默认为falseWxErrorException
- the wx error exceptionpublic WxUserCardListResult getUserCardList(String openId, String cardId) throws WxErrorException
WxMpCardService
getUserCardList
在接口中 WxMpCardService
openId
- 需要查询的用户openidcardId
- 卡券ID。不填写时默认查询当前appid下的卡券WxErrorException
- the wx error exceptionCopyright © 2024. All rights reserved.