com.konakart.bl.modules.shipping.ups
Class Ups
java.lang.Object
com.konakart.bl.modules.BaseModule
com.konakart.bl.modules.shipping.BaseShippingModule
com.konakart.bl.modules.shipping.ups.Ups
- All Implemented Interfaces:
- ShippingInterface
public class Ups
- extends BaseShippingModule
- implements ShippingInterface
This shipping module communicates with UPS to retrieve shipping rates. Using the Admin App you
must set up the following configuration variables:
UPS Module:
- UPS Access License Number
- Request URL (test: https://wwwcie.ups.com/ups.app/xml/Rate production:
https://onlinetools.ups.com/ups.app/xml/Rate)
- UPS UserId
- UPS Password
- Return quote for a defined service code : Defaults to false so that quotes are returned for
all services that UPS gives for the specified delivery address.
- UPS Service code : If the above is set to true, then we only return a quote for this service
- UPS Service codes to exclude : Comma separated list of service codes to exclude
- Measurement Unit : LBS or KGS
- Packaging type by weight : Defaults to 1000:00 where 00 is the packaging code (unknown
packaging) for up to 1000 Lbs or Kgs. You could set it to something like 10:25,25:24,100:00 which
means that for up to 10lbs we will ask for package code 25. For 10 to 25 lbs we will ask for
package code 24 and for 25 to 100 lbs we will ask for package code 00. Before setting specific
package codes you need to be sure that UPS supports the package for the destination.
- Handling fee : Defaults to 0. It is added to the charge returned by UPS.
Shipping and Packaging under Configuration
- Country of Origin : Country from which packages will be shipped.
- Postal Code : Postal code of area from which packages will be shipped
- Maximum package weight : This is used to split the order into multiple packages . We make
multiple calls to UPS and sum the costs to create a total.
- Package tare weight : This is added to the weight of the items being shipped per package
Nested Class Summary |
protected class |
Ups.StaticData
Used to store the static data of this module |
Methods inherited from class com.konakart.bl.modules.BaseModule |
getBasketMgr, getCatMgr, getConfigMgr, getConfiguration, getConfigurationValue, getConfigurationValueAsBigDecimalWithDefault, getConfigurationValueAsBool, getConfigurationValueAsIntWithDefault, getCurrMgr, getCustMgr, getEmailMgr, getEng, getLangMgr, getMultiStoreMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getResourceBundle, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, init, isAvailable, isAvailable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Ups
public Ups(KKEngIf eng)
throws org.apache.torque.TorqueException,
KKException,
com.workingdogs.village.DataSetException
- Constructor
- Parameters:
eng
-
- Throws:
com.workingdogs.village.DataSetException
KKException
org.apache.torque.TorqueException
getQuote
public ShippingQuote getQuote(Order order,
ShippingInfo info)
throws java.lang.Exception
- We get a quote from UPS. If we only get one quote back then we return a ShippingQuote object
with the details of the quote. If we get back more than one quote then we create an array of
ShippingQuote objects and attach them to the ShippingQuote object that we return. In this
case all of the quotes must be in the array since the quote itself isn't processed.
It becomes more complex when we have the shipment split into a number of packages. The split
is done by the manager calling this method and is presented to us in an orderWeightList. For
each item in the list, we call UPS and get back one or more quotes. We then have to add up
the quotes and return them as single quotes that can be displayed on the screen.
- Specified by:
getQuote
in interface ShippingInterface
- Parameters:
order
- The order object
- Returns:
- Returns a ShippingQuote object
- Throws:
java.lang.Exception
isAvailable
public boolean isAvailable()
throws KKException
- Returns true or false
- Specified by:
isAvailable
in interface ShippingInterface
- Returns:
- True or False
- Throws:
KKException
setStaticVariables
public void setStaticVariables()
throws KKException
- Sets some static variables during setup
- Specified by:
setStaticVariables
in interface ShippingInterface
- Throws:
KKException
Copyright © 2011 DS Data Systems UK Ltd.