NAME
Business::Shipping::RateRequest - Abstract class for shipping cost estimation
VERSION
$Rev: 159 $ $Date: 2004-09-09 20:26:14 -0700 (Thu, 09 Sep 2004) $
DESCRIPTION
Abstract Class: real implementations are done in subclasses.
Represents a request for shipping cost estimation.
METHODS
is_success()
Boolean. 1 = Rate Request was successful.
cache()
Boolean. 1 = Save results using Cache::FileCache, and reload them if an identical request is made later. See submit() for implementation details.
invalid()
Boolean. 1 = Rate request was invalid, because user supplied invalid data. This can be useful in determining whether or not to log incident reports (see UserTag/business-shipping.tag for an example implementation).
results()
Hashref. Stores the results of a rate request, for example:
{ 'UPS' => [ { id => 1, charges => 10.50 }, { id => 2, charges => 23.00 } ] }
See _handle_response() for implementation details.
shipment()
Stores a Business::Shipping::Shipment object. Many methods are forwarded to it. At this time, each RateRequest only has one Shipment.
$shipment->go( %args )
This method sets some values (optional), performs the request, then parses the results.
validate()
Does some validation common to all RateRequest objects, but most of the validation goes on in the subclass.
get_unique_hash()
Calls unique() on all subclasses to determine a list of unique elements.
Returns a hash of element_name => element_value. Used by gen_unique_key().
hash_to_sorted_values()
Sorts hash alphabetically, then returns just the values. (So that the key will have the values sorted in the same order always).
gen_unique_key( )
Calls get_unique_hash(), sorts them with hash_to_sorted_values(), then returns them in string format.
total_charges()
Iterates the $self->results hash and sums the charges from each package->charges. Returns the total.
get_unique_keys()
_gen_unique_values()
$self->calc_debug_string()
Arrange the values of some important variables in a pretty format. Return a scalar string.
$self->display_price_components()
Return formatted string of price component information
AUTHOR
Dan Browning <db@kavod.com>, Kavod Technologies, http://www.kavod.com.
COPYRIGHT AND LICENCE
Copyright (c) 2003-2004 Kavod Technologies, Dan Browning. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. See LICENSE for more info.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 118:
Expected '=item *'