Skip to content

Commit 0962492

Browse files
committed
Agreement added; AccountEventDataDeserializer, AccountAPIResource removed
1 parent f0a77e0 commit 0962492

21 files changed

Lines changed: 471 additions & 201 deletions

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>Pingplusplus</groupId>
55
<artifactId>pingpp-java</artifactId>
6-
<version>2.3.7</version>
6+
<version>2.3.8</version>
77
<dependencies>
88
<dependency>
99
<groupId>com.google.code.gson</groupId>

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.3.7";
14+
public static final String VERSION = "2.3.8";
1515
/**
1616
* api key
1717
*/
Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
package com.pingplusplus.model;
2+
3+
import com.pingplusplus.exception.*;
4+
import com.pingplusplus.net.APIResource;
5+
6+
import java.util.Map;
7+
8+
/**
9+
* 微信企业付款
10+
*/
11+
public class Agreement extends APIResource {
12+
String id;
13+
String object;
14+
Boolean livemode;
15+
String app;
16+
Long created;
17+
String channel;
18+
String contractNo;
19+
String contractId;
20+
Map<String, Object> credential;
21+
String status;
22+
Long timeSucceeded;
23+
Long timeCanceled;
24+
String failureCode;
25+
String failureMsg;
26+
Map<String, Object> extra;
27+
Map<String, Object> metadata;
28+
29+
public String getId() {
30+
return id;
31+
}
32+
33+
public void setId(String id) {
34+
this.id = id;
35+
}
36+
37+
public String getObject() {
38+
return object;
39+
}
40+
41+
public void setObject(String object) {
42+
this.object = object;
43+
}
44+
45+
public Boolean getLivemode() {
46+
return livemode;
47+
}
48+
49+
public void setLivemode(Boolean livemode) {
50+
this.livemode = livemode;
51+
}
52+
53+
public String getApp() {
54+
return app;
55+
}
56+
57+
public void setApp(String app) {
58+
this.app = app;
59+
}
60+
61+
public Long getCreated() {
62+
return created;
63+
}
64+
65+
public void setCreated(Long created) {
66+
this.created = created;
67+
}
68+
69+
public String getChannel() {
70+
return channel;
71+
}
72+
73+
public void setChannel(String channel) {
74+
this.channel = channel;
75+
}
76+
77+
public String getContractNo() {
78+
return contractNo;
79+
}
80+
81+
public void setContractNo(String contractNo) {
82+
this.contractNo = contractNo;
83+
}
84+
85+
public String getContractId() {
86+
return contractId;
87+
}
88+
89+
public void setContractId(String contractId) {
90+
this.contractId = contractId;
91+
}
92+
93+
public Map<String, Object> getCredential() {
94+
return credential;
95+
}
96+
97+
public void setCredential(Map<String, Object> credential) {
98+
this.credential = credential;
99+
}
100+
101+
public String getStatus() {
102+
return status;
103+
}
104+
105+
public void setStatus(String status) {
106+
this.status = status;
107+
}
108+
109+
public Long getTimeSucceeded() {
110+
return timeSucceeded;
111+
}
112+
113+
public void setTimeSucceeded(Long timeSucceeded) {
114+
this.timeSucceeded = timeSucceeded;
115+
}
116+
117+
public Long getTimeCanceled() {
118+
return timeCanceled;
119+
}
120+
121+
public void setTimeCanceled(Long timeCanceled) {
122+
this.timeCanceled = timeCanceled;
123+
}
124+
125+
public String getFailureCode() {
126+
return failureCode;
127+
}
128+
129+
public void setFailureCode(String failureCode) {
130+
this.failureCode = failureCode;
131+
}
132+
133+
public String getFailureMsg() {
134+
return failureMsg;
135+
}
136+
137+
public void setFailureMsg(String failureMsg) {
138+
this.failureMsg = failureMsg;
139+
}
140+
141+
public Map<String, Object> getExtra() {
142+
return extra;
143+
}
144+
145+
public void setExtra(Map<String, Object> extra) {
146+
this.extra = extra;
147+
}
148+
149+
public Map<String, Object> getMetadata() {
150+
return metadata;
151+
}
152+
153+
public void setMetadata(Map<String, Object> metadata) {
154+
this.metadata = metadata;
155+
}
156+
157+
/**
158+
* 创建签约(agreement)
159+
*
160+
* @param params 签约参数
161+
* @return Agreement
162+
* @throws AuthenticationException
163+
* @throws InvalidRequestException
164+
* @throws APIConnectionException
165+
* @throws APIException
166+
* @throws ChannelException
167+
*/
168+
public static Agreement create(Map<String, Object> params)
169+
throws AuthenticationException, InvalidRequestException,
170+
APIConnectionException, APIException, ChannelException, RateLimitException {
171+
return create(params, null);
172+
}
173+
174+
/**
175+
* 创建签约(agreement)
176+
*
177+
* @param params 签约参数
178+
* @param apiKey Ping++ APiKey
179+
* @return Transfer
180+
* @throws AuthenticationException
181+
* @throws InvalidRequestException
182+
* @throws APIConnectionException
183+
* @throws APIException
184+
* @throws ChannelException
185+
* @throws RateLimitException
186+
*/
187+
public static Agreement create(Map<String, Object> params, String apiKey)
188+
throws AuthenticationException, InvalidRequestException,
189+
APIConnectionException, APIException, ChannelException, RateLimitException {
190+
return request(RequestMethod.POST, classURL(Agreement.class), apiKey, params, Agreement.class);
191+
}
192+
193+
/**
194+
* 查询签约(agreement)
195+
*
196+
* @param id id
197+
* @return Agreement
198+
* @throws AuthenticationException
199+
* @throws InvalidRequestException
200+
* @throws APIConnectionException
201+
* @throws APIException
202+
* @throws ChannelException
203+
*/
204+
public static Agreement retrieve(String id) throws AuthenticationException,
205+
InvalidRequestException, APIConnectionException,
206+
APIException, ChannelException, RateLimitException {
207+
return retrieve(id, null);
208+
}
209+
210+
/**
211+
* 查询签约(agreement)
212+
*
213+
* @param id id
214+
* @param apiKey Ping++ ApiKey
215+
* @return Agreement
216+
* @throws AuthenticationException
217+
* @throws InvalidRequestException
218+
* @throws APIConnectionException
219+
* @throws APIException
220+
* @throws ChannelException
221+
* @throws RateLimitException
222+
*/
223+
public static Agreement retrieve(String id, String apiKey) throws AuthenticationException,
224+
InvalidRequestException, APIConnectionException,
225+
APIException, ChannelException, RateLimitException {
226+
return request(RequestMethod.GET, instanceURL(Agreement.class, id), apiKey, null, Agreement.class);
227+
}
228+
229+
/**
230+
* 查询签约列表
231+
*
232+
* @param params 分页参数等
233+
* @return AgreementCollection
234+
* @throws AuthenticationException
235+
* @throws InvalidRequestException
236+
* @throws APIConnectionException
237+
* @throws APIException
238+
* @throws ChannelException
239+
*/
240+
public static AgreementCollection list(Map<String, Object> params)
241+
throws AuthenticationException, InvalidRequestException,
242+
APIConnectionException, APIException, ChannelException, RateLimitException {
243+
return list(params, null);
244+
}
245+
246+
/**
247+
* 查询签约列表
248+
*
249+
* @param apiKey Ping++ APiKey
250+
* @param params 分页参数等
251+
* @return AgreementCollection
252+
* @throws AuthenticationException
253+
* @throws InvalidRequestException
254+
* @throws APIConnectionException
255+
* @throws APIException
256+
* @throws ChannelException
257+
* @throws RateLimitException
258+
*/
259+
public static AgreementCollection list(Map<String, Object> params, String apiKey)
260+
throws AuthenticationException, InvalidRequestException,
261+
APIConnectionException, APIException, ChannelException, RateLimitException {
262+
return request(RequestMethod.GET, classURL(Agreement.class), apiKey, params, AgreementCollection.class);
263+
}
264+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.pingplusplus.model;
2+
3+
public class AgreementCollection extends PingppCollection<Agreement> {
4+
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import com.google.gson.FieldNamingPolicy;
44
import com.google.gson.Gson;
55
import com.google.gson.GsonBuilder;
6-
import com.pingplusplus.serializer.BatchRefundChargesSerializer;
7-
import com.pingplusplus.serializer.BatchTransferRecipientSerializer;
8-
import com.pingplusplus.serializer.DoubleTypeSerializer;
6+
import com.pingplusplus.serializer.*;
97

108
import java.lang.reflect.Field;
119

@@ -19,6 +17,9 @@ public abstract class PingppObject {
1917
.registerTypeAdapter(BatchTransferRecipientSerializer.class, new BatchTransferRecipientSerializer())
2018
.registerTypeAdapter(BatchRefundCharges.class, new BatchRefundChargesSerializer())
2119
.registerTypeAdapter(Double.class, new DoubleTypeSerializer())
20+
.registerTypeAdapter(ChargeEssentials.class, new ChargeEssentialsSerializer())
21+
.registerTypeAdapter(CouponTemplateExpiration.class, new CouponTemplateExpirationSerializer())
22+
.registerTypeAdapter(SettleAccountRecipient.class, new SettleAccountRecipientSerializer())
2223
.create();
2324

2425
public static Gson getPrettyPrintGson() {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class RedEnvelope extends APIResource {
3535
String description;
3636
String failureMsg;
3737
Map<String, String> extra;
38-
Map<String, String> metadata;
38+
Map<String, Object> metadata;
3939

4040
public String getStatus() {
4141
return status;
@@ -198,11 +198,11 @@ public void setBody(String body) {
198198
this.body = body;
199199
}
200200

201-
public Map<String, String> getMetadata() {
201+
public Map<String, Object> getMetadata() {
202202
return metadata;
203203
}
204204

205-
public void setMetadata(Map<String, String> metadata) {
205+
public void setMetadata(Map<String, Object> metadata) {
206206
this.metadata = metadata;
207207
}
208208

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
import com.pingplusplus.exception.*;
44
import com.pingplusplus.net.APIResource;
5-
import com.pingplusplus.net.AccountAPIResource;
65

76
import java.util.Map;
87

9-
public class Royalty extends AccountAPIResource {
8+
public class Royalty extends APIResource {
109
String id;
1110
String object;
1211
Boolean livemode;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
import com.pingplusplus.exception.*;
44
import com.pingplusplus.net.APIResource;
5-
import com.pingplusplus.net.AccountAPIResource;
65

76
import java.util.Map;
87

9-
public class RoyaltySettlement extends AccountAPIResource {
8+
public class RoyaltySettlement extends APIResource {
109
String id;
1110
String object;
1211
Boolean livemode;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
import com.pingplusplus.exception.*;
44
import com.pingplusplus.net.APIResource;
5-
import com.pingplusplus.net.AccountAPIResource;
65

76
import java.util.Map;
87

9-
public class RoyaltyTemplate extends AccountAPIResource {
8+
public class RoyaltyTemplate extends APIResource {
109
String id;
1110
String object;
1211
Boolean livemode;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
import com.pingplusplus.exception.*;
44
import com.pingplusplus.net.APIResource;
5-
import com.pingplusplus.net.AccountAPIResource;
65

76
import java.util.Map;
87

9-
public class RoyaltyTransaction extends AccountAPIResource {
8+
public class RoyaltyTransaction extends APIResource {
109
String id;
1110
String object;
1211
Integer amount;

0 commit comments

Comments
 (0)