# Conflicts: # pom.xml # spring-boot-starters/pom.xml # spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml # spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml # spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml # spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml # weixin-java-common/pom.xml # weixin-java-cp/pom.xml # weixin-java-miniapp/pom.xml # weixin-java-mp/pom.xml # weixin-java-open/pom.xml # weixin-java-pay/pom.xml # weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/BaseWxPayRequest.java # weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/WxPayOrderQueryResult.javadev
| @@ -73,7 +73,7 @@ | |||||
| <dependency> | <dependency> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>(不同模块参考下文)</artifactId> | <artifactId>(不同模块参考下文)</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </dependency> | </dependency> | ||||
| ``` | ``` | ||||
| @@ -6,7 +6,7 @@ | |||||
| <modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| <packaging>pom</packaging> | <packaging>pom</packaging> | ||||
| <name>WxJava - Weixin/Wechat Java SDK</name> | <name>WxJava - Weixin/Wechat Java SDK</name> | ||||
| <description>微信开发Java SDK</description> | <description>微信开发Java SDK</description> | ||||
| @@ -6,7 +6,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <packaging>pom</packaging> | <packaging>pom</packaging> | ||||
| <artifactId>wx-java-spring-boot-starters</artifactId> | <artifactId>wx-java-spring-boot-starters</artifactId> | ||||
| @@ -5,7 +5,7 @@ | |||||
| <parent> | <parent> | ||||
| <artifactId>wx-java-spring-boot-starters</artifactId> | <artifactId>wx-java-spring-boot-starters</artifactId> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
| @@ -5,7 +5,7 @@ | |||||
| <parent> | <parent> | ||||
| <artifactId>wx-java-spring-boot-starters</artifactId> | <artifactId>wx-java-spring-boot-starters</artifactId> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
| @@ -5,7 +5,7 @@ | |||||
| <parent> | <parent> | ||||
| <artifactId>wx-java-spring-boot-starters</artifactId> | <artifactId>wx-java-spring-boot-starters</artifactId> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
| @@ -5,7 +5,7 @@ | |||||
| <parent> | <parent> | ||||
| <artifactId>wx-java-spring-boot-starters</artifactId> | <artifactId>wx-java-spring-boot-starters</artifactId> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
| @@ -6,7 +6,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <artifactId>weixin-graal</artifactId> | <artifactId>weixin-graal</artifactId> | ||||
| @@ -6,7 +6,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <artifactId>weixin-java-common</artifactId> | <artifactId>weixin-java-common</artifactId> | ||||
| @@ -7,7 +7,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <artifactId>weixin-java-cp</artifactId> | <artifactId>weixin-java-cp</artifactId> | ||||
| @@ -7,7 +7,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <artifactId>weixin-java-miniapp</artifactId> | <artifactId>weixin-java-miniapp</artifactId> | ||||
| @@ -7,7 +7,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <artifactId>weixin-java-mp</artifactId> | <artifactId>weixin-java-mp</artifactId> | ||||
| @@ -124,6 +124,24 @@ public interface WxMpCardService { | |||||
| */ | */ | ||||
| String getCardDetail(String cardId) throws WxErrorException; | String getCardDetail(String cardId) throws WxErrorException; | ||||
| /** | |||||
| * 批量查询卡券列表 | |||||
| * 详见 https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1451025272 | |||||
| * | |||||
| * @param offset 查询卡列表的起始偏移量,从0开始,即offset: 5是指从从列表里的第六个开始读取。 | |||||
| * @param count 需要查询的卡片的数量(数量最大50) | |||||
| * @param statusList 支持开发者拉出指定状态的卡券列表 | |||||
| * “CARD_STATUS_NOT_VERIFY”, 待审核 ; | |||||
| * “CARD_STATUS_VERIFY_FAIL”, 审核失败; | |||||
| * “CARD_STATUS_VERIFY_OK”, 通过审核; | |||||
| * “CARD_STATUS_DELETE”, 卡券被商户删除; | |||||
| * “CARD_STATUS_DISPATCH”, 在公众平台投放过的卡券; | |||||
| * @return 返回的卡券详情JSON字符串 | |||||
| * <br> [注] 由于返回的JSON格式过于复杂,难以定义其对应格式的Bean并且难以维护,因此只返回String格式的JSON串。 | |||||
| * <br> 可由 com.google.gson.JsonParser#parse 等方法直接取JSON串中的某个字段。 | |||||
| */ | |||||
| WxMpCardBatchGetResult getCardBatchGet(Integer offset, Integer count, List<String> statusList) throws WxErrorException; | |||||
| /** | /** | ||||
| * 添加测试白名单. | * 添加测试白名单. | ||||
| * | * | ||||
| @@ -108,7 +108,9 @@ public class WxMpCardServiceImpl implements WxMpCardService { | |||||
| @Override | @Override | ||||
| public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { | public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { | ||||
| JsonObject param = new JsonObject(); | JsonObject param = new JsonObject(); | ||||
| param.addProperty("card_id", cardId); | |||||
| if (StringUtils.isNotBlank(cardId)) { | |||||
| param.addProperty("card_id", cardId); | |||||
| } | |||||
| param.addProperty("code", code); | param.addProperty("code", code); | ||||
| param.addProperty("check_consume", checkConsume); | param.addProperty("check_consume", checkConsume); | ||||
| String responseContent = this.wxMpService.post(WxMpApiUrl.Card.CARD_CODE_GET, param.toString()); | String responseContent = this.wxMpService.post(WxMpApiUrl.Card.CARD_CODE_GET, param.toString()); | ||||
| @@ -171,6 +173,22 @@ public class WxMpCardServiceImpl implements WxMpCardService { | |||||
| return responseContent; | return responseContent; | ||||
| } | } | ||||
| @Override | |||||
| public WxMpCardBatchGetResult getCardBatchGet(Integer offset, Integer count, List<String> statusList) throws WxErrorException { | |||||
| JsonObject param = new JsonObject(); | |||||
| param.addProperty("offset", offset); | |||||
| param.addProperty("count", count); | |||||
| if(statusList.size() > 0) { | |||||
| JsonArray statusArray = new JsonArray(); | |||||
| for(String item: statusList) { | |||||
| statusArray.add(item); | |||||
| } | |||||
| param.add("status_list", statusArray); | |||||
| } | |||||
| String responseContent = this.wxMpService.post(WxMpApiUrl.Card.CARD_BATCHGET, param.toString()); | |||||
| return WxMpCardBatchGetResult.fromJson(responseContent); | |||||
| } | |||||
| @Override | @Override | ||||
| public String addTestWhiteList(String openid) throws WxErrorException { | public String addTestWhiteList(String openid) throws WxErrorException { | ||||
| JsonArray array = new JsonArray(); | JsonArray array = new JsonArray(); | ||||
| @@ -0,0 +1,45 @@ | |||||
| package me.chanjar.weixin.mp.bean.card; | |||||
| import com.google.gson.annotations.SerializedName; | |||||
| import lombok.Data; | |||||
| import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder; | |||||
| import java.io.Serializable; | |||||
| import java.util.List; | |||||
| /** | |||||
| * | |||||
| * 批量查询卡券列表 | |||||
| * @author Stormeye | |||||
| * @version 19/06/04 | |||||
| */ | |||||
| @Data | |||||
| public class WxMpCardBatchGetResult implements Serializable { | |||||
| private static final long serialVersionUID = -7950878428289035637L; | |||||
| public static WxMpCardBatchGetResult fromJson(String json) { | |||||
| return WxMpGsonBuilder.create().fromJson(json, WxMpCardBatchGetResult.class); | |||||
| } | |||||
| private String errorCode; | |||||
| private String errorMsg; | |||||
| /** | |||||
| * 卡券ID列表 | |||||
| */ | |||||
| @SerializedName("card_id_list") | |||||
| private List<String> cardList; | |||||
| /** | |||||
| * 该商户名下卡券ID总数 | |||||
| */ | |||||
| @SerializedName("total_num") | |||||
| private Integer totalNum; | |||||
| @Override | |||||
| public String toString() { | |||||
| return WxMpGsonBuilder.create().toJson(this); | |||||
| } | |||||
| } | |||||
| @@ -576,6 +576,12 @@ public class WxMpXmlMessage implements Serializable { | |||||
| @XStreamAlias("Reason") | @XStreamAlias("Reason") | ||||
| private String reason; | private String reason; | ||||
| /** | |||||
| * 审核失败的小程序截图示例. | |||||
| */ | |||||
| @XStreamAlias("ScreenShot") | |||||
| private String screenShot; | |||||
| /////////////////////////////////////// | /////////////////////////////////////// | ||||
| // 扫一扫事件推送 | // 扫一扫事件推送 | ||||
| /////////////////////////////////////// | /////////////////////////////////////// | ||||
| @@ -516,6 +516,10 @@ public interface WxMpApiUrl { | |||||
| * get. | * get. | ||||
| */ | */ | ||||
| CARD_GET(API_DEFAULT_HOST_URL, "/card/get"), | CARD_GET(API_DEFAULT_HOST_URL, "/card/get"), | ||||
| /** | |||||
| * batch get | |||||
| */ | |||||
| CARD_BATCHGET(API_DEFAULT_HOST_URL, "/card/batchget"), | |||||
| /** | /** | ||||
| * wx_card. | * wx_card. | ||||
| */ | */ | ||||
| @@ -528,6 +532,10 @@ public interface WxMpApiUrl { | |||||
| * get. | * get. | ||||
| */ | */ | ||||
| CARD_CODE_GET(API_DEFAULT_HOST_URL, "/card/code/get"), | CARD_CODE_GET(API_DEFAULT_HOST_URL, "/card/code/get"), | ||||
| /** | |||||
| * get card list | |||||
| */ | |||||
| CARD_USER_GETCARDLIST(API_DEFAULT_HOST_URL, "/card/user/getcardlist"), | |||||
| /** | /** | ||||
| * consume. | * consume. | ||||
| */ | */ | ||||
| @@ -7,7 +7,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <artifactId>weixin-java-open</artifactId> | <artifactId>weixin-java-open</artifactId> | ||||
| @@ -5,6 +5,7 @@ import com.google.gson.annotations.SerializedName; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import me.chanjar.weixin.common.util.json.WxGsonBuilder; | import me.chanjar.weixin.common.util.json.WxGsonBuilder; | ||||
| import me.chanjar.weixin.open.bean.result.WxOpenResult; | |||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| @@ -17,18 +18,12 @@ import java.io.Serializable; | |||||
| * @author <a href="https://github.com/binarywang">Binary Wang</a> | * @author <a href="https://github.com/binarywang">Binary Wang</a> | ||||
| */ | */ | ||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = false) | |||||
| public class WxOpenCreateResult implements Serializable { | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxOpenCreateResult extends WxOpenResult { | |||||
| @SerializedName("open_appid") | @SerializedName("open_appid") | ||||
| private String openAppid; | private String openAppid; | ||||
| @SerializedName("errcode") | |||||
| private String errcode; | |||||
| @SerializedName("errmsg") | |||||
| private String errmsg; | |||||
| public static WxOpenCreateResult fromJson(String json) { | public static WxOpenCreateResult fromJson(String json) { | ||||
| return WxGsonBuilder.create().fromJson(json, WxOpenCreateResult.class); | return WxGsonBuilder.create().fromJson(json, WxOpenCreateResult.class); | ||||
| } | } | ||||
| @@ -0,0 +1,27 @@ | |||||
| package me.chanjar.weixin.open.bean.ma; | |||||
| import com.google.gson.annotations.SerializedName; | |||||
| import lombok.Data; | |||||
| import lombok.NonNull; | |||||
| import java.io.Serializable; | |||||
| /** | |||||
| * 微信开放平台小程序成员对象 | |||||
| * | |||||
| * @author Stormeye | |||||
| * @date 2019/04/26 | |||||
| */ | |||||
| @Data | |||||
| public class WxOpenAuthorizer implements Serializable { | |||||
| @NonNull | |||||
| @SerializedName("authorizer_appid") | |||||
| private String authorizerAppid; | |||||
| @SerializedName("refresh_token") | |||||
| private String refreshToken; | |||||
| @SerializedName("auth_time") | |||||
| private Long authTime; | |||||
| } | |||||
| @@ -5,7 +5,7 @@ | |||||
| <parent> | <parent> | ||||
| <groupId>com.github.binarywang</groupId> | <groupId>com.github.binarywang</groupId> | ||||
| <artifactId>wx-java</artifactId> | <artifactId>wx-java</artifactId> | ||||
| <version>3.8.0</version> | |||||
| <version>3.8.0.A</version> | |||||
| </parent> | </parent> | ||||
| <modelVersion>4.0.0</modelVersion> | <modelVersion>4.0.0</modelVersion> | ||||
| @@ -21,6 +21,19 @@ import java.util.Map; | |||||
| @XStreamAlias("xml") | @XStreamAlias("xml") | ||||
| public class WxPayOrderCloseRequest extends BaseWxPayRequest { | public class WxPayOrderCloseRequest extends BaseWxPayRequest { | ||||
| /** | |||||
| * <pre> | |||||
| * 微信订单号 | |||||
| * transaction_id | |||||
| * 二选一 | |||||
| * String(32) | |||||
| * 20150806125346 | |||||
| * 微信的订单号,优先使用。 | |||||
| * </pre> | |||||
| */ | |||||
| @XStreamAlias("transaction_id") | |||||
| private String transactionId; | |||||
| /** | /** | ||||
| * <pre> | * <pre> | ||||
| * 商户订单号 | * 商户订单号 | ||||
| @@ -49,7 +49,33 @@ public class WxPayMicropayResult extends BaseWxPayResult { | |||||
| /** | /** | ||||
| * <pre> | * <pre> | ||||
| * 交易类型. | |||||
| * 用户子标识 | |||||
| * openid | |||||
| * 是 | |||||
| * String(128) | |||||
| * Y | |||||
| * 用户在商户appid 下的唯一标识 | |||||
| * </pre> | |||||
| **/ | |||||
| @XStreamAlias("sub_openid") | |||||
| private String subOpenid; | |||||
| /** | |||||
| * <pre> | |||||
| * 是否关注子公众账号 | |||||
| * sub_is_subscribe | |||||
| * 是 | |||||
| * String(1) | |||||
| * Y | |||||
| * 用户是否关注公众账号,仅在公众账号类型支付有效,取值范围:Y或N;Y-关注;N-未关注 | |||||
| * </pre> | |||||
| **/ | |||||
| @XStreamAlias("sub_is_subscribe") | |||||
| private String subIsSubscribe; | |||||
| /** | |||||
| * <pre> | |||||
| * 交易类型 | |||||
| * trade_type | * trade_type | ||||
| * 是 | * 是 | ||||
| * String(16) | * String(16) | ||||