| Line 2... |
Line 2... |
| 2 |
|
2 |
|
| 3 |
import in.shop2020.datalogger.EventType;
|
3 |
import in.shop2020.datalogger.EventType;
|
| 4 |
import in.shop2020.model.v1.order.RechargeOrder;
|
4 |
import in.shop2020.model.v1.order.RechargeOrder;
|
| 5 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
5 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
| 6 |
import in.shop2020.model.v1.order.RechargeType;
|
6 |
import in.shop2020.model.v1.order.RechargeType;
|
| - |
|
7 |
import in.shop2020.model.v1.order.Transaction;
|
| 7 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
8 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| - |
|
9 |
import in.shop2020.model.v1.user.PromotionException;
|
| 8 |
import in.shop2020.payments.PaymentException;
|
10 |
import in.shop2020.payments.PaymentException;
|
| 9 |
import in.shop2020.serving.utils.FormattingUtils;
|
11 |
import in.shop2020.serving.utils.FormattingUtils;
|
| 10 |
import in.shop2020.thrift.clients.PaymentClient;
|
12 |
import in.shop2020.thrift.clients.PaymentClient;
|
| - |
|
13 |
import in.shop2020.thrift.clients.PromotionClient;
|
| 11 |
import in.shop2020.thrift.clients.TransactionClient;
|
14 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 12 |
import in.shop2020.utils.DataLogger;
|
15 |
import in.shop2020.utils.DataLogger;
|
| 13 |
|
16 |
|
| 14 |
import java.text.SimpleDateFormat;
|
17 |
import java.text.SimpleDateFormat;
|
| 15 |
import java.util.Date;
|
18 |
import java.util.Date;
|
| Line 57... |
Line 60... |
| 57 |
String message = null;
|
60 |
String message = null;
|
| 58 |
|
61 |
|
| 59 |
public RechargeResultController(){
|
62 |
public RechargeResultController(){
|
| 60 |
super();
|
63 |
super();
|
| 61 |
}
|
64 |
}
|
| - |
|
65 |
|
| - |
|
66 |
private void trackCouponUsage(String couponCode) {
|
| - |
|
67 |
try {
|
| - |
|
68 |
if (couponCode != null && !couponCode.isEmpty()) {
|
| - |
|
69 |
PromotionClient promotionServiceClient = new PromotionClient();
|
| - |
|
70 |
promotionServiceClient.getClient().trackCouponUsage(couponCode, rechargeOrder.getId(), rechargeOrder.getUserId());
|
| - |
|
71 |
}
|
| - |
|
72 |
} catch (PromotionException e) {
|
| - |
|
73 |
log.error("Promotion Exception: " + e);
|
| - |
|
74 |
} catch (TException e) {
|
| - |
|
75 |
log.error("Transport from Promotion Service failed:", e);
|
| - |
|
76 |
} catch (Exception e) {
|
| - |
|
77 |
log.error("Unexpected exception:", e);
|
| - |
|
78 |
}
|
| - |
|
79 |
}
|
| 62 |
|
80 |
|
| 63 |
public String index() {
|
81 |
public String index() {
|
| 64 |
PaymentClient paymentServiceClient = null;
|
82 |
PaymentClient paymentServiceClient = null;
|
| 65 |
TransactionClient transactionServiceClient = null;
|
83 |
TransactionClient transactionServiceClient = null;
|
| 66 |
//UserClient userServiceClient = null;
|
84 |
//UserClient userServiceClient = null;
|
| Line 204... |
Line 222... |
| 204 |
} else {
|
222 |
} else {
|
| 205 |
DataLogger.logData(EventType.RECHARGE_SUCCESSFUL, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
|
223 |
DataLogger.logData(EventType.RECHARGE_SUCCESSFUL, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
|
| 206 |
Long.toString(rechargeOrder.getOperatorId()), Long.toString(rechargeOrder.getTotalAmount()), Long.toString(rechargeOrder.getWalletAmount()),
|
224 |
Long.toString(rechargeOrder.getOperatorId()), Long.toString(rechargeOrder.getTotalAmount()), Long.toString(rechargeOrder.getWalletAmount()),
|
| 207 |
rechargeOrder.getRechargeType().toString());
|
225 |
rechargeOrder.getRechargeType().toString());
|
| 208 |
|
226 |
|
| - |
|
227 |
if(rechargeOrder.getCouponCode() != null) {
|
| - |
|
228 |
trackCouponUsage(rechargeOrder.getCouponCode());
|
| - |
|
229 |
}
|
| - |
|
230 |
|
| 209 |
String operator = "";
|
231 |
String operator = "";
|
| 210 |
if(isDTH()) {
|
232 |
if(isDTH()) {
|
| 211 |
operator = getProvider();
|
233 |
operator = getProvider();
|
| 212 |
} else {
|
234 |
} else {
|
| 213 |
operator = getProvider() + " mobile";
|
235 |
operator = getProvider() + " mobile";
|