Subversion Repositories SmartDukaan

Rev

Rev 853 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 853 Rev 890
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import java.io.IOException;
-
 
4
import java.util.HashMap;
-
 
5
import java.util.List;
3
import java.util.List;
6
import java.util.Map;
-
 
7
 
4
 
8
import org.apache.juli.logging.Log;
5
import org.apache.juli.logging.Log;
9
import org.apache.juli.logging.LogFactory;
6
import org.apache.juli.logging.LogFactory;
10
import org.apache.struts2.convention.annotation.InterceptorRef;
7
import org.apache.struts2.convention.annotation.InterceptorRef;
11
import org.apache.struts2.convention.annotation.InterceptorRefs;
8
import org.apache.struts2.convention.annotation.InterceptorRefs;
12
import org.apache.struts2.convention.annotation.Result;
-
 
13
import org.apache.struts2.convention.annotation.Results;
-
 
14
import org.apache.thrift.TException;
9
import org.apache.thrift.TException;
15
 
10
 
16
import in.shop2020.model.v1.order.LineItem;
-
 
17
import in.shop2020.model.v1.order.Order;
11
import in.shop2020.model.v1.order.Order;
18
import in.shop2020.model.v1.order.TransactionServiceException;
12
import in.shop2020.model.v1.order.TransactionServiceException;
19
import in.shop2020.model.v1.order.TransactionStatus;
-
 
20
import in.shop2020.model.v1.user.ShoppingCartException;
13
import in.shop2020.model.v1.user.ShoppingCartException;
21
import in.shop2020.payments.PaymentException;
14
import in.shop2020.payments.PaymentException;
22
import in.shop2020.payments.PaymentStatus;
-
 
23
import in.shop2020.serving.utils.Utils;
-
 
24
import in.shop2020.thrift.clients.PaymentServiceClient;
15
import in.shop2020.thrift.clients.PaymentServiceClient;
25
import in.shop2020.thrift.clients.TransactionServiceClient;
16
import in.shop2020.thrift.clients.TransactionServiceClient;
26
import in.shop2020.thrift.clients.UserContextServiceClient;
17
import in.shop2020.thrift.clients.UserContextServiceClient;
27
import in.shop2020.utils.Logger;
18
import in.shop2020.utils.Logger;
28
 
19
 
Line 61... Line 52...
61
		
52
		
62
		long txnId;
53
		long txnId;
63
		try {
54
		try {
64
			txnId = pclient.getClient().getPayment(merchantPaymentId).getMerchantTxnId();
55
			txnId = pclient.getClient().getPayment(merchantPaymentId).getMerchantTxnId();
65
				
56
				
66
		orders = tsc.getClient().getOrdersForTransaction(txnId);
57
			orders = tsc.getClient().getOrdersForTransaction(txnId);
67
		
58
			
68
		int totalItems = usc.getClient().getCart(userinfo.getCartId()).getLinesSize();
59
			int totalItems = usc.getClient().getCart(userinfo.getCartId()).getLinesSize();
69
		userinfo.setTotalItems(totalItems);
60
			userinfo.setTotalItems(totalItems);
70
		} catch (PaymentException e) {
61
		} catch (PaymentException e) {
71
			log.error("Payment service not responding. Payment id is" + merchantPaymentId);
62
			log.error("Payment service not responding. Payment id is" + merchantPaymentId);
72
			e.printStackTrace();
63
			e.printStackTrace();
73
		} catch (TException e) {
64
		} catch (TException e) {
74
			log.error("Thrift service exception. Payment id is" + merchantPaymentId);
65
			log.error("Thrift service exception. Payment id is" + merchantPaymentId);