Skip to content

Commit 319dc31

Browse files
committed
兼容两种微信公众号接入方式
1 parent 4b74310 commit 319dc31

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.1.3
2+
* 兼容两种微信公众号接入方式
3+
14
## 2.1.2
25
* 补全确实字段
36
* 修正 Event 解析

src/com/pingplusplus/Pingpp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public abstract class Pingpp {
1111
/**
1212
* version
1313
*/
14-
public static final String VERSION = "2.1.2";
14+
public static final String VERSION = "2.1.3";
1515
/**
1616
* api key
1717
*/

src/com/pingplusplus/net/ChargeDeserializer.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ public Charge deserialize(JsonElement jsonElement, Type type, JsonDeserializatio
3030
Long timeStamp = wx.get("timeStamp").getAsLong();
3131
wx.addProperty("timeStamp", "" + timeStamp);
3232
} else if (null != credentialJson.getAsJsonObject("wx_pub")) {
33-
JsonObject wx = credentialJson.getAsJsonObject("wx_pub");
34-
Long timeStamp = wx.get("timeStamp").getAsLong();
35-
wx.addProperty("timeStamp", "" + timeStamp);
33+
JsonObject wxPub = credentialJson.getAsJsonObject("wx_pub");
34+
if (null == wxPub.get("signed_data") && wxPub.get("timeStamp") != null) {
35+
Long timeStamp = wxPub.get("timeStamp").getAsLong();
36+
wxPub.addProperty("timeStamp", "" + timeStamp);
37+
}
3638
} else if (null != credentialJson.getAsJsonObject("bfb")) {
3739
JsonObject bfb = credentialJson.getAsJsonObject("bfb");
3840
Long total_amount = bfb.get("total_amount").getAsLong();
3941
bfb.addProperty("total_amount", total_amount + "");
4042
}
41-
4243
}
4344

4445
Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).

0 commit comments

Comments
 (0)