Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
28653 amit.gupta 1
package com.spice.profitmandi.dao.entity.transaction;
2
 
3
import java.time.LocalDateTime;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.GeneratedValue;
8
import javax.persistence.GenerationType;
9
import javax.persistence.Id;
10
import javax.persistence.Table;
11
 
12
@Entity
13
@Table(name="payment.payment", schema = "payment")
14
public class Payment {
15
 
16
	@Id
17
	@Column(name = "id", unique = true, updatable = false)
18
	@GeneratedValue(strategy = GenerationType.IDENTITY)
19
	private int id;
20
 
21
	@Column
22
	private int gatewayId;
23
	@Column
24
	private String gatewayPaymentId;
25
 
26
	@Column
27
	private int merchantTxnId;
28
 
29
	@Column
30
	private String gatewayTxnId;
31
 
32
	@Column
33
	private double amount;
34
 
35
	@Column
36
	private String gatewayTxnStatus;
37
 
38
	@Column
39
	private int status;
40
 
41
	@Column
42
	private int userId;
43
 
44
	@Column
45
	private String errorCode;
46
 
47
	@Column
48
	private String description;
49
 
50
	@Column
51
	private String authCode;
52
 
53
	@Column
54
	private String referenceCode;
55
 
56
	@Column
57
	private String sessionId;
58
 
59
	@Column
60
	private LocalDateTime gatewayTxnDate;
61
 
62
	@Column
63
	private LocalDateTime initTimestamp;
64
 
65
	@Column
66
	private LocalDateTime successTimestamp;
67
 
68
	@Column
69
	private LocalDateTime errorTimestamp;
70
 
71
	@Column
72
	private LocalDateTime provisionalCaptureTimestamp;
73
 
74
	@Column
75
	private boolean isDigital;
76
 
77
	@Column
78
	private float refundAmount;
79
 
80
	@Override
81
	public String toString() {
82
		return "Payment [id=" + id + ", gatewayId=" + gatewayId + ", gatewayPaymentId=" + gatewayPaymentId
83
				+ ", merchantTxnId=" + merchantTxnId + ", gatewayTxnId=" + gatewayTxnId + ", amount=" + amount
84
				+ ", gatewayTxnStatus=" + gatewayTxnStatus + ", status=" + status + ", userId=" + userId
85
				+ ", errorCode=" + errorCode + ", description=" + description + ", authCode=" + authCode
86
				+ ", referenceCode=" + referenceCode + ", sessionId=" + sessionId + ", gatewayTxnDate=" + gatewayTxnDate
87
				+ ", initTimestamp=" + initTimestamp + ", successTimestamp=" + successTimestamp + ", errorTimestamp="
88
				+ errorTimestamp + ", provisionalCaptureTimestamp=" + provisionalCaptureTimestamp + ", isDigital="
89
				+ isDigital + ", refundAmount=" + refundAmount + "]";
90
	}
91
 
92
	public int getId() {
93
		return id;
94
	}
95
 
96
	public void setId(int id) {
97
		this.id = id;
98
	}
99
 
100
	public int getGatewayId() {
101
		return gatewayId;
102
	}
103
 
104
	public void setGatewayId(int gatewayId) {
105
		this.gatewayId = gatewayId;
106
	}
107
 
108
	public String getGatewayPaymentId() {
109
		return gatewayPaymentId;
110
	}
111
 
112
	public void setGatewayPaymentId(String gatewayPaymentId) {
113
		this.gatewayPaymentId = gatewayPaymentId;
114
	}
115
 
116
	public int getMerchantTxnId() {
117
		return merchantTxnId;
118
	}
119
 
120
	public void setMerchantTxnId(int merchantTxnId) {
121
		this.merchantTxnId = merchantTxnId;
122
	}
123
 
124
	public String getGatewayTxnId() {
125
		return gatewayTxnId;
126
	}
127
 
128
	public void setGatewayTxnId(String gatewayTxnId) {
129
		this.gatewayTxnId = gatewayTxnId;
130
	}
131
 
132
	public double getAmount() {
133
		return amount;
134
	}
135
 
136
	public void setAmount(double amount) {
137
		this.amount = amount;
138
	}
139
 
140
	public String getGatewayTxnStatus() {
141
		return gatewayTxnStatus;
142
	}
143
 
144
	public void setGatewayTxnStatus(String gatewayTxnStatus) {
145
		this.gatewayTxnStatus = gatewayTxnStatus;
146
	}
147
 
148
	public int getStatus() {
149
		return status;
150
	}
151
 
152
	public void setStatus(int status) {
153
		this.status = status;
154
	}
155
 
156
	public int getUserId() {
157
		return userId;
158
	}
159
 
160
	public void setUserId(int userId) {
161
		this.userId = userId;
162
	}
163
 
164
	public String getErrorCode() {
165
		return errorCode;
166
	}
167
 
168
	public void setErrorCode(String errorCode) {
169
		this.errorCode = errorCode;
170
	}
171
 
172
	public String getDescription() {
173
		return description;
174
	}
175
 
176
	public void setDescription(String description) {
177
		this.description = description;
178
	}
179
 
180
	public String getAuthCode() {
181
		return authCode;
182
	}
183
 
184
	public void setAuthCode(String authCode) {
185
		this.authCode = authCode;
186
	}
187
 
188
	public String getReferenceCode() {
189
		return referenceCode;
190
	}
191
 
192
	public void setReferenceCode(String referenceCode) {
193
		this.referenceCode = referenceCode;
194
	}
195
 
196
	public String getSessionId() {
197
		return sessionId;
198
	}
199
 
200
	public void setSessionId(String sessionId) {
201
		this.sessionId = sessionId;
202
	}
203
 
204
	public LocalDateTime getGatewayTxnDate() {
205
		return gatewayTxnDate;
206
	}
207
 
208
	public void setGatewayTxnDate(LocalDateTime gatewayTxnDate) {
209
		this.gatewayTxnDate = gatewayTxnDate;
210
	}
211
 
212
	public LocalDateTime getInitTimestamp() {
213
		return initTimestamp;
214
	}
215
 
216
	public void setInitTimestamp(LocalDateTime initTimestamp) {
217
		this.initTimestamp = initTimestamp;
218
	}
219
 
220
	public LocalDateTime getSuccessTimestamp() {
221
		return successTimestamp;
222
	}
223
 
224
	public void setSuccessTimestamp(LocalDateTime successTimestamp) {
225
		this.successTimestamp = successTimestamp;
226
	}
227
 
228
	public LocalDateTime getErrorTimestamp() {
229
		return errorTimestamp;
230
	}
231
 
232
	public void setErrorTimestamp(LocalDateTime errorTimestamp) {
233
		this.errorTimestamp = errorTimestamp;
234
	}
235
 
236
	public LocalDateTime getProvisionalCaptureTimestamp() {
237
		return provisionalCaptureTimestamp;
238
	}
239
 
240
	public void setProvisionalCaptureTimestamp(LocalDateTime provisionalCaptureTimestamp) {
241
		this.provisionalCaptureTimestamp = provisionalCaptureTimestamp;
242
	}
243
 
244
	public boolean isDigital() {
245
		return isDigital;
246
	}
247
 
248
	public void setDigital(boolean isDigital) {
249
		this.isDigital = isDigital;
250
	}
251
 
252
	public float getRefundAmount() {
253
		return refundAmount;
254
	}
255
 
256
	public void setRefundAmount(float refundAmount) {
257
		this.refundAmount = refundAmount;
258
	}
259
 
260
	@Override
261
	public int hashCode() {
262
		final int prime = 31;
263
		int result = 1;
264
		long temp;
265
		temp = Double.doubleToLongBits(amount);
266
		result = prime * result + (int) (temp ^ (temp >>> 32));
267
		result = prime * result + ((authCode == null) ? 0 : authCode.hashCode());
268
		result = prime * result + ((description == null) ? 0 : description.hashCode());
269
		result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode());
270
		result = prime * result + ((errorTimestamp == null) ? 0 : errorTimestamp.hashCode());
271
		result = prime * result + gatewayId;
272
		result = prime * result + ((gatewayPaymentId == null) ? 0 : gatewayPaymentId.hashCode());
273
		result = prime * result + ((gatewayTxnDate == null) ? 0 : gatewayTxnDate.hashCode());
274
		result = prime * result + ((gatewayTxnId == null) ? 0 : gatewayTxnId.hashCode());
275
		result = prime * result + ((gatewayTxnStatus == null) ? 0 : gatewayTxnStatus.hashCode());
276
		result = prime * result + id;
277
		result = prime * result + ((initTimestamp == null) ? 0 : initTimestamp.hashCode());
278
		result = prime * result + (isDigital ? 1231 : 1237);
279
		result = prime * result + merchantTxnId;
280
		result = prime * result + ((provisionalCaptureTimestamp == null) ? 0 : provisionalCaptureTimestamp.hashCode());
281
		result = prime * result + ((referenceCode == null) ? 0 : referenceCode.hashCode());
282
		result = prime * result + Float.floatToIntBits(refundAmount);
283
		result = prime * result + ((sessionId == null) ? 0 : sessionId.hashCode());
284
		result = prime * result + status;
285
		result = prime * result + ((successTimestamp == null) ? 0 : successTimestamp.hashCode());
286
		result = prime * result + userId;
287
		return result;
288
	}
