| Line 21... |
Line 21... |
| 21 |
import in.shop2020.payments.PaymentException;
|
21 |
import in.shop2020.payments.PaymentException;
|
| 22 |
import in.shop2020.serving.controllers.BaseController;
|
22 |
import in.shop2020.serving.controllers.BaseController;
|
| 23 |
import in.shop2020.serving.pages.PageContentKeys;
|
23 |
import in.shop2020.serving.pages.PageContentKeys;
|
| 24 |
import in.shop2020.serving.pages.PageEnum;
|
24 |
import in.shop2020.serving.pages.PageEnum;
|
| 25 |
import in.shop2020.serving.pages.PageManager;
|
25 |
import in.shop2020.serving.pages.PageManager;
|
| - |
|
26 |
import in.shop2020.serving.services.PageLoaderHandler;
|
| 26 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
27 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
| 27 |
import in.shop2020.thrift.clients.LogisticsServiceClient;
|
28 |
import in.shop2020.thrift.clients.LogisticsServiceClient;
|
| 28 |
import in.shop2020.thrift.clients.ShoppingCartClient;
|
29 |
import in.shop2020.thrift.clients.ShoppingCartClient;
|
| 29 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
30 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
| 30 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
31 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| Line 147... |
Line 148... |
| 147 |
Transaction t = getTransaction();
|
148 |
Transaction t = getTransaction();
|
| 148 |
TransactionServiceClient tsc = new TransactionServiceClient();
|
149 |
TransactionServiceClient tsc = new TransactionServiceClient();
|
| 149 |
long transaction_id = tsc.getClient().createTransaction(t);
|
150 |
long transaction_id = tsc.getClient().createTransaction(t);
|
| 150 |
|
151 |
|
| 151 |
List<Order> orders = tsc.getClient().getOrdersForTransaction(transaction_id);
|
152 |
List<Order> orders = tsc.getClient().getOrdersForTransaction(transaction_id);
|
| 152 |
this.message = "Your transaction id is "+ transaction_id + " and orderids are: ";
|
153 |
this.message = "Your order numbers are as below:";
|
| - |
|
154 |
|
| 153 |
for(Order order: orders){
|
155 |
for(Order order: orders){
|
| 154 |
this.message = this.message + " <br> order: " + order.getId();
|
156 |
this.message = this.message + "<br> <a href=\"./order/" + order.getId() + "\">" + order.getId() + "</a>";
|
| 155 |
}
|
157 |
}
|
| 156 |
|
158 |
|
| 157 |
|
159 |
|
| 158 |
cl.getClient().commitCart(userinfo.getCartId());
|
160 |
cl.getClient().commitCart(userinfo.getCartId());
|
| 159 |
|
161 |
|
| 160 |
userinfo.setCartId(-1);
|
162 |
userinfo.setCartId(-1);
|
| 161 |
userinfo.setTotalItems(0);
|
163 |
userinfo.setTotalItems(0);
|
| 162 |
this.session.setAttribute("userinfo", userinfo);
|
164 |
this.session.setAttribute("userinfo", userinfo);
|
| 163 |
|
165 |
|
| - |
|
166 |
PageLoaderHandler pageLoader = new PageLoaderHandler();
|
| - |
|
167 |
htmlSnippets = new HashMap<String, String>();
|
| - |
|
168 |
htmlSnippets.put("HEADER", pageLoader.getHeaderHtml(userinfo.getUserId(), userinfo.isSessionId(), userinfo.getNameOfUser()));
|
| - |
|
169 |
htmlSnippets.put("MAIN_MENU", pageLoader.getMainMenuHtml());
|
| - |
|
170 |
htmlSnippets.put("SEARCH_BAR", pageLoader.getSearchBarHtml(userinfo.getTotalItems(), 10000));
|
| - |
|
171 |
htmlSnippets.put("CUSTOMER_SERVICE", pageLoader.getCustomerServiceHtml());
|
| - |
|
172 |
htmlSnippets.put("FOOTER",pageLoader.getFooterHtml());
|
| - |
|
173 |
|
| 164 |
return "success";
|
174 |
return "success";
|
| 165 |
}
|
175 |
}
|
| 166 |
|
176 |
|
| 167 |
public String getMessage(){
|
177 |
public String getMessage(){
|
| 168 |
return this.message;
|
178 |
return this.message;
|