Subversion Repositories SmartDukaan

Rev

Rev 2145 | Rev 2199 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2145 Rev 2159
Line 10... Line 10...
10
 
10
 
11
import in.shop2020.config.ConfigException;
11
import in.shop2020.config.ConfigException;
12
import in.shop2020.model.v1.order.LineItem;
12
import in.shop2020.model.v1.order.LineItem;
13
import in.shop2020.model.v1.order.Order;
13
import in.shop2020.model.v1.order.Order;
14
import in.shop2020.model.v1.order.Transaction;
14
import in.shop2020.model.v1.order.Transaction;
-
 
15
import in.shop2020.payments.Attribute;
15
import in.shop2020.payments.Payment;
16
import in.shop2020.payments.Payment;
-
 
17
import in.shop2020.serving.services.IPaymentService;
16
import in.shop2020.thrift.clients.PaymentServiceClient;
18
import in.shop2020.thrift.clients.PaymentServiceClient;
17
import in.shop2020.thrift.clients.TransactionServiceClient;
19
import in.shop2020.thrift.clients.TransactionServiceClient;
18
import in.shop2020.thrift.clients.config.ConfigClient;
20
import in.shop2020.thrift.clients.config.ConfigClient;
19
 
21
 
20
@SuppressWarnings("serial")
22
@SuppressWarnings("serial")
Line 47... Line 49...
47
		}
49
		}
48
	}
50
	}
49
	
51
	
50
	private String id;
52
	private String id;
51
	
53
	
-
 
54
	private String paymentOption;
-
 
55
	
52
	private StringBuilder description;
56
	private StringBuilder description;
53
	
57
	
54
	private double amount;
58
	private double amount;
55
	
59
	
56
	private ContactDetails billingDetails;
60
	private ContactDetails billingDetails;
Line 80... Line 84...
80
			addActionError("We are experiencing some problems. Please try later.");
84
			addActionError("We are experiencing some problems. Please try later.");
81
			return "shipping-redirect";
85
			return "shipping-redirect";
82
		}
86
		}
83
		
87
		
84
		setDescription(order);
88
		setDescription(order);
-
 
89
		setPaymentOption(payment);
85
		
90
		
86
		this.amount = payment.getAmount();
91
		this.amount = payment.getAmount();
87
		this.billingDetails = new ContactDetails(order.getCustomer_name(),
92
		this.billingDetails = new ContactDetails(order.getCustomer_name(),
88
				order.getCustomer_email(), order.getCustomer_address1(),
93
				order.getCustomer_email(), order.getCustomer_address1(),
89
				order.getCustomer_city(), order.getCustomer_state(),
94
				order.getCustomer_city(), order.getCustomer_state(),
Line 141... Line 146...
141
	}
146
	}
142
	
147
	
143
	public double getAmount() {
148
	public double getAmount() {
144
		return amount;
149
		return amount;
145
	}
150
	}
-
 
151
 
-
 
152
	public void setPaymentOption(Payment payment) {
-
 
153
		for(Attribute attr : payment.getAttributes()){
-
 
154
			if(attr.getName().equals(IPaymentService.PAYMENT_METHOD))
-
 
155
				this.paymentOption = attr.getValue();
-
 
156
		}
-
 
157
	}
-
 
158
	
-
 
159
	public String getPaymentOption(){
-
 
160
		return paymentOption;
-
 
161
	}
146
	
162
	
147
	public ContactDetails getBillingDetails() {
163
	public ContactDetails getBillingDetails() {
148
		return billingDetails;
164
		return billingDetails;
149
	}
165
	}
150
 
166