| Line 1... |
Line 1... |
| 1 |
package in.shop2020.serving.controllers;
|
1 |
package in.shop2020.serving.controllers;
|
| 2 |
|
2 |
|
| 3 |
import java.util.Date;
|
- |
|
| 4 |
import java.util.List;
|
- |
|
| 5 |
|
- |
|
| 6 |
import org.apache.log4j.Logger;
|
- |
|
| 7 |
import org.apache.struts2.convention.annotation.InterceptorRef;
|
- |
|
| 8 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
- |
|
| 9 |
import org.apache.thrift.TException;
|
3 |
import in.shop2020.datalogger.EventType;
|
| 10 |
|
- |
|
| 11 |
import in.shop2020.model.v1.order.Order;
|
4 |
import in.shop2020.model.v1.order.Order;
|
| 12 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
5 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| 13 |
import in.shop2020.model.v1.user.Cart;
|
6 |
import in.shop2020.model.v1.user.Cart;
|
| 14 |
import in.shop2020.model.v1.user.ShoppingCartException;
|
7 |
import in.shop2020.model.v1.user.ShoppingCartException;
|
| 15 |
import in.shop2020.model.v1.user.UserAffiliateException;
|
8 |
import in.shop2020.model.v1.user.UserAffiliateException;
|
| 16 |
import in.shop2020.payments.PaymentException;
|
9 |
import in.shop2020.payments.PaymentException;
|
| 17 |
import in.shop2020.serving.interceptors.TrackingInterceptor;
|
10 |
import in.shop2020.serving.interceptors.TrackingInterceptor;
|
| 18 |
import in.shop2020.serving.utils.DataLogger;
|
11 |
import in.shop2020.serving.utils.DataLogger;
|
| 19 |
import in.shop2020.serving.utils.FormattingUtils;
|
12 |
import in.shop2020.serving.utils.FormattingUtils;
|
| 20 |
import in.shop2020.serving.utils.DataLogger.Event;
|
- |
|
| 21 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
13 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
| 22 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
14 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
| 23 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
15 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| 24 |
|
16 |
|
| - |
|
17 |
import java.util.Date;
|
| - |
|
18 |
import java.util.List;
|
| - |
|
19 |
|
| - |
|
20 |
import org.apache.log4j.Logger;
|
| - |
|
21 |
import org.apache.struts2.convention.annotation.InterceptorRef;
|
| - |
|
22 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
| - |
|
23 |
import org.apache.thrift.TException;
|
| - |
|
24 |
|
| 25 |
|
25 |
|
| 26 |
@InterceptorRefs({
|
26 |
@InterceptorRefs({
|
| 27 |
@InterceptorRef("myDefault"),
|
27 |
@InterceptorRef("myDefault"),
|
| 28 |
@InterceptorRef("login")
|
28 |
@InterceptorRef("login")
|
| 29 |
})
|
29 |
})
|
| Line 91... |
Line 91... |
| 91 |
} catch (UserAffiliateException e) {
|
91 |
} catch (UserAffiliateException e) {
|
| 92 |
log.error("Affiliate service exception. Payment id is" + merchantPaymentId + " message id and name are " + e.getId() + e.getMessage());
|
92 |
log.error("Affiliate service exception. Payment id is" + merchantPaymentId + " message id and name are " + e.getId() + e.getMessage());
|
| 93 |
e.printStackTrace();
|
93 |
e.printStackTrace();
|
| 94 |
}
|
94 |
}
|
| 95 |
|
95 |
|
| 96 |
DataLogger.logData(Event.PAYMENT_SUCCESS.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), Long.toString(merchantPaymentId));
|
96 |
DataLogger.logData(EventType.PAYMENT_SUCCESS.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), Long.toString(merchantPaymentId));
|
| 97 |
|
97 |
|
| 98 |
return "index";
|
98 |
return "index";
|
| 99 |
}
|
99 |
}
|
| 100 |
|
100 |
|
| 101 |
public String formatPrice(double price) {
|
101 |
public String formatPrice(double price) {
|