1 package com.foxinmy.weixin4j.payment;
2
3 import java.util.Date;
4
5 import javax.xml.bind.annotation.XmlAccessType;
6 import javax.xml.bind.annotation.XmlAccessorType;
7 import javax.xml.bind.annotation.XmlElement;
8 import javax.xml.bind.annotation.XmlRootElement;
9
10 import com.alibaba.fastjson.annotation.JSONField;
11 import com.foxinmy.weixin4j.payment.mch.MerchantResult;
12 import com.foxinmy.weixin4j.util.DateUtil;
13
14
15
16
17
18
19
20
21
22
23 @Deprecated
24 @XmlRootElement
25 @XmlAccessorType(XmlAccessType.FIELD)
26 public class PayPackage extends MerchantResult {
27
28 private static final long serialVersionUID = 3450161267802545790L;
29
30
31
32
33 private String body;
34
35
36
37 private String detail;
38
39
40
41 @XmlElement(name = "out_trade_no")
42 @JSONField(name = "out_trade_no")
43 private String outTradeNo;
44
45
46
47 @XmlElement(name = "total_fee")
48 @JSONField(name = "total_fee")
49 private int totalFee;
50
51
52
53 @XmlElement(name = "notify_url")
54 @JSONField(name = "notify_url")
55 private String notifyUrl;
56
57
58
59 @XmlElement(name = "spbill_create_ip")
60 @JSONField(name = "spbill_create_ip")
61 private String createIp;
62
63
64
65 private String attach;
66
67
68
69
70 @XmlElement(name = "time_start")
71 @JSONField(name = "time_start")
72 private String timeStart;
73
74
75
76
77 @XmlElement(name = "time_expire")
78 @JSONField(name = "time_expire")
79 private String timeExpire;
80
81
82
83 @XmlElement(name = "goods_tag")
84 @JSONField(name = "goods_tag")
85 private String goodsTag;
86
87 protected PayPackage() {
88
89 }
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115 public PayPackage(String body, String detail, String outTradeNo,
116 double totalFee, String notifyUrl, String createIp, String attach,
117 Date timeStart, Date timeExpire, String goodsTag) {
118 this.body = body;
119 this.detail = detail;
120 this.outTradeNo = outTradeNo;
121 this.totalFee = DateUtil.formatYuan2Fen(totalFee);
122 this.notifyUrl = notifyUrl;
123 this.createIp = createIp;
124 this.attach = attach;
125 this.timeStart = timeStart != null ? DateUtil
126 .fortmat2yyyyMMddHHmmss(timeStart) : null;
127 this.timeExpire = timeExpire != null ? DateUtil
128 .fortmat2yyyyMMddHHmmss(timeExpire) : null;
129 this.goodsTag = goodsTag;
130 }
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156 public PayPackage(String body, String detail, String outTradeNo,
157 long totalFee, String notifyUrl, String createIp, String attach,
158 Date timeStart, Date timeExpire, String goodsTag) {
159 this.body = body;
160 this.detail = detail;
161 this.outTradeNo = outTradeNo;
162 this.totalFee = Long.valueOf(totalFee).intValue();
163 this.notifyUrl = notifyUrl;
164 this.createIp = createIp;
165 this.attach = attach;
166 this.timeStart = timeStart != null ? DateUtil
167 .fortmat2yyyyMMddHHmmss(timeStart) : null;
168 this.timeExpire = timeExpire != null ? DateUtil
169 .fortmat2yyyyMMddHHmmss(timeExpire) : null;
170 this.goodsTag = goodsTag;
171 }
172
173 public String getBody() {
174 return body;
175 }
176
177 public void setBody(String body) {
178 this.body = body;
179 }
180
181 public String getDetail() {
182 return detail;
183 }
184
185 public void setDetail(String detail) {
186 this.detail = detail;
187 }
188
189 public String getOutTradeNo() {
190 return outTradeNo;
191 }
192
193 public void setOutTradeNo(String outTradeNo) {
194 this.outTradeNo = outTradeNo;
195 }
196
197 public int getTotalFee() {
198 return totalFee;
199 }
200
201
202
203
204
205
206 @JSONField(serialize = false)
207 public double getFormatTotalFee() {
208 return totalFee / 100d;
209 }
210
211
212
213
214
215
216
217 public void setTotalFee(double totalFee) {
218 this.totalFee = DateUtil.formatYuan2Fen(totalFee);
219 }
220
221 public String getNotifyUrl() {
222 return notifyUrl;
223 }
224
225 public void setNotifyUrl(String notifyUrl) {
226 this.notifyUrl = notifyUrl;
227 }
228
229 public String getCreateIp() {
230 return createIp;
231 }
232
233 public void setCreateIp(String createIp) {
234 this.createIp = createIp;
235 }
236
237 public String getAttach() {
238 return attach;
239 }
240
241 public void setAttach(String attach) {
242 this.attach = attach;
243 }
244
245 public String getTimeStart() {
246 return timeStart;
247 }
248
249 public void setTimeStart(String timeStart) {
250 this.timeStart = timeStart;
251 }
252
253 public void setTimeExpire(String timeExpire) {
254 this.timeExpire = timeExpire;
255 }
256
257 public void setTimeStart(Date timeStart) {
258 this.timeStart = timeStart != null ? DateUtil
259 .fortmat2yyyyMMddHHmmss(timeStart) : null;
260 }
261
262 public String getTimeExpire() {
263 return timeExpire;
264 }
265
266 public void setTimeExpire(Date timeExpire) {
267 this.timeExpire = timeExpire != null ? DateUtil
268 .fortmat2yyyyMMddHHmmss(timeExpire) : null;
269 }
270
271 public String getGoodsTag() {
272 return goodsTag;
273 }
274
275 public void setGoodsTag(String goodsTag) {
276 this.goodsTag = goodsTag;
277 }
278
279 @Override
280 public String toString() {
281 return "body=" + body + ", detail=" + detail + ", outTradeNo="
282 + outTradeNo + ", totalFee=" + totalFee + ", notifyUrl="
283 + notifyUrl + ", createIp=" + createIp + ", attach=" + attach
284 + ", timeStart=" + timeStart + ", timeExpire=" + timeExpire
285 + ", goodsTag=" + goodsTag;
286 }
287 }