1 package com.foxinmy.weixin4j.model;
2
3 import com.alibaba.fastjson.annotation.JSONCreator;
4 import com.alibaba.fastjson.annotation.JSONField;
5 import com.foxinmy.weixin4j.util.StringUtil;
6
7
8
9
10
11
12
13
14
15
16
17 @Deprecated
18 public class WeixinPayAccount extends WeixinAccount {
19
20 private static final long serialVersionUID = -2791256176906048632L;
21
22
23
24 private final String paySignKey;
25
26
27
28 private final String mchId;
29
30
31
32 private String certificateKey;
33
34
35
36 private String certificateFile;
37
38
39
40 private String deviceInfo;
41
42
43
44 private String partnerId;
45
46
47
48
49 private String subId;
50
51
52
53 private String subMchId;
54
55
56
57
58
59
60
61
62
63
64
65 public WeixinPayAccount(String id, String paySignKey, String mchId) {
66 this(id, paySignKey, mchId, mchId, "classpath:ca.p12");
67 }
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83 public WeixinPayAccount(String id, String paySignKey, String mchId, String certificateKey, String certificateFile) {
84 this(id, null, paySignKey, mchId, certificateKey, certificateFile, null, null, null, null);
85 }
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111 @JSONCreator
112 public WeixinPayAccount(@JSONField(name = "id") String id, @JSONField(name = "secret") String secret,
113 @JSONField(name = "paySignKey") String paySignKey, @JSONField(name = "mchId") String mchId,
114 @JSONField(name = "certificateKey") String certificateKey,
115 @JSONField(name = "certificateFile") String certificateFile,
116 @JSONField(name = "deviceInfo") String deviceInfo, @JSONField(name = "partnerId") String partnerId,
117 @JSONField(name = "subId") String subId, @JSONField(name = "subMchId") String subMchId) {
118 super(id, secret);
119 this.paySignKey = paySignKey;
120 this.mchId = mchId;
121 this.certificateKey = certificateKey;
122 this.certificateFile = certificateFile;
123 this.deviceInfo = deviceInfo;
124 this.partnerId = partnerId;
125 this.subId = subId;
126 this.subMchId = subMchId;
127 }
128
129 public String getPaySignKey() {
130 return paySignKey;
131 }
132
133 public String getMchId() {
134 return mchId;
135 }
136
137 public String getDeviceInfo() {
138 return deviceInfo;
139 }
140
141 public String getCertificateKey() {
142 return StringUtil.isBlank(certificateKey) ? mchId : certificateKey;
143 }
144
145 public String getPartnerId() {
146 return partnerId;
147 }
148
149 public String getSubId() {
150 return subId;
151 }
152
153 public String getSubMchId() {
154 return subMchId;
155 }
156
157 public void setCertificateKey(String certificateKey) {
158 this.certificateKey = certificateKey;
159 }
160
161 public String getCertificateFile() {
162 return certificateFile;
163 }
164
165 public void setCertificateFile(String certificateFile) {
166 this.certificateFile = certificateFile;
167 }
168
169 public void setDeviceInfo(String deviceInfo) {
170 this.deviceInfo = deviceInfo;
171 }
172
173 public void setPartnerId(String partnerId) {
174 this.partnerId = partnerId;
175 }
176
177 public void setSubId(String subId) {
178 this.subId = subId;
179 }
180
181 public void setSubMchId(String subMchId) {
182 this.subMchId = subMchId;
183 }
184
185 @Override
186 public String toString() {
187 return "WeixinPayAccount [" + super.toString() + ", paySignKey=" + paySignKey + ", mchId=" + mchId
188 + ", certificateKey=" + certificateKey + ",certificateFile =" + certificateFile + ", deviceInfo="
189 + deviceInfo + ", partnerId=" + partnerId + ", subId=" + subId + ", subMchId=" + subMchId + "]";
190 }
191 }