| Line 85... |
Line 85... |
| 85 |
log.error("Exception in createOrders function. Something want wrong.");
|
85 |
log.error("Exception in createOrders function. Something want wrong.");
|
| 86 |
e.printStackTrace();
|
86 |
e.printStackTrace();
|
| 87 |
return "shipping-redirect";
|
87 |
return "shipping-redirect";
|
| 88 |
}
|
88 |
}
|
| 89 |
|
89 |
|
| 90 |
if (paymentOption.equals(IPaymentService.EBS_MASTERCARD) || paymentOption.equals(IPaymentService.EBS_VISA)) {
|
90 |
if (paymentOption.equals(IPaymentService.EBS_MASTERCARD) || paymentOption.equals(IPaymentService.EBS_VISA) || paymentOption.equals(IPaymentService.EBS_VISA_ELECTRON)) {
|
| 91 |
// User has selected Visa or MasterCard CC
|
91 |
// User has selected Visa or MasterCard CC
|
| 92 |
IPaymentService hdfcPaymentService = new HdfcPaymentService();
|
92 |
IPaymentService hdfcPaymentService = new HdfcPaymentService();
|
| 93 |
paymentId = hdfcPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption);
|
93 |
paymentId = hdfcPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption);
|
| 94 |
if (paymentId == IPaymentService.PAYMENT_NOT_CREATED) {
|
94 |
if (paymentId == IPaymentService.PAYMENT_NOT_CREATED) {
|
| 95 |
addActionError("We are experiencing some problems. Please try later.");
|
95 |
log.error("Unable to process payment through HDFC. Falling through to EBS.");
|
| 96 |
return "shipping-redirect";
|
- |
|
| 97 |
} else {
|
96 |
} else {
|
| 98 |
this.redirectURL = ((HdfcPaymentService)hdfcPaymentService).getRedirectUrl();
|
97 |
this.redirectURL = ((HdfcPaymentService)hdfcPaymentService).getRedirectUrl();
|
| 99 |
log.info(this.redirectURL);
|
98 |
log.info(this.redirectURL);
|
| 100 |
return "success";
|
99 |
return "success";
|
| 101 |
}
|
100 |
}
|
| 102 |
} else {
|
101 |
}
|
| - |
|
102 |
|
| - |
|
103 |
if(paymentOption.equals(IPaymentService.EBS_VISA_ELECTRON))
|
| - |
|
104 |
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.
|
| - |
|
105 |
|
| 103 |
IPaymentService ebsPaymentService = new EbsPaymentService();
|
106 |
IPaymentService ebsPaymentService = new EbsPaymentService();
|
| 104 |
paymentId = ebsPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption);
|
107 |
paymentId = ebsPaymentService.createPayment(userinfo.getCartId(), userinfo.getUserId(), txnId, paymentOption);
|
| 105 |
if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
|
108 |
if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
|
| 106 |
addActionError("We are experiencing some problems. Please try later.");
|
109 |
addActionError("We are experiencing some problems. Please try later.");
|
| 107 |
return "shipping-redirect";
|
110 |
return "shipping-redirect";
|
| 108 |
}else{
|
111 |
}else{
|
| 109 |
log.info("Successfully created payment for EBS to process. Redirecting to /ebs-pay/" + paymentId);
|
112 |
log.info("Successfully created payment for EBS to process. Redirecting to /ebs-pay/" + paymentId);
|
| 110 |
return "ebs-pay-redirect";
|
113 |
return "ebs-pay-redirect";
|
| 111 |
}
|
- |
|
| 112 |
}
|
114 |
}
|
| 113 |
}
|
115 |
}
|
| 114 |
|
116 |
|
| 115 |
public String getId(){
|
117 |
public String getId(){
|
| 116 |
return id;
|
118 |
return id;
|