Subversion Repositories SmartDukaan

Rev

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

Rev 6103 Rev 6108
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.datalogger.DataLogger;
3
import in.shop2020.utils.DataLogger;
4
import in.shop2020.datalogger.EventType;
4
import in.shop2020.datalogger.EventType;
5
import in.shop2020.model.v1.order.OrderType;
5
import in.shop2020.model.v1.order.OrderType;
6
import in.shop2020.model.v1.order.RechargeCoupon;
6
import in.shop2020.model.v1.order.RechargeCoupon;
7
import in.shop2020.model.v1.order.RechargeOrder;
7
import in.shop2020.model.v1.order.RechargeOrder;
8
import in.shop2020.model.v1.order.RechargeOrderStatus;
8
import in.shop2020.model.v1.order.RechargeOrderStatus;
Line 69... Line 69...
69
        return "index";
69
        return "index";
70
    }
70
    }
71
    
71
    
72
    public String create() {
72
    public String create() {
73
    	if(getProvider().equals("-1")){
73
    	if(getProvider().equals("-1")){
-
 
74
    		DataLogger.logData(EventType.PROVIDER_FETCH_FAILURE, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
-
 
75
    				rechargeType.toString(), number, operator);
74
    		return "recharge-redirect";
76
    		return "recharge-redirect";
75
    	}
77
    	}
76
        setTotalAmount(amount);
78
        setTotalAmount(amount);
77
        if(userinfo.isLoggedIn()) {
79
        if(userinfo.isLoggedIn()) {
78
            try {
80
            try {
Line 178... Line 180...
178
            user.setCommunicationEmail(email);
180
            user.setCommunicationEmail(email);
179
            UserClient userContextServiceClient = new UserClient();
181
            UserClient userContextServiceClient = new UserClient();
180
            in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
182
            in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
181
            user = userClient.createUser(user);
183
            user = userClient.createUser(user);
182
            }
184
            }
183
            //DataLogger.logData(EventType.REGISTER_SUCCESS, getSessionId(), user.getUserId(), email, "", email);
-
 
184
        }catch (UserContextException ux){
185
        }catch (UserContextException ux){
185
            //DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS, getSessionId(), userinfo.getUserId(), email, "", email);
-
 
186
            return -1;               
186
            return -1;               
187
        } catch (TTransportException e) {
187
        } catch (TTransportException e) {
188
            //DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS, getSessionId(), userinfo.getUserId(), email, "", email);
-
 
189
            return -1;
188
            return -1;
190
        } catch (TException e) {
189
        } catch (TException e) {
191
            //DataLogger.logData(EventType.REGISTER_FAILED_USER_EXISTS, getSessionId(), userinfo.getUserId(), email, "", email);
-
 
192
            return -1;
190
            return -1;
193
        }
191
        }
194
        /*
-
 
195
        List<String> toList = new ArrayList<String>();
-
 
196
        toList.add(email);
-
 
197
        HelperClient helperServiceClient = null;
-
 
198
        try {
-
 
199
            helperServiceClient = new HelperClient();
-
 
200
            in.shop2020.utils.HelperService.Client client = helperServiceClient.getClient();
-
 
201
            Mail mail = new Mail();
-
 
202
            mail.setSubject("Registration successful");
-
 
203
            mail.setTo(toList);
-
 
204
            mail.setData("Your have successfully registered with Saholic.com. Your user name is: " + email + " and your password is: " +  password);
-
 
205
            client.sendMail(mail);
-
 
206
        } catch (Exception e) {
-
 
207
            log.error("Unexpected error while mailing the new password");
-
 
208
            return -1;
-
 
209
        }*/
-
 
210
        return user.getUserId();
192
        return user.getUserId();
211
    }
193
    }
212
    
194
    
213
    public String temp() {
195
    public String temp() {
214
        try {
196
        try {