| Line 6... |
Line 6... |
| 6 |
import in.shop2020.payments.Constants;
|
6 |
import in.shop2020.payments.Constants;
|
| 7 |
import in.shop2020.payments.Payment;
|
7 |
import in.shop2020.payments.Payment;
|
| 8 |
import in.shop2020.payments.PaymentException;
|
8 |
import in.shop2020.payments.PaymentException;
|
| 9 |
import in.shop2020.serving.model.ShipmentUpdate;
|
9 |
import in.shop2020.serving.model.ShipmentUpdate;
|
| 10 |
import in.shop2020.serving.services.BlueDartTrackingService;
|
10 |
import in.shop2020.serving.services.BlueDartTrackingService;
|
| 11 |
import in.shop2020.thrift.clients.PaymentServiceClient;
|
11 |
import in.shop2020.thrift.clients.PaymentClient;
|
| 12 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
12 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 13 |
|
13 |
|
| 14 |
import java.text.SimpleDateFormat;
|
14 |
import java.text.SimpleDateFormat;
|
| 15 |
import java.util.ArrayList;
|
15 |
import java.util.ArrayList;
|
| 16 |
import java.util.Date;
|
16 |
import java.util.Date;
|
| 17 |
import java.util.HashMap;
|
17 |
import java.util.HashMap;
|
| Line 42... |
Line 42... |
| 42 |
public UserOrderInfoController(){
|
42 |
public UserOrderInfoController(){
|
| 43 |
super();
|
43 |
super();
|
| 44 |
}
|
44 |
}
|
| 45 |
|
45 |
|
| 46 |
public String index() throws Exception {
|
46 |
public String index() throws Exception {
|
| 47 |
PaymentServiceClient paymentServiceClient = new PaymentServiceClient();
|
47 |
PaymentClient paymentServiceClient = new PaymentClient();
|
| 48 |
TransactionServiceClient transactionServiceClient = new TransactionServiceClient();
|
48 |
TransactionClient transactionServiceClient = new TransactionClient();
|
| 49 |
|
49 |
|
| 50 |
Order order = null;
|
50 |
Order order = null;
|
| 51 |
try {
|
51 |
try {
|
| 52 |
order = transactionServiceClient.getClient().getOrderForCustomer(orderId, userId);
|
52 |
order = transactionServiceClient.getClient().getOrderForCustomer(orderId, userId);
|
| 53 |
}
|
53 |
}
|
| Line 68... |
Line 68... |
| 68 |
|
68 |
|
| 69 |
shipmentUpdates = blueDartTrackingService.getUpdates(order.getAirwaybill_no());
|
69 |
shipmentUpdates = blueDartTrackingService.getUpdates(order.getAirwaybill_no());
|
| 70 |
return "index";
|
70 |
return "index";
|
| 71 |
}
|
71 |
}
|
| 72 |
|
72 |
|
| 73 |
private void setPayments(List<Payment> payments, SimpleDateFormat sdf, PaymentServiceClient paymentServiceClient) throws PaymentException, TException {
|
73 |
private void setPayments(List<Payment> payments, SimpleDateFormat sdf, PaymentClient paymentServiceClient) throws PaymentException, TException {
|
| 74 |
paymentsList = new ArrayList<Map<String,String>>();
|
74 |
paymentsList = new ArrayList<Map<String,String>>();
|
| 75 |
for (Payment payment : payments) {
|
75 |
for (Payment payment : payments) {
|
| 76 |
Map<String,String> paymentMap = new HashMap<String, String>();
|
76 |
Map<String,String> paymentMap = new HashMap<String, String>();
|
| 77 |
if (payment.getAuthCode() != null && !payment.getAuthCode().isEmpty()) {
|
77 |
if (payment.getAuthCode() != null && !payment.getAuthCode().isEmpty()) {
|
| 78 |
paymentMap.put("authcode", payment.getAuthCode());
|
78 |
paymentMap.put("authcode", payment.getAuthCode());
|