Subversion Repositories SmartDukaan

Rev

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

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