| Line 8... |
Line 8... |
| 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.PaymentClient;
|
11 |
import in.shop2020.thrift.clients.PaymentClient;
|
| 12 |
import in.shop2020.thrift.clients.TransactionClient;
|
12 |
import in.shop2020.thrift.clients.TransactionClient;
|
| - |
|
13 |
import in.shop2020.utils.ModelUtils;
|
| 13 |
|
14 |
|
| 14 |
import java.text.SimpleDateFormat;
|
15 |
import java.text.SimpleDateFormat;
|
| 15 |
import java.util.ArrayList;
|
16 |
import java.util.ArrayList;
|
| 16 |
import java.util.Date;
|
17 |
import java.util.Date;
|
| 17 |
import java.util.HashMap;
|
18 |
import java.util.HashMap;
|
| Line 119... |
Line 120... |
| 119 |
|
120 |
|
| 120 |
private void setLineItems(List<LineItem> lineitems) {
|
121 |
private void setLineItems(List<LineItem> lineitems) {
|
| 121 |
lineItemsList = new ArrayList<Map<String,String>>();
|
122 |
lineItemsList = new ArrayList<Map<String,String>>();
|
| 122 |
for (LineItem lItem : lineitems) {
|
123 |
for (LineItem lItem : lineitems) {
|
| 123 |
Map<String, String> lineItemMap = new HashMap<String, String>();
|
124 |
Map<String, String> lineItemMap = new HashMap<String, String>();
|
| 124 |
StringBuilder productName = new StringBuilder();
|
- |
|
| 125 |
if (lItem.getBrand() != null && !lItem.getBrand().isEmpty()) {
|
- |
|
| 126 |
productName.append(lItem.getBrand() + " ");
|
- |
|
| 127 |
}
|
- |
|
| 128 |
if (lItem.getModel_name() != null && !lItem.getModel_name().isEmpty()) {
|
- |
|
| 129 |
productName.append(lItem.getModel_name() + " ");
|
- |
|
| 130 |
}
|
- |
|
| 131 |
if (lItem.getModel_number() != null && !lItem.getModel_number().isEmpty()) {
|
- |
|
| 132 |
productName.append(lItem.getModel_number() + " ");
|
- |
|
| 133 |
}
|
- |
|
| 134 |
lineItemMap.put("name", productName.toString());
|
125 |
lineItemMap.put("name", ModelUtils.extractProductNameFromLineItem(lItem));
|
| 135 |
lineItemMap.put("quantity", Double.toString(lItem.getQuantity()));
|
126 |
lineItemMap.put("quantity", Double.toString(lItem.getQuantity()));
|
| 136 |
lineItemMap.put("unit_price", Double.toString(lItem.getUnit_price()));
|
127 |
lineItemMap.put("unit_price", Double.toString(lItem.getUnit_price()));
|
| 137 |
lineItemMap.put("total_price", Double.toString(lItem.getTotal_price()));
|
128 |
lineItemMap.put("total_price", Double.toString(lItem.getTotal_price()));
|
| 138 |
lineItemsList.add(lineItemMap);
|
129 |
lineItemsList.add(lineItemMap);
|
| 139 |
}
|
130 |
}
|
| Line 172... |
Line 163... |
| 172 |
userOrder.put("invoiceno", order.getInvoice_number());
|
163 |
userOrder.put("invoiceno", order.getInvoice_number());
|
| 173 |
userOrder.put("receiver", order.getReceiver());
|
164 |
userOrder.put("receiver", order.getReceiver());
|
| 174 |
userOrder.put("status", order.getStatusDescription());
|
165 |
userOrder.put("status", order.getStatusDescription());
|
| 175 |
userOrder.put("trackingid", order.getTracking_id());
|
166 |
userOrder.put("trackingid", order.getTracking_id());
|
| 176 |
userOrder.put("amount", Double.toString(order.getTotal_amount()));
|
167 |
userOrder.put("amount", Double.toString(order.getTotal_amount()));
|
| 177 |
|
- |
|
| 178 |
StringBuilder address = new StringBuilder();
|
- |
|
| 179 |
if (order.getCustomer_address1() != null) {
|
- |
|
| 180 |
address.append(order.getCustomer_address1() + ", ");
|
- |
|
| 181 |
}
|
- |
|
| 182 |
if (order.getCustomer_address2() != null) {
|
- |
|
| 183 |
address.append(order.getCustomer_address2() + ", ");
|
- |
|
| 184 |
}
|
- |
|
| 185 |
if (order.getCustomer_city() != null) {
|
- |
|
| 186 |
address.append(order.getCustomer_city() + ", ");
|
- |
|
| 187 |
}
|
- |
|
| 188 |
if (order.getCustomer_state() != null) {
|
- |
|
| 189 |
address.append(order.getCustomer_state() + "-");
|
- |
|
| 190 |
}
|
- |
|
| 191 |
if (order.getCustomer_pincode() != null) {
|
- |
|
| 192 |
address.append(order.getCustomer_pincode());
|
- |
|
| 193 |
}
|
- |
|
| 194 |
userOrder.put("shipping", address.toString());
|
168 |
userOrder.put("shipping", ModelUtils.extractAddressFromOrder(order));
|
| 195 |
}
|
169 |
}
|
| 196 |
|
170 |
|
| 197 |
public String getPaymentMethod(List<Attribute> paymentAttributes) {
|
171 |
public String getPaymentMethod(List<Attribute> paymentAttributes) {
|
| 198 |
String paymentMethod = null;
|
172 |
String paymentMethod = null;
|
| 199 |
if(paymentAttributes == null || paymentAttributes.isEmpty()) {
|
173 |
if(paymentAttributes == null || paymentAttributes.isEmpty()) {
|