Subversion Repositories SmartDukaan

Rev

Rev 28653 | Details | Compare with Previous | Last modification | View Log | RSS feed

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