289
 
290
	@Override
291
	public boolean equals(Object obj) {
292
		if (this == obj)
293
			return true;
294
		if (obj == null)
295
			return false;
296
		if (getClass() != obj.getClass())
297
			return false;
298
		Payment other = (Payment) obj;
299
		if (Double.doubleToLongBits(amount) != Double.doubleToLongBits(other.amount))
300
			return false;
301
		if (authCode == null) {
302
			if (other.authCode != null)
303
				return false;
304
		} else if (!authCode.equals(other.authCode))
305
			return false;
306
		if (description == null) {
307
			if (other.description != null)
308
				return false;
309
		} else if (!description.equals(other.description))
310
			return false;
311
		if (errorCode == null) {
312
			if (other.errorCode != null)
313
				return false;
314
		} else if (!errorCode.equals(other.errorCode))
315
			return false;
316
		if (errorTimestamp == null) {
317
			if (other.errorTimestamp != null)
318
				return false;
319
		} else if (!errorTimestamp.equals(other.errorTimestamp))
320
			return false;
321
		if (gatewayId != other.gatewayId)
322
			return false;
323
		if (gatewayPaymentId == null) {
324
			if (other.gatewayPaymentId != null)
325
				return false;
326
		} else if (!gatewayPaymentId.equals(other.gatewayPaymentId))
327
			return false;
328
		if (gatewayTxnDate == null) {
329
			if (other.gatewayTxnDate != null)
330
				return false;
331
		} else if (!gatewayTxnDate.equals(other.gatewayTxnDate))
332
			return false;
333
		if (gatewayTxnId == null) {
334
			if (other.gatewayTxnId != null)
335
				return false;
336
		} else if (!gatewayTxnId.equals(other.gatewayTxnId))
337
			return false;
338
		if (gatewayTxnStatus == null) {
339
			if (other.gatewayTxnStatus != null)
340
				return false;
341
		} else if (!gatewayTxnStatus.equals(other.gatewayTxnStatus))
342
			return false;
343
		if (id != other.id)
344
			return false;
345
		if (initTimestamp == null) {
346
			if (other.initTimestamp != null)
347
				return false;
348
		} else if (!initTimestamp.equals(other.initTimestamp))
349
			return false;
350
		if (isDigital != other.isDigital)
351
			return false;
352
		if (merchantTxnId != other.merchantTxnId)
353
			return false;
354
		if (provisionalCaptureTimestamp == null) {
355
			if (other.provisionalCaptureTimestamp != null)
356
				return false;
357
		} else if (!provisionalCaptureTimestamp.equals(other.provisionalCaptureTimestamp))
358
			return false;
359
		if (referenceCode == null) {
360
			if (other.referenceCode != null)
361
				return false;
362
		} else if (!referenceCode.equals(other.referenceCode))
363
			return false;
364
		if (Float.floatToIntBits(refundAmount) != Float.floatToIntBits(other.refundAmount))
365
			return false;
366
		if (sessionId == null) {
367
			if (other.sessionId != null)
368
				return false;
369
		} else if (!sessionId.equals(other.sessionId))
370
			return false;
371
		if (status != other.status)
372
			return false;
373
		if (successTimestamp == null) {
374
			if (other.successTimestamp != null)
375
				return false;
376
		} else if (!successTimestamp.equals(other.successTimestamp))
377
			return false;
378
		if (userId != other.userId)
379
			return false;
380
		return true;
381
	}
382
 
383
 
384
 
385
}