atg.projects.store.integrations.cybersource
Class StoreCyberSourceTax

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.integrations.cybersource.CyberSourceTax
              extended by atg.projects.store.integrations.cybersource.StoreCyberSourceTax
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.payment.tax.TaxProcessor, java.util.EventListener

public class StoreCyberSourceTax
extends atg.integrations.cybersource.CyberSourceTax

This class extends the ATG CyberSourceTax class as to be able to set the showTaxPerOffer on the ICSClientRequest.


Field Summary
static java.lang.String AMOUNT
          Amount constant.
static java.lang.String BILL_CITY
          Billing city constant.
static java.lang.String BILL_COUNTRY
          Billing country constant.
static java.lang.String BILL_COUNTY
          Billing county constant.
static java.lang.String BILL_STATE
          Billing state constant.
static java.lang.String BILL_ZIP
          Billing zip code constant.
static java.lang.String CLASS_VERSION
          Class version string.
static java.lang.String CURRENCY
          Currency constant.
static java.lang.String ICS_APPLICATIONS
          ICS application constant.
static java.lang.String KEY_SEPARATOR
          Cybersource reply's key separator.
static java.lang.String MERCHANT_ID
          Merchant id constant.
static java.lang.String MERCHANT_REF_NUMBER
          Merchant reference number constant.
static java.lang.String MERCHANT_SKU
          Merchant sku constant.
static java.lang.String NEXUS
          Nexus sku constant.
static java.lang.String PRODUCT_CODE
          Product code constant.
static java.lang.String PRODUCT_NAME
          Product name constant.
static java.lang.String QUANTITY
          Quantity constant.
static java.lang.String SHIP_TO_ADDRESS1
          First shipping address constant.
static java.lang.String SHIP_TO_ADDRESS2
          Second shipping address constant.
static java.lang.String SHIP_TO_CITY
          Shipping address city constant.
static java.lang.String SHIP_TO_COUNTRY
          Shipping address country constant.
static java.lang.String SHIP_TO_COUNTY
          Shipping address county constant.
static java.lang.String SHIP_TO_STATE
          Shipping address state constant.
static java.lang.String SHIP_TO_ZIP
          Shipping address zip code constant.
static java.lang.String SHOW_TAX_PER_OFFER
          Show tax per offer constant.
 
Fields inherited from class atg.integrations.cybersource.CyberSourceTax
AcceptanceCity, AcceptanceCountry, AcceptanceState, AcceptanceZip, mCsCon, mNoNexus, mOriginCity, mOriginCountry, mOriginState, mOriginZip, mSellerRegistrationNumber, mShipFromCity, mShipFromCountry, mShipFromState, mShipFromZip, mUseProductCode, NoNexus, SellerRegistration, ShipFromCity, ShipFromCountry, ShipFromState, ShipFromZip
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
StoreCyberSourceTax()
           
 
Method Summary
 atg.payment.tax.TaxStatus calculate(atg.payment.tax.TaxRequestInfo pTaxRequestInfo, int i)
          Call to cybersource to calculate taxes with this single CyberSource request
 atg.payment.tax.TaxStatus calculateAllTax(atg.payment.tax.TaxStatus[] taxstatus)
          Overrides base method to not only calculate total taxes for passed TaxStatus objects but to preserve per offer taxes details in final TaxStatus.
 java.lang.String getShippingProductCode()
           
 java.lang.String getShowTaxPerOffer()
           
 java.lang.String[] getTaxPerOfferProperties()
          Returns the TaxPerOfferProperties
protected  void setBillingInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest, atg.payment.tax.TaxRequestInfo pTaxRequestInfo, int i)
          Utility method to set the billing address information on the ICSCLientRequest.
protected  void setShipFromInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest, atg.payment.tax.TaxRequestInfo pTaxRequestInfo, int i)
          Utility method to set the origin shipping address information on the ICSCLientRequest.
 void setShippingProductCode(java.lang.String pShippingProductCode)
           
