Subversion Repositories SmartDukaan

Rev

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

Rev 6495 Rev 6504
Line 69... Line 69...
69
    private String couponMessage = "";
69
    private String couponMessage = "";
70
    private String hiddenUserId = "";
70
    private String hiddenUserId = "";
71
    private long couponAmount = 0;
71
    private long couponAmount = 0;
72
    private static final String chars = "abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
72
    private static final String chars = "abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
73
    private static final BigInteger key = new BigInteger("0333910847013829827302347601486730417451");
73
    private static final BigInteger key = new BigInteger("0333910847013829827302347601486730417451");
-
 
74
    private static final String COUPON_APPLIED_SUCCESSFULLY = "Coupon Applied";
74
    
75
    
75
    private static final Random random = new Random();
76
    private static final Random random = new Random();
76
    private static final int LENGTH = 10;
77
    private static final int LENGTH = 10;
77
    private static Logger log = Logger.getLogger(Class.class);
78
    private static Logger log = Logger.getLogger(Class.class);
78
    
79
    
Line 295... Line 296...
295
            
296
            
296
            PromotionClient pc = new PromotionClient();
297
            PromotionClient pc = new PromotionClient();
297
            Map<Long, String> couponResult = null;
298
            Map<Long, String> couponResult = null;
298
            couponResult = pc.getClient().applyRechargeCoupon(couponCode, Long.parseLong(totalAmount), Long.parseLong(userId));
299
            couponResult = pc.getClient().applyRechargeCoupon(couponCode, Long.parseLong(totalAmount), Long.parseLong(userId));
299
            if(couponResult != null) {
300
            if(couponResult != null) {
300
                if (!couponResult.containsValue(couponCode)) {
301
                if (!couponResult.containsValue(COUPON_APPLIED_SUCCESSFULLY)) {
301
                    couponCode = "";
302
                    couponCode = "";
302
                    couponAmount = 0;
303
                    couponAmount = 0;
303
                }
304
                } else {
304
                
-
 
305
                for (long couponAmount : couponResult.keySet()) {
305
                    for (long couponAmount : couponResult.keySet()) {
306
                    setCouponMessage(couponResult.get(couponAmount));
306
                        this.couponAmount = couponAmount;
307
                    this.couponAmount = couponAmount;
307
                    }
308
                }
308
                }
309
            } else {
309
            } else {
310
                couponCode = "";
310
                couponCode = "";
311
                couponAmount = 0;
311
                couponAmount = 0;
312
            }
312
            }