Subversion Repositories SmartDukaan

Rev

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

Rev 7001 Rev 7862
Line 6... Line 6...
6
import in.shop2020.model.v1.user.Address;
6
import in.shop2020.model.v1.user.Address;
7
import in.shop2020.model.v1.user.ShoppingCartException;
7
import in.shop2020.model.v1.user.ShoppingCartException;
8
import in.shop2020.serving.interceptors.TrackingInterceptor;
8
import in.shop2020.serving.interceptors.TrackingInterceptor;
9
import in.shop2020.serving.services.CodPaymentService;
9
import in.shop2020.serving.services.CodPaymentService;
10
import in.shop2020.serving.services.CommonPaymentService;
10
import in.shop2020.serving.services.CommonPaymentService;
-
 
11
import in.shop2020.serving.services.CouponPaymentService;
11
import in.shop2020.serving.services.EbsPaymentService;
12
import in.shop2020.serving.services.EbsPaymentService;
12
import in.shop2020.serving.services.HdfcEmiPaymentService;
13
import in.shop2020.serving.services.HdfcEmiPaymentService;
13
import in.shop2020.serving.services.HdfcPaymentService;
14
import in.shop2020.serving.services.HdfcPaymentService;
14
import in.shop2020.serving.services.IPaymentService;
15
import in.shop2020.serving.services.IPaymentService;
15
import in.shop2020.serving.services.InnovitiPaymentService;
16
import in.shop2020.serving.services.InnovitiPaymentService;
Line 126... Line 127...
126
                addActionError("We are experiencing some problems. Please try later.");
127
                addActionError("We are experiencing some problems. Please try later.");
127
                return "proceed-to-pay-redirect";
128
                return "proceed-to-pay-redirect";
128
            }
129
            }
129
    	}
130
    	}
130
    	
131
    	
-
 
132
    	if(paymentOption.equals(IPaymentService.COUPON)) {
-
 
133
    	    if(!verifyCaptcha()){
-
 
134
                addActionError("Invalid captcha");
-
 
135
                log.info("Invalid captcha error msg has been added");
-
 
136
                return "proceed-to-pay-redirect";    
-
 
137
            }
-
 
138
    	}
-
 
139
    	
131
    	try {
140
    	try {
132
    		if(!createOrders(addressId, currentCartId, currentUserId, Long.parseLong(paymentOption))) {
141
    		if(!createOrders(addressId, currentCartId, currentUserId, Long.parseLong(paymentOption))) {
133
    			addActionError("We are experiencing some problems. Please try later.");
142
    			addActionError("We are experiencing some problems. Please try later.");
134
    			return "proceed-to-pay-redirect";
143
    			return "proceed-to-pay-redirect";
135
    		}
144
    		}
Line 182... Line 191...
182
			} else {
191
			} else {
183
	            log.info("Successfully created payment for Innoviti to process. Redirecting to /innoviti-pay/" + paymentId);
192
	            log.info("Successfully created payment for Innoviti to process. Redirecting to /innoviti-pay/" + paymentId);
184
				return "innoviti-pay-redirect";
193
				return "innoviti-pay-redirect";
185
			}
194
			}
186
		
195
		
187
    	
196
    	case 16:
-
 
197
            IPaymentService couponPaymentService = new CouponPaymentService();
-
 
198
            paymentId = couponPaymentService.createPayment(userinfo.getUserId(), txnId, paymentOption, 16);
-
 
199
            if (paymentId == IPaymentService.PAYMENT_NOT_CREATED) {
-
 
200
                //Very unlikely. The only possible reason can be that the payment service is down.
-
 
201
                log.error("Unable to process the Coupon payment.");
-
 
202
                addActionError("We are experiencing some problems. Please try later.");
-
 
203
                return "proceed-to-pay-redirect";
-
 
204
            } else {
-
 
205
                CommonPaymentService.processCouponTxn(txnId);
-
 
206
                return "cod-redirect";
-
 
207
            }
188
		default:
208
		default:
189
			break;
209
			break;
190
		}
210
		}
191
    	
211
    	
192
 
212
 
Line 235... Line 255...
235
    	gatewayId = ProceedToPayController.getGatewayId(Long.parseLong(paymentOption));
255
    	gatewayId = ProceedToPayController.getGatewayId(Long.parseLong(paymentOption));
236
    	if(gatewayId==0){
256
    	if(gatewayId==0){
237
    		if(paymentOption.equals(IPaymentService.COD)){
257
    		if(paymentOption.equals(IPaymentService.COD)){
238
    			gatewayId = 4;
258
    			gatewayId = 4;
239
    		}
259
    		}
-
 
260
    		if(paymentOption.equals(IPaymentService.COUPON)){
-
 
261
                gatewayId = 16;
-
 
262
            }
240
    	}
263
    	}
241
    	return gatewayId;
264
    	return gatewayId;
242
    }
265
    }
243
    
266
    
244
    /**
267
    /**