| Line 155... |
Line 155... |
| 155 |
totalAmount = li.getUnit_price() * li.getQuantity();
|
155 |
totalAmount = li.getUnit_price() * li.getQuantity();
|
| 156 |
}
|
156 |
}
|
| 157 |
if (totalAmount > walletAmount) {
|
157 |
if (totalAmount > walletAmount) {
|
| 158 |
addActionError("Total Amount not be greater than wallet amount");
|
158 |
addActionError("Total Amount not be greater than wallet amount");
|
| 159 |
} else if (!this.userClient.addItemPricingToCart(user.getActiveCartId(), ipqList)) {
|
159 |
} else if (!this.userClient.addItemPricingToCart(user.getActiveCartId(), ipqList)) {
|
| - |
|
160 |
addActionError("Failed to add pricing to cart, please try again");
|
| - |
|
161 |
} else if (user.getDefaultAddressId() == 0) {
|
| 160 |
addActionError("Total Amount not be greater than wallet amount");
|
162 |
addActionError("Please make sure default address is set");
|
| 161 |
} else {
|
163 |
} else {
|
| 162 |
log.info("Setting wallet amount in cart");
|
164 |
log.info("Setting wallet amount in cart");
|
| - |
|
165 |
this.userClient.addAddressToCart(user.getActiveCartId(), user.getDefaultAddressId());
|
| 163 |
this.userClient.setWalletAmountInCart(user.getActiveCartId(), walletAmount);
|
166 |
this.userClient.setWalletAmountInCart(user.getActiveCartId(), totalAmount);
|
| 164 |
transactionId = String.valueOf(this.userClient.createOrders(user.getActiveCartId(), "", 0, "", 0, user.getUserId(), 7890,
|
167 |
transactionId = String.valueOf(this.userClient.createOrders(user.getActiveCartId(), "", 0, "", 0, user.getUserId(), 7890,
|
| 165 |
OrderSource.WEBSITE.getValue(), true));
|
168 |
OrderSource.WEBSITE.getValue(), true));
|
| 166 |
log.info("Creating wallet payment for transactionId - " + transactionId);
|
169 |
log.info("Creating wallet payment for transactionId - " + transactionId);
|
| 167 |
createPayment(user);
|
170 |
createPayment(user);
|
| 168 |
|
171 |
|