public abstract class TaxService extends GenericService
TaxService provides a simpler interface for creating TaxRequest objects. This class will be subclassed by an actual service (domestic or international) which will provide the impl to the abstract createRequest method and additional properties for making a valid taxware request
TaxRequest
,
SalesTaxCaller
,
TaxResult
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
protected java.lang.String |
mCompanyId |
protected boolean |
mFailedToInitialize |
protected java.util.Set |
mNonFatalCompCodes |
static atg.payment.Message |
msg |
protected java.lang.String |
mShipFromCountry |
static java.lang.String |
Resource_Name |
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
TaxService() |
Modifier and Type | Method and Description |
---|---|
TaxResult[] |
calculateSalesTax(TaxRequest[] request)
Actually calculate the sales tax.
|
protected abstract TaxRequest |
createRequest(java.lang.String strDstCountry,
java.lang.String strDstCity,
java.lang.String strDstProvince,
java.lang.String strDstZip,
java.lang.String strPOACountry,
java.lang.String strPOACity,
java.lang.String strPOAProvince,
java.lang.String strPOAZip,
java.lang.String strCurrencyCode,
long centsPrice,
long centsDiscountPrice,
long centsFreight,
java.util.Date dateTax)
Create a new TaxRequest, filling in Destination and Point of Acceptance information
from our member variables.
|
void |
doStartService()
Initialize data structures when service is started.
|
void |
doStopService()
Un-initialize data structures when service is stopped.
|
java.lang.String |
getCompanyId()
Get CompanyId for whom the taxes will be calculated.
|
boolean |
getFailedToInitialize()
Return whether the service failed to initialize
|
long[] |
getNonFatalCompletionCodes()
Get the list of non-fatal general completion codes.
|
java.lang.String |
getShipFromCountry()
Get ShipFromCountry used for tax calculations.
|
void |
setCompanyId(java.lang.String pCompanyId)
Set CompanyId for whom the taxes will be calculated.
|
void |
setNonFatalCompletionCodes(long[] pNonFatalCompCodes)
Set the list of non-fatal general completion codes.
|
void |
setShipFromCountry(java.lang.String pShipFromCountry)
Set 2 character ShipFromCountry used for tax calculations.
|
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public static final java.lang.String Resource_Name
public static atg.payment.Message msg
protected boolean mFailedToInitialize
protected java.lang.String mCompanyId
protected java.lang.String mShipFromCountry
protected java.util.Set mNonFatalCompCodes
public boolean getFailedToInitialize()
public void setNonFatalCompletionCodes(long[] pNonFatalCompCodes)
public long[] getNonFatalCompletionCodes()
public void setCompanyId(java.lang.String pCompanyId)
public java.lang.String getCompanyId()
public void setShipFromCountry(java.lang.String pShipFromCountry)
public java.lang.String getShipFromCountry()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- throws if we cannot open TaxWare.protected abstract TaxRequest createRequest(java.lang.String strDstCountry, java.lang.String strDstCity, java.lang.String strDstProvince, java.lang.String strDstZip, java.lang.String strPOACountry, java.lang.String strPOACity, java.lang.String strPOAProvince, java.lang.String strPOAZip, java.lang.String strCurrencyCode, long centsPrice, long centsDiscountPrice, long centsFreight, java.util.Date dateTax)
public TaxResult[] calculateSalesTax(TaxRequest[] request) throws TaxwareMinorException, TaxwareCriticalException
TaxwareCriticalException
- Thrown if installation problem.TaxwareMinorException
- Thrown on bad data or other problem.public void doStopService() throws ServiceException
doStopService
in class GenericService
ServiceException
- throws if we cannot shutdown TaxWare.