WebService::UPS::TrackedPackage - Generated from the WebService::UPS::TrackRequest Object, Use this object to get tracking infomation
my $Package = WebService::UPS::TrackRequest->new; $Package->Username('kbrandt'); $Package->Password('topsecrent'); $Package->License('8C3D7EE8FZZZZZ4'); $Package->TrackingNumber('1ZA45Y5111111111'); print $Package->Username(); my $trackedpackage = $Package->requestTrack(); $trackedpackage->isError()
$trackedpackage = WebService::UPS::TrackRequest->new( _returned_xml => $object->requestTrack());
The constructor method that creates a new Request Object. You probably should not be calling this directly as above, rather it should returned from the WebService::UPS::TrackRequest Object
This is populated by the WebService::UPS::TrackRequest Object, you shouldn't be messing with it in general. But if you dump it with dumper, and you are clever, you might be able to access things that my module doesn't have getters for.
Set this to something to make a lot of stuff appear
$trackedpackage->isError()
Returns 1 if the UPS response says there was an error with your TrackRequest, if no error, returns 0.
$trackedpackage->getError()
Returns the UPS response Error if your trackrequest was invalid
my $addressObject = $trackedpackage->getShipperAddress()
Returns a WebService::UPS::Address object with the shipper's address information.
See getShipperAddress, but for where the package is going.
$trackedpackage->getActivityCount()
Returns how many 'Activity Entries' there are. This is useful if you want to iterate over the activity and return a bunch of WebService::UPS::Activity Objects. To itterate with it, make sure you use (- 1).
$trackedpackage->getActivity(1)
Returns a WebService::UPS::Activity object at the index specified (1 in the above example). If no argument is provided, the method will assume 0, which seems to be the most recent entry. Use getActivityCount to find out how many activity Entries there are.
$trackedpackage->getCurrentStatus()
Returns a string with UPS's summary of the shipment's current Status
$trackedpackage->getScheduledDeliveryDate()
Returns when UPS thinks your package will be delivered might be returned, but be careful!!, this will still be there if the delivery date has been rescheduled.
$trackedpackage->getActivityList()
A convenience method that uses other methods. This displays a tab delimited list with the Date, Location, and Description of all activity for the package (Also, a header). You might want to look at this as an example of how to use this module.
$trackedpackage->getWeight()
Returns a string "Weight Unit", for example "18.00 LBS"
$trackedpackage->getDescription()
Returns a string which should be whatever you specified as the description attribute in your TrackRequest Object. However, it is fetched from the UPS response, hence 'should'.
Kyle Brandt, kyle@kbrandt.com http://www.kbrandt.com
To install WebService::UPS::Address, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::UPS::Address
CPAN shell
perl -MCPAN -e shell install WebService::UPS::Address
For more information on module installation, please visit the detailed CPAN module installation guide.