Subversion Repositories SmartDukaan

Rev

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

Rev 6442 Rev 6736
Line 106... Line 106...
106
            if(deliveryLocation.equals("myLocation")) {
106
            if(deliveryLocation.equals("myLocation")) {
107
                userClient.addStoreToCart(cartId, 0);
107
                userClient.addStoreToCart(cartId, 0);
108
            }
108
            }
109
            // Validate the cart to ensure that we are not accepting payment for
109
            // Validate the cart to ensure that we are not accepting payment for
110
            // an invalid order.
110
            // an invalid order.
111
            errorMsg = userClient.validateCart(cartId, sourceId);
111
            errorMsg = userClient.validateCart(cartId, sourceId).get(0);
112
            
112
            
113
            Cart cart = userClient.getCart(cartId);
113
            Cart cart = userClient.getCart(cartId);
114
            String couponCode = cart.getCouponCode();
114
            String couponCode = cart.getCouponCode();
115
            logger.info("Coupon: " + couponCode);
115
            logger.info("Coupon: " + couponCode);
116
            
116
            
Line 255... Line 255...
255
    	}
255
    	}
256
    	Gson gson  = new Gson();
256
    	Gson gson  = new Gson();
257
    	return gson.toJson(schemes);
257
    	return gson.toJson(schemes);
258
    }
258
    }
259
    
259
    
-
 
260
    public String getJSONEmiDiscountSchemes(){
-
 
261
    	try {
-
 
262
    	PromotionService.Client pc = new PromotionClient().getClient();
-
 
263
    	Gson gson  = new Gson();
-
 
264
    	return gson.toJson(pc.getEmiDiscount(userinfo.getCartId()));
-
 
265
    	}catch (Exception e){
-
 
266
    		logger.warn("Could not retrive emi based promotions for cart: " + userinfo.getCartId() + ".\n" + e);
-
 
267
    		return "{}";
-
 
268
    	}
-
 
269
    }
-
 
270
    
260
    public List<EmiScheme> getEmiSchemes(){
271
    public List<EmiScheme> getEmiSchemes(){
261
    	/*List<EmiScheme> schemes = new ArrayList<EmiScheme>();
272
    	/*List<EmiScheme> schemes = new ArrayList<EmiScheme>();
262
    	schemes.add(new EmiScheme(1,1,1,3,"HDFC Bank", 2000, "3 Months", EmiChargeType.FIXED, 500));
273
    	schemes.add(new EmiScheme(1,1,1,3,"HDFC Bank", 2000, "3 Months", EmiChargeType.FIXED, 500));
263
    	schemes.add(new EmiScheme(2,1,1,6,"HDFC Bank", 4000, "6 Months", EmiChargeType.FIXED, 1000));
274
    	schemes.add(new EmiScheme(2,1,1,6,"HDFC Bank", 4000, "6 Months", EmiChargeType.FIXED, 1000));
264
    	schemes.add(new EmiScheme(3,1,1,9,"HDFC Bank", 6000, "9 Months", EmiChargeType.FIXED, 1500));
275
    	schemes.add(new EmiScheme(3,1,1,9,"HDFC Bank", 6000, "9 Months", EmiChargeType.FIXED, 1500));