com.konakart.bl.modules.shipping.uspsint
Class Uspsint
java.lang.Object
com.konakart.bl.modules.BaseModule
com.konakart.bl.modules.shipping.BaseShippingModule
com.konakart.bl.modules.shipping.uspsint.Uspsint
- All Implemented Interfaces:
- ShippingInterface
public class Uspsint
- extends BaseShippingModule
- implements ShippingInterface
This shipping module communicates with USPSINT to retrieve shipping rates. Using the Admin App
you must set up the following configuration variables:
USPSINT Module:
- USPSINT User Id which you need to receive from USPSINT
- Request URL (production: http://production.shippingapis.com/ShippingAPI.dll)
- Mail Type. Defines the type of mail. Valid values are:
- PACKAGE
- ENVELOPE
- MATTER FOR THE BLIND
- POSTCARDS OR AEROGRAMME
- USPSINT Service codes to exclude. You can decide to exclude certain ones. The excluded rates
are defined by comma separated codes. The codes are:
- 1 Express Mail International
- 2 Priority Mail International
- 4 Global Express Guaranteed (Document and Non-document)
- 5 Global Express Guaranteed Document used
- 6 Global Express Guaranteed Non-Document Rectangular shape
- 7 Global Express Guaranteed Non-Document Non- Rectangular
- 8 Priority Mail Flat Rate Envelope
- 9 Priority Mail Flat Rate Box
- 10 Express Mail International Flat Rate Envelope
- 11 Priority Mail Large Flat Rate Box
- 12 Global Express Guaranteed Envelope
- 13 First Class Mail International Letters
- 14 First Class Mail International Flats
- 15 First Class Mail International Parcels
- 21 PostCards
- Machinable Package can be set to true or false. The USPSINT definitions for machinable can be
found here: http://pe.usps.com/text/dmm300/101.htm
- Include insurance can be set to true or false. When set to true, the quote includes insurance
that covers the cost of the products.
- Handling fee : Defaults to 0. It is added to the charge returned by USPSINT.
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 USPSINT 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 |
Uspsint.StaticData
Used to store the static data of this module |
| Methods inherited from class com.konakart.bl.modules.BaseModule |
getBasketMgr, getCatMgr, getConfigMgr, getCurrMgr, getCustMgr, getEmailMgr, getEng, getLangMgr, getMultiStoreMgr, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getResourceBundle, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, init, isAvailable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Uspsint
public Uspsint(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 USPSINT. 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 USPSINT 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.