| Line 1... |
Line 1... |
| 1 |
package in.shop2020.serving.controllers;
|
1 |
package in.shop2020.serving.controllers;
|
| 2 |
|
2 |
|
| 3 |
import java.io.IOException;
|
- |
|
| 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.payments.PaymentException;
|
6 |
import in.shop2020.payments.PaymentException;
|
| 14 |
import in.shop2020.serving.utils.DataLogger;
|
7 |
import in.shop2020.serving.utils.DataLogger;
|
| 15 |
import in.shop2020.serving.utils.DataLogger.Event;
|
- |
|
| 16 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
8 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
| 17 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
9 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
| 18 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
10 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| 19 |
|
11 |
|
| - |
|
12 |
import java.io.IOException;
|
| - |
|
13 |
import java.util.List;
|
| - |
|
14 |
|
| - |
|
15 |
import org.apache.log4j.Logger;
|
| - |
|
16 |
import org.apache.struts2.convention.annotation.InterceptorRef;
|
| - |
|
17 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
| - |
|
18 |
import org.apache.thrift.TException;
|
| - |
|
19 |
|
| 20 |
@InterceptorRefs({
|
20 |
@InterceptorRefs({
|
| 21 |
@InterceptorRef("myDefault"),
|
21 |
@InterceptorRef("myDefault"),
|
| 22 |
@InterceptorRef("login")
|
22 |
@InterceptorRef("login")
|
| 23 |
})
|
23 |
})
|
| 24 |
|
24 |
|
| Line 46... |
Line 46... |
| 46 |
|
46 |
|
| 47 |
public String index() throws IOException, SecurityException, PaymentException, TException, TransactionServiceException{
|
47 |
public String index() throws IOException, SecurityException, PaymentException, TException, TransactionServiceException{
|
| 48 |
this.message = "Payment failed at the payment gateway. Please pay again.";
|
48 |
this.message = "Payment failed at the payment gateway. Please pay again.";
|
| 49 |
|
49 |
|
| 50 |
merchantPaymentId = Long.parseLong(this.request.getParameter("paymentId"));
|
50 |
merchantPaymentId = Long.parseLong(this.request.getParameter("paymentId"));
|
| 51 |
DataLogger.logData(Event.PAYMENT_SUCCESS.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), Long.toString(merchantPaymentId));
|
51 |
DataLogger.logData(EventType.PAYMENT_FAILURE.name(), session.getId(), Long.toString(userinfo.getUserId()), userinfo.getEmail(), Long.toString(merchantPaymentId));
|
| 52 |
return "index";
|
52 |
return "index";
|
| 53 |
}
|
53 |
}
|
| 54 |
|
54 |
|
| 55 |
|
55 |
|
| 56 |
public String getMessage(){
|
56 |
public String getMessage(){
|