Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1946 chandransh 1
package in.shop2020.payment.domain;
2
 
3
import in.shop2020.payments.Attribute;
4
import in.shop2020.payments.PaymentGatewayStatus;
5
 
6
import java.io.Serializable;
7
import java.util.Date;
8
import java.util.List;
9
 
10
public class PaymentGateway implements Serializable {
11
 
12
	private static final long serialVersionUID = 3896389657892694359L;
13
 
14
    private long id;
15
	private String name;
16
    private String aliasName;    
17
    private String url;
18
    private String responseUrl;
19
    private String errorUrl;
20
    private int status;
21
    private Date addedOn;
22
    private List<GatewayAttribute> attributes;
23
 
24
    public in.shop2020.payments.PaymentGateway getThriftPaymentGateway(){
25
    	in.shop2020.payments.PaymentGateway tPaymentGateway = new in.shop2020.payments.PaymentGateway();
26
    	tPaymentGateway.setId(this.id);
27
    	tPaymentGateway.setName(this.name);
28
    	tPaymentGateway.setAliasName(this.aliasName);
29
    	tPaymentGateway.setUrl(this.url);
30
    	tPaymentGateway.setResponseUrl(this.responseUrl);
31
    	tPaymentGateway.setErrorUrl(this.errorUrl);
32
    	tPaymentGateway.setStatus(PaymentGatewayStatus.findByValue(this.status));
33
    	if(this.addedOn != null){
34
    		tPaymentGateway.setAddedOn(this.addedOn.getTime());
35
    	}
36
 
37
    	if(!(attributes == null || attributes.isEmpty())){
38
    		for(GatewayAttribute attr : attributes)
39
    			tPaymentGateway.addToAttributes(new Attribute(attr.getName(), attr.getValue()));
40
    	}
41
    	return tPaymentGateway;
42
    }
43
 
44
    public long getId() {
45
		return id;
46
	}
47
	public void setId(long id) {
48
		this.id = id;
49
	}
50
	public String getName() {
51
		return name;
52
	}
53
	public void setName(String name) {
54
		this.name = name;
55
	}
56
	public String getAliasName() {
57
		return aliasName;
58
	}
59
	public void setAliasName(String aliasName) {
60
		this.aliasName = aliasName;
61
	}
62
	public String getUrl() {
63
		return url;
64
	}
65
	public void setUrl(String url) {
66
		this.url = url;
67
	}
68
	public String getResponseUrl() {
69
		return responseUrl;
70
	}
71
	public void setResponseUrl(String responseUrl) {
72
		this.responseUrl = responseUrl;
73
	}
74
	public String getErrorUrl() {
75
		return errorUrl;
76
	}
77
	public void setErrorUrl(String errorUrl) {
78
		this.errorUrl = errorUrl;
79
	}
80
	public int getStatus() {
81
		return status;
82
	}
83
	public void setStatus(int status) {
84
		this.status = status;
85
	}
86
	public Date getAddedOn() {
87
		return addedOn;
88
	}
89
	public void setAddedOn(Date addedOn) {
90
		this.addedOn = addedOn;
91
	}
92
	public List<GatewayAttribute> getAttributes() {
93
		return attributes;
94
	}
95
	public void setAttributes(List<GatewayAttribute> attributes) {
96
		this.attributes = attributes;
97
	}
98
}