Net-UPS
view release on metacpan or search on metacpan
lib/Net/UPS.pm view on Meta::CPAN
The list provided in I<exclude> will be excluded from the list of available services. For example, assume you don't want rates for 'NEXT_DAY_AIR_SAVER', '2ND_DAY_AIR_AM' and 'NEXT_DAY_AIR_EARLY_AM' returned:
$service = $ups->from_for_rates($from, $to, $package, {
exclude => ['NEXT_DAY_AIR_SAVER', '2ND_DAY_AIR_AM', 'NEXT_DAY_AIR_EARLY_AM']});
Note that excluding services may even generate an empty service list, because for some location excluded services might be the only services available. You better contact your UPS representative for consultation. As of this writing I haven't done tha...
=back
=item service ()
Returns the last service used by the most recent call to C<rate()>.
=item validate_address ($address)
=item validate_address ($address, \%args)
Validates a given address against UPS' U.S. Address Validation service. C<$address> can be one of the following:
=over 4
=item *
US Zip Code
=item *
Hash Reference - keys of the hash should correspond to attributes of Net::UPS::Address
=item *
Net::UPS::Address class instance
=back
C<%args>, if present, contains arguments that effect validation results. As of this release the only supported argument is I<tolerance>, which defines threshold for address matches. I<tolerance> is a floating point number between 0 and 1, inclusively...
my $addresses = $ups->validate_address($address);
unless ( defined $addresses ) {
die $ups->errstr;
}
unless ( @$addresses ) {
die "Address is not correct, nor are there any suggestions\n";
}
if ( $addresses->[0]->is_match ) {
print "Address Matches Exactly!\n";
} else {
print "Your address didn't match exactly. Following are some valid suggestions\n";
for (@$addresses ) {
printf("%s, %s %s\n", $_->city, $_->state, $_->postal_code);
}
}
=pod
=back
=head1 BUGS AND KNOWN ISSUES
No bugs are known of as of this release. If you think you found a bug, document it at http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-UPS. It's more likely to get noticed in there than in my busy inbox.
=head1 TODO
There are still a lot of features UPS.com offers in its Online Tools API that Net::UPS doesn't handle. This is the list of features that need to be supported before Net::UPS can claim full compliance.
=head2 PACKAGE OPTIONS
Following features needs to be supported by Net::UPS::Package class to define additional package options:
=over 4
=item COD
=item Delivery Confirmation
=item Insurance
=item Additional Handling flag
=back
=head2 SERVICE OPTIONS
Following featureds need to be supported by Net::UPS::Service as well as in form of arguments to rate() and shop_for_rates() methods:
=over 4
=item Saturday Pickup
=item Saturday Delivery
=item COD Service request
=item Handling Charge
=back
=head1 AUTHOR
Sherzod B. Ruzmetov E<lt>sherzodr@cpan.orgE<gt>, http://author.handalak.com/
=head2 CREDITS
Thanks to Christian - E<lt>cpan [AT] pickledbrain.comE<gt> for locating and fixing a bug in Net::UPS::Package::is_oversized(). See the source for details.
=head1 COPYRIGHT
Copyright (C) 2005 Sherzod Ruzmetov. All rights reserved. This library is free software.
You can modify and/or distribute it under the same terms as Perl itself.
=head1 DISCLAIMER
THIS LIBRARY IS PROVIDED WITH USEFULNES IN MIND, BUT WITHOUT ANY GUARANTEE (NEITHER IMPLIED NOR EXPRESSED) OF ITS FITNES FOR A PARTICUALR PURPOSE. USE IT AT YOUR OWN RISK.
=head1 SEE ALSO
L<Net::UPS::Address|Net::UPS::Address>, L<Net::UPS::Rate>, L<Net::UPS::Service|Net::UPS::Service>, L<Net::UPS::Package|Net::UPS::Package>, L<Net::UPS::Tutorial|Net::UPS::Tutorial>
=head1 APPENDIXES
( run in 1.299 second using v1.01-cache-2.11-cpan-39bf76dae61 )