| Line 11... |
Line 11... |
| 11 |
import in.shop2020.model.v1.user.UserContextException;
|
11 |
import in.shop2020.model.v1.user.UserContextException;
|
| 12 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
12 |
import in.shop2020.model.v1.user.UserContextService.Client;
|
| 13 |
import in.shop2020.payments.Payment;
|
13 |
import in.shop2020.payments.Payment;
|
| 14 |
import in.shop2020.payments.PaymentException;
|
14 |
import in.shop2020.payments.PaymentException;
|
| 15 |
import in.shop2020.support.utils.ReportsUtils;
|
15 |
import in.shop2020.support.utils.ReportsUtils;
|
| 16 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
16 |
import in.shop2020.thrift.clients.PaymentClient;
|
| 17 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
17 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 18 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
18 |
import in.shop2020.thrift.clients.UserClient;
|
| 19 |
|
19 |
|
| 20 |
import java.io.ByteArrayOutputStream;
|
20 |
import java.io.ByteArrayOutputStream;
|
| 21 |
import java.io.IOException;
|
21 |
import java.io.IOException;
|
| 22 |
import java.text.ParseException;
|
- |
|
| 23 |
import java.util.Collections;
|
22 |
import java.util.Collections;
|
| 24 |
import java.util.Date;
|
23 |
import java.util.Date;
|
| 25 |
import java.util.HashMap;
|
24 |
import java.util.HashMap;
|
| 26 |
import java.util.List;
|
25 |
import java.util.List;
|
| 27 |
import java.util.Map;
|
26 |
import java.util.Map;
|
| Line 80... |
Line 79... |
| 80 |
try {
|
79 |
try {
|
| 81 |
//Formatting Form input parameters
|
80 |
//Formatting Form input parameters
|
| 82 |
String email = request.getParameter("email");
|
81 |
String email = request.getParameter("email");
|
| 83 |
String orderid = request.getParameter("orderid");
|
82 |
String orderid = request.getParameter("orderid");
|
| 84 |
|
83 |
|
| 85 |
TransactionServiceClient transactionServiceClient = new TransactionServiceClient();
|
84 |
TransactionClient transactionServiceClient = new TransactionClient();
|
| 86 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient = transactionServiceClient.getClient();
|
85 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient = transactionServiceClient.getClient();
|
| 87 |
|
86 |
|
| 88 |
UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
|
87 |
UserClient userContextServiceClient = new UserClient();
|
| 89 |
Client userClient = userContextServiceClient.getClient();
|
88 |
Client userClient = userContextServiceClient.getClient();
|
| 90 |
|
89 |
|
| 91 |
PaymentServiceClient paymentServiceClient = new PaymentServiceClient();
|
90 |
PaymentClient paymentServiceClient = new PaymentClient();
|
| 92 |
in.shop2020.payments.PaymentService.Client paymentClient = paymentServiceClient.getClient();
|
91 |
in.shop2020.payments.PaymentService.Client paymentClient = paymentServiceClient.getClient();
|
| 93 |
|
92 |
|
| 94 |
User user = null;
|
93 |
User user = null;
|
| 95 |
if (email != null && !email.isEmpty()) {
|
94 |
if (email != null && !email.isEmpty()) {
|
| 96 |
user = userClient.getUserByEmail(email);
|
95 |
user = userClient.getUserByEmail(email);
|
| Line 144... |
Line 143... |
| 144 |
} catch (IOException e) {
|
143 |
} catch (IOException e) {
|
| 145 |
errorMsg = "Failed to write to response.";
|
144 |
errorMsg = "Failed to write to response.";
|
| 146 |
logger.error("Error streaming the user orders report", e);
|
145 |
logger.error("Error streaming the user orders report", e);
|
| 147 |
}
|
146 |
}
|
| 148 |
|
147 |
|
| 149 |
} catch (ParseException e) {
|
- |
|
| 150 |
errorMsg = e.getMessage();
|
- |
|
| 151 |
logger.error("Unexpected parse exception", e);
|
- |
|
| 152 |
} catch (TransactionServiceException e) {
|
148 |
} catch (TransactionServiceException e) {
|
| 153 |
errorMsg = e.getMessage();
|
149 |
errorMsg = e.getMessage();
|
| 154 |
logger.error("Error retrieving info from transaction service", e);
|
150 |
logger.error("Error retrieving info from transaction service", e);
|
| 155 |
} catch (UserContextException e) {
|
151 |
} catch (UserContextException e) {
|
| 156 |
errorMsg = e.getMessage();
|
152 |
errorMsg = e.getMessage();
|
| 157 |
logger.error("Error retrieving info from user service", e);
|
153 |
logger.error("Error retrieving info from user service", e);
|