Subversion Repositories SmartDukaan

Rev

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

Rev 6060 Rev 6335
Line 105... Line 105...
105
    	        addActionError("Invalid captcha");
105
    	        addActionError("Invalid captcha");
106
    	        log.info("Invalid captcha error msg has been added");
106
    	        log.info("Invalid captcha error msg has been added");
107
    	        return "proceed-to-pay-redirect";    
107
    	        return "proceed-to-pay-redirect";    
108
    	    }
108
    	    }
109
    	    
109
    	    
-
 
110
    	    if(deliveryLocation.equals("myLocation")){
110
    	    //Check that this address is eligible for COD shipping.
111
	    	    //Check that this address is eligible for COD shipping.
111
    	    UserClient userServiceClient = null;
112
	    	    UserClient userServiceClient = null;
112
            try {
113
	            try {
113
                userServiceClient = new UserClient();
114
	                userServiceClient = new UserClient();
114
                in.shop2020.model.v1.user.UserContextService.Client userClient = userServiceClient.getClient();
115
	                in.shop2020.model.v1.user.UserContextService.Client userClient = userServiceClient.getClient();
115
                Address address = userClient.getAddressById(addressId);
116
	                Address address = userClient.getAddressById(addressId);
116
                
117
	                
117
                if(!userClient.showCODOption(currentCartId, sourceId, address.getPin())){
118
	                if(!userClient.showCODOption(currentCartId, sourceId, address.getPin())){
118
                    addActionError("Cash on Delivery is currently not available for this pincode. Please choose a different payment option.");
119
	                    addActionError("Cash on Delivery is currently not available for this pincode. Please choose a different payment option.");
119
                    return "proceed-to-pay-redirect";    
120
	                    return "proceed-to-pay-redirect";    
120
                }
121
	                }
121
            } catch (Exception e) {
122
	            } catch (Exception e) {
122
                log.error("Unable to talk to the user context service.", e);
123
	                log.error("Unable to talk to the user context service.", e);
123
                addActionError("We are experiencing some problems. Please try later.");
124
	                addActionError("We are experiencing some problems. Please try later.");
124
                return "proceed-to-pay-redirect";
125
	                return "proceed-to-pay-redirect";
125
            }
126
	            }
-
 
127
    	    }
126
    	}
128
    	}
127
    	
129
    	
128
    	try {
130
    	try {
129
    		if(!createOrders(addressId, currentCartId, currentUserId)) {
131
    		if(!createOrders(addressId, currentCartId, currentUserId)) {
130
    			addActionError("We are experiencing some problems. Please try later.");
132
    			addActionError("We are experiencing some problems. Please try later.");