| Line 1... |
Line 1... |
| 1 |
package in.shop2020.serving.controllers;
|
1 |
package in.shop2020.serving.controllers;
|
| 2 |
|
2 |
|
| 3 |
import java.util.List;
|
3 |
import java.util.List;
|
| 4 |
|
4 |
|
| - |
|
5 |
import in.shop2020.serving.services.PayuPaymentService;
|
| 5 |
import in.shop2020.model.v1.order.RechargeOrder;
|
6 |
import in.shop2020.model.v1.order.RechargeOrder;
|
| 6 |
import in.shop2020.model.v1.user.Address;
|
7 |
import in.shop2020.model.v1.user.Address;
|
| 7 |
import in.shop2020.payments.Payment;
|
8 |
import in.shop2020.payments.Payment;
|
| 8 |
import in.shop2020.payments.PaymentException;
|
9 |
import in.shop2020.payments.PaymentException;
|
| 9 |
import in.shop2020.serving.services.EbsPaymentService;
|
10 |
import in.shop2020.serving.services.EbsPaymentService;
|
| Line 160... |
Line 161... |
| 160 |
paymentOption = IPaymentService.EBS_VISA;
|
161 |
paymentOption = IPaymentService.EBS_VISA;
|
| 161 |
else if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD_DEBIT) || paymentOption.equals(IPaymentService.HDFC_MASTERCARD_CREDIT))
|
162 |
else if(paymentOption.equals(IPaymentService.HDFC_MASTERCARD_DEBIT) || paymentOption.equals(IPaymentService.HDFC_MASTERCARD_CREDIT))
|
| 162 |
paymentOption = IPaymentService.EBS_MASTERCARD;
|
163 |
paymentOption = IPaymentService.EBS_MASTERCARD;
|
| 163 |
else if(paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON))
|
164 |
else if(paymentOption.equals(IPaymentService.HDFC_VISA_ELECTRON))
|
| 164 |
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.
|
165 |
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.
|
| - |
|
166 |
|
| - |
|
167 |
if(paymentOption.equals(IPaymentService.PAYU_CC)){
|
| - |
|
168 |
paymentOption = IPaymentService.PAYU_CC;
|
| - |
|
169 |
PayuPaymentService payuPaymentService = new PayuPaymentService();
|
| - |
|
170 |
paymentId = payuPaymentService.createPayment(rechargeOrder, paymentOption);
|
| - |
|
171 |
this.redirectURL = "payu-pay/" + paymentId + "/edit?phone=" + phone;
|
| - |
|
172 |
return "success";
|
| - |
|
173 |
}
|
| 165 |
|
174 |
|
| 166 |
EbsPaymentService ebsPaymentService = new EbsPaymentService();
|
175 |
EbsPaymentService ebsPaymentService = new EbsPaymentService();
|
| 167 |
paymentId = ebsPaymentService.createPayment(rechargeOrder, paymentOption);
|
176 |
paymentId = ebsPaymentService.createPayment(rechargeOrder, paymentOption);
|
| 168 |
if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
|
177 |
if(paymentId == IPaymentService.PAYMENT_NOT_CREATED){
|
| 169 |
addActionError("We are experiencing some problems. Please try later.");
|
178 |
addActionError("We are experiencing some problems. Please try later.");
|