Skip to content

Commit d94b46f

Browse files
committed
batch_transfer 增加字段信息
1 parent 6019d3a commit d94b46f

12 files changed

Lines changed: 200 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# ChangeLog
22

3+
## 2.2.3 (2017-03-27)
4+
#### 修改
5+
- BatchTransfer 增加字段
6+
37
## 2.2.2 (2017-03-21)
48
#### 修正
59
- alipay_pc_direct/alipay_wap 渠道 credential 字段类型的修正

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ maven 远程仓库
3434
<dependency>
3535
<groupId>Pingplusplus</groupId>
3636
<artifactId>pingpp-java</artifactId>
37-
<version>2.2.2</version>
37+
<version>2.2.3</version>
3838
<type>jar</type>
3939
</dependency>
4040
```
@@ -52,7 +52,7 @@ repositories {
5252

5353
安装 Ping++ SDK
5454
```
55-
compile 'Pingplusplus:pingpp-java:2.2.2'
55+
compile 'Pingplusplus:pingpp-java:2.2.3'
5656
```
5757

5858
### 初始化

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.2
1+
2.2.3

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>Pingplusplus</groupId>
66
<artifactId>pingpp-java</artifactId>
7-
<version>2.2.2</version>
7+
<version>2.2.3</version>
88
<name>pingpp-java</name>
99
<url>https://github.com/PingPlusPlus/pingpp-java</url>
1010
<properties>

src/main/java/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.2.2";
14+
public static final String VERSION = "2.2.3";
1515
/**
1616
* api key
1717
*/

src/main/java/com/pingplusplus/model/BatchTransferRecipient.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public class BatchTransferRecipient extends PingppObject {
1212
String status;
1313
String openBankCode;
1414
String openBank;
15+
Integer fee;
16+
String failureMsg;
17+
String orderNo;
18+
String transactionNo;
1519

1620
public String getAccount() {
1721
return account;
@@ -76,4 +80,36 @@ public String getOpenBank() {
7680
public void setOpenBank(String openBank) {
7781
this.openBank = openBankCode;
7882
}
83+
84+
public Integer getFee() {
85+
return fee;
86+
}
87+
88+
public void setFee(Integer fee) {
89+
this.fee = fee;
90+
}
91+
92+
public String getFailureMsg() {
93+
return failureMsg;
94+
}
95+
96+
public void setFailureMsg(String failureMsg) {
97+
this.failureMsg = failureMsg;
98+
}
99+
100+
public String getOrderNo() {
101+
return orderNo;
102+
}
103+
104+
public void setOrderNo(String orderNo) {
105+
this.orderNo = orderNo;
106+
}
107+
108+
public String getTransactionNo() {
109+
return transactionNo;
110+
}
111+
112+
public void setTransactionNo(String transactionNo) {
113+
this.transactionNo = transactionNo;
114+
}
79115
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.pingplusplus.model;
2+
3+
/**
4+
* Created by Afon on 17/03/27.
5+
*/
6+
public abstract class DeletedObjectBase extends PingppObject implements DeletedPingppObject {
7+
String id;
8+
Boolean deleted;
9+
10+
public String getId() {
11+
return id;
12+
}
13+
public void setId(String id) {
14+
this.id = id;
15+
}
16+
public Boolean getDeleted() {
17+
return deleted;
18+
}
19+
public void setDeleted(Boolean deleted) {
20+
this.deleted = deleted;
21+
}
22+
}

src/main/java/com/pingplusplus/model/PingppObject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.google.gson.GsonBuilder;
66
import com.pingplusplus.serializer.BatchRefundChargesSerializer;
77
import com.pingplusplus.serializer.BatchTransferRecipientSerializer;
8+
import com.pingplusplus.serializer.DoubleTypeSerializer;
89

910
import java.lang.reflect.Field;
1011

@@ -17,6 +18,7 @@ public abstract class PingppObject {
1718
.disableHtmlEscaping()
1819
.registerTypeAdapter(BatchTransferRecipientSerializer.class, new BatchTransferRecipientSerializer())
1920
.registerTypeAdapter(BatchRefundCharges.class, new BatchRefundChargesSerializer())
21+
.registerTypeAdapter(Double.class, new DoubleTypeSerializer())
2022
.create();
2123

2224
public static Gson getPrettyPrintGson() {

src/main/java/com/pingplusplus/serializer/ChargeDeserializer.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,22 @@ public Charge deserialize(JsonElement jsonElement, Type type, JsonDeserializatio
2626
if (null != chargeJson.getAsJsonObject("credential")) {
2727
JsonObject credentialJson = chargeJson.getAsJsonObject("credential");
2828
JsonObject channelCredential;
29-
if (null != credentialJson.getAsJsonObject("wx")) {
29+
if (credentialJson.getAsJsonObject("wx") != null) {
3030
JsonObject wx = credentialJson.getAsJsonObject("wx");
3131
Long timeStamp = wx.get("timeStamp").getAsLong();
32-
wx.addProperty("timeStamp", "" + timeStamp);
33-
} else if (null != credentialJson.getAsJsonObject("wx_pub")) {
32+
wx.addProperty("timeStamp", Long.toString(timeStamp));
33+
} else if (credentialJson.getAsJsonObject("wx_pub") != null) {
3434
JsonObject wxPub = credentialJson.getAsJsonObject("wx_pub");
3535
if (null == wxPub.get("signed_data") && wxPub.get("timeStamp") != null) {
3636
Long timeStamp = wxPub.get("timeStamp").getAsLong();
37-
wxPub.addProperty("timeStamp", "" + timeStamp);
37+
wxPub.addProperty("timeStamp", Long.toString(timeStamp));
38+
}
39+
} else if ((channelCredential = credentialJson.getAsJsonObject("bfb")) != null
40+
|| (channelCredential = credentialJson.getAsJsonObject("bfb_wap")) != null) {
41+
if (channelCredential.has("total_amount")) {
42+
Long total_amount = channelCredential.get("total_amount").getAsLong();
43+
channelCredential.addProperty("total_amount", Long.toString(total_amount));
3844
}
39-
} else if (null != credentialJson.getAsJsonObject("bfb")) {
40-
JsonObject bfb = credentialJson.getAsJsonObject("bfb");
41-
Long total_amount = bfb.get("total_amount").getAsLong();
42-
bfb.addProperty("total_amount", total_amount + "");
4345
} else if ((channelCredential = credentialJson.getAsJsonObject("alipay")) != null
4446
|| (channelCredential = credentialJson.getAsJsonObject("alipay_wap")) != null
4547
|| (channelCredential = credentialJson.getAsJsonObject("alipay_pc_direct")) != null) {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.pingplusplus.serializer;
2+
3+
import com.google.gson.JsonElement;
4+
import com.google.gson.JsonPrimitive;
5+
import com.google.gson.JsonSerializationContext;
6+
import com.google.gson.JsonSerializer;
7+
8+
import java.lang.reflect.Type;
9+
10+
/**
11+
* Created by afon on 17/03/27.
12+
*/
13+
public class DoubleTypeSerializer implements JsonSerializer<Double> {
14+
15+
@Override
16+
public JsonElement serialize(Double src, Type type, JsonSerializationContext jsonSerializationContext) {
17+
if(src == src.longValue())
18+
return new JsonPrimitive(src.longValue());
19+
return new JsonPrimitive(src);
20+
}
21+
}

0 commit comments

Comments
 (0)