Subversion Repositories SmartDukaan

Rev

Rev 6457 | Rev 6504 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6050 anupam.sin 1
package in.shop2020.serving.controllers;
2
 
6091 anupam.sin 3
import in.shop2020.datalogger.EventType;
6050 anupam.sin 4
import in.shop2020.model.v1.order.OrderType;
5
import in.shop2020.model.v1.order.RechargeCoupon;
6
import in.shop2020.model.v1.order.RechargeOrder;
7
import in.shop2020.model.v1.order.RechargeOrderStatus;
6397 anupam.sin 8
import in.shop2020.model.v1.order.RechargePlan;
6050 anupam.sin 9
import in.shop2020.model.v1.order.RechargeType;
6057 anupam.sin 10
import in.shop2020.model.v1.order.UserWallet;
6050 anupam.sin 11
import in.shop2020.model.v1.user.User;
12
import in.shop2020.model.v1.user.UserContextException;
13
import in.shop2020.serving.utils.DesEncrypter;
14
import in.shop2020.serving.utils.Utils;
15
import in.shop2020.thrift.clients.HelperClient;
6433 anupam.sin 16
import in.shop2020.thrift.clients.PromotionClient;
6050 anupam.sin 17
import in.shop2020.thrift.clients.TransactionClient;
18
import in.shop2020.thrift.clients.UserClient;
6228 anupam.sin 19
import in.shop2020.utils.DataLogger;
6091 anupam.sin 20
import in.shop2020.utils.Mail;
6050 anupam.sin 21
 
6495 anupam.sin 22
import java.math.BigInteger;
6050 anupam.sin 23
import java.util.ArrayList;
6433 anupam.sin 24
import java.util.HashMap;
6050 anupam.sin 25
import java.util.List;
6433 anupam.sin 26
import java.util.Map;
6091 anupam.sin 27
import java.util.Random;
6050 anupam.sin 28
 
6495 anupam.sin 29
import javax.mail.internet.AddressException;
30
import javax.mail.internet.InternetAddress;
31
 
6249 anupam.sin 32
import nl.captcha.Captcha;
33
 
6050 anupam.sin 34
import org.apache.log4j.Logger;
35
import org.apache.struts2.convention.annotation.Result;
36
import org.apache.struts2.convention.annotation.Results;
37
import org.apache.thrift.TException;
38
import org.apache.thrift.transport.TTransportException;
39
 
40
@Results({
6228 anupam.sin 41
    @Result(name="recharge-pay-options-redirect", type="redirectAction", params = {"actionName" , "recharge-pay-options", "rechargeOrderId", "${rechargeOrderId}"}),
6103 amit.gupta 42
    @Result(name="create-recharge-redirect", type="redirectAction", params = {"actionName" , "wallet-only-payment", "rechargeOrderId", "${rechargeOrderId}"}),
6270 rajveer 43
    @Result(name="recharge-redirect", type="redirectAction", params = {"actionName" , "recharge", "error", "${errorMessage}"})
6050 anupam.sin 44
})
45
 
