public class VeraZipOrderImpl extends BillingShipping implements VeraZipable
This class exists to enable easily adding verazip support to OrderImpl. This class works with the TaxWareCalculateSalesTax order processing item.
Most of the code here attempts to implements the VeraZipable interface, mostly through an array of ZipResult objects.
Much of the other code deals with providing access functions so that it can be hooked up to a web page.
A final chunk of code attempts to set whatever can be set from the current ZipResult object.
OrderImpl,
VeraZipable,
ZipResult,
ZipResultItem,
ZipRequest| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION |
protected int[] |
mZipIndexArray
The index into the array associated with the zip result.
|
protected ZipResult[] |
mZipResultArray
The zip result returned from verazip.
|
BILLING_ADDRESS_NAME, SHIP_TO_ADDRESS_NAME| Constructor and Description |
|---|
VeraZipOrderImpl(ApplicationLogging log) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAddressNameForIndex(int index) |
int |
getBillZipOptionChoice()
gets the index for the currently chosen billing zip option.
|
int |
getBillZipOptionCount()
Returns the count of possible string options.
|
java.lang.String[] |
getBillZipOptions()
Returns the string array describing the current billing zip options.
|
int |
getIndexForAddressName(java.lang.String pName)
Returns the array index for the address with
the given name.
|
int |
getMaxCountOfZipAddresses()
Returns the maxinumber of addressed to check.
|
int |
getShipToZipOptionChoice()
gets the index for the currently chosen ship-to zip option.
|
int |
getShipToZipOptionCount() |
java.lang.String[] |
getShipToZipOptions()
Returns the string array describing the current billing zip options.
|
java.lang.String |
getZipErrorString()
Sets the current zip error string.
|
ZipRequest |
getZipRequestForAddress(int idxAddress)
Get the request for the specified address object.
|
ZipResult |
getZipResultAt(int idx)
Get the ZipResult object.
|
boolean |
isZipError()
Returns true if there is currently a zip order.
|
protected static boolean |
nullOrEmptyString(java.lang.String pString)
A helper function which checks to see if
a string is null or empty.
|
protected void |
setBillInfoFromZipResult(ZipResult pZipResult)
Attempts to set whatever information is possible from
the specified zip result.
|
void |
setBillZipOptionChoice(int pIndex)
Sets the index for the currently chosen zip option.
|
protected void |
setShipToInfoFromZipResult(ZipResult pZipResult)
Attempts to set whatever information is possible from
the specified zip result.
|
void |
setShipToZipOptionChoice(int pIndex)
Sets the index for the currently chosen ship-to zip option.
|
void |
setZipError(boolean pIsError)
Sets a zip error -- probably not a good idea to use.
|
void |
setZipErrorString(java.lang.String pError)
Sets the current zip error string.
|
void |
setZipResultAt(int idx,
ZipResult pZipResult)
Set the ZipResult object at the specified index.
|
public static java.lang.String CLASS_VERSION
protected ZipResult[] mZipResultArray
protected int[] mZipIndexArray
public VeraZipOrderImpl(ApplicationLogging log)
public int getMaxCountOfZipAddresses()
getMaxCountOfZipAddresses in interface VeraZipablepublic int getIndexForAddressName(java.lang.String pName)
getIndexForAddressName in interface VeraZipablepublic java.lang.String getAddressNameForIndex(int index)
getAddressNameForIndex in interface VeraZipableprotected void setShipToInfoFromZipResult(ZipResult pZipResult)
If a choice has been set, copies any non-matching info from the choice.
protected void setBillInfoFromZipResult(ZipResult pZipResult)
If a choice has been set, copies any non-matching info from the choice.
protected static boolean nullOrEmptyString(java.lang.String pString)
public void setZipResultAt(int idx,
ZipResult pZipResult)
Note that we go ahead and call the setXXXXInfoFromZipResult method as well, so that defaults will be there the next time the page is rendered.
Set ZipResut always does real set, regardless of whether mUseBillAddress is set.
setZipResultAt in interface VeraZipablepublic ZipResult getZipResultAt(int idx)
getZipResultAt in interface VeraZipablepublic int getShipToZipOptionCount()
public java.lang.String[] getShipToZipOptions()
public void setShipToZipOptionChoice(int pIndex)
public int getShipToZipOptionChoice()
public int getBillZipOptionCount()
public java.lang.String[] getBillZipOptions()
public void setBillZipOptionChoice(int pIndex)
public int getBillZipOptionChoice()
public ZipRequest getZipRequestForAddress(int idxAddress)
getZipRequestForAddress in interface VeraZipablepublic void setZipErrorString(java.lang.String pError)
setZipErrorString in interface VeraZipablepublic java.lang.String getZipErrorString()
getZipErrorString in interface VeraZipablepublic void setZipError(boolean pIsError)
setZipError in interface VeraZipablepublic boolean isZipError()
isZipError in interface VeraZipable