com.konakart.blif
Interface OrderMgrIf

All Known Implementing Classes:
OrderMgr

public interface OrderMgrIf

OrderMgrIf Interface which an implementation of this manager must adhere to.


Method Summary
 Order changeDeliveryAddress(java.lang.String sessionId, OrderIf order, AddressIf deliveryAddress)
          The current delivery address is substituted with the new one.
 void changeOrderStatus(int orderId, int status, boolean customerNotified, java.lang.String comments)
          The state of the current order id changed and an orders_status_history record is added to the order to keep track of the change.
 void changeOrderStatus(java.lang.String sessionId, int orderId, int status, boolean customerNotified, java.lang.String comments)
          The state of the current order id changed and an orders_status_history record is added to the order to keep track of the change.
 Order createAndSaveOrder(java.lang.String emailAddr, java.lang.String password, CustomerRegistrationIf custReg, BasketIf[] basketItemArray, java.lang.String shippingModule, java.lang.String paymentModule, int languageId)
           
 Order createOrder(java.lang.String sessionId, BasketIf[] basketItemArray, int languageId)
          An order object is returned with all addresses populated with the default address of the customer referenced by the session Id.
 Order createOrderWithOptions(java.lang.String sessionId, BasketIf[] basketItemArray, CreateOrderOptionsIf options, int languageId)
          An order object is returned with all addresses populated with the default address of the customer referenced by the session Id.
 void deleteOrderIdForSecretKey(java.lang.String secretKey)
          The order id stored in the database and indexed by the secretKey, is deleted
 OrderStatus[] getAllOrderStatuses(int languageId)
          Returns an array of Order Status objects for a given language
 IpnHistory[] getIpnHistory(int orderId)
          Retrieve an array of IpnHistory objects for an order.
 IpnHistory[] getIpnHistory(java.lang.String sessionId, int orderId)
          Retrieve an array of IpnHistory objects for an order.
 Order getOrder(java.lang.String sessionId, int orderId, int languageId)
          Retrieve an order for the customer referenced by the sessionId.
 Order getOrderForOrderId(int orderId, int languageId)
          Retrieve an order for an orderId.
 int getOrderIdFromSecretKey(java.lang.String secretKey)
          The order id stored in the database and indexed by the secretKey, is returned
 Orders getOrdersPerCustomer(DataDescriptorIf dataDesc, java.lang.String sessionId, int languageId)
          Retrieve a number of orders for the customer referenced by the sessionId.
 int getOrderStatus(java.lang.String sessionId, int orderId)
          Get the order status for an order.
 java.lang.String getSecretKeyForOrderId(int orderId)
          Every time we send a notification to a payment gateway, we get a new secret key for the order, which is sent back to us in the reply.
 java.lang.String getStatusText(int statusId, int languageId)
          Returns the text of a status from the orders_status table
 TaxRate[] getTaxRateObjectsPerOrder(Order order)
          Returns a list of TaxRate objects used by this order.
 int saveIpnHistory(java.lang.String sessionId, IpnHistoryIf ipnHistory)
          The IpnHistory object is saved in the database.
 int saveOrder(java.lang.String sessionId, OrderIf order, int languageId)
          A new order is created in the DB.
 Orders searchForOrdersPerCustomer(java.lang.String sessionId, DataDescriptorIf dataDesc, OrderSearchIf orderSearch, int languageId)
          Return orders matching the search criteria.
 void setCreditCardDetailsOnOrder(java.lang.String sessionId, int orderId, CreditCardIf card)
          The credit card details in the CreditCard object passed in as a parameter, are saved in the database for an existing order.
 void setRewardPointReservationId(int customerId, int orderId, int reservationId)
          Verifies that the order belongs to the customer identified by the customerId parameter and then updates the reservation id.
 void setRewardPointReservationId(java.lang.String sessionId, int orderId, int reservationId)
          Verifies that the order belongs to the customer identified by the sessionId parameter and then updates the reservation id.
 void updateInventory(java.lang.String sessionId, int orderId)
          If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders.
 void updateInventoryWithOptions(java.lang.String sessionId, int orderId, CreateOrderOptionsIf options)
          If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders.
 

Method Detail

saveOrder

int saveOrder(java.lang.String sessionId,
              OrderIf order,
              int languageId)
              throws java.lang.Exception
A new order is created in the DB. The Order object parameter should have all addresses populated (customer, billing and delivery). The status of the newly created order is taken from th eorder itself. A check is made to determine whether the status exists within the orders_status table. To save an order we have to write into a few DB tables: orders, orders_products, orders_products_attributes, orders_total, orders_status_history. We do this in a single transaction.

Parameters:
sessionId -
order -
languageId -
Returns:
The id of the new order
Throws:
java.lang.Exception

createOrder

Order createOrder(java.lang.String sessionId,
                  BasketIf[] basketItemArray,
                  int languageId)
                  throws java.lang.Exception
An order object is returned with all addresses populated with the default address of the customer referenced by the session Id. The products being ordered are retrieved from the basketItemArray. The returned object has not been saved in the DB.