protected  void setShipToInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest, atg.payment.tax.TaxRequestInfo pTaxRequestInfo, int i)
          Utility method to set the destination shipping address information on the ICSCLientRequest.
 void setShowTaxPerOffer(java.lang.String pShowTaxPerOffer)
           
 void setTaxPerOfferProperties(java.lang.String[] pTaxPerOfferProperties)
          Sets the TaxPerOfferProperties
 
Methods inherited from class atg.integrations.cybersource.CyberSourceTax
assignTaxProductCode, calculateTax, calculateTaxByShipping, doStartService, getCsCon, getNoNexus, getOriginCity, getOriginCountry, getOriginState, getOriginZip, getSellerRegistrationNumber, getShipFromCity, getShipFromCountry, getShipFromState, getShipFromZip, getUseProductCode, main, performTax, setCsCon, setNoNexus, setOriginCity, setOriginCountry, setOriginState, setOriginZip, setSellerRegistrationNumber, setShipFromCity, setShipFromCountry, setShipFromState, setShipFromZip, setUseProductCode, TaxProductCodeSetting, toString
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string.


CURRENCY

public static final java.lang.String CURRENCY
Currency constant.

See Also:
Constant Field Values

ICS_APPLICATIONS

public static final java.lang.String ICS_APPLICATIONS
ICS application constant.

See Also:
Constant Field Values

MERCHANT_ID

public static final java.lang.String MERCHANT_ID
Merchant id constant.

See Also:
Constant Field Values

MERCHANT_REF_NUMBER

public static final java.lang.String MERCHANT_REF_NUMBER
Merchant reference number constant.

See Also:
Constant Field Values

MERCHANT_SKU

public static final java.lang.String MERCHANT_SKU
Merchant sku constant.

See Also:
Constant Field Values

NEXUS

public static final java.lang.String NEXUS
Nexus sku constant.

See Also:
Constant Field Values

AMOUNT

public static final java.lang.String AMOUNT
Amount constant.

See Also:
Constant Field Values

QUANTITY

public static final java.lang.String QUANTITY
Quantity constant.

See Also:
Constant Field Values

BILL_CITY

public static final java.lang.String BILL_CITY
Billing city constant.

See Also:
Constant Field Values

BILL_COUNTRY

public static final java.lang.String BILL_COUNTRY
Billing country constant.

See Also:
Constant Field Values

BILL_COUNTY

public static final java.lang.String BILL_COUNTY
Billing county constant.

See Also:
Constant Field Values

BILL_STATE

public static final java.lang.String BILL_STATE
Billing state constant.

See Also:
Constant Field Values

BILL_ZIP

public static final java.lang.String BILL_ZIP
Billing zip code constant.

See Also:
Constant Field Values

SHIP_TO_ADDRESS1

public static final java.lang.String SHIP_TO_ADDRESS1
First shipping address constant.

See Also:
Constant Field Values

SHIP_TO_ADDRESS2

public static final java.lang.String SHIP_TO_ADDRESS2
Second shipping address constant.

See Also:
Constant Field Values

SHIP_TO_CITY

public static final java.lang.String SHIP_TO_CITY
Shipping address city constant.

See Also:
Constant Field Values

SHIP_TO_COUNTRY

public static final java.lang.String SHIP_TO_COUNTRY
Shipping address country constant.

See Also:
Constant Field Values

SHIP_TO_COUNTY

public static final java.lang.String SHIP_TO_COUNTY
Shipping address county constant.

See Also:
Constant Field Values

SHIP_TO_STATE

public static final java.lang.String SHIP_TO_STATE
Shipping address state constant.

See Also:
Constant Field Values

SHIP_TO_ZIP

public static final java.lang.String SHIP_TO_ZIP
Shipping address zip code constant.

See Also:
Constant Field Values

SHOW_TAX_PER_OFFER

public static final java.lang.String SHOW_TAX_PER_OFFER
Show tax per offer constant.

