Interface ShippingProcessor

All Superinterfaces:
BusinessObject
All Known Implementing Classes:
BaseShippingProcessor, BasicShippingProcessor, FedExShippingProcessor, UPSShippingProcessor, USPSShippingProcessor

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 appComponents.properties file.

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

    Modifier and Type
    Method
    Description
    Load the shipping options related to this ShippingProcessor.
    processShipping(Map parameters)
    Process the shipping charges for the current user's order.

    Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject

    initialize
  • Method Details

    • loadShippingOptions

      Collection loadShippingOptions(Map parameters) throws 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:

      • code: A unique String code for the shipping option under this shipping processor. E.g., "GROUND".
      • name: The String name of the shipping option for diplay to users. E.g., "Ground".
      • price: The formatted price for the shipping option represented as a String and including currency formatting, for display to the user.
      • priceDouble: The raw price for the shipping option represented as a Double.
      Parameters:
      parameters - A Map containing information from the current request.
      Returns:
      A Collection of Map objects that contain the code, name, and price for each shipping option related to this ShippingProcessor.
      Throws:
      Exception
    • processShipping

      Map processShipping(Map parameters) throws 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:
      Exception