|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /usr/local/share/man/man3/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.26 (Pod::Simple 3.23)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Business::UPS 3"
.TH Business::UPS 3 "2010-05-04" "perl v5.8.8" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Business::UPS \- A UPS Interface Module
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Business::UPS;
\&
\& my ($shipping,$ups_zone,$error) = getUPS(qw/GNDCOM 23606 23607 50/);
\& $error and die "ERROR: $error\en";
\& print "Shipping is \e$$shipping\en";
\& print "UPS Zone is $ups_zone\en";
\&
\& %track = UPStrack("z10192ixj29j39");
\& $track{error} and die "ERROR: $track{error}";
\&
\& # \*(AqDelivered\*(Aq or \*(AqIn\-transit\*(Aq
\& print "This package is $track{Current Status}\en";
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
A way of sending four arguments to a module to get shipping charges
that can be used in, say, a \s-1CGI\s0.
.SH "REQUIREMENTS"
.IX Header "REQUIREMENTS"
I've tried to keep this package to a minimum, so you'll need:
.IP "\(bu" 4
Perl 5.003 or higher
.IP "\(bu" 4
LWP::UserAgent Module
.SH "ARGUMENTS for \fIgetUPS()\fP"
.IX Header "ARGUMENTS for getUPS()"
Call the subroutine with the following values:
.PP
.Vb 4
\& 1. Product code (see product\-codes.txt)
\& 2. Origin Zip Code
\& 3. Destination Zip Code
\& 4. Weight of Package
.Ve
.PP
and optionally:
.PP
.Vb 7
\& 5. Country Code, (see country\-codes.txt)
\& 6. Rate Chart (drop\-off, pick\-up, etc \- see below)
\& 6. Length,
\& 7. Width,
\& 8. Height,
\& 9. Oversized (defined if oversized), and
\& 10. COD (defined if C.O.D.)
.Ve
.IP "1." 4
Product Codes:
.Sp
.Vb 10
\& 1DM Next Day Air Early AM
\& 1DML Next Day Air Early AM Letter
\& 1DA Next Day Air
\& 1DAL Next Day Air Letter
\& 1DP Next Day Air Saver
\& 1DPL Next Day Air Saver Letter
\& 2DM 2nd Day Air A.M.
\& 2DA 2nd Day Air
\& 2DML 2nd Day Air A.M. Letter
\& 2DAL 2nd Day Air Letter
\& 3DS 3 Day Select
\& GNDCOM Ground Commercial
\& GNDRES Ground Residential
\& XPR Worldwide Express
\& XDM Worldwide Express Plus
\& XPRL Worldwide Express Letter
\& XDML Worldwide Express Plus Letter
\& XPD Worldwide Expedited
.Ve
.Sp
In an \s-1HTML\s0 \*(L"option\*(R" input it might look like this:
.Sp
.Vb 10
\& <OPTION VALUE="1DM">Next Day Air Early AM
\& <OPTION VALUE="1DML">Next Day Air Early AM Letter
\& <OPTION SELECTED VALUE="1DA">Next Day Air
\& <OPTION VALUE="1DAL">Next Day Air Letter
\& <OPTION VALUE="1DP">Next Day Air Saver
\& <OPTION VALUE="1DPL">Next Day Air Saver Letter
\& <OPTION VALUE="2DM">2nd Day Air A.M.
\& <OPTION VALUE="2DA">2nd Day Air
\& <OPTION VALUE="2DML">2nd Day Air A.M. Letter
\& <OPTION VALUE="2DAL">2nd Day Air Letter
\& <OPTION VALUE="3DS">3 Day Select
\& <OPTION VALUE="GNDCOM">Ground Commercial
\& <OPTION VALUE="GNDRES">Ground Residential
.Ve
.IP "2." 4
Origin Zip(tm) Code
.Sp
Origin Zip Code as a number or string (\s-1NOT\s0 +4 Format)
.IP "3." 4
Destination Zip(tm) Code
.Sp
Destination Zip Code as a number or string (\s-1NOT\s0 +4 Format)
.IP "4." 4
Weight
.Sp
Weight of the package in pounds
.IP "5." 4
Country
.Sp
Defaults to \s-1US\s0
.IP "6." 4
Rate Chart
.Sp
How does the package get to \s-1UPS:\s0
.Sp
Can be one of the following:
.Sp
.Vb 5
\& Regular Daily Pickup
\& On Call Air
\& One Time Pickup
\& Letter Center
\& Customer Counter
.Ve
.SH "ARGUMENTS for \fIUPStrack()\fP"
.IX Header "ARGUMENTS for UPStrack()"
The tracking number.
.PP
.Vb 3
\& use Business::UPS;
\& %t = UPStrack("1ZX29W290250xxxxxx");
\& print "This package is $track{\*(AqCurrent Status\*(Aq}\en";
.Ve
.SH "RETURN VALUES"
.IX Header "RETURN VALUES"
.IP "\fIgetUPS()\fR" 4
.IX Item "getUPS()"
.Vb 1
\& The raw LWP::UserAgent get returns a list with the following values:
\&
\& ## Desc Typical Value
\& \-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-
\& 0. Name of server: UPSOnLine3
\& 1. Product code: GNDCOM
\& 2. Orig Postal: 23606
\& 3. Country: US
\& 4. Dest Postal: 23607
\& 5. Country: US
\& 6. Shipping Zone: 002
\& 7. Weight (lbs): 50
\& 8. Sub\-total Cost: 7.75
\& 9. Addt\*(Aql Chrgs: 0.00
\& 10. Total Cost: 7.75
.Ve
.IP "\fIUPStrack()\fR" 4
.IX Item "UPStrack()"
The hash that's returned is like the following:
.Sp
.Vb 10
\& \*(AqLast Updated\*(Aq => \*(AqJun 10 2003 12:28 P.M.\*(Aq
\& \*(AqShipped On\*(Aq => \*(AqJune 9, 2003\*(Aq
\& \*(AqSigned By\*(Aq => \*(AqSIGNATURE\*(Aq
\& \*(AqShipped To\*(Aq => \*(AqLOS ANGELES,CA,US\*(Aq
\& \*(AqScanning\*(Aq => HASH(0x146e0c) (more later...)
\& \*(AqActivity Count\*(Aq => 5
\& \*(AqWeight\*(Aq => \*(Aq16.00 Lbs\*(Aq
\& \*(AqCurrent Status\*(Aq => \*(AqDelivered\*(Aq
\& \*(AqLocation\*(Aq => \*(AqRESIDENTIAL\*(Aq
\& \*(AqService Type\*(Aq => \*(AqSTANDARD\*(Aq
.Ve
.Sp
Notice the key 'Scanning' is a reference to a hash.
(Which is a reference to another hash.)
.Sp
Scanning will contain a hash with keys 1 .. (Activity Count)
Each of those values is another hash, holding a reference to
an activity that's happened to an item. (See example for
details)
.Sp
.Vb 9
\& %hash{Scanning}{1}{\*(Aqlocation\*(Aq} = \*(AqMESQUITE,TX,US\*(Aq;
\& %hash{Scanning}{1}{\*(Aqdate\*(Aq} = \*(AqJun 10, 2003\*(Aq;
\& %hash{Scanning}{1}{\*(Aqtime\*(Aq} = \*(Aq12:55 A.M.\*(Aq;
\& %hash{Scanning}{1}{\*(Aqactivity\*(Aq} = \*(AqARRIVAL SCAN\*(Aq;
\& %hash{Scanning}{2}{\*(Aqlocation\*(Aq} = \*(AqMESQUITE,TX,US\*(Aq;
\& .
\& .
\& .
\& %hash{Scanning}{x}{\*(Aqactivity\*(Aq} = \*(AqDELIVERED\*(Aq;
.Ve
.Sp
\&\s-1NOTE:\s0 The items generally go in reverse chronological order.
.SH "EXAMPLE"
.IX Header "EXAMPLE"
.IP "\fIgetUPS()\fR" 4
.IX Item "getUPS()"
To retreive the shipping of a 'Ground Commercial' Package
weighing 25lbs. sent from 23001 to 24002 this package would
be called like this:
.Sp
.Vb 2
\& #!/usr/local/bin/perl
\& use Business::UPS;
\&
\& my ($shipping,$ups_zone,$error) = getUPS(qw/GNDCOM 23001 23002 25/);
\& $error and die "ERROR: $error\en";
\& print "Shipping is \e$$shipping\en";
\& print "UPS Zone is $ups_zone\en";
.Ve
.IP "\fIUPStrack()\fR" 4
.IX Item "UPStrack()"
.Vb 1
\& #!/usr/local/bin/perl
\&
\& use Business::UPS;
\&
\& %t = UPStrack("z10192ixj29j39");
\& $t{error} and die "ERROR: $t{error}";
\&
\& print "This package is $t{\*(AqCurrent Status\*(Aq}\en"; # \*(AqDelivered\*(Aq or
\& # \*(AqIn\-transit\*(Aq
\& print "More info:\en";
\& foreach $key (keys %t) {
\& print "KEY: $key = $t{$key}\en";
\& }
\&
\& %activities = %{$t{\*(AqScanning\*(Aq}};
\&
\& print "Package activity:\en";
\& for (my $num = $t{\*(AqActivity Count\*(Aq}; $num > 0; $num\-\-)
\& {
\& print "\-\- ITEM $num \-\-\en";
\& foreach $newkey (keys %{$activities{$num}})
\& {
\& print "$newkey: $activities{$num}{$newkey}\en";
\& }
\& }
.Ve
.SH "BUGS"
.IX Header "BUGS"
Probably lots. Contact me if you find them.
.SH "AUTHOR"
.IX Header "AUTHOR"
Justin Wheeler <upsmodule@datademons.com>
.PP
mailto:upsmodule@datademons.com
.PP
This software was originally written by Mark Solomon <mailto:msoloman@seva.net> (http://www.seva.net/~msolomon/)
.PP
\&\s-1NOTE:\s0 \s-1UPS\s0 is a registered trademark of United Parcel Service. Due to \s-1UPS\s0 licensing, using this software is not
be endorsed by \s-1UPS\s0, and may not be allowed. Use at your own risk.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIperl\fR\|(1).
.SH "POD ERRORS"
.IX Header "POD ERRORS"
Hey! \fBThe above document had some coding errors, which are explained below:\fR
.IP "Around line 253:" 4
.IX Item "Around line 253:"
=back doesn't take any parameters, but you said =back 4