1 package com.foxinmy.weixin4j.payment.mch;
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.type.mch.CorpPaymentCheckNameType;
12 import com.foxinmy.weixin4j.util.DateUtil;
13
14
15
16
17
18
19
20
21
22
23
24 @Deprecated
25 @XmlRootElement
26 @XmlAccessorType(XmlAccessType.FIELD)
27 public class CorpPaymentRecord extends MerchantResult {
28
29 private static final long serialVersionUID = -1926873539419750498L;
30
31
32
33
34 @JSONField(name = "detail_id")
35 @XmlElement(name = "detail_id")
36 private String transactionId;
37
38
39
40 @JSONField(name = "partner_trade_no")
41 @XmlElement(name = "partner_trade_no")
42 private String outTradeNo;
43
44
45
46 @JSONField(name = "status")
47 @XmlElement(name = "status")
48 private String transactionStatus;
49
50
51
52 @JSONField(name = "reason")
53 @XmlElement(name = "reason")
54 private String failureReason;
55
56
57
58 @JSONField(name = "openid")
59 @XmlElement(name = "openid")
60 private String openId;
61
62
63
64 @JSONField(name = "transfer_name")
65 @XmlElement(name = "transfer_name")
66 private String transferName;
67
68
69
70 @JSONField(name = "payment_amount")
71 @XmlElement(name = "payment_amount")
72 private int paymentAmount;
73
74
75
76 @JSONField(name = "transfer_time")
77 @XmlElement(name = "transfer_time")
78 private String transferTime;
79
80
81
82
83
84 @XmlElement(name = "check_name")
85 @JSONField(name = "check_name")
86 private String checkNameType;
87
88
89
90 @XmlElement(name = "desc")
91 private String desc;
92
93
94
95 @JSONField(name = "check_name_result")
96 @XmlElement(name = "check_name_result")
97 private String checkNameResult;
98
99 protected CorpPaymentRecord() {
100
101 }
102
103 public String getTransactionId() {
104 return transactionId;
105 }
106
107 public String getOutTradeNo() {
108 return outTradeNo;
109 }
110
111 public String getTransactionStatus() {
112 return transactionStatus;
113 }
114
115
116
117
118
119
120 @JSONField(serialize = false)
121 public boolean getFormatTransactionStatus() {
122 return "success".equalsIgnoreCase(transactionStatus);
123 }
124
125 public String getFailureReason() {
126 return failureReason;
127 }
128
129 public String getOpenId() {
130 return openId;
131 }
132
133 public String getTransferName() {
134 return transferName;
135 }
136
137 public int getPaymentAmount() {
138 return paymentAmount;
139 }
140
141
142
143
144
145
146 @JSONField(serialize = false)
147 public double getFormatPaymentAmount() {
148 return paymentAmount / 100d;
149 }
150
151 public String getTransferTime() {
152 return transferTime;
153 }
154
155
156
157
158
159
160 @JSONField(serialize = false)
161 public Date getFormatTransferTime() {
162 return transferTime != null ? DateUtil
163 .parse2yyyyMMddHHmmss(transferTime) : null;
164 }
165
166 public String getCheckNameType() {
167 return checkNameType;
168 }
169
170 @JSONField(serialize = false)
171 public CorpPaymentCheckNameType getFormatCheckNameType() {
172 return checkNameType != null ? CorpPaymentCheckNameType
173 .valueOf(checkNameType) : null;
174 }
175
176 public String getDesc() {
177 return desc;
178 }
179
180 public String getCheckNameResult() {
181 return checkNameResult;
182 }
183
184
185
186
187
188
189 @JSONField(serialize = false)
190 public boolean getFormatCheckNameResult() {
191 return "pass".equalsIgnoreCase(checkNameResult);
192 }
193
194 @Override
195 public String toString() {
196 return "CorpPaymentRecord [transactionId=" + transactionId
197 + ", outTradeNo=" + outTradeNo + ", transactionStatus="
198 + getFormatTransactionStatus() + ", failureReason="
199 + failureReason + ", openId=" + openId + ", transferName="
200 + transferName + ", paymentAmount=" + getFormatPaymentAmount()
201 + ", transferTime=" + transferTime + ", checkNameType="
202 + checkNameType + ", desc=" + desc + ", checkNameResult="
203 + getFormatCheckNameResult() + ", " + super.toString() + "]";
204 }
205 }