init()
user_error()
validate()
rate_request()
log_level()
event_handlers()
_new_subclass()
Business::Shipping - Rates and tracking for UPS and USPS
Version 1.54
use Business::Shipping; my $rate_request = Business::Shipping->rate_request( shipper => 'Offline::UPS', service => 'GNDRES', from_zip => '98682', to_zip => '98270', weight => 5.00, ); $rate_request->go() or die $rate_request->user_error(); print $rate_request->total_charges();
Business::Shipping currently supports three shippers:
perl -MCPAN -e 'install Bundle::Business::Shipping'
See the INSTALL file for more details.
Some of these modules are not required to use only one shipper. See the INSTALL file for more information.
Bundle::DBD::CSV (any) Business::Shipping::DataFiles (any) Cache::FileCache (any) Class::MethodMaker::Engine (any) Clone (any) Config::IniFiles (any) Crypt::SSLeay (any) Log::Log4perl (any) LWP::UserAgent (any) Math::BaseCnv (any) Scalar::Util (1.10) XML::DOM (any) XML::Simple (2.05)
Be careful to read, understand, and comply with the terms of use for the provider that you will use.
No signup required. Business::Shipping::DataFiles
has all of rate tables.
icustomercare@usps.com
) or phone: 1-800-344-7779.
Log4perl is used for logging error, debug, etc. messages. See config/log4perl.conf. For simple manipulation of the current log level, use the Business::Shipping->log_level( $log_level ) class method (below).
To preload all modules, call Business::Shipping with this syntax:
use Business::Shipping { preload => 'All' };
To preload the modules for just one shipper:
use Business::Shipping { preload => 'USPS_Online' }; Without preloading, some modules will be loaded at runtime. Normally, runtime loading is the best mode of operation. However, there are some circumstances when preloading is advantagous. For example:
init()
Generic attribute setter.
user_error()
Log and store errors that should be visibile to the user.
validate()
Confirms that the object is valid. Checks that required attributes are set.
rate_request()
This method is used to request shipping rate information from online providers or offline tables. A hash is accepted as input. The acceptable values are determined by the shipper class, but the following are common to all:
Business::Shipping::SHIPPER
. For example, UPS_Online
.
There are some additional common values:
log_level()
Sets the log level for all Business::Shipping objects.
Takes a scalar that can be 'debug', 'info', 'warn', 'error', or 'fatal'.
event_handlers()
For backwards compatibility only.
_new_subclass()
Private Method.
Generates an object of a given subclass dynamically. Will dynamically 'use' the corresponding module, unless runtime module loading has been disabled via the 'preload' option.
Important modules that are related to Business::Shipping:
Other CPAN modules that are simliar to Business::Shipping:
It is appreciated when users mention their use of Business::Shipping to the author and/or on their website or in their application.
UserTag/business-shipping.tag
.
The website carries the most recent version.
http://www.kavod.com/Business-Shipping
This module is supported by the author. Please report any bugs or feature
requests to bug-business-shipping@rt.cpan.org
, or through the web interface
at http://rt.cpan.org. The author will be notified, and then you'll
automatically be notified of progress on your bug as the author makes changes.
See the TODO file for a comprehensive list of known bugs.
See the CREDITS file.
Dan Browning <db@kavod.com>, Kavod Technologies, http://www.kavod.com.
Copyright (c) 2003-2004 Kavod Technologies, Dan Browning. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See LICENSE for more info.