| Line 27... |
Line 27... |
| 27 |
import in.shop2020.thrift.clients.TransactionClient;
|
27 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 28 |
import in.shop2020.thrift.clients.UserClient;
|
28 |
import in.shop2020.thrift.clients.UserClient;
|
| 29 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
29 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
| 30 |
|
30 |
|
| 31 |
@SuppressWarnings("serial")
|
31 |
@SuppressWarnings("serial")
|
| 32 |
@InterceptorRefs({
|
- |
|
| 33 |
@InterceptorRef("myDefault"),
|
- |
|
| 34 |
@InterceptorRef("login")
|
- |
|
| 35 |
})
|
32 |
|
| 36 |
@Results({
|
33 |
@Results({
|
| 37 |
@Result(name="shipping-redirect", type="redirectAction",
|
34 |
@Result(name="recharge-redirect", type="redirectAction",
|
| 38 |
params = {"actionName" , "shipping"})
|
35 |
params = {"actionName" , "recharge"})
|
| 39 |
})
|
36 |
})
|
| 40 |
public class EbsPayController extends ValidationAwareSupport{
|
37 |
public class EbsPayController extends ValidationAwareSupport{
|
| 41 |
|
38 |
|
| 42 |
private static Logger log = Logger.getLogger(Class.class);
|
39 |
private static Logger log = Logger.getLogger(Class.class);
|
| 43 |
|
40 |
|
| Line 125... |
Line 122... |
| 125 |
paymentServiceClient = new PaymentClient();
|
122 |
paymentServiceClient = new PaymentClient();
|
| 126 |
payment = paymentServiceClient.getClient().getPayment(paymentId);
|
123 |
payment = paymentServiceClient.getClient().getPayment(paymentId);
|
| 127 |
} catch (Exception e) {
|
124 |
} catch (Exception e) {
|
| 128 |
log.error("Error while getting payment client", e);
|
125 |
log.error("Error while getting payment client", e);
|
| 129 |
addActionError("We are experiencing some problems. Please try later.");
|
126 |
addActionError("We are experiencing some problems. Please try later.");
|
| 130 |
return "shipping-redirect";
|
127 |
return "recharge-redirect";
|
| 131 |
}
|
128 |
}
|
| 132 |
|
129 |
|
| 133 |
RechargeOrder rechargeOrder = null;
|
130 |
RechargeOrder rechargeOrder = null;
|
| 134 |
try {
|
131 |
try {
|
| 135 |
long txnId = payment.getMerchantTxnId();
|
132 |
long txnId = payment.getMerchantTxnId();
|
| Line 137... |
Line 134... |
| 137 |
in.shop2020.model.v1.order.TransactionService.Client txnClient = transactionServiceClient.getClient();
|
134 |
in.shop2020.model.v1.order.TransactionService.Client txnClient = transactionServiceClient.getClient();
|
| 138 |
rechargeOrder = txnClient.getRechargeOrdersForTransaction(txnId);
|
135 |
rechargeOrder = txnClient.getRechargeOrdersForTransaction(txnId);
|
| 139 |
} catch (Exception e) {
|
136 |
} catch (Exception e) {
|
| 140 |
log.error("Error while getting transaction information", e);
|
137 |
log.error("Error while getting transaction information", e);
|
| 141 |
addActionError("We are experiencing some problems. Please try later.");
|
138 |
addActionError("We are experiencing some problems. Please try later.");
|
| 142 |
return "shipping-redirect";
|
139 |
return "recharge-redirect";
|
| 143 |
}
|
140 |
}
|
| 144 |
|
141 |
|
| 145 |
String desc = "Recharge for Rs. " + rechargeOrder.getTotalAmount() + ", operator : " + rechargeOrder.getOperatorId();
|
142 |
String desc = "Recharge for Rs. " + rechargeOrder.getTotalAmount() + ", operator : " + rechargeOrder.getOperatorId();
|
| 146 |
this.description = new StringBuilder(desc);
|
143 |
this.description = new StringBuilder(desc);
|
| 147 |
setPaymentOption(payment);
|
144 |
setPaymentOption(payment);
|