Subversion Repositories SmartDukaan

Rev

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

Rev 3617 Rev 3859
Line 9... Line 9...
9
import in.shop2020.serving.services.CommonPaymentService;
9
import in.shop2020.serving.services.CommonPaymentService;
10
import in.shop2020.serving.services.EbsPaymentService;
10
import in.shop2020.serving.services.EbsPaymentService;
11
import in.shop2020.serving.services.HdfcEmiPaymentService;
11
import in.shop2020.serving.services.HdfcEmiPaymentService;
12
import in.shop2020.serving.services.HdfcPaymentService;
12
import in.shop2020.serving.services.HdfcPaymentService;
13
import in.shop2020.serving.services.IPaymentService;
13
import in.shop2020.serving.services.IPaymentService;
14
import in.shop2020.serving.utils.DesEncrypter;
-
 
15
import in.shop2020.serving.utils.Utils;
14
import in.shop2020.serving.utils.Utils;
16
import in.shop2020.thrift.clients.LogisticsClient;
15
import in.shop2020.thrift.clients.LogisticsClient;
17
import in.shop2020.thrift.clients.TransactionClient;
16
import in.shop2020.thrift.clients.TransactionClient;
18
import in.shop2020.thrift.clients.UserClient;
17
import in.shop2020.thrift.clients.UserClient;
19
import in.shop2020.utils.DataLogger;
18
import in.shop2020.utils.DataLogger;
20
 
19
 
21
import java.util.ArrayList;
20
import java.util.ArrayList;
22
import java.util.List;
21
import java.util.List;
23
import java.util.ResourceBundle;
22
import java.util.ResourceBundle;
24
 
23
 
25
import javax.servlet.http.Cookie;
-
 
26
 
-
 
27
import net.tanesha.recaptcha.ReCaptchaImpl;
24
import net.tanesha.recaptcha.ReCaptchaImpl;
28
import net.tanesha.recaptcha.ReCaptchaResponse;
25
import net.tanesha.recaptcha.ReCaptchaResponse;
29
 
26
 
30
import org.apache.log4j.Logger;
27
import org.apache.log4j.Logger;
31
import org.apache.struts2.convention.annotation.InterceptorRef;
28
import org.apache.struts2.convention.annotation.InterceptorRef;
Line 276... Line 273...
276
			return false;
273
			return false;
277
		}
274
		}
278
		
275
		
279
		
276
		
280
		try {
277
		try {
281
		    String sessionSrc = null;
-
 
282
		    Cookie sessionSrcCookie = (Cookie) cookiesMap.get(TrackingInterceptor.SESSION_SRC_COOKIE);
278
		    String sessionSrc = getCookie(TrackingInterceptor.SESSION_SRC_COOKIE, true, TrackingInterceptor.ENCRIPTION_STRING);
283
            if (sessionSrcCookie != null) {
-
 
284
                DesEncrypter desEncrypter = new DesEncrypter(TrackingInterceptor.ENCRIPTION_STRING);
279
		    String firstSrc = getCookie(TrackingInterceptor.SRC_COOKIE, true, TrackingInterceptor.ENCRIPTION_STRING);
285
                sessionSrc = desEncrypter.decrypt(sessionSrcCookie.getValue());
-
 
286
            }
-
 
287
            
280
            
-
 
281
		    long sessionTime = 0;
-
 
282
            try {
288
            Cookie sessionSrcTimeCookie = (Cookie) cookiesMap.get(TrackingInterceptor.SESSION_SRC_TIME_COOKIE);
283
                sessionTime = Long.parseLong(getCookie(TrackingInterceptor.SESSION_SRC_TIME_COOKIE, false, null));
289
            long sessionTime = 0;
284
            } catch (Exception e) {
-
 
285
                log.warn("Unable to parse session src time cookie.", e);
-
 
286
            }
290
            if (sessionSrcTimeCookie != null) {
287
            long firstSrcTime = 0;
291
                try {
288
            try {
292
                    sessionTime = Long.parseLong(sessionSrcTimeCookie.getValue());
289
                firstSrcTime = Long.parseLong(getCookie(TrackingInterceptor.SRC_TIME_COOKIE, false, null));
293
                } catch (Exception e) {
290
            } catch (Exception e) {
294
                    log.warn("Unable to parse session src time cookie.", e);
291
                log.warn("Unable to parse session src time cookie.", e);
295
                }
-
 
296
            }
292
            }
297
		    txnId = userClient.createOrders(currentCartId, sessionSrc, sessionTime);
293
            txnId = userClient.createOrders(currentCartId, sessionSrc, sessionTime, firstSrc, firstSrcTime);
298
		} catch (ShoppingCartException e1) {
294
		} catch (ShoppingCartException e1) {
299
			log.error("Error while creating orders from cart.", e1);
295
			log.error("Error while creating orders from cart.", e1);
300
			return false;
296
			return false;
301
		} catch (TException e) {
297
		} catch (TException e) {
302
			log.error("Thrift exception while creating orders from cart.", e);
298
			log.error("Thrift exception while creating orders from cart.", e);