Subversion Repositories SmartDukaan

Rev

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

Rev 7343 Rev 7386
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
-
 
3
import in.shop2020.model.v1.order.HotspotStore;
3
import in.shop2020.model.v1.order.Order;
4
import in.shop2020.model.v1.order.Order;
4
import in.shop2020.model.v1.order.TransactionServiceException;
5
import in.shop2020.model.v1.order.TransactionServiceException;
5
import in.shop2020.payments.PaymentException;
6
import in.shop2020.payments.PaymentException;
6
import in.shop2020.serving.utils.FormattingUtils;
7
import in.shop2020.serving.utils.FormattingUtils;
7
import in.shop2020.thrift.clients.PaymentClient;
8
import in.shop2020.thrift.clients.PaymentClient;
Line 27... Line 28...
27
    private FormattingUtils formattingUtils = new FormattingUtils();
28
    private FormattingUtils formattingUtils = new FormattingUtils();
28
    
29
    
29
    
30
    
30
public String index() {
31
public String index() {
31
        
32
        
-
 
33
        String loginStatus = (String) request.getSession().getAttribute("LOGGED_IN");
-
 
34
        if(loginStatus == null || !loginStatus.equals("TRUE")){
-
 
35
            return "authfail";
-
 
36
        }
-
 
37
        
-
 
38
        storeId = Long.parseLong((String) request.getSession().getAttribute("STORE_ID"));
-
 
39
        if(!hotspotStores.containsKey(storeId)){
-
 
40
            try{
-
 
41
                HotspotStore hotSpotStore = (new TransactionClient()).getClient().getHotspotStore(storeId, "");
-
 
42
                hotspotStores.put(storeId, hotSpotStore);
-
 
43
            } catch (Exception e) {
-
 
44
                log.error("Unable to get store", e);
-
 
45
            }
-
 
46
        }
-
 
47
    
32
        PaymentClient paymentServiceClient = null;
48
        PaymentClient paymentServiceClient = null;
33
        TransactionClient transactionServiceClient = null;
49
        TransactionClient transactionServiceClient = null;
34
        
50
        
35
        try {
51
        try {
36
            paymentServiceClient = new PaymentClient();
52
            paymentServiceClient = new PaymentClient();
Line 65... Line 81...
65
        return userId;
81
        return userId;
66
    }
82
    }
67
    public void setUserId(long userId) {
83
    public void setUserId(long userId) {
68
        this.userId = userId;
84
        this.userId = userId;
69
    }
85
    }
70
 
-
 
71
 
86
    
72
    public void setOrders(List<Order> orders) {
87
    public void setOrders(List<Order> orders) {
73
        this.orders = orders;
88
        this.orders = orders;
74
    }
89
    }
75
 
90
 
76
 
91