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