1 package com.foxinmy.weixin4j.pay.payment.mch;
2
3 import com.alibaba.fastjson.annotation.JSONField;
4 import com.foxinmy.weixin4j.pay.type.mch.CorpPaymentCheckNameType;
5 import com.foxinmy.weixin4j.util.DateUtil;
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
12
13
14
15
16
17
18
19
20
21 @XmlRootElement
22 @XmlAccessorType(XmlAccessType.FIELD)
23 public class CorpPayment extends MerchantResult {
24
25 private static final long serialVersionUID = 3734639674346425312L;
26
27
28
29 @XmlElement(name = "partner_trade_no")
30 @JSONField(name = "partner_trade_no")
31 private String outTradeNo;
32
33
34
35 @JSONField(name = "openid")
36 @XmlElement(name = "openid")
37 private String openId;
38
39
40
41
42
43 @XmlElement(name = "check_name")
44 @JSONField(name = "check_name")
45 private CorpPaymentCheckNameType checkNameType;
46
47
48
49 @XmlElement(name = "re_user_name")
50 @JSONField(name = "re_user_name")
51 private String userName;
52
53
54
55 private String desc;
56
57
58
59 private int amount;
60
61
62
63 @XmlElement(name = "spbill_create_ip")
64 @JSONField(name = "spbill_create_ip")
65 private String clientIp;
66
67 protected CorpPayment() {
68
69 }
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 public CorpPayment(String outTradeNo, String openId,
88 CorpPaymentCheckNameType checkNameType, String desc, double amount,
89 String clientIp) {
90 this.outTradeNo = outTradeNo;
91 this.openId = openId;
92 this.checkNameType = checkNameType;
93 this.desc = desc;
94 this.amount = DateUtil.formatYuan2Fen(amount);
95 this.clientIp = clientIp;
96 }
97
98 public String getOutTradeNo() {
99 return outTradeNo;
100 }
101
102 public void setOutTradeNo(String outTradeNo) {
103 this.outTradeNo = outTradeNo;
104 }
105
106 public String getOpenId() {
107 return openId;
108 }
109
110 public void setOpenId(String openId) {
111 this.openId = openId;
112 }
113
114 public CorpPaymentCheckNameType getCheckNameType() {
115 return checkNameType;
116 }
117
118 public void setCheckNameType(CorpPaymentCheckNameType checkNameType) {
119 this.checkNameType = checkNameType;
120 }
121
122 public String getUserName() {
123 return userName;
124 }
125
126 public void setUserName(String userName) {
127 this.userName = userName;
128 }
129
130 public String getDesc() {
131 return desc;
132 }
133
134 public void setDesc(String desc) {
135 this.desc = desc;
136 }
137
138 public int getAmount() {
139 return amount;
140 }
141
142 public void setAmount(int amount) {
143 this.amount = amount;
144 }
145
146
147
148
149
150
151 @JSONField(serialize = false)
152 public double getFormatAmount() {
153 return amount / 100d;
154 }
155
156 public String getClientIp() {
157 return clientIp;
158 }
159
160 public void setClientIp(String clientIp) {
161 this.clientIp = clientIp;
162 }
163
164 @Override
165 public String toString() {
166 return "CorpPayment [outTradeNo=" + outTradeNo + ", openId=" + openId
167 + ", checkNameType=" + checkNameType + ", userName=" + userName
168 + ", desc=" + desc + ", amount=" + amount + ", clientIp="
169 + clientIp + ", " + super.toString() + "]";
170 }
171 }