When an order is saved in the database or the status of an order is changed (i.e. through the callback of a payment gateway), KonaKart instantiates a class defined by the property ORDER_INTEGRATION_CLASS. If this property isn't set, the class that is instantiated is com.konakart.bl.OrderIntegrationMgr. If you write a custom class it must implement the interface com.konakart.bl.OrderIntegrationMgrInterface which contains two methods:
public void saveOrder(OrderIf order);
public void changeOrderStatus(int orderId,
int currentStatus,
int newStatus);
When an order is saved, the class is instantiated and the saveOrder() method is called with the order passed in as a parameter. The changeOrderStatus() method is called when the status is changed. The parameters supplied to the method are the orderId, the current status and the new status.
The state of an order may be changed manually through the Admin App. In this case KonaKart instantiates a class defined by the property ADMIN_ORDER_INTEGRATION_CLASS. If this property isn't set, the class that is instantiated is com.konakartadmin.bl.AdminOrderIntegrationMgr. If you write a custom class it must implement the interface com.konakartadmin.bl.AdminOrderIntegrationMgrInterface which contains the method:
public void changeOrderStatus(int orderId,
int currentStatus,
int newStatus);
This mechanism is a useful generic way to interface KonaKart to external systems since the custom classes could write data to a database, call a web service or write data to a file etc.
The ORDER_INTEGRATION_CLASS and ADMIN_ORDER_INTEGRATION_CLASS properties can be edited in the Configuration>>Stock and Orders section of the Admin App.