1 package com.foxinmy.weixin4j.payment.mch;
2
3 import java.util.List;
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.RefundChannel;
12 import com.foxinmy.weixin4j.xml.ListsuffixResult;
13
14
15
16
17
18
19
20
21
22
23
24 @Deprecated
25 @XmlRootElement
26 @XmlAccessorType(XmlAccessType.FIELD)
27 public class RefundResult extends MerchantTradeResult {
28
29 private static final long serialVersionUID = -3687863914168618620L;
30
31
32
33
34 @XmlElement(name = "out_refund_no")
35 @JSONField(name = "out_refund_no")
36 private String outRefundNo;
37
38
39
40 @XmlElement(name = "refund_id")
41 @JSONField(name = "refund_id")
42 private String refundId;
43
44
45
46 @XmlElement(name = "refund_channel")
47 @JSONField(name = "refund_channel")
48 private String refundChannel;
49
50
51
52 @XmlElement(name = "refund_fee")
53 @JSONField(name = "refund_fee")
54 private int refundFee;
55
56
57
58 @XmlElement(name = "cash_refund_fee")
59 @JSONField(name = "cash_refund_fee")
60 private Integer cashRefundFee;
61
62
63
64
65
66 @ListsuffixResult({ ".*(_\\d)$" })
67 private List<RefundDetail> refundList;
68
69 protected RefundResult() {
70
71 }
72
73 public String getOutRefundNo() {
74 return outRefundNo;
75 }
76
77 public String getRefundId() {
78 return refundId;
79 }
80
81 public String getRefundChannel() {
82 return refundChannel;
83 }
84
85 @JSONField(serialize = false)
86 public RefundChannel getFormatRefundChannel() {
87 return refundChannel != null ? RefundChannel.valueOf(refundChannel
88 .toUpperCase()) : null;
89 }
90
91 public int getRefundFee() {
92 return refundFee;
93 }
94
95
96
97
98
99
100 @JSONField(serialize = false)
101 public double getFormatRefundFee() {
102 return refundFee / 100d;
103 }
104
105 public Integer getCashRefundFee() {
106 return cashRefundFee;
107 }
108
109
110
111
112
113
114 @JSONField(serialize = false)
115 public double getFormatCashRefundFee() {
116 return cashRefundFee != null ? cashRefundFee.intValue() / 100d : 0d;
117 }
118
119 public List<RefundDetail> getRefundList() {
120 return refundList;
121 }
122
123 @Override
124 public String toString() {
125 return "RefundResult [" + super.toString() + ", outRefundNo="
126 + outRefundNo + ", refundId=" + refundId + ", refundChannel="
127 + refundChannel + ", refundFee=" + refundFee
128 + ", cashRefundFee=" + cashRefundFee + ", refundList="
129 + refundList + "]";
130 }
131 }