| Line 10... |
Line 10... |
| 10 |
import in.shop2020.serving.services.CommonPaymentService;
|
10 |
import in.shop2020.serving.services.CommonPaymentService;
|
| 11 |
import in.shop2020.serving.services.EbsPaymentService;
|
11 |
import in.shop2020.serving.services.EbsPaymentService;
|
| 12 |
import in.shop2020.serving.services.HdfcEmiPaymentService;
|
12 |
import in.shop2020.serving.services.HdfcEmiPaymentService;
|
| 13 |
import in.shop2020.serving.services.HdfcPaymentService;
|
13 |
import in.shop2020.serving.services.HdfcPaymentService;
|
| 14 |
import in.shop2020.serving.services.IPaymentService;
|
14 |
import in.shop2020.serving.services.IPaymentService;
|
| - |
|
15 |
import in.shop2020.serving.services.PayuPaymentService;
|
| 15 |
import in.shop2020.serving.utils.DesEncrypter;
|
16 |
import in.shop2020.serving.utils.DesEncrypter;
|
| 16 |
import in.shop2020.serving.utils.Utils;
|
17 |
import in.shop2020.serving.utils.Utils;
|
| 17 |
import in.shop2020.thrift.clients.TransactionClient;
|
18 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 18 |
import in.shop2020.thrift.clients.UserClient;
|
19 |
import in.shop2020.thrift.clients.UserClient;
|
| 19 |
import in.shop2020.utils.DataLogger;
|
20 |
import in.shop2020.utils.DataLogger;
|
| Line 38... |
Line 39... |
| 38 |
|
39 |
|
| 39 |
@Results({
|
40 |
@Results({
|
| 40 |
@Result(name="shipping-redirect", type="redirectAction", params = {"actionName" , "shipping"}),
|
41 |
@Result(name="shipping-redirect", type="redirectAction", params = {"actionName" , "shipping"}),
|
| 41 |
@Result(name="proceed-to-pay-redirect", type="redirectAction", params = {"actionName" , "proceed-to-pay", "deliveryLocation", "${deliveryLocation}"}),
|
42 |
@Result(name="proceed-to-pay-redirect", type="redirectAction", params = {"actionName" , "proceed-to-pay", "deliveryLocation", "${deliveryLocation}"}),
|
| 42 |
@Result(name="ebs-pay-redirect", type="redirect", location="/ebs-pay/${paymentId}"),
|
43 |
@Result(name="ebs-pay-redirect", type="redirect", location="/ebs-pay/${paymentId}"),
|
| - |
|
44 |
@Result(name="payu-pay-redirect", type="redirect", location="/payu-pay/${paymentId}"),
|
| 43 |
@Result(name="cod-redirect", type="redirect", location="/pay-success?paymentId=${paymentId}")
|
45 |
@Result(name="cod-redirect", type="redirect", location="/pay-success?paymentId=${paymentId}")
|
| 44 |
})
|
46 |
})
|
| 45 |
public class OrderController extends BaseController {
|
47 |
public class OrderController extends BaseController {
|
| 46 |
|
48 |
|
| 47 |
public long getPaymentId() {
|
49 |
public long getPaymentId() {
|
| Line 178... |
Line 180... |
| 178 |
else if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD_DEBIT) || paymentOption.equals(IPaymentService.HDFC_MASTERCARD_CREDIT))
|
180 |
else if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD_DEBIT) || paymentOption.equals(IPaymentService.HDFC_MASTERCARD_CREDIT))
|
| 179 |
paymentOption = IPaymentService.EBS_MASTERCARD;
|
181 |
paymentOption = IPaymentService.EBS_MASTERCARD;
|
| 180 |
else if(paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON))
|
182 |
else if(paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON))
|
| 181 |
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.
|
183 |
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.
|
| 182 |
|
184 |
|
| - |
|
185 |
if(paymentOption.equals(IPaymentService.PAYU_CC)){
|
| - |
|
186 |
paymentOption = IPaymentService.PAYU_CC;
|
| - |
|
187 |
IPaymentService payuPaymentService = new PayuPaymentService();
|
| - |
|
188 |
paymentId = payuPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
|
| - |
|
189 |
return "payu-pay-redirect";
|
| - |
|
190 |
}
|
| - |
|
191 |
|
| 183 |
IPaymentService ebsPaymentService = new EbsPaymentService();
|
192 |
IPaymentService ebsPaymentService = new EbsPaymentService();
|
| 184 |
paymentId = ebsPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
|
193 |
paymentId = ebsPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption, sourceId);
|
| 185 |
if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
|
194 |
if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
|
| 186 |
addActionError("We are experiencing some problems. Please try later.");
|
195 |
addActionError("We are experiencing some problems. Please try later.");
|
| 187 |
log.error("Unable to process payment through EBS.");
|
196 |
log.error("Unable to process payment through EBS.");
|