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