46
public class ConfirmController extends BaseController{
47
 
48
    /**
49
     * 
50
     */
51
    private static final long serialVersionUID = 1L;
6057 anupam.sin 52
    private long rechargeOrderId = 0;
6050 anupam.sin 53
    private String amount = "";
6086 anupam.sin 54
    private String walletAmountUsed = "0";
6050 anupam.sin 55
    private String operator = "";
56
    private String number = "";
57
    private String email = "";
58
    private String rechargeType = "";
59
    private DesEncrypter desEncrypter = new DesEncrypter("saholic");
60
    private List<String> couponIds = null;
61
    private List<RechargeCoupon> coupons = null;
6058 anupam.sin 62
    private String userId;
6057 anupam.sin 63
    private String message = "";
6249 anupam.sin 64
    private String errorMessage = "";
6070 anupam.sin 65
    private String totalAmount = "";
6178 anupam.sin 66
    private String plan = "";
6307 anupam.sin 67
    private String circleCode;
6433 anupam.sin 68
    private String couponCode = "";
69
    private String couponMessage = "";
6495 anupam.sin 70
    private String hiddenUserId = "";
6433 anupam.sin 71
    private long couponAmount = 0;
6091 anupam.sin 72
    private static final String chars = "abcdefghijklmonpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
6495 anupam.sin 73
    private static final BigInteger key = new BigInteger("0333910847013829827302347601486730417451");
74
 
6091 anupam.sin 75
    private static final Random random = new Random();
76
    private static final int LENGTH = 10;
6050 anupam.sin 77
    private static Logger log = Logger.getLogger(Class.class);
78
 
79
    public String index() {
80
        return "index";
81
    }
82
 
83
    public String create() {
6270 rajveer 84
    	errorMessage = validateRecharge();
85
    	if(!errorMessage.equals("SUCCESS")){
6108 amar.kumar 86
    		DataLogger.logData(EventType.PROVIDER_FETCH_FAILURE, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
87
    				rechargeType.toString(), number, operator);
6103 amit.gupta 88
    		return "recharge-redirect";
89
    	}
6433 anupam.sin 90
 
6294 rajveer 91
    	setErrorMessage("");
6086 anupam.sin 92
        setTotalAmount(amount);
6433 anupam.sin 93
 
6057 anupam.sin 94
        if(userinfo.isLoggedIn()) {
6124 anupam.sin 95
            setUserId("" + userinfo.getUserId());
6433 anupam.sin 96
            calculateAmounts();
6124 anupam.sin 97
        } else {
98
            long tempUserId = createUserAndSendMail(email);
99
            if(tempUserId == -1)
100
            {
6270 rajveer 101
            	errorMessage = "Oops! There seems to be a problem. Please try after some time";
6124 anupam.sin 102
                return "recharge-redirect";
103
            } else {
104
                setUserId("" + tempUserId);
105
            }
6057 anupam.sin 106
        }
6495 anupam.sin 107
 
108
        setHash(encrypt(getUserId()));
6050 anupam.sin 109
        return index();
110
    }
6433 anupam.sin 111
 
112
    private void calculateAmounts() {
113
 
114
        try {
115
            TransactionClient tc = new TransactionClient();
116
            UserWallet wallet = tc.getClient().getUserWallet(userinfo.getUserId());
117
            long amountA = 0;
118
            if(wallet.getAmount() == 0){
119
                setAmount("" + (Long.parseLong(totalAmount) - couponAmount));
120
                setMessage("");
121
            } else if ((amountA = wallet.getAmount() - (Long.parseLong(totalAmount) - couponAmount)) >= 0) {
122
                setAmount("0");
123
                setWalletAmountUsed("" + (wallet.getAmount() - amountA));
124
                setMessage("Amount used from RechargeWallet : Rs. " + walletAmountUsed
125
                        + "<br>Amount left in your RechargeWallet : Rs. " + amountA);
126
 
127
            } else {
128
                setAmount("" + (0-amountA));
129
                setWalletAmountUsed("" + wallet.getAmount());
130
                setMessage("Amount used from RechargeWallet : Rs. " + walletAmountUsed
131
                        + "<br>Amount left in your RechargeWallet : Rs.0");
132
            }
133
        } catch (Exception e) {
134
            log.error("Unable to get user wallet", e);
135
        }
136
    }
6050 anupam.sin 137
 
6270 rajveer 138
    public String validateRecharge(){
6103 amit.gupta 139
    	TransactionClient tcl;
140
    	try {
141
    		tcl = new TransactionClient();
6336 anupam.sin 142
    		return tcl.getClient().validateRecharge(RechargeType.findByValue(Integer.parseInt(this.rechargeType)), number, Long.parseLong(operator));
6103 amit.gupta 143
    	} catch (Exception e) {
144
    		log.error("Unable to get service provider for Device number " + number + " and rechargeType : " +  rechargeType, e);
145
    	}
6270 rajveer 146
    	return "Oops! There seems to be a problem. Please try after some time";
6103 amit.gupta 147
 
148
    }
6495 anupam.sin 149
 
150
    private String validateFields() {
151
        if(amount == null || amount == "") {
152
            log.warn("Amount received is empty or null");
153
            return "Amount cannot be empty";
154
        }
155
 
156
        if(rechargeType == null || rechargeType == "") {
157
            log.warn("rechargeType received is empty or null");
158
            return "Oops! There seems to be a problem. Please try after some time";
159
        }
160
 
161
        if(email == null || email == "") {
162
            log.warn("Email received is empty or null");
163
            return "Email address cannot be empty";
164
        }
165
 
166
        try {
167
            InternetAddress emailAdd = new InternetAddress(email);
168
            emailAdd.validate();
169
        } catch (AddressException e1) {
170
            log.warn("Invalid email address : " + email, e1);
171
            return "ERROR : Invalid email address.";
172
        }
173
 
174
        if (RechargeType.findByValue(Integer.parseInt(this.rechargeType)) == RechargeType.DTH) {
175
            if (Long.parseLong(totalAmount) < 200 || Long.parseLong(totalAmount) > 9999) {
176
                return "DTH recharge amount should be between Rs.200 and Rs.9999";
177
            }
178
 
179
        } else if (RechargeType.findByValue(Integer.parseInt(this.rechargeType)) == RechargeType.MOBILE) {
180
            if (Long.parseLong(totalAmount) < 10 || Long.parseLong(totalAmount) > 1000) {
181
                return "Recharge amount should be between Rs.10 and Rs.1000";
182
            }
183
            if (number.length() != 10) {
184
                return "Number should be of 10 digits";
185
            }
186
 
187
        } else {
188
            log.warn("Invalid rechargeType : " + rechargeType);
189
            return "Oops! There seems to be a problem. Please try after some time";
190
        }
191
 
192
        if (operator == null || operator == "") {
193
            log.warn("Invalid operator : " + operator);
194
            return "Oops! There seems to be a problem. Please try after some time";
195
        }
196
        return "SUCCESS";
197
    }
6103 amit.gupta 198
 
6307 anupam.sin 199
    public boolean shouldPromptForWallet(){
200
        if(!isLoggedIn()) {
201
            try {
202
                TransactionClient tc = new TransactionClient();
203
                UserWallet wallet = tc.getClient().getUserWallet(Long.parseLong(userId));
204
                if(wallet.getAmount() != 0) {
205
                    return true;
206
                }
207
            } catch (Exception e) {
208
                log.error("Unable to get wallet for userId : " + userId, e);
209
            }
210
        }
211
        return false;
212
    }
213
 
6433 anupam.sin 214
    public String applyRechargeCoupon() {
215
        Map<Long, String> couponResult = null;
216
        try {
217
            PromotionClient pc = new PromotionClient();
218
            couponResult = pc.getClient().applyRechargeCoupon(couponCode, Long.parseLong(totalAmount), Long.parseLong(userId));
219
            if (couponResult != null) {
220
                for (long couponAmount : couponResult.keySet()) {
221
                    setCouponMessage(couponResult.get(couponAmount));
222
                    this.couponAmount = couponAmount;
223
                }
224
            }
6443 anupam.sin 225
 
226
            if(couponAmount == 0) {
6495 anupam.sin 227
                couponCode = "";
6443 anupam.sin 228
            }
229
 
6433 anupam.sin 230
            if(userinfo.isLoggedIn()) {
231
                calculateAmounts();
232
            } else {
233
                setAmount("" + (Long.parseLong(amount) - couponAmount));
234
            }
235
            return index();
236
        } catch (Exception e) {
237
            log.error("Unable to apply recharge coupon : " + couponCode, e);
238
            setCouponMessage("Currently this coupon is unavailable");
239
        }
240
        return index();
241
    }
242
 
6050 anupam.sin 243
    public String createRecharge(){
6249 anupam.sin 244
        if (amount.equals("0")) {
245
            if (!verifyCaptcha()) {
246
                setErrorMessage("Invalid captcha. Try Again.");
247
                log.info("Invalid captcha error msg has been added");
248
                return index();
249
            }
250
        }
6495 anupam.sin 251
 
252
        String decryptedUserId = decrypt(hiddenUserId);
253
        if(!userId.equals(decryptedUserId)) {
254
            log.warn("userId and hash do not match");
255
            errorMessage = "Oops! There seems to be a problem. Please try after some time";
256
            return "recharge-redirect";
257
        }
258
 
259
        errorMessage = validateFields();
260
        if (!errorMessage.equals("SUCCESS")) {
261
            return "recharge-redirect";
262
        }
263
 
6050 anupam.sin 264
        try {
6058 anupam.sin 265
            TransactionClient tc = new TransactionClient();
6397 anupam.sin 266
            List<RechargePlan> plans = tc.getClient().getPlansForOperator(Long.parseLong(operator));
267
            List<String> planNameList = new ArrayList<String>();
268
            if (plans == null || plans.isEmpty()) {
269
                setPlan("");
270
            } else {
271
                for (RechargePlan tempPlan : plans) {
272
                    planNameList.add(tempPlan.getName());
273
                }
274
                if (!planNameList.contains(plan)) {
275
                    errorMessage = "Oops! There seems to be a problem. Please try after some time";
276
                    log.warn("OperatorId : " + operator + " and plan : " + plan + " do not match");
277
                    return "recharge-redirect";
278
                }
279
            }
280
 
6433 anupam.sin 281
            if(userinfo.isLoggedIn()) {
282
                UserWallet wallet = tc.getClient().getUserWallet(userinfo.getUserId());
283
                if(wallet.getAmount() < Long.parseLong(walletAmountUsed)) {
284
                    errorMessage = "Oops! There seems to be a problem. Please try after some time";
285
                    log.warn("WalletAmount used : " + walletAmountUsed + " is greater than wallet Balance  : " + wallet.getAmount());
286
                    return "recharge-redirect";
287
                }
288
 
289
                if (userinfo.getUserId() != Long.parseLong(userId)) {
290
                    errorMessage = "Oops! There seems to be a problem. Please try after some time";
291
                    log.warn("Logged in user : " + userinfo.getUserId() + " does not match with userId sent by user  : " +  userId);
292
                    return "recharge-redirect";
293
                }
294
            }
295
 
296
            PromotionClient pc = new PromotionClient();
297
            Map<Long, String> couponResult = null;
298
            couponResult = pc.getClient().applyRechargeCoupon(couponCode, Long.parseLong(totalAmount), Long.parseLong(userId));
299
            if(couponResult != null) {
6495 anupam.sin 300
                if (!couponResult.containsValue(couponCode)) {
301
                    couponCode = "";
302
                    couponAmount = 0;
303
                }
304
 
6433 anupam.sin 305
                for (long couponAmount : couponResult.keySet()) {
306
                    setCouponMessage(couponResult.get(couponAmount));
307
                    this.couponAmount = couponAmount;
308
                }
6495 anupam.sin 309
            } else {
310
                couponCode = "";
311
                couponAmount = 0;
6433 anupam.sin 312
            }
313
 
314
            if (Long.parseLong(totalAmount) != Long.parseLong(amount) + Long.parseLong(walletAmountUsed) + couponAmount){
315
                errorMessage = "Oops! There seems to be a problem. Please try after some time";
316
                log.warn("WalletAmount : " + walletAmountUsed + " plus couponAmount : " + couponAmount + " plus amount to be paid : " +
317
                        amount + "do not match with rechargeAmount : " + totalAmount);
318
                return "recharge-redirect";
319
            }
320
 
321
 
6050 anupam.sin 322
            RechargeOrder rechargeOrder = new RechargeOrder();
6249 anupam.sin 323
            rechargeOrder.setTotalAmount(Long.parseLong(totalAmount));
6050 anupam.sin 324
            rechargeOrder.setUserEmailId(email);
6058 anupam.sin 325
            rechargeOrder.setUserId(Long.parseLong(userId));
6050 anupam.sin 326
            rechargeOrder.setDeviceNumber(number);
6178 anupam.sin 327
            rechargeOrder.setPlan(plan);
6050 anupam.sin 328
            rechargeOrder.setOperatorId(Long.parseLong(operator));
6057 anupam.sin 329
            rechargeOrder.setRechargeType(RechargeType.findByValue(Integer.parseInt(rechargeType)));
6050 anupam.sin 330
            rechargeOrder.setStatus(RechargeOrderStatus.PAYMENT_PENDING);
331
            rechargeOrder.setOrderType(OrderType.B2C);
6070 anupam.sin 332
            rechargeOrder.setWalletAmount(Long.parseLong(getWalletAmountUsed()));
6433 anupam.sin 333
            rechargeOrder.setCouponAmount(couponAmount);
334
            rechargeOrder.setCouponCode(couponCode);
6397 anupam.sin 335
            TransactionClient tc1 = new TransactionClient();
336
            rechargeOrder = tc1.getClient().createRechargeOrder(rechargeOrder);
6057 anupam.sin 337
            setRechargeOrderId(rechargeOrder.getId());
6050 anupam.sin 338
 
6178 anupam.sin 339
        } catch (Exception e) {
340
            log.error("Unable to create recharge order", e);
6270 rajveer 341
            errorMessage = "Oops! There seems to be a problem. Please try after some time";
6178 anupam.sin 342
            return "recharge-redirect";
6050 anupam.sin 343
        }
344
        if(amount.equals("0")) {
345
            return "create-recharge-redirect";
346
        } else {
347
            return "recharge-pay-options-redirect";
348
        }
349
    }
350
 
6249 anupam.sin 351
    private boolean verifyCaptcha() {
352
        String cookieCaptchaAnswer = getCookie(Captcha.NAME, true, "saholic");
353
        String captchaReceived = (String) request.getParameter("captcha_response_field");
354
 
355
        if (captchaReceived.equalsIgnoreCase(cookieCaptchaAnswer)) {
356
            try {
357
                DataLogger.logData(EventType.CAPTCHA_SUCCESS, getSessionId(), userinfo.getUserId(), userinfo.getEmail());
358
            } catch (Exception e1) {
359
                log.warn("Unable to log orders through the datalogger", e1);
360
            }
361
            return true;
362
        } 
363
        else {
364
            try {
365
                DataLogger.logData(EventType.CAPTCHA_FAILED, getSessionId(), userinfo.getUserId(), userinfo.getEmail());
366
            } catch (Exception e1) {
367
                log.warn("Unable to log orders through the datalogger", e1);
368
            }
369
            return false;
370
        }
371
    }
372
 
6091 anupam.sin 373
    private static String generateNewPassword() {
374
        char[] buf = new char[LENGTH];
375
        for (int i = 0; i < buf.length; i++) {
376
            buf[i] = chars.charAt(random.nextInt(chars.length()));
377
        }
378
        return new String(buf);
379
    }
380
 
381
    private long createUserAndSendMail(String email) {
382
        User user = null;
383
        String password = null;
384
        try{
385
        UserClient ucl = new UserClient();
386
        user = ucl.getClient().getUserByEmail(email);
6124 anupam.sin 387
        if(user.getUserId() == -1) {
6091 anupam.sin 388
            user.setEmail(email);
389
            password = generateNewPassword();
390
            String encryptedPassword = desEncrypter.encrypt(password);
391
            user.setPassword(encryptedPassword);
392
            user.setCommunicationEmail(email);
393
            UserClient userContextServiceClient = new UserClient();
394
            in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
395
            user = userClient.createUser(user);
6124 anupam.sin 396
 
397
            List<String> toList = new ArrayList<String>();
398
            toList.add(email);
399
            HelperClient helperServiceClient = null;
400
                helperServiceClient = new HelperClient();
401
                in.shop2020.utils.HelperService.Client client = helperServiceClient.getClient();
402
                Mail mail = new Mail();
6131 anupam.sin 403
                mail.setSubject("Saholic Registration successful");
6124 anupam.sin 404
                mail.setTo(toList);
405
                mail.setData("Your have successfully registered with Saholic.com. Your user name is: " + email + " and your password is: " +  password);
406
                client.sendMail(mail);
6091 anupam.sin 407
            }
408
        }catch (UserContextException ux){
409
            return -1;               
410
        } catch (TTransportException e) {
411
            return -1;
412
        } catch (TException e) {
413
            return -1;
6124 anupam.sin 414
        } catch (Exception e) {
415
            log.error("Unexpected error while mailing the new password");
416
            return -1;
6091 anupam.sin 417
        }
418
        return user.getUserId();
419
    }
420
 
6057 anupam.sin 421
    public String getOperatorName() {
6206 rajveer 422
    	String operatorName = null;
423
    	if(rechargeType.equals("1")){
424
    		operatorName = Utils.getMobileProvidersMap().get(Long.parseLong(operator));	
425
    	}
426
    	if(rechargeType.equals("2")){
427
    		operatorName = Utils.getDthProvidersMap().get(Long.parseLong(operator));	
428
    	}
429
    	if(operatorName == null){
430
    		operatorName = "N/A";	
431
    	}
432
    	return operatorName;
6057 anupam.sin 433
    }
434
 
6495 anupam.sin 435
    public String encrypt(String strToEncrypt) {
436
        BigInteger strBigInt = new BigInteger(strToEncrypt.getBytes());
437
        System.out.println(strBigInt);
438
        BigInteger hashedPasswd = key.xor(strBigInt);
439
        System.out.println(hashedPasswd);
440
        return (hashedPasswd.toString(16));
441
    }
442
 
443
    public String decrypt(String encrypted) {
444
        try
445
        {
446
            BigInteger encryptedBigInt = new BigInteger(encrypted, 16);
447
            System.out.println(encryptedBigInt);
448
            BigInteger strBigInt = encryptedBigInt.xor(key);
449
            System.out.println(strBigInt);
450
            String decrypted = new String(strBigInt.toByteArray());
451
            return decrypted;
452
        } catch (Exception e) {
453
            System.out.println("oops");
454
            return "";
455
        }
456
    }
457
 
6050 anupam.sin 458
    public String getAmount() {
459
        return amount;
460
    }
461
    public void setAmount(String amount) {
462
        this.amount = amount;
463
    }
6073 amit.gupta 464
 
465
    public void setDthamount(String amount) {
466
    	this.amount = amount;
467
    }
6050 anupam.sin 468
    public String getOperator() {
469
        return operator;
470
    }
471
    public void setOperator(String operator) {
472
        this.operator = operator;
473
    }
474
    public String getNumber() {
475
        return number;
476
    }
477
    public void setNumber(String number) {
478
        this.number = number;
479
    }
6073 amit.gupta 480
 
481
    public void setDthnumber(String dthnumber) {
482
    	this.number = dthnumber;
483
    }
484
 
485
 
6050 anupam.sin 486
    public String getEmail() {
487
        return email;
488
    }
489
    public void setEmail(String email) {
490
        this.email = email;
491
    }
492
 
493
    public void setCouponIds(List<String> couponIds) {
494
        this.couponIds = couponIds;
495
    }
496
 
497
    public List<String> getCouponIds() {
498
        return couponIds;
499
    }
500
 
501
    public void setCoupons(List<RechargeCoupon> coupons) {
502
        this.coupons = coupons;
503
    }
504
 
505
    public List<RechargeCoupon> getCoupons() {
506
        return coupons;
507
    }
508
 
509
    public String getRechargeType() {
510
        return rechargeType;
511
    }
512
 
513
    public void setRechargeType(String rechargeType) {
514
        this.rechargeType = rechargeType;
515
    }
516
 
6058 anupam.sin 517
    public String getUserId() {
6050 anupam.sin 518
        return userId;
519
    }
520
 
6058 anupam.sin 521
    public void setUserId(String userId) {
522
        this.userId = userId;
6050 anupam.sin 523
    }
524
 
6057 anupam.sin 525
    public boolean isLoggedIn() {
526
        return userinfo.isLoggedIn();
527
    }
528
 
529
    public void setMessage(String message) {
530
        this.message = message;
531
    }
532
 
533
    public String getMessage() {
534
        return message;
535
    }
536
 
537
    public long getRechargeOrderId() {
538
        return rechargeOrderId;
539
    }
540
 
541
    public void setRechargeOrderId(long l) {
542
        this.rechargeOrderId = l;
543
    }
6070 anupam.sin 544
 
545
    public String getTotalAmount() {
546
        return totalAmount;
547
    }
6249 anupam.sin 548
 
549
    public void setTotalAmount(String amount) {
550
        this.totalAmount  = amount;
551
 
552
    }
6070 anupam.sin 553
 
554
    public String getWalletAmountUsed() {
555
        return walletAmountUsed;
556
    }
557
 
558
    public void setWalletAmountUsed(String walletAmountUsed) {
559
        this.walletAmountUsed = walletAmountUsed;
560
    }
6178 anupam.sin 561
 
562
    public String getPlan() {
563
        return plan;
564
    }
565
 
566
    public void setPlan(String plan) {
567
        this.plan = plan;
568
    }
6249 anupam.sin 569
 
570
    public String getErrorMessage() {
571
        return errorMessage;
572
    }
573
 
574
    public void setErrorMessage(String errorMessage) {
575
        this.errorMessage = errorMessage;
576
    }
6307 anupam.sin 577
 
578
    public String getCircleCode() {
579
        return circleCode;
580
    }
581
 
582
    public void setCircleCode(String circleCode) {
583
        this.circleCode = circleCode;
584
    }
6433 anupam.sin 585
 
586
    public void setDiscountCode(String discountCode) {
587
        this.couponCode = discountCode;
588
    }
6057 anupam.sin 589
 
6433 anupam.sin 590
    public String getCouponCode() {
591
        return couponCode;
592
    }
593
 
594
    public void setCouponCode(String couponCode) {
595
        this.couponCode = couponCode;
596
    }
597
 
598
    public void setCouponAmount(long couponAmount) {
599
        this.couponAmount = couponAmount;
600
    }
601
 
602
    public long getCouponAmount() {
603
        return couponAmount;
604
    }
605
 
606
    public void setCouponMessage(String couponMessage) {
607
        this.couponMessage = couponMessage;
608
    }
609
 
610
    public String getCouponMessage() {
611
        return couponMessage;
612
    }
613
 
6495 anupam.sin 614
    public void setHash(String hash) {
615
        this.hiddenUserId = hash;
616
    }
617
 
618
    public String getHiddenUserId() {
619
        return hiddenUserId;
620
    }
6050 anupam.sin 621
}