|
1 | 1 | package me.chanjar.weixin.mp.api;
|
2 | 2 |
|
| 3 | +import me.chanjar.weixin.common.bean.WxCardApiSignature; |
3 | 4 | import me.chanjar.weixin.common.bean.WxMenu;
|
4 | 5 | import me.chanjar.weixin.common.bean.WxJsapiSignature;
|
5 | 6 | import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
|
@@ -770,12 +771,89 @@ public interface WxMpService {
|
770 | 771 | * @return
|
771 | 772 | */
|
772 | 773 | public boolean checkJSSDKCallbackDataSignature(Map<String, String> kvm, String signature);
|
773 |
| - |
| 774 | + |
774 | 775 | /**
|
775 | 776 | * 发送微信红包给个人用户
|
776 | 777 | * @param parameters
|
777 | 778 | * @return
|
778 | 779 | * @throws WxErrorException
|
779 | 780 | */
|
780 | 781 | public WxRedpackResult sendRedpack(Map<String, String> parameters) throws WxErrorException;
|
| 782 | + |
| 783 | + /** |
| 784 | + * 获得卡券api_ticket,不强制刷新卡券api_ticket |
| 785 | + * @see #getCardApiTicket(boolean) |
| 786 | + * @return 卡券api_ticket |
| 787 | + * @throws WxErrorException |
| 788 | + */ |
| 789 | + public String getCardApiTicket() throws WxErrorException; |
| 790 | + |
| 791 | + /** |
| 792 | + * <pre> |
| 793 | + * 获得卡券api_ticket |
| 794 | + * 获得时会检查卡券apiToken是否过期,如果过期了,那么就刷新一下,否则就什么都不干 |
| 795 | + * |
| 796 | + * 详情请见: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 |
| 797 | + * </pre> |
| 798 | + * @param forceRefresh 强制刷新 |
| 799 | + * @return 卡券api_ticket |
| 800 | + * @throws WxErrorException |
| 801 | + */ |
| 802 | + public String getCardApiTicket(boolean forceRefresh) throws WxErrorException; |
| 803 | + |
| 804 | + /** |
| 805 | + * <pre> |
| 806 | + * 创建调用卡券api时所需要的签名 |
| 807 | + * |
| 808 | + * 详情请见:http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html#.E9.99.84.E5.BD |
| 809 | + * .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 |
| 810 | + * .9F.E6.88.90.E7.AE.97.E6.B3.95 |
| 811 | + * </pre> |
| 812 | + * |
| 813 | + * @param optionalSignParam 参与签名的参数数组。 |
| 814 | + * 可以为下列字段:app_id, card_id, card_type, code, openid, location_id |
| 815 | + * @return 卡券Api签名对象 |
| 816 | + */ |
| 817 | + public WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws |
| 818 | + WxErrorException; |
| 819 | + |
| 820 | + /** |
| 821 | + * 卡券Code解码 |
| 822 | + * @param encryptCode 加密Code,通过JSSDK的chooseCard接口获得 |
| 823 | + * @return 解密后的Code |
| 824 | + * @throws WxErrorException |
| 825 | + */ |
| 826 | + public String decryptCardCode(String encryptCode) throws WxErrorException; |
| 827 | + |
| 828 | + /** |
| 829 | + * 卡券Code查询 |
| 830 | + * @param cardId 卡券ID代表一类卡券 |
| 831 | + * @param code 单张卡券的唯一标准 |
| 832 | + * @param checkConsume 是否校验code核销状态,填入true和false时的code异常状态返回数据不同 |
| 833 | + * @return WxMpCardResult对象 |
| 834 | + * @throws WxErrorException |
| 835 | + */ |
| 836 | + public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) |
| 837 | + throws WxErrorException; |
| 838 | + |
| 839 | + /** |
| 840 | + * 卡券Code核销。核销失败会抛出异常 |
| 841 | + * @param code 单张卡券的唯一标准 |
| 842 | + * @return |
| 843 | + * @throws WxErrorException |
| 844 | + */ |
| 845 | + public void consumeCardCode(String code) throws WxErrorException; |
| 846 | + |
| 847 | + /** |
| 848 | + * 卡券Mark接口。 |
| 849 | + * 开发者在帮助消费者核销卡券之前,必须帮助先将此code(卡券串码)与一个openid绑定(即mark住), |
| 850 | + * 才能进一步调用核销接口,否则报错。 |
| 851 | + * @param code 卡券的code码 |
| 852 | + * @param cardId 卡券的ID |
| 853 | + * @param openId 用券用户的openid |
| 854 | + * @param isMark 是否要mark(占用)这个code,填写true或者false,表示占用或解除占用 |
| 855 | + * @throws WxErrorException |
| 856 | + */ |
| 857 | + public void markCardCode(String code, String cardId, String openId, boolean isMark) throws |
| 858 | + WxErrorException; |
781 | 859 | }
|
0 commit comments