• Welcome to KonaKart Community Forum. Please login or sign up.
 

Writing to database from OrderMgr

Started by lrkwz, November 19, 2009, 08:18:21 am

Previous topic - Next topic

lrkwz

Hello,
   I'll like to copy some order info to a custom table when the order state changes to "payment received". I though the right places are:
   

package com.konakartadmin.bl;

public class AdminMyOrderIntegrationMgr extends AdminOrderIntegrationMgr {

   public void changeOrderStatus(int orderId, int currentStatus, int newStatus){
       AdminOrder o = getAdminEng().getOrderForOrderId( ??????, orderId);
...
}

to catch the order when the state has been changed by an administrator

and


package com.konakart.bl;

public class ArceseOrderIntegrationMgr extends OrderIntegrationMgr {
   
   public void changeOrderStatus(int orderId, int currentStatus, int newStatus){
OrderIf o = getEng().getOrder(??????, orderId, 1);
...
}


to catch the order when the state has been changed by a payment gateway callback .

BUT how do I get an Order having only it's ID? KKEngIf.getOrder() needs the session id of the logged user how do I find it?

Is there a better technique?

Thank you

julie

Take a look at the source code of the OrderIntegrationManager for examples:

\KonaKart\custom\appn\src\com\konakart\bl\OrderIntegrationMgr.java

lrkwz