Subversion Repositories SmartDukaan

Rev

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

Rev 3561 Rev 3616
Line 6... Line 6...
6
import in.shop2020.model.v1.user.ShoppingCartException;
6
import in.shop2020.model.v1.user.ShoppingCartException;
7
import in.shop2020.serving.interceptors.TrackingInterceptor;
7
import in.shop2020.serving.interceptors.TrackingInterceptor;
8
import in.shop2020.serving.services.CodPaymentService;
8
import in.shop2020.serving.services.CodPaymentService;
9
import in.shop2020.serving.services.CommonPaymentService;
9
import in.shop2020.serving.services.CommonPaymentService;
10
import in.shop2020.serving.services.EbsPaymentService;
10
import in.shop2020.serving.services.EbsPaymentService;
-
 
11
import in.shop2020.serving.services.HdfcEmiPaymentService;
11
import in.shop2020.serving.services.HdfcPaymentService;
12
import in.shop2020.serving.services.HdfcPaymentService;
12
import in.shop2020.serving.services.IPaymentService;
13
import in.shop2020.serving.services.IPaymentService;
13
import in.shop2020.serving.utils.DesEncrypter;
14
import in.shop2020.serving.utils.DesEncrypter;
14
import in.shop2020.serving.utils.Utils;
15
import in.shop2020.serving.utils.Utils;
15
import in.shop2020.thrift.clients.LogisticsClient;
16
import in.shop2020.thrift.clients.LogisticsClient;
Line 147... Line 148...
147
                return "proceed-to-pay-redirect";
148
                return "proceed-to-pay-redirect";
148
            } else {
149
            } else {
149
                CommonPaymentService.processCodTxn(txnId);
150
                CommonPaymentService.processCodTxn(txnId);
150
                return "cod-redirect";
151
                return "cod-redirect";
151
            }
152
            }
-
 
153
    	} else if(paymentOption.equals(IPaymentService.HDFC_EMI)){
-
 
154
    	    IPaymentService hdfcEmiPaymentService = new HdfcEmiPaymentService();
-
 
155
            paymentId = hdfcEmiPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
-
 
156
            if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
-
 
157
                addActionError("We are experiencing some problems. Please try later.");
-
 
158
                log.error("Unable to process payment through HDFC EMI.");
-
 
159
                return "proceed-to-pay-redirect";
-
 
160
            } else {
-
 
161
                this.redirectURL = ((HdfcPaymentService)hdfcEmiPaymentService).getRedirectUrl();
-
 
162
                log.info(this.redirectURL);
-
 
163
                return "success";
-
 
164
            }
152
    	} else {
165
    	} else {
153
            if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD) || paymentOption.equals(IPaymentService.HDFC_VISA) || paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON)) {
166
            if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD) || paymentOption.equals(IPaymentService.HDFC_VISA) || paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON)) {
154
                // User has selected Visa or MasterCard CC
167
                // User has selected Visa or MasterCard CC
155
                IPaymentService hdfcPaymentService = new HdfcPaymentService();
168
                IPaymentService hdfcPaymentService = new HdfcPaymentService();
156
                paymentId = hdfcPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
169
                paymentId = hdfcPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
Line 172... Line 185...
172
            
185
            
173
            IPaymentService ebsPaymentService = new EbsPaymentService();
186
            IPaymentService ebsPaymentService = new EbsPaymentService();
174
            paymentId = ebsPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
187
            paymentId = ebsPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
175
            if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
188
            if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
176
                addActionError("We are experiencing some problems. Please try later.");
189
                addActionError("We are experiencing some problems. Please try later.");
-
 
190
                log.error("Unable to process payment through EBS.");
177
                return "proceed-to-pay-redirect";
191
                return "proceed-to-pay-redirect";
178
            } else {
192
            } else {
179
                log.info("Successfully created payment for EBS to process. Redirecting to /ebs-pay/" + paymentId);
193
                log.info("Successfully created payment for EBS to process. Redirecting to /ebs-pay/" + paymentId);
180
                return "ebs-pay-redirect";
194
                return "ebs-pay-redirect";
181
            }    	    
195
            }