| Line 5... |
Line 5... |
| 5 |
import in.shop2020.model.v1.order.OrderType;
|
5 |
import in.shop2020.model.v1.order.OrderType;
|
| 6 |
import in.shop2020.model.v1.order.RechargeCoupon;
|
6 |
import in.shop2020.model.v1.order.RechargeCoupon;
|
| 7 |
import in.shop2020.model.v1.order.RechargeOrder;
|
7 |
import in.shop2020.model.v1.order.RechargeOrder;
|
| 8 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
8 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
| 9 |
import in.shop2020.model.v1.order.RechargeType;
|
9 |
import in.shop2020.model.v1.order.RechargeType;
|
| 10 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
- |
|
| 11 |
import in.shop2020.model.v1.order.UserWallet;
|
10 |
import in.shop2020.model.v1.order.UserWallet;
|
| 12 |
import in.shop2020.model.v1.user.Sex;
|
- |
|
| 13 |
import in.shop2020.model.v1.user.User;
|
11 |
import in.shop2020.model.v1.user.User;
|
| 14 |
import in.shop2020.model.v1.user.UserContextException;
|
12 |
import in.shop2020.model.v1.user.UserContextException;
|
| 15 |
import in.shop2020.serving.interceptors.TrackingInterceptor;
|
- |
|
| 16 |
import in.shop2020.serving.utils.DesEncrypter;
|
13 |
import in.shop2020.serving.utils.DesEncrypter;
|
| 17 |
import in.shop2020.serving.utils.Utils;
|
14 |
import in.shop2020.serving.utils.Utils;
|
| 18 |
import in.shop2020.thrift.clients.HelperClient;
|
15 |
import in.shop2020.thrift.clients.HelperClient;
|
| 19 |
import in.shop2020.thrift.clients.TransactionClient;
|
16 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 20 |
import in.shop2020.thrift.clients.UserClient;
|
17 |
import in.shop2020.thrift.clients.UserClient;
|
| 21 |
import in.shop2020.utils.HelperServiceException;
|
- |
|
| 22 |
import in.shop2020.utils.Mail;
|
18 |
import in.shop2020.utils.Mail;
|
| 23 |
|
19 |
|
| 24 |
import java.util.ArrayList;
|
20 |
import java.util.ArrayList;
|
| 25 |
import java.util.List;
|
21 |
import java.util.List;
|
| 26 |
import java.util.Map;
|
- |
|
| 27 |
import java.util.Random;
|
22 |
import java.util.Random;
|
| 28 |
|
23 |
|
| 29 |
import javax.servlet.http.Cookie;
|
- |
|
| 30 |
|
- |
|
| 31 |
import org.apache.log4j.Logger;
|
24 |
import org.apache.log4j.Logger;
|
| 32 |
import org.apache.struts2.convention.annotation.Result;
|
25 |
import org.apache.struts2.convention.annotation.Result;
|
| 33 |
import org.apache.struts2.convention.annotation.Results;
|
26 |
import org.apache.struts2.convention.annotation.Results;
|
| 34 |
import org.apache.thrift.TException;
|
27 |
import org.apache.thrift.TException;
|
| 35 |
import org.apache.thrift.transport.TTransportException;
|
28 |
import org.apache.thrift.transport.TTransportException;
|
| 36 |
|
29 |
|
| 37 |
@SuppressWarnings({ "serial", "serial" })
|
- |
|
| 38 |
@Results({
|
30 |
@Results({
|
| 39 |
@Result(name="recharge-pay-options-redirect", type="redirectAction", params = {"actionName" , "recharge-pay-options", "rechargeOrderId", "${rechargeOrderId}", "amount", "${amount}", "userId", "${userId}"}),
|
31 |
@Result(name="recharge-pay-options-redirect", type="redirectAction", params = {"actionName" , "recharge-pay-options", "rechargeOrderId", "${rechargeOrderId}", "amount", "${amount}", "userId", "${userId}"}),
|
| 40 |
@Result(name="create-recharge-redirect", type="redirectAction", params = {"actionName" , "wallet-only-payment", "rechargeOrderId", "${rechargeOrderId}"}),
|
32 |
@Result(name="create-recharge-redirect", type="redirectAction", params = {"actionName" , "wallet-only-payment", "rechargeOrderId", "${rechargeOrderId}"}),
|
| 41 |
@Result(name="recharge-redirect", type="redirectAction", params = {"actionName" , "recharge", "error", "ServiceDown"})
|
33 |
@Result(name="recharge-redirect", type="redirectAction", params = {"actionName" , "recharge", "error", "ServiceDown"})
|
| 42 |
})
|
34 |
})
|
| Line 204... |
Line 196... |
| 204 |
}
|
196 |
}
|
| 205 |
return user.getUserId();
|
197 |
return user.getUserId();
|
| 206 |
}
|
198 |
}
|
| 207 |
|
199 |
|
| 208 |
public String getOperatorName() {
|
200 |
public String getOperatorName() {
|
| 209 |
try {
|
201 |
String operatorName = null;
|
| 210 |
TransactionClient tc = new TransactionClient();
|
202 |
if(rechargeType.equals("1")){
|
| 211 |
Map<Long, String> providers = tc.getClient().getServiceProviders(RechargeType.findByValue(Integer.parseInt(rechargeType)));
|
203 |
operatorName = Utils.getMobileProvidersMap().get(Long.parseLong(operator));
|
| - |
|
204 |
}
|
| - |
|
205 |
if(rechargeType.equals("2")){
|
| 212 |
return providers.get(Long.parseLong(operator));
|
206 |
operatorName = Utils.getDthProvidersMap().get(Long.parseLong(operator));
|
| - |
|
207 |
}
|
| 213 |
} catch(Exception e) {
|
208 |
if(operatorName == null){
|
| 214 |
log.error("Unable to get operator name");
|
209 |
operatorName = "N/A";
|
| 215 |
}
|
210 |
}
|
| 216 |
return "N/A";
|
211 |
return operatorName;
|
| 217 |
}
|
212 |
}
|
| 218 |
|
213 |
|
| 219 |
public String getAmount() {
|
214 |
public String getAmount() {
|
| 220 |
return amount;
|
215 |
return amount;
|
| 221 |
}
|
216 |
}
|