See Also:
Constant Field Values

PRODUCT_CODE

public static final java.lang.String PRODUCT_CODE
Product code constant.

See Also:
Constant Field Values

PRODUCT_NAME

public static final java.lang.String PRODUCT_NAME
Product name constant.

See Also:
Constant Field Values

KEY_SEPARATOR

public static final java.lang.String KEY_SEPARATOR
Cybersource reply's key separator.

See Also:
Constant Field Values
Constructor Detail

StoreCyberSourceTax

public StoreCyberSourceTax()
Method Detail

getShowTaxPerOffer

public java.lang.String getShowTaxPerOffer()
Returns:
show tax per offer property.

setShowTaxPerOffer

public void setShowTaxPerOffer(java.lang.String pShowTaxPerOffer)
Parameters:
pShowTaxPerOffer - - show tax per offer property.

getShippingProductCode

public java.lang.String getShippingProductCode()
Returns:
shipping product code.

setShippingProductCode

public void setShippingProductCode(java.lang.String pShippingProductCode)
Parameters:
pShippingProductCode - - shipping product code.

getTaxPerOfferProperties

public java.lang.String[] getTaxPerOfferProperties()
Returns the TaxPerOfferProperties


setTaxPerOfferProperties

public void setTaxPerOfferProperties(java.lang.String[] pTaxPerOfferProperties)
Sets the TaxPerOfferProperties


calculate

public atg.payment.tax.TaxStatus calculate(atg.payment.tax.TaxRequestInfo pTaxRequestInfo,
                                           int i)
                                    throws com.cybersource.ics.base.exception.ICSException
Call to cybersource to calculate taxes with this single CyberSource request

Overrides:
calculate in class atg.integrations.cybersource.CyberSourceTax
Parameters:
pTaxRequestInfo - - tax request information
i - - some i parameter
Returns:
tax status
Throws:
com.cybersource.ics.base.exception.ICSException - if error occurs

calculateAllTax

public atg.payment.tax.TaxStatus calculateAllTax(atg.payment.tax.TaxStatus[] taxstatus)
Overrides base method to not only calculate total taxes for passed TaxStatus objects but to preserve per offer taxes details in final TaxStatus. Per offer taxes are stored into final TaxStatus with "_{tax_status_index} suffix, where {tax_status_index} - the TaxStatus index.

Overrides:
calculateAllTax in class atg.integrations.cybersource.CyberSourceTax

setBillingInfo

protected void setBillingInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest,
                              atg.payment.tax.TaxRequestInfo pTaxRequestInfo,
                              int i)
                       throws com.cybersource.ics.base.exception.ICSException
Utility method to set the billing address information on the ICSCLientRequest.

Parameters:
pRequest - - cyberstore request
pTaxRequestInfo - - tas request info
i - - some i parameter
Throws:
com.cybersource.ics.base.exception.ICSException - if error occurs

setShipToInfo

protected void setShipToInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest,
                             atg.payment.tax.TaxRequestInfo pTaxRequestInfo,
                             int i)
                      throws com.cybersource.ics.base.exception.ICSException
Utility method to set the destination shipping address information on the ICSCLientRequest.

Parameters:
pRequest - - cyberstore request
pTaxRequestInfo - - tax request information
i - - some i parameter
Throws:
com.cybersource.ics.base.exception.ICSException - if error occurs

setShipFromInfo

protected void setShipFromInfo(com.cybersource.ics.client.message.ICSClientRequest pRequest,
                               atg.payment.tax.TaxRequestInfo pTaxRequestInfo,
                               int i)
                        throws com.cybersource.ics.base.exception.ICSException
Utility method to set the origin shipping address information on the ICSCLientRequest.

Parameters:
pRequest - - cyberstore request
pTaxRequestInfo - - tax request information
i - - some i parameter
Throws:
com.cybersource.ics.base.exception.ICSException - if error occurs