Subversion Repositories SmartDukaan

Rev

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

Rev 5572 Rev 5613
Line 87... Line 87...
87
            long cartId = userinfo.getCartId();
87
            long cartId = userinfo.getCartId();
88
            if(deliveryLocation.equals("myLocation")) {
88
            if(deliveryLocation.equals("myLocation")) {
89
                userClient.addStoreToCart(cartId, 0);
89
                userClient.addStoreToCart(cartId, 0);
90
            }
90
            }
91
            
91
            
92
            if (deliveryLocation.equals("HotSpot")) {
-
 
93
                addressId = hotSpotAddressId ;
-
 
94
                showStorePickUpOption = true;
-
 
95
            }
92
            
96
            // Validate the cart to ensure that we are not accepting payment for
93
            // Validate the cart to ensure that we are not accepting payment for
97
            // an invalid order.
94
            // an invalid order.
98
            errorMsg = userClient.validateCart(cartId, sourceId);
95
            errorMsg = userClient.validateCart(cartId, sourceId);
99
            
96
            
100
            Cart cart = userClient.getCart(cartId);
97
            Cart cart = userClient.getCart(cartId);
Line 111... Line 108...
111
            if(addressId == -1){
108
            if(addressId == -1){
112
                addressId = cart.getAddressId();
109
                addressId = cart.getAddressId();
113
            }
110
            }
114
            address = userClient.getAddressById(addressId);
111
            address = userClient.getAddressById(addressId);
115
            
112
            
-
 
113
            if (deliveryLocation.equals("HotSpot")) {
-
 
114
                showStorePickUpOption = true;
-
 
115
                userClient.addStoreToCart(cartId, hotSpotAddressId);
-
 
116
                showCodOption = true;
-
 
117
            }else{
116
            try {
118
            	try {
117
                showCodOption = userClient.showCODOption(cartId, sourceId, address.getPin());
119
            		showCodOption = userClient.showCODOption(cartId, sourceId, address.getPin());
118
            } catch(Exception e) {
120
            	} catch(Exception e) {
119
                logger.error("Error while checking if COD is available for: " + showCodOption, e);
121
            		logger.error("Error while checking if COD is available for: " + showCodOption, e);
120
                showCodOption = false; //Not a critical error, proceeding with defensive behaviour.
122
            		showCodOption = false; //Not a critical error, proceeding with defensive behaviour.
-
 
123
            	}
121
            }
124
            }
122
            
125
            
123
            
126
            
124
            
-
 
125
            DataLogger.logData(EventType.PROCEED_TO_PAY, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
127
            DataLogger.logData(EventType.PROCEED_TO_PAY, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
126
                    Long.toString(cartId), itemIdString);
128
                    Long.toString(cartId), itemIdString);
127
        } catch(Exception e) {
129
        } catch(Exception e) {
128
            logger.error("Error while either validating the cart or getting the address", e);
130
            logger.error("Error while either validating the cart or getting the address", e);
129
            addActionError("We are experiencing some problem. Please try again.");
131
            addActionError("We are experiencing some problem. Please try again.");