1 package com.foxinmy.weixin4j.pay.payment.mch;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4 import com.foxinmy.weixin4j.pay.payment.PayPackage;
5 import com.foxinmy.weixin4j.pay.type.CurrencyType;
6 import com.foxinmy.weixin4j.pay.type.TradeType;
7
8 import javax.xml.bind.annotation.XmlAccessType;
9 import javax.xml.bind.annotation.XmlAccessorType;
10 import javax.xml.bind.annotation.XmlElement;
11 import javax.xml.bind.annotation.XmlRootElement;
12 import java.util.Date;
13
14
15
16
17
18
19
20
21
22
23 @XmlRootElement
24 @XmlAccessorType(XmlAccessType.FIELD)
25 public class MchPayPackage extends PayPackage {
26
27 private static final long serialVersionUID = 8944928173669656177L;
28
29
30
31
32 @XmlElement(name = "trade_type")
33 @JSONField(name = "trade_type")
34 private String tradeType;
35
36
37
38 @XmlElement(name = "fee_type")
39 @JSONField(name = "fee_type")
40 private String feeType;
41
42
43
44 @XmlElement(name = "openid")
45 @JSONField(name = "openid")
46 private String openId;
47
48
49
50
51 @XmlElement(name = "product_id")
52 @JSONField(name = "product_id")
53 private String productId;
54
55
56
57
58 @XmlElement(name = "auth_code")
59 @JSONField(name = "auth_code")
60 private String authCode;
61
62
63
64 @XmlElement(name = "limit_pay")
65 @JSONField(name = "limit_pay")
66 private String limitPay;
67
68
69
70 @XmlElement(name = "sub_openid")
71 @JSONField(name = "sub_openid")
72 private String subOpenId;
73
74
75
76 @XmlElement(name = "scene_info")
77 @JSONField(name = "scene_info")
78 private String sceneInfo;
79
80
81
82
83 private String receipt;
84
85
86
87 private String deposit;
88
89
90
91
92
93 @XmlElement(name = "profit_sharing")
94 @JSONField(name = "profit_sharing")
95 private String profitSharing;
96
97 protected MchPayPackage() {
98
99 }
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125 public MchPayPackage(String body, String outTradeNo, double totalFee,
126 String notifyUrl, String createIp, TradeType tradeType,
127 String openId, String authCode, String productId, String attach) {
128 this(body, null, outTradeNo, totalFee, CurrencyType.CNY, notifyUrl,
129 createIp, tradeType, openId, authCode, productId, attach, null,
130 null, null, null, null, null, null, null);
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178 public MchPayPackage(String body, String detial, String outTradeNo,
179 double totalFee, CurrencyType feeType, String notifyUrl,
180 String createIp, TradeType tradeType, String openId,
181 String authCode, String productId, String attach, Date timeStart,
182 Date timeExpire, String goodsTag, String limitPay, String subOpenId, String receipt,
183 String deposit, String profitSharing) {
184 super(body, detial, outTradeNo, totalFee, notifyUrl, createIp, attach,
185 timeStart, timeExpire, goodsTag);
186 this.tradeType = tradeType != null ? tradeType.name() : null;
187 this.feeType = feeType == null ? CurrencyType.CNY.name() : feeType.name();
188 this.openId = openId;
189 this.authCode = authCode;
190 this.productId = productId;
191 this.limitPay = limitPay;
192 this.subOpenId = subOpenId;
193 this.receipt = receipt;
194 this.deposit = deposit;
195 this.profitSharing = profitSharing;
196 }
197
198 public String getTradeType() {
199 return tradeType;
200 }
201
202 public void setTradeType(String tradeType) {
203 this.tradeType = tradeType;
204 }
205
206 public String getFeeType() {
207 return feeType;
208 }
209
210 public void setFeeType(String feeType) {
211 this.feeType = feeType;
212 }
213
214 public String getOpenId() {
215 return openId;
216 }
217
218 public void setOpenId(String openId) {
219 this.openId = openId;
220 }
221
222 public String getAuthCode() {
223 return authCode;
224 }
225
226 public void setAuthCode(String authCode) {
227 this.authCode = authCode;
228 }
229
230 public String getProductId() {
231 return productId;
232 }
233
234 public void setProductId(String productId) {
235 this.productId = productId;
236 }
237
238 public String getLimitPay() {
239 return limitPay;
240 }
241
242 public void setLimitPay(String limitPay) {
243 this.limitPay = limitPay;
244 }
245
246 public String getSubOpenId() {
247 return subOpenId;
248 }
249
250 public void setSubOpenId(String subOpenId) {
251 this.subOpenId = subOpenId;
252 }
253
254 public String getSceneInfo() {
255 return sceneInfo;
256 }
257
258 public void setSceneInfo(String sceneInfo) {
259 this.sceneInfo = sceneInfo;
260 }
261
262 public String getReceipt() {
263 return receipt;
264 }
265
266 public void setReceipt(String receipt) {
267 this.receipt = receipt;
268 }
269
270 public String getDeposit() {
271 return deposit;
272 }
273
274 public void setDeposit(String deposit) {
275 this.deposit = deposit;
276 }
277
278 public String getProfitSharing() {
279 return profitSharing;
280 }
281
282 public void setProfitSharing(String profitSharing) {
283 this.profitSharing = profitSharing;
284 }
285
286 @Override
287 public String toString() {
288 return "MchPayPackage{" +
289 "tradeType='" + tradeType + '\'' +
290 ", feeType='" + feeType + '\'' +
291 ", openId='" + openId + '\'' +
292 ", productId='" + productId + '\'' +
293 ", authCode='" + authCode + '\'' +
294 ", limitPay='" + limitPay + '\'' +
295 ", subOpenId='" + subOpenId + '\'' +
296 ", sceneInfo='" + sceneInfo + '\'' +
297 ", receipt='" + receipt + '\'' +
298 ", deposit=" + deposit +
299 ", profitSharing=" + profitSharing +
300 '}';
301 }
302 }