| Line 6... |
Line 6... |
| 6 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
6 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
| 7 |
import in.shop2020.model.v1.catalog.Item;
|
7 |
import in.shop2020.model.v1.catalog.Item;
|
| 8 |
import in.shop2020.model.v1.order.LineItem;
|
8 |
import in.shop2020.model.v1.order.LineItem;
|
| 9 |
import in.shop2020.model.v1.order.Order;
|
9 |
import in.shop2020.model.v1.order.Order;
|
| 10 |
import in.shop2020.model.v1.order.OrderStatus;
|
10 |
import in.shop2020.model.v1.order.OrderStatus;
|
| - |
|
11 |
import in.shop2020.model.v1.order.OrderType;
|
| 11 |
import in.shop2020.model.v1.order.Transaction;
|
12 |
import in.shop2020.model.v1.order.Transaction;
|
| 12 |
import in.shop2020.model.v1.order.TransactionService.Client;
|
13 |
import in.shop2020.model.v1.order.TransactionService.Client;
|
| 13 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
14 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| 14 |
import in.shop2020.model.v1.order.TransactionStatus;
|
15 |
import in.shop2020.model.v1.order.TransactionStatus;
|
| - |
|
16 |
//import in.shop2020.model.v1.order.Attribute;
|
| - |
|
17 |
import in.shop2020.logistics.PickUpType;
|
| 15 |
import in.shop2020.model.v1.user.Address;
|
18 |
import in.shop2020.model.v1.user.Address;
|
| 16 |
import in.shop2020.model.v1.user.User;
|
19 |
import in.shop2020.model.v1.user.User;
|
| 17 |
import in.shop2020.model.v1.user.UserContextException;
|
20 |
import in.shop2020.model.v1.user.UserContextException;
|
| 18 |
import in.shop2020.payments.Attribute;
|
21 |
import in.shop2020.payments.Attribute;
|
| 19 |
import in.shop2020.payments.Payment;
|
22 |
import in.shop2020.payments.Payment;
|
| Line 65... |
Line 68... |
| 65 |
private String rtgsBranch;
|
68 |
private String rtgsBranch;
|
| 66 |
private String ifscCode;
|
69 |
private String ifscCode;
|
| 67 |
private String amount;
|
70 |
private String amount;
|
| 68 |
private String itemId;
|
71 |
private String itemId;
|
| 69 |
private String output;
|
72 |
private String output;
|
| 70 |
private String selfPickup;
|
73 |
private String pickUp;
|
| - |
|
74 |
private String orderType;
|
| - |
|
75 |
private String tinNumber;
|
| 71 |
private Transaction transaction;
|
76 |
private Transaction transaction;
|
| 72 |
private Payment payment;
|
77 |
private Payment payment;
|
| 73 |
|
78 |
|
| 74 |
private Map<Transaction, Double> transactions;
|
79 |
private Map<Transaction, Double> transactions;
|
| 75 |
private List<LineItem> lineItems;
|
80 |
private List<LineItem> lineItems;
|
| Line 156... |
Line 161... |
| 156 |
if (user == null) {
|
161 |
if (user == null) {
|
| 157 |
addActionError("Could not find user by email: " + customerEmailId);
|
162 |
addActionError("Could not find user by email: " + customerEmailId);
|
| 158 |
hasError = true;
|
163 |
hasError = true;
|
| 159 |
}
|
164 |
}
|
| 160 |
else {
|
165 |
else {
|
| - |
|
166 |
/*
|
| 161 |
boolean selfPickupFlag = false;
|
167 |
boolean selfPickupFlag = false;
|
| 162 |
if(selfPickup.equals("on")){
|
168 |
if(selfPickup.equals("on")){
|
| 163 |
selfPickupFlag = true;
|
169 |
selfPickupFlag = true;
|
| 164 |
}
|
170 |
}
|
| - |
|
171 |
*/
|
| 165 |
transactionId = String.valueOf(createTransaction(user));
|
172 |
transactionId = String.valueOf(createTransaction(user));
|
| 166 |
createPayment(user);
|
173 |
createPayment(user);
|
| - |
|
174 |
|
| - |
|
175 |
in.shop2020.model.v1.order.Attribute orderAttribute = new in.shop2020.model.v1.order.Attribute();
|
| - |
|
176 |
orderAttribute.setName("tinNumber");
|
| - |
|
177 |
orderAttribute.setValue(tinNumber);
|
| 167 |
|
178 |
|
| 168 |
Client transactionClient = new TransactionClient().getClient();
|
179 |
Client transactionClient = new TransactionClient().getClient();
|
| - |
|
180 |
if(!tinNumber.equals("") && !(tinNumber == null)) {
|
| - |
|
181 |
transactionClient.setOrderAttributeForTransaction(Long.parseLong(transactionId), orderAttribute);
|
| - |
|
182 |
}
|
| 169 |
transactionClient.changeTransactionStatus(Long.valueOf(transactionId), TransactionStatus.AUTHORIZED, "Payment received for the order", selfPickupFlag);
|
183 |
transactionClient.changeTransactionStatus(Long.valueOf(transactionId), TransactionStatus.AUTHORIZED, "Payment received for the order", PickUpType.valueOf(pickUp).getValue(), OrderType.valueOf(orderType));
|
| 170 |
transactionClient.changeTransactionStatus(Long.valueOf(transactionId), TransactionStatus.IN_PROCESS, "RTGS Payment accepted", selfPickupFlag);
|
184 |
transactionClient.changeTransactionStatus(Long.valueOf(transactionId), TransactionStatus.IN_PROCESS, "RTGS Payment accepted", PickUpType.valueOf(pickUp).getValue(), OrderType.valueOf(orderType));
|
| 171 |
log.info("Successfully created transaction: " + transactionId + " for amount: " + amount);
|
185 |
log.info("Successfully created transaction: " + transactionId + " for amount: " + amount);
|
| 172 |
}
|
186 |
}
|
| 173 |
} catch (UserContextException e) {
|
187 |
} catch (UserContextException e) {
|
| 174 |
addActionError("Error while finding customer: " + customerEmailId);
|
188 |
addActionError("Error while finding customer: " + customerEmailId);
|
| 175 |
log.error("Could not fetch user for email Id: " + customerEmailId, e);
|
189 |
log.error("Could not fetch user for email Id: " + customerEmailId, e);
|
| Line 434... |
Line 448... |
| 434 |
|
448 |
|
| 435 |
public void setOutput(String output) {
|
449 |
public void setOutput(String output) {
|
| 436 |
this.output = output;
|
450 |
this.output = output;
|
| 437 |
}
|
451 |
}
|
| 438 |
|
452 |
|
| - |
|
453 |
public String getPickUp() {
|
| - |
|
454 |
return pickUp;
|
| - |
|
455 |
}
|
| - |
|
456 |
|
| 439 |
public void setSelfPickup(String selfPickup) {
|
457 |
public void setPickUp(String pickUp) {
|
| 440 |
this.selfPickup = selfPickup;
|
458 |
this.pickUp = pickUp;
|
| - |
|
459 |
}
|
| - |
|
460 |
|
| - |
|
461 |
public String getOrderType() {
|
| - |
|
462 |
return orderType;
|
| - |
|
463 |
}
|
| 441 |
}
|
464 |
|
| - |
|
465 |
public void setOrderType(String orderType) {
|
| - |
|
466 |
this.orderType = orderType;
|
| - |
|
467 |
}
|
| 442 |
|
468 |
|
| 443 |
public String getSelfPickup() {
|
469 |
public String getTinNumber() {
|
| 444 |
return selfPickup;
|
470 |
return tinNumber;
|
| - |
|
471 |
}
|
| 445 |
}
|
472 |
|
| - |
|
473 |
public void setTinNumber(String tinNumber) {
|
| - |
|
474 |
this.tinNumber = tinNumber;
|
| - |
|
475 |
}
|
| 446 |
}
|
476 |
}
|