Parameters:
sessionId -
basketItemArray -
languageId -
Returns:
Order object
Throws:
java.lang.Exception

createOrderWithOptions

Order createOrderWithOptions(java.lang.String sessionId,
                             BasketIf[] basketItemArray,
                             CreateOrderOptionsIf options,
                             int languageId)
                             throws java.lang.Exception
An order object is returned with all addresses populated with the default address of the customer referenced by the session Id. The products being ordered are retrieved from the basketItemArray. The returned object has not been saved in the DB.
If the options parameter is set to null, the functionality is identical to createOrder(), otherwise the option parameters are used to determine the additional functionality.

Parameters:
sessionId -
basketItemArray -
options -
languageId -
Returns:
Order object
Throws:
java.lang.Exception

changeDeliveryAddress

Order changeDeliveryAddress(java.lang.String sessionId,
                            OrderIf order,
                            AddressIf deliveryAddress)
                            throws java.lang.Exception
The current delivery address is substituted with the new one. If the country and zone have changed, then we need to work out the new tax for the order products

Parameters:
sessionId -
order -
deliveryAddress -
Returns:
New Order
Throws:
java.lang.Exception

getTaxRateObjectsPerOrder

TaxRate[] getTaxRateObjectsPerOrder(Order order)
                                    throws java.lang.Exception
Returns a list of TaxRate objects used by this order. A tax rate object is added to the list if it is used to add tax to a product or to the shipping.

Parameters:
order -
Returns:
Returns an array of TaxRate objects used by this order
Throws:
java.lang.Exception

getOrdersPerCustomer

Orders getOrdersPerCustomer(DataDescriptorIf dataDesc,
                            java.lang.String sessionId,
                            int languageId)
                            throws java.lang.Exception
Retrieve a number of orders for the customer referenced by the sessionId. The orders are always returned sorted by date (most recent orders first). The DataDescriptor is used to retrieve offset and limit information. If null, the offset defaults to 0 and a default limit is used.

Parameters:
dataDesc -
sessionId -
languageId -
Returns:
An Orders object
Throws:
java.lang.Exception

getOrder

Order getOrder(java.lang.String sessionId,
               int orderId,
               int languageId)
               throws java.lang.Exception
Retrieve an order for the customer referenced by the sessionId.

Parameters:
sessionId -
orderId -
languageId -
Returns:
An Order object
Throws:
java.lang.Exception

getOrderForOrderId

Order getOrderForOrderId(int orderId,
                         int languageId)
                         throws java.lang.Exception
Retrieve an order for an orderId.

Parameters:
orderId -
languageId -
Returns:
An Order object
Throws:
java.lang.Exception

getStatusText

java.lang.String getStatusText(int statusId,
                               int languageId)
                               throws java.lang.Exception
Returns the text of a status from the orders_status table

Parameters:
statusId -
languageId -
Returns:
Returns the text of the status. Null if not found.
Throws:
java.lang.Exception

changeOrderStatus

void changeOrderStatus(java.lang.String sessionId,
                       int orderId,
                       int status,
                       boolean customerNotified,
                       java.lang.String comments)
                       throws java.lang.Exception
The state of the current order id changed and an orders_status_history record is added to the order to keep track of the change.

Parameters:
sessionId -
orderId -
status -
customerNotified - Has the customer been notified
comments -
Throws:
java.lang.Exception

changeOrderStatus

void changeOrderStatus(int orderId,
                       int status,
                       boolean customerNotified,
                       java.lang.String comments)
                       throws java.lang.Exception
The state of the current order id changed and an orders_status_history record is added to the order to keep track of the change.

Parameters:
orderId -
status -
customerNotified - Has the customer been notified
comments -
Throws:
java.lang.Exception

updateInventory

void updateInventory(java.lang.String sessionId,
                     int orderId)
                     throws java.lang.Exception
If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders. If we hit the STOCK_REORDER_LEVEL, then we instantiate a class defined by the STOCK_REORDER_CLASS and call it. If STOCK_ALLOW_CHECKOUT is set to true, when we hit zero items in stock we don't touch the status, otherwise we disable the product when the quantity reaches zero by setting the status to zero. In this method we also update any promotion data such as the number of times a coupon has been used or the number of times a customer has used a promotion.

Parameters:
sessionId -
orderId -
Throws:
java.lang.Exception

updateInventoryWithOptions

void updateInventoryWithOptions(java.lang.String sessionId,
                                int orderId,
                                CreateOrderOptionsIf options)
                                throws java.lang.Exception
If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders. If we hit the STOCK_REORDER_LEVEL, then we instantiate a class defined by the STOCK_REORDER_CLASS and call it. If STOCK_ALLOW_CHECKOUT is set to true, when we hit zero items in stock we don't touch the status, otherwise we disable the product when the quantity reaches zero by setting the status to zero. In this method we also update any promotion data such as the number of times a coupon has been used or the number of times a customer has used a promotion. If the options parameter is set to null, the functionality is identical to updateInventory(), otherwise the option parameters are used to determine the additional functionality.

