com.softslate.commerce.businessobjects.tax
Class BaseTaxProcessor

java.lang.Object
  extended bycom.softslate.commerce.businessobjects.core.BaseBusinessObject
      extended bycom.softslate.commerce.businessobjects.core.BaseBusinessProcessor
          extended bycom.softslate.commerce.businessobjects.tax.BaseTaxProcessor
All Implemented Interfaces:
BusinessObject, BusinessProcessor, TaxProcessor
Direct Known Subclasses:
BasicTaxProcessor

public abstract class BaseTaxProcessor
extends BaseBusinessProcessor
implements TaxProcessor

Abstract class that provides methods useful for TaxProcessor implementations.

Author:
David Tobey

Field Summary
(package private) static org.apache.commons.logging.Log log
           
 
Fields inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
 
Constructor Summary
BaseTaxProcessor()
           
 
Method Summary
abstract  int processTax()
           
 java.util.Map processTax(java.util.Map parameters)
          Assists with processing of tax charges.
 void updateTotalsAndStatuses()
          Updates the totals and statuses of a user's order with a new tax charge included.
 
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatPrice, getBusinessObjectFactory, getDaoFactory, getSettingsBean, getUser, initialize, setBusinessObjectFactory, setDaoFactory, setSettingsBean, setUser
 
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessObject
formatDateTime, parseDateTime, prepareRequestData, sendHTTPPost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
 

Field Detail

log

static org.apache.commons.logging.Log log
Constructor Detail

BaseTaxProcessor

public BaseTaxProcessor()
Method Detail

processTax

public abstract int processTax()
                        throws java.lang.Exception
Throws:
java.lang.Exception

processTax

public java.util.Map processTax(java.util.Map parameters)
                         throws java.lang.Exception
Assists with processing of tax charges. Copies the incoming Map of parameters to this BaseTaxProcessor instance and calls processTax() followed by updateTotalsAndStatuses() to update the order's totals. Finally, writes the new totals to the database using OrderGatewayDAO.updateOrderAndDelivery(boolean, com.softslate.commerce.businessobjects.order.Order, com.softslate.commerce.businessobjects.order.OrderDelivery).

Specified by:
processTax in interface TaxProcessor
Parameters:
parameters - A Map containing any input parameters from the user related to how the tax should be charged.
Returns:
A Map containing a least one key named "resultCode", which contains a String parsable into an integer, representing the results of the processing. 0 for the resultCode indicates success, anything else indicates an error and that processing should stop.
Throws:
java.lang.Exception

updateTotalsAndStatuses

public void updateTotalsAndStatuses()
                             throws java.lang.Exception
Updates the totals and statuses of a user's order with a new tax charge included. The user's Order and that order's first OrderDelivery are updated with new price totals and subtotals.

Throws:
java.lang.Exception


Copyright © SoftSlate, Inc. 2003–2005