Class AvaTaxProcessor
java.lang.Object
com.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.tax.BaseTaxProcessor
com.softslate.commerce.businessobjects.tax.AvaTaxProcessor
- All Implemented Interfaces:
BusinessObject,BusinessProcessor,AddressValidationProcessor,TaxProcessor
Integrates with the AvaTax service. For technical reference:
http://developer.avalara.com/ and
http://developer.avalara.com/resources/api-sample-code
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String(package private) static org.apache.commons.logging.Log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoAddressErrorMessage(com.avalara.avatax.services.address.ArrayOfMessage messages) com.avalara.avatax.services.tax.CancelTaxResultdoCancelTax(Order order) com.avalara.avatax.services.tax.CancelTaxResultdoCancelTax(Order order, int taxRequestNumber) com.avalara.avatax.services.tax.CancelTaxResultdoCancelTax(Order order, String docType) com.avalara.avatax.services.tax.CancelTaxResultdoCancelTax(Order order, String docType, int taxRequestNumber) doErrorMessage(com.avalara.avatax.services.tax.ArrayOfMessage messages) doErrorName(com.avalara.avatax.services.tax.ArrayOfMessage messages) protected intcom.avalara.avatax.services.tax.GetTaxResultdoGetTax()com.avalara.avatax.services.tax.GetTaxResultcom.avalara.avatax.services.tax.GetTaxResultcom.avalara.avatax.services.tax.GetTaxResultcom.avalara.avatax.services.tax.GetTaxResultcom.avalara.avatax.services.tax.GetTaxResultdoGetTaxAndCommit(Order order) com.avalara.avatax.services.tax.GetTaxHistoryResultdoGetTaxHistory(Order order) com.avalara.avatax.services.tax.GetTaxHistoryResultdoGetTaxHistory(Order order, int taxRequestNumber) doItemAmount(OrderItem oi, double orderSubtotal, double totalOfTaxableGlobalDiscounts) com.avalara.avatax.services.tax.PostTaxResultcom.avalara.avatax.services.tax.PostTaxResultdoPostTaxAndCommit(Order order) com.avalara.avatax.services.tax.PostTaxResultdoPostTaxAndCommit(Order order, int taxRequestNumber) com.avalara.avatax.services.tax.PostTaxResultdoPostTaxNoCommit(Order order, String docType) com.avalara.avatax.services.tax.IsAuthorizedResultcom.avalara.avatax.services.address.AddressSvcSoapcom.avalara.avatax.services.tax.TaxSvcSoapprotected booleanisCountrySetToCalculateTax(Order order) protected booleanprotected booleanisCustomerTaxExempt(Order order) protected booleanisStateSetToCalculateTax(Order order) com.avalara.avatax.services.tax.LinelineForOrderItem(OrderItem oi, int count, double orderSubtotal, double totalOfTaxableGlobalDiscounts) com.avalara.avatax.services.tax.LinelineForShipping(Order order, int count) intintprocessTax(Map parameters) Assists with processing of tax charges.protected booleanprotected booleanbooleantaxShouldBeZero(Order order) booleandoublevalidateAddress(Map parameters) intvalidateAddressDuringTaxes(Order order) Methods inherited from class com.softslate.commerce.businessobjects.tax.BaseTaxProcessor
isShippingTaxable, updateTaxableSubtotal, updateTaxableSubtotalMethods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getProductIDs, getSettings, getUser, initialize, isProcessorClassActive, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPGet, sendHTTPPost, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, updateOrderTotals, updateOrderTotals, updateOrderTotals, utilsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initializeMethods inherited from interface com.softslate.commerce.businessobjects.core.BusinessProcessor
getAppComponents, getAppSettings, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getSettings, getUser, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, utils
-
Field Details
-
log
static org.apache.commons.logging.Log log -
errorMessage
-
-
Constructor Details
-
AvaTaxProcessor
public AvaTaxProcessor()
-
-
Method Details
-
processTax
Description copied from class:BaseTaxProcessorAssists with processing of tax charges. Copies the incomingMapof parameters to thisBaseTaxProcessorinstance and callsupdateTaxableSubtotal(), followed byprocessTax(), followed byupdateTotalsAndStatuses()to update the order's totals. Finally, writes the new totals to the database usingOrderGatewayDAO.updateOrderAndDelivery(boolean, com.softslate.commerce.businessobjects.order.Order, com.softslate.commerce.businessobjects.order.OrderDelivery).- Specified by:
processTaxin interfaceTaxProcessor- Overrides:
processTaxin classBaseTaxProcessor- Parameters:
parameters- AMapcontaining 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:
Exception
-
processTax
- Specified by:
processTaxin classBaseTaxProcessor- Throws:
Exception
-
shouldDoAddressValidationDuringTaxes
-
isCountrySetToVerifyAddresses
-
shouldDoAddressValidationAfterAddressSubmitted
-
taxShouldBeZero
- Throws:
Exception
-
isCustomerTaxExempt
-
taxShouldFallBackToBasicRates
-
isCountrySetToCalculateTax
-
isStateSetToCalculateTax
-
doFallBack
- Throws:
Exception
-
processAvaTax
- Throws:
Exception
-
validateAddress
- Specified by:
validateAddressin interfaceAddressValidationProcessor- Throws:
Exception
-
validateAddressDuringTaxes
- Throws:
Exception
-
validateAddressReturningErrorsAndMessages
- Throws:
Exception
-
getAddressSvc
public com.avalara.avatax.services.address.AddressSvcSoap getAddressSvc() throws javax.xml.rpc.ServiceException, javax.xml.soap.SOAPException, MalformedURLException- Throws:
javax.xml.rpc.ServiceExceptionjavax.xml.soap.SOAPExceptionMalformedURLException
-
doAddressErrorMessage
-
doGetTax
- Throws:
Exception
-
doGetTax
- Throws:
Exception
-
doGetTax
public com.avalara.avatax.services.tax.GetTaxResult doGetTax(Order order, String docType, boolean commitTax) throws Exception - Throws:
Exception
-
doGetTax
public com.avalara.avatax.services.tax.GetTaxResult doGetTax(Order order, String docType, boolean commitTax, int taxRequestNumber) throws Exception - Throws:
Exception
-
getTaxSvc
public com.avalara.avatax.services.tax.TaxSvcSoap getTaxSvc() throws javax.xml.rpc.ServiceException, javax.xml.soap.SOAPException, MalformedURLException, IOException- Throws:
javax.xml.rpc.ServiceExceptionjavax.xml.soap.SOAPExceptionMalformedURLExceptionIOException
-
doDocDate
-
lineForOrderItem
public com.avalara.avatax.services.tax.Line lineForOrderItem(OrderItem oi, int count, double orderSubtotal, double totalOfTaxableGlobalDiscounts) -
doItemAmount
public BigDecimal doItemAmount(OrderItem oi, double orderSubtotal, double totalOfTaxableGlobalDiscounts) -
doItemTaxCode
-
totalOfTaxableGlobalDiscounts
-
lineForShipping
-
doErrorMessage
-
doErrorName
-
doGetTaxAndCommit
- Throws:
Exception
-
doGetTaxAndCommit
- Throws:
Exception
-
doCancelTax
- Throws:
Exception
-
doCancelTax
public com.avalara.avatax.services.tax.CancelTaxResult doCancelTax(Order order, int taxRequestNumber) throws Exception - Throws:
Exception
-
doCancelTax
public com.avalara.avatax.services.tax.CancelTaxResult doCancelTax(Order order, String docType) throws Exception - Throws:
Exception
-
doCancelTax
public com.avalara.avatax.services.tax.CancelTaxResult doCancelTax(Order order, String docType, int taxRequestNumber) throws Exception - Throws:
Exception
-
doPostTaxNoCommit
public com.avalara.avatax.services.tax.PostTaxResult doPostTaxNoCommit(Order order, String docType) throws Exception - Throws:
Exception
-
doPostTaxAndCommit
public com.avalara.avatax.services.tax.PostTaxResult doPostTaxAndCommit(Order order) throws Exception - Throws:
Exception
-
doPostTaxAndCommit
public com.avalara.avatax.services.tax.PostTaxResult doPostTaxAndCommit(Order order, int taxRequestNumber) throws Exception - Throws:
Exception
-
doPostTax
public com.avalara.avatax.services.tax.PostTaxResult doPostTax(Order order, String docType, boolean commitTax, int taxRequestNumber) throws Exception - Throws:
Exception
-
doTestConnection
- Throws:
Exception
-
doGetTaxHistory
public com.avalara.avatax.services.tax.GetTaxHistoryResult doGetTaxHistory(Order order) throws Exception - Throws:
Exception
-
doGetTaxHistory
public com.avalara.avatax.services.tax.GetTaxHistoryResult doGetTaxHistory(Order order, int taxRequestNumber) throws Exception - Throws:
Exception
-