Subversion Repositories SmartDukaan

Rev

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

Rev 12789 Rev 13372
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.model.v1.inventory.Warehouse;
3
import in.shop2020.model.v1.inventory.Warehouse;
4
import in.shop2020.model.v1.order.Attribute;
4
import in.shop2020.model.v1.order.Attribute;
5
import in.shop2020.model.v1.order.Order;
-
 
6
import in.shop2020.model.v1.order.OrderSource;
5
import in.shop2020.model.v1.order.OrderSource;
7
import in.shop2020.model.v1.order.OrderType;
6
import in.shop2020.model.v1.order.OrderType;
8
import in.shop2020.model.v1.order.TransactionServiceException;
7
import in.shop2020.model.v1.order.TransactionServiceException;
9
import in.shop2020.model.v1.user.Address;
8
import in.shop2020.model.v1.user.Address;
10
import in.shop2020.model.v1.user.Cart;
9
import in.shop2020.model.v1.user.Cart;
11
import in.shop2020.model.v1.user.PrivateDealUser;
10
import in.shop2020.model.v1.user.PrivateDealUser;
12
import in.shop2020.model.v1.user.ShoppingCartException;
11
import in.shop2020.model.v1.user.ShoppingCartException;
13
import in.shop2020.model.v1.user.User;
-
 
14
import in.shop2020.serving.interceptors.TrackingInterceptor;
12
import in.shop2020.serving.interceptors.TrackingInterceptor;
15
import in.shop2020.serving.services.CodPaymentService;
13
import in.shop2020.serving.services.CodPaymentService;
16
import in.shop2020.serving.services.CommonPaymentService;
14
import in.shop2020.serving.services.CommonPaymentService;
17
import in.shop2020.serving.services.CouponPaymentService;
15
import in.shop2020.serving.services.CouponPaymentService;
18
import in.shop2020.serving.services.EbsPaymentService;
16
import in.shop2020.serving.services.EbsPaymentService;
19
import in.shop2020.serving.services.HdfcEmiPaymentService;
17
import in.shop2020.serving.services.HdfcEmiPaymentService;
20
import in.shop2020.serving.services.HdfcPaymentService;
18
import in.shop2020.serving.services.HdfcPaymentService;
21
import in.shop2020.serving.services.IPaymentService;
19
import in.shop2020.serving.services.IPaymentService;
22
import in.shop2020.serving.services.InnovitiPaymentService;
20
import in.shop2020.serving.services.InnovitiPaymentService;
-
 
21
import in.shop2020.serving.services.PayuPaymentService;
23
import in.shop2020.serving.utils.DesEncrypter;
22
import in.shop2020.serving.utils.DesEncrypter;
24
import in.shop2020.serving.utils.Utils;
-
 
25
import in.shop2020.thrift.clients.InventoryClient;
23
import in.shop2020.thrift.clients.InventoryClient;
26
import in.shop2020.thrift.clients.TransactionClient;
24
import in.shop2020.thrift.clients.TransactionClient;
27
import in.shop2020.thrift.clients.UserClient;
25
import in.shop2020.thrift.clients.UserClient;
28
import in.shop2020.utils.FedExShipAccountInfo;
26
import in.shop2020.utils.FedExShipAccountInfo;
29
 
27
 
Line 295... Line 293...
295
        else if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD_DEBIT) || paymentOption.equals(IPaymentService.HDFC_MASTERCARD_CREDIT))
293
        else if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD_DEBIT) || paymentOption.equals(IPaymentService.HDFC_MASTERCARD_CREDIT))
296
            paymentOption = IPaymentService.EBS_MASTERCARD;
294
            paymentOption = IPaymentService.EBS_MASTERCARD;
297
        else if(paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON))
295
        else if(paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON))
298
            paymentOption = null;           //Since we don't know the bank's name in this case, we'll let the user select the bank on the EBS page.
296
            paymentOption = null;           //Since we don't know the bank's name in this case, we'll let the user select the bank on the EBS page.
299
        
297
        
300
//        if(paymentOption.equals(IPaymentService.PAYU_CC)){
298
        if(paymentOption.equals(IPaymentService.PAYU_CC)){
301
//        	paymentOption = IPaymentService.PAYU_CC;
299
        	paymentOption = IPaymentService.PAYU_CC;
302
//        	IPaymentService payuPaymentService = new PayuPaymentService();
300
        	IPaymentService payuPaymentService = new PayuPaymentService();
303
//        	paymentId = payuPaymentService.createPayment(userinfo.getUserId(), txnId, paymentOption, gatewayId);
301
        	paymentId = payuPaymentService.createPayment(userinfo.getUserId(), txnId, paymentOption, gatewayId);
304
//        	return "payu-pay-redirect";
302
        	return "payu-pay-redirect";
305
//        }
303
        }
306
        
304
        
307
        IPaymentService ebsPaymentService = new EbsPaymentService();
305
        IPaymentService ebsPaymentService = new EbsPaymentService();
308
        paymentId = ebsPaymentService.createPayment(userinfo.getUserId(), txnId, paymentOption, 2);
306
        paymentId = ebsPaymentService.createPayment(userinfo.getUserId(), txnId, paymentOption, 2);
309
        if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
307
        if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
310
            addActionError("We are experiencing some problems. Please try later.");
308
            addActionError("We are experiencing some problems. Please try later.");