Parameters:
sessionId -
orderId -
options -
Throws:
java.lang.Exception

getSecretKeyForOrderId

java.lang.String getSecretKeyForOrderId(int orderId)
                                        throws java.lang.Exception
Every time we send a notification to a payment gateway, we get a new secret key for the order, which is sent back to us in the reply. We use the secret key to look up the order.

Parameters:
orderId -
Returns:
Returns the secret key
Throws:
java.lang.Exception

getOrderIdFromSecretKey

int getOrderIdFromSecretKey(java.lang.String secretKey)
                            throws com.workingdogs.village.DataSetException,
                                   org.apache.torque.TorqueException
The order id stored in the database and indexed by the secretKey, is returned

Parameters:
secretKey -
Returns:
The order Id that was stored in the database. A negative number is returned if no orderId can be found.
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

deleteOrderIdForSecretKey

void deleteOrderIdForSecretKey(java.lang.String secretKey)
                               throws org.apache.torque.TorqueException
The order id stored in the database and indexed by the secretKey, is deleted

Parameters:
secretKey -
Throws:
org.apache.torque.TorqueException

saveIpnHistory

int saveIpnHistory(java.lang.String sessionId,
                   IpnHistoryIf ipnHistory)
                   throws java.lang.Exception
The IpnHistory object is saved in the database.

Parameters:
sessionId -
ipnHistory -
Returns:
Id of newly created object
Throws:
java.lang.Exception

createAndSaveOrder

Order createAndSaveOrder(java.lang.String emailAddr,
                         java.lang.String password,
                         CustomerRegistrationIf custReg,
                         BasketIf[] basketItemArray,
                         java.lang.String shippingModule,
                         java.lang.String paymentModule,
                         int languageId)
                         throws java.lang.Exception
Parameters:
emailAddr -
password -
custReg -
basketItemArray -
shippingModule -
paymentModule -
languageId -
Returns:
Returns an Order object
Throws:
java.lang.Exception

setCreditCardDetailsOnOrder

void setCreditCardDetailsOnOrder(java.lang.String sessionId,
                                 int orderId,
                                 CreditCardIf card)
                                 throws java.lang.Exception
The credit card details in the CreditCard object passed in as a parameter, are saved in the database for an existing order. Before being saved, this sensitive information is encrypted.
No update or insert is done for attributes of the CreditCard object that are set to null. The credit card details are mapped as follows to attributes in the order object:

Parameters:
sessionId -
orderId -
card -
Throws:
java.lang.Exception

setRewardPointReservationId

void setRewardPointReservationId(java.lang.String sessionId,
                                 int orderId,
                                 int reservationId)
                                 throws java.lang.Exception
Verifies that the order belongs to the customer identified by the sessionId parameter and then updates the reservation id.

Parameters:
sessionId -
orderId -
reservationId -
Throws:
java.lang.Exception

setRewardPointReservationId

void setRewardPointReservationId(int customerId,
                                 int orderId,
                                 int reservationId)
                                 throws java.lang.Exception
Verifies that the order belongs to the customer identified by the customerId parameter and then updates the reservation id.

Parameters:
customerId -
orderId -
reservationId -
Throws:
java.lang.Exception

getIpnHistory

IpnHistory[] getIpnHistory(int orderId)
                           throws com.workingdogs.village.DataSetException,
                                  org.apache.torque.TorqueException
Retrieve an array of IpnHistory objects for an order.

Parameters:
orderId -
Returns:
Returns an array of IpnHistory objects for the order
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

getIpnHistory

IpnHistory[] getIpnHistory(java.lang.String sessionId,
                           int orderId)
                           throws java.lang.Exception
Retrieve an array of IpnHistory objects for an order. The order must belong to the customer referenced by the sessionId.

Parameters:
sessionId - The session id of the logged in user
orderId - The numeric id of the order
Returns:
Returns an array of IpnHistory objects for the order
Throws:
java.lang.Exception

getOrderStatus

int getOrderStatus(java.lang.String sessionId,
                   int orderId)
                   throws java.lang.Exception
Get the order status for an order.

Parameters:
sessionId - The session id of the logged in user
orderId - The numeric id of the order
Returns:
Returns the order status. Returns -1 if the order doesn't exist.
Throws:
java.lang.Exception

searchForOrdersPerCustomer

Orders searchForOrdersPerCustomer(java.lang.String sessionId,
                                  DataDescriptorIf dataDesc,
                                  OrderSearchIf orderSearch,
                                  int languageId)
                                  throws java.lang.Exception
Return orders matching the search criteria.

Parameters:
sessionId -
dataDesc -
orderSearch -
languageId -
Returns:
An Orders object
Throws:
java.lang.Exception

getAllOrderStatuses

OrderStatus[] getAllOrderStatuses(int languageId)
                                  throws java.lang.Exception
Returns an array of Order Status objects for a given language

Parameters:
languageId -
Returns:
Returns an array of Order Status Objects
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.