|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softslate.commerce.businessobjects.core.BaseBusinessObject com.softslate.commerce.businessobjects.core.BaseBusinessProcessor com.softslate.commerce.businessobjects.shipping.BaseShippingProcessor
public abstract class BaseShippingProcessor
Abstract class that provides methods useful for
ShippingProcessor
implementations.
Field Summary | |
---|---|
private java.util.Collection |
availableOptions
|
(package private) static org.apache.commons.logging.Log |
log
|
private java.lang.String |
shippingOption
|
Constructor Summary | |
---|---|
BaseShippingProcessor()
|
Method Summary | |
---|---|
java.util.Collection |
getAvailableOptions()
|
java.lang.String |
getShippingOption()
|
abstract java.util.Collection |
loadShippingOptions()
|
java.util.Collection |
loadShippingOptions(java.util.Map argument)
Load the shipping options related to this ShippingProcessor . |
abstract int |
processShipping()
|
java.util.Map |
processShipping(java.util.Map parameters)
Assists with processing of shipping charges. |
void |
setAvailableOptions(java.util.Collection availableOptions)
|
void |
setShippingOption(java.lang.String string)
|
void |
updateOrderWithOption()
Sets the option the user selected in the user's order, by default in the order delivery's status details field. |
void |
updateOrderWithOptionPrice()
Sets the shipping price in the order based on the option the user selected. |
void |
updateTotalsAndStatuses()
Updates the totals and statuses of a user's order with a new shipping charge included. |
void |
updateTotalsAndStatusesInDatabase()
|
boolean |
verifyOption()
Verifies that the option the user selected is allowed by checking it against the Collection of avialable options. |
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor |
---|
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getProductIDs, getSettings, getUser, initialize, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setSettings, setUser, utils |
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 |
---|
static org.apache.commons.logging.Log log
private java.lang.String shippingOption
private java.util.Collection availableOptions
Constructor Detail |
---|
public BaseShippingProcessor()
Method Detail |
---|
public java.lang.String getShippingOption()
public void setShippingOption(java.lang.String string)
public java.util.Collection getAvailableOptions()
public void setAvailableOptions(java.util.Collection availableOptions)
public java.util.Collection loadShippingOptions(java.util.Map argument) throws java.lang.Exception
ShippingProcessor
ShippingProcessor
.
Shipping options might include, for example, ground, 2-day air, bulk, etc.
The Collection
returned should be a collection of
Map
objects that must include the following keys:
String
code for the shipping option
under this shipping processor. E.g., "GROUND".String
name of the shipping option for
diplay to users. E.g., "Ground".String
and including currency formatting, for display to
the user.Double
.
loadShippingOptions
in interface ShippingProcessor
argument
- A Map containing information from the current request.
Collection
of Map
objects that
contain the code, name, and price for each shipping option
related to this ShippingProcessor
.
java.lang.Exception
public abstract java.util.Collection loadShippingOptions() throws java.lang.Exception
java.lang.Exception
public abstract int processShipping() throws java.lang.Exception
java.lang.Exception
public java.util.Map processShipping(java.util.Map parameters) throws java.lang.Exception
Map
of parameters to this
BaseShippingProcessor
instance and calls
processShipping()
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)
.
processShipping
in interface ShippingProcessor
parameters
- A Map containing the shipping infofmation submitted by the
user. It should contain a key named
shippingOption
that contains the
code
of the shipping option selected by the
user.
java.lang.Exception
public boolean verifyOption()
public void updateOrderWithOption()
public void updateOrderWithOptionPrice()
public void updateTotalsAndStatuses() throws java.lang.Exception
Order
and that order's first
OrderDelivery
are updated with new price totals, and
subtotals.
java.lang.Exception
public void updateTotalsAndStatusesInDatabase() throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |