diff --git a/pom.xml b/pom.xml
index 3e915cfc8..dbe53d124 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
+ * Created by BinaryWang on 2017/5/4. + *+ * + * @author Binary Wang + */ +@XStreamAlias("HardWare") +public class HardWare { + /** + * 消息展示,目前支持myrank(排行榜) + */ + @XStreamAlias("MessageView") + @XStreamConverter(value = XStreamCDataConverter.class) + private String messageView; + /** + * 消息点击动作,目前支持ranklist(点击跳转排行榜) + */ + @XStreamAlias("MessageAction") + @XStreamConverter(value = XStreamCDataConverter.class) + private String messageAction; + + @Override + public String toString() { + return ToStringUtils.toSimpleString(this); + } + + public String getMessageView() { + return messageView; + } + + public void setMessageView(String messageView) { + this.messageView = messageView; + } + + public String getMessageAction() { + return messageAction; + } + + public void setMessageAction(String messageAction) { + this.messageAction = messageAction; + } +} diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/ScanCodeInfo.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/ScanCodeInfo.java new file mode 100644 index 000000000..ddebffdf6 --- /dev/null +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/ScanCodeInfo.java @@ -0,0 +1,52 @@ +package me.chanjar.weixin.mp.bean.message; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamConverter; +import me.chanjar.weixin.common.util.ToStringUtils; +import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; + +/** + *
+ * Created by BinaryWang on 2017/5/4. + *+ * + * @author Binary Wang + */ +@XStreamAlias("ScanCodeInfo") +public class ScanCodeInfo { + @XStreamAlias("ScanType") + @XStreamConverter(value = XStreamCDataConverter.class) + private String scanType; + @XStreamAlias("ScanResult") + @XStreamConverter(value = XStreamCDataConverter.class) + private String scanResult; + + @Override + public String toString() { + return ToStringUtils.toSimpleString(this); + } + + /** + * 扫描类型,一般是qrcode + */ + public String getScanType() { + + return this.scanType; + } + + public void setScanType(String scanType) { + this.scanType = scanType; + } + + /** + * 扫描结果,即二维码对应的字符串信息 + */ + public String getScanResult() { + return this.scanResult; + } + + public void setScanResult(String scanResult) { + this.scanResult = scanResult; + } + +} diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/SendLocationInfo.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/SendLocationInfo.java new file mode 100644 index 000000000..a397ab819 --- /dev/null +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/SendLocationInfo.java @@ -0,0 +1,82 @@ +package me.chanjar.weixin.mp.bean.message; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamConverter; +import me.chanjar.weixin.common.util.ToStringUtils; +import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; + +/** + *
+ * Created by BinaryWang on 2017/5/4. + *+ * + * @author Binary Wang + */ +@XStreamAlias("SendLocationInfo") +public class SendLocationInfo { + + @XStreamAlias("Location_X") + @XStreamConverter(value = XStreamCDataConverter.class) + private String locationX; + + @XStreamAlias("Location_Y") + @XStreamConverter(value = XStreamCDataConverter.class) + private String locationY; + + @XStreamAlias("Scale") + @XStreamConverter(value = XStreamCDataConverter.class) + private String scale; + + @XStreamAlias("Label") + @XStreamConverter(value = XStreamCDataConverter.class) + private String label; + + @XStreamAlias("Poiname") + @XStreamConverter(value = XStreamCDataConverter.class) + private String poiname; + + @Override + public String toString() { + return ToStringUtils.toSimpleString(this); + } + + public String getLocationX() { + return this.locationX; + } + + public void setLocationX(String locationX) { + this.locationX = locationX; + } + + public String getLocationY() { + return this.locationY; + } + + public void setLocationY(String locationY) { + this.locationY = locationY; + } + + public String getScale() { + return this.scale; + } + + public void setScale(String scale) { + this.scale = scale; + } + + public String getLabel() { + return this.label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getPoiname() { + return this.poiname; + } + + public void setPoiname(String poiname) { + this.poiname = poiname; + } +} diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/SendPicsInfo.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/SendPicsInfo.java new file mode 100644 index 000000000..3461355c9 --- /dev/null +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/SendPicsInfo.java @@ -0,0 +1,61 @@ +package me.chanjar.weixin.mp.bean.message; + +import com.thoughtworks.xstream.annotations.XStreamAlias; +import com.thoughtworks.xstream.annotations.XStreamConverter; +import me.chanjar.weixin.common.util.ToStringUtils; +import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; + +import java.util.ArrayList; +import java.util.List; + +/** + *
+ * Created by BinaryWang on 2017/5/4. + *+ * + * @author Binary Wang + */ +@XStreamAlias("SendPicsInfo") +public class SendPicsInfo { + @XStreamAlias("PicList") + protected final List
@@ -199,6 +197,30 @@ public class WxMpXmlMessage implements Serializable {
@XStreamAlias("OuterId")
private Integer outerId;
+ /**
+ * 用户删除会员卡后可重新找回,当用户本次操作为找回时,该值为1,否则为0
+ */
+ @XStreamAlias("IsRestoreMemberCard")
+ private String isRestoreMemberCard;
+
+ /**
+ * 领取场景值,用于领取渠道数据统计。可在生成二维码接口及添加Addcard接口中自定义该字段的字符串值。
+ */
+ @XStreamAlias("OuterStr")
+ private String outerStr;
+
+ /**
+ * 是否转赠退回,0代表不是,1代表是。
+ */
+ @XStreamAlias("IsReturnBack")
+ private String isReturnBack;
+
+ /**
+ * 是否是群转赠,0代表不是,1代表是。
+ */
+ @XStreamAlias("IsChatRoom")
+ private String isChatRoom;
+
@XStreamAlias("ScanCodeInfo")
private ScanCodeInfo scanCodeInfo = new ScanCodeInfo();
@@ -314,11 +336,11 @@ public class WxMpXmlMessage implements Serializable {
/**
* 从加密字符串转换
*
- * @param encryptedXml
- * @param wxMpConfigStorage
- * @param timestamp
- * @param nonce
- * @param msgSignature
+ * @param encryptedXml 密文
+ * @param wxMpConfigStorage 配置存储器对象
+ * @param timestamp 时间戳
+ * @param nonce 随机串
+ * @param msgSignature 签名串
*/
public static WxMpXmlMessage fromEncryptedXml(String encryptedXml,
WxMpConfigStorage wxMpConfigStorage, String timestamp, String nonce,
@@ -750,28 +772,28 @@ public class WxMpXmlMessage implements Serializable {
this.outerId = outerId;
}
- public WxMpXmlMessage.ScanCodeInfo getScanCodeInfo() {
+ public ScanCodeInfo getScanCodeInfo() {
return this.scanCodeInfo;
}
- public void setScanCodeInfo(WxMpXmlMessage.ScanCodeInfo scanCodeInfo) {
+ public void setScanCodeInfo(ScanCodeInfo scanCodeInfo) {
this.scanCodeInfo = scanCodeInfo;
}
- public WxMpXmlMessage.SendPicsInfo getSendPicsInfo() {
+ public SendPicsInfo getSendPicsInfo() {
return this.sendPicsInfo;
}
- public void setSendPicsInfo(WxMpXmlMessage.SendPicsInfo sendPicsInfo) {
+ public void setSendPicsInfo(SendPicsInfo sendPicsInfo) {
this.sendPicsInfo = sendPicsInfo;
}
- public WxMpXmlMessage.SendLocationInfo getSendLocationInfo() {
+ public SendLocationInfo getSendLocationInfo() {
return this.sendLocationInfo;
}
public void setSendLocationInfo(
- WxMpXmlMessage.SendLocationInfo sendLocationInfo) {
+ SendLocationInfo sendLocationInfo) {
this.sendLocationInfo = sendLocationInfo;
}
@@ -807,198 +829,41 @@ public class WxMpXmlMessage implements Serializable {
this.fromKfAccount = fromKfAccount;
}
+ public String getIsRestoreMemberCard() {
+ return isRestoreMemberCard;
+ }
+
+ public void setIsRestoreMemberCard(String isRestoreMemberCard) {
+ this.isRestoreMemberCard = isRestoreMemberCard;
+ }
+
+ public String getOuterStr() {
+ return outerStr;
+ }
+
+ public void setOuterStr(String outerStr) {
+ this.outerStr = outerStr;
+ }
+
+ public String getIsReturnBack() {
+ return isReturnBack;
+ }
+
+ public void setIsReturnBack(String isReturnBack) {
+ this.isReturnBack = isReturnBack;
+ }
+
+ public String getIsChatRoom() {
+ return isChatRoom;
+ }
+
+ public void setIsChatRoom(String isChatRoom) {
+ this.isChatRoom = isChatRoom;
+ }
+
@Override
public String toString() {
return ToStringUtils.toSimpleString(this);
}
- @XStreamAlias("HardWare")
- public static class HardWare {
- /**
- * 消息展示,目前支持myrank(排行榜)
- */
- @XStreamAlias("MessageView")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String messageView;
- /**
- * 消息点击动作,目前支持ranklist(点击跳转排行榜)
- */
- @XStreamAlias("MessageAction")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String messageAction;
-
- @Override
- public String toString() {
- return ToStringUtils.toSimpleString(this);
- }
-
- public String getMessageView() {
- return messageView;
- }
-
- public void setMessageView(String messageView) {
- this.messageView = messageView;
- }
-
- public String getMessageAction() {
- return messageAction;
- }
-
- public void setMessageAction(String messageAction) {
- this.messageAction = messageAction;
- }
- }
-
- @XStreamAlias("ScanCodeInfo")
- public static class ScanCodeInfo {
- @XStreamAlias("ScanType")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String scanType;
- @XStreamAlias("ScanResult")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String scanResult;
-
- @Override
- public String toString() {
- return ToStringUtils.toSimpleString(this);
- }
-
- /**
- * 扫描类型,一般是qrcode
- */
- public String getScanType() {
-
- return this.scanType;
- }
-
- public void setScanType(String scanType) {
- this.scanType = scanType;
- }
-
- /**
- * 扫描结果,即二维码对应的字符串信息
- */
- public String getScanResult() {
- return this.scanResult;
- }
-
- public void setScanResult(String scanResult) {
- this.scanResult = scanResult;
- }
-
- }
-
- @XStreamAlias("SendPicsInfo")
- public static class SendPicsInfo {
- @XStreamAlias("PicList")
- protected final List- picList = new ArrayList<>();
- @XStreamAlias("Count")
- private Long count;
-
- @Override
- public String toString() {
- return ToStringUtils.toSimpleString(this);
- }
-
- public Long getCount() {
- return this.count;
- }
-
- public void setCount(Long count) {
- this.count = count;
- }
-
- public List
- getPicList() {
- return this.picList;
- }
-
- @XStreamAlias("item")
- public static class Item {
- @XStreamAlias("PicMd5Sum")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String picMd5Sum;
-
- @Override
- public String toString() {
- return ToStringUtils.toSimpleString(this);
- }
-
- public String getPicMd5Sum() {
- return this.picMd5Sum;
- }
-
- public void setPicMd5Sum(String picMd5Sum) {
- this.picMd5Sum = picMd5Sum;
- }
- }
- }
-
- @XStreamAlias("SendLocationInfo")
- public static class SendLocationInfo {
-
- @XStreamAlias("Location_X")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String locationX;
-
- @XStreamAlias("Location_Y")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String locationY;
-
- @XStreamAlias("Scale")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String scale;
-
- @XStreamAlias("Label")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String label;
-
- @XStreamAlias("Poiname")
- @XStreamConverter(value = XStreamCDataConverter.class)
- private String poiname;
-
- @Override
- public String toString() {
- return ToStringUtils.toSimpleString(this);
- }
-
- public String getLocationX() {
- return this.locationX;
- }
-
- public void setLocationX(String locationX) {
- this.locationX = locationX;
- }
-
- public String getLocationY() {
- return this.locationY;
- }
-
- public void setLocationY(String locationY) {
- this.locationY = locationY;
- }
-
- public String getScale() {
- return this.scale;
- }
-
- public void setScale(String scale) {
- this.scale = scale;
- }
-
- public String getLabel() {
- return this.label;
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-
- public String getPoiname() {
- return this.poiname;
- }
-
- public void setPoiname(String poiname) {
- this.poiname = poiname;
- }
- }
}
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index 820402142..989fd9fac 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
weixin-java-parent
com.github.binarywang
- 2.7.0-SNAPSHOT
+ 2.6.1.BETA
4.0.0
@@ -22,7 +22,7 @@
com.github.binarywang
qrcode-utils
- 1.0
+ 1.1
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index c03b24826..895a827a5 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -129,7 +129,7 @@ public class WxPayConfig {
* 微信支付是否使用仿真测试环境
* 默认不使用
*/
- public boolean useSandboxForWxPay() {
+ public boolean useSandbox() {
return false;
}
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java
index 1a949bc06..c15a3ab6b 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceImpl.java
@@ -45,7 +45,7 @@ public class WxPayServiceImpl implements WxPayService {
}
private String getPayBaseUrl() {
- if (this.getConfig().useSandboxForWxPay()) {
+ if (this.getConfig().useSandbox()) {
return PAY_BASE_URL + "/sandboxnew";
}
@@ -203,7 +203,7 @@ public class WxPayServiceImpl implements WxPayService {
configMap.put("noncestr", String.valueOf(System.currentTimeMillis()));
configMap.put("appid", appId);
// 此map用于客户端与微信服务器交互
- payInfo.put("paySign", SignUtils.createSign(payInfo, this.getConfig().getMchKey()));
+ payInfo.put("sign", SignUtils.createSign(configMap, this.getConfig().getMchKey()));
payInfo.put("prepayId", prepayId);
payInfo.put("partnerId", partnerid);
payInfo.put("appId", appId);
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/XmlWxPayConfig.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/XmlWxPayConfig.java
index a10f36f3b..d029590ad 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/XmlWxPayConfig.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/XmlWxPayConfig.java
@@ -2,13 +2,6 @@ package com.github.binarywang.wxpay.testbase;
import com.github.binarywang.wxpay.config.WxPayConfig;
import com.thoughtworks.xstream.annotations.XStreamAlias;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.http.ssl.SSLContexts;
-
-import javax.net.ssl.SSLContext;
-import java.io.File;
-import java.io.FileInputStream;
-import java.security.KeyStore;
@XStreamAlias("xml")
public class XmlWxPayConfig extends WxPayConfig {
@@ -23,9 +16,9 @@ public class XmlWxPayConfig extends WxPayConfig {
}
@Override
- public boolean useSandboxForWxPay() {
+ public boolean useSandbox() {
//沙箱环境不成熟,有问题无法使用,暂时屏蔽掉
- // return true;
+// return true;
return false;
}
}