com.softslate.commerce.businessobjects.shipping
Interface ShippingProcessor

All Superinterfaces:
BusinessObject
All Known Implementing Classes:
BaseShippingProcessor, BasicShippingProcessor

public interface ShippingProcessor
extends BusinessObject

Interface for objects that are able to process shipping charges in the store. Custom shipping processors must simply implement ShippingProcessor.

To change or add to the list of shipping processors currently active in the system, modify the "activeShippingProcessors" setting in the npcSetting table of the database.

During checkout, the Struts layer invokes each of the "activeShippingProcessors" by calling their loadShippingOptions() method to get a list of options related to this ShippingProcessor, and processShipping(Map parameters) to process the option that was selected. The incoming Map contains the shippingOption selected by the user, along with any other request parameters.

The default "activeShippingProcessor" is BasicShippingProcessor.

Author:
David Tobey

Method Summary
 java.util.Collection loadShippingOptions()
          Load the shipping options related to this ShippingProcessor.
 java.util.Map processShipping(java.util.Map parameters)
          Process the shipping charges for the current user's order.
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
 

Method Detail

loadShippingOptions

public java.util.Collection loadShippingOptions()
                                         throws java.lang.Exception
Load the shipping options related to this 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:

Returns:
A Collection of Map objects that contain the code, name, and price for each shipping option related to this ShippingProcessor.
Throws:
java.lang.Exception

processShipping

public java.util.Map processShipping(java.util.Map parameters)
                              throws java.lang.Exception
Process the shipping charges for the current user's order. The incoming Map should contain a key named shippingOption that contains the code of the shipping option selected by the user. It may also contain additional input parameters related to how the shipping should be charged.

Parameters:
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.
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:
java.lang.Exception


Copyright © SoftSlate, Inc. 2003–2005