Hi all-
We recently found that if a cart totalled zero dollars that we were still going through the CC processing step. I added this code to the CheckoutConfirmationSubmitAction class to handle this case. I'm just posting this here in case anyone else has the same issue.
OrderIf checkoutOrder = kkAppEng.getOrderMgr().getCheckoutOrder();
if (checkoutOrder == null || checkoutOrder.getStatusTrail() == null)
{
return mapping.findForward("CheckoutDelivery");
}
---------------- BEGIN NEW CODE --------------------
BigDecimal orderTotal = checkoutOrder.getTotalIncTax();
if (orderTotal.compareTo(java.math.BigDecimal.ZERO) == 0) {
// Set the order status
checkoutOrder.setStatus(com.konakart.bl.OrderMgr.PAYMENT_RECEIVED_STATUS);
// Save the order
int orderId = kkAppEng.getOrderMgr().saveOrder(/* sendEmail */true);
OrderIntegrationMgr oim = new OrderIntegrationMgr();
oim.manageDigitalDownloads(orderId);
// Update the inventory
kkAppEng.getOrderMgr().updateInventory(orderId);
// If we received no exceptions, delete the basket
kkAppEng.getBasketMgr().emptyBasket();
return mapping.findForward("CheckoutFinished");
}
------- END NEW CODE -------------
int paymentType = kkAppEng.getOrderMgr().getPaymentType();
We recently found that if a cart totalled zero dollars that we were still going through the CC processing step. I added this code to the CheckoutConfirmationSubmitAction class to handle this case. I'm just posting this here in case anyone else has the same issue.
OrderIf checkoutOrder = kkAppEng.getOrderMgr().getCheckoutOrder();
if (checkoutOrder == null || checkoutOrder.getStatusTrail() == null)
{
return mapping.findForward("CheckoutDelivery");
}
---------------- BEGIN NEW CODE --------------------
BigDecimal orderTotal = checkoutOrder.getTotalIncTax();
if (orderTotal.compareTo(java.math.BigDecimal.ZERO) == 0) {
// Set the order status
checkoutOrder.setStatus(com.konakart.bl.OrderMgr.PAYMENT_RECEIVED_STATUS);
// Save the order
int orderId = kkAppEng.getOrderMgr().saveOrder(/* sendEmail */true);
OrderIntegrationMgr oim = new OrderIntegrationMgr();
oim.manageDigitalDownloads(orderId);
// Update the inventory
kkAppEng.getOrderMgr().updateInventory(orderId);
// If we received no exceptions, delete the basket
kkAppEng.getBasketMgr().emptyBasket();
return mapping.findForward("CheckoutFinished");
}
------- END NEW CODE -------------
int paymentType = kkAppEng.getOrderMgr().getPaymentType();