shipping 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,53 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>valid_address? (Shipping::UPS)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre><span class="ruby-comment cmt"># File lib/shipping/ups.rb, line 49</span>
14
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_address?</span>( <span class="ruby-identifier">delta</span> = <span class="ruby-value">1.0</span> )
15
- <span class="ruby-ivar">@required</span> = [<span class="ruby-identifier">:ups_account</span>, <span class="ruby-identifier">:ups_user</span>, <span class="ruby-identifier">:ups_password</span>]
16
-
17
- <span class="ruby-identifier">state</span> = <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">has_value?</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">STATES</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">downcase</span>) <span class="ruby-operator">:</span> <span class="ruby-ivar">@state</span>
18
-
19
- <span class="ruby-ivar">@data</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>
20
- <span class="ruby-identifier">b</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">:target</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@data</span>
21
-
22
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">instruct!</span>
23
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccessRequest</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
24
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">AccessLicenseNumber</span> <span class="ruby-ivar">@ups_account</span>
25
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">UserId</span> <span class="ruby-ivar">@ups_user</span>
26
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Password</span> <span class="ruby-ivar">@ups_password</span>
27
- }
28
- <span class="ruby-identifier">b</span>.<span class="ruby-identifier">instruct!</span>
29
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">AddressValidationRequest</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
30
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Request</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
31
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">RequestAction</span> <span class="ruby-value str">&quot;AV&quot;</span>
32
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">TransactionReference</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
33
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">CustomerContext</span> <span class="ruby-node">&quot;#{@city}, #{state} #{@zip}&quot;</span>
34
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">XpciVersion</span> <span class="ruby-constant">API_VERSION</span>
35
- }
36
- }
37
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">Address</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">b</span><span class="ruby-operator">|</span>
38
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">City</span> <span class="ruby-ivar">@city</span>
39
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">StateProvinceCode</span> <span class="ruby-identifier">state</span>
40
- <span class="ruby-identifier">b</span>.<span class="ruby-constant">PostalCode</span> <span class="ruby-ivar">@zip</span>
41
- }
42
- }
43
-
44
- <span class="ruby-identifier">get_response</span> <span class="ruby-value str">&quot;https://wwwcie.ups.com/ups.app/xml/AV&quot;</span>
45
-
46
- <span class="ruby-keyword kw">if</span> <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//AddressValidationResponse/Response/ResponseStatusCode&quot;</span>).<span class="ruby-identifier">text</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;1&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">REXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XPath</span>.<span class="ruby-identifier">first</span>(<span class="ruby-ivar">@response</span>, <span class="ruby-value str">&quot;//AddressValidationResponse/AddressValidationResult/Quality&quot;</span>).<span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">delta</span>
47
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
48
- <span class="ruby-keyword kw">else</span>
49
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
50
- <span class="ruby-keyword kw">end</span>
51
- <span class="ruby-keyword kw">end</span></pre>
52
- </body>
53
- </html>
@@ -1 +0,0 @@
1
- Thu Jun 02 02:00:08 PDT 2005
@@ -1,174 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: README</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>README</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>README
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Wed May 04 21:14:50 PDT 2005</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
- <div id="description">
72
- <h2>Welcome to <a href="../classes/Shipping.html">Shipping</a></h2>
73
- <p>
74
- <a href="../classes/Shipping.html">Shipping</a> is a module that connects
75
- APIs for various shippers like UPS and FedEx.
76
- </p>
77
- <h2>Download</h2>
78
- <ul>
79
- <li>gem install shipping
80
-
81
- </li>
82
- <li><a
83
- href="http://rubyforge.org/projects/shipping">rubyforge.org/projects/shipping</a>
84
-
85
- </li>
86
- <li>svn co <a
87
- href="http://rufy.com/svn/shipping/trunk">rufy.com/svn/shipping/trunk</a>
88
-
89
- </li>
90
- </ul>
91
- <h3>Usage</h3>
92
- <p>
93
- There is going to be some data that will persist for all connections. For
94
- example, you will not want to repeat the fedex account number every time in
95
- your implementation code. To set default values, setup a file called
96
- .shipping.yml in the home directory of the user who will be using this
97
- library. An example file would be:
98
- </p>
99
- <pre>
100
- fedex_url: https://gatewaybeta.fedex.com/GatewayDC
101
- fedex_account: 1234556
102
- fedex_meter: 387878
103
-
104
- ups_account: 7B4F74E3075AEEFF
105
- ups_user: username
106
- ups_password: password
107
- </pre>
108
- <p>
109
- You can set as many default values as you would like in this file.
110
- </p>
111
- <pre>
112
- require 'shipping'
113
-
114
- ups = Shipping::UPS.new :zip =&gt; 97202, :sender_zip =&gt; 10001, :weight =&gt; 2
115
- ups.price =&gt; 8.77
116
- ups.valid_address? =&gt; false
117
-
118
- ups.city = &quot;Portland&quot;
119
- ups.valid_address? =&gt; true
120
- </pre>
121
- <p>
122
- Alternately, you can instantiate the base class and then see both UPS and
123
- FedEx information.
124
- </p>
125
- <pre>
126
- ship = Shipping::Base.new :zip =&gt; 97202, :state =&gt; &quot;OR&quot;, :sender_zip =&gt; 10001, :weight =&gt; 2
127
- ship.ups.price =&gt; 8.77
128
- ship.fedex.price =&gt; 5.17
129
-
130
- ship.city = &quot;Portland&quot;
131
- ship.ups.valid_address? =&gt; true
132
- </pre>
133
- <h2>Authors</h2>
134
- <ul>
135
- <li>Lucas Carlson (<a href="mailto:lucas@rufy.com">lucas@rufy.com</a>)
136
-
137
- </li>
138
- </ul>
139
- <p>
140
- This library is released under the terms of the GNU LGPL.
141
- </p>
142
-
143
- </div>
144
-
145
-
146
- </div>
147
-
148
-
149
- </div>
150
-
151
-
152
- <!-- if includes -->
153
-
154
- <div id="section">
155
-
156
-
157
-
158
-
159
-
160
-
161
-
162
-
163
- <!-- if method_list -->
164
-
165
-
166
- </div>
167
-
168
-
169
- <div id="validator-badges">
170
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
171
- </div>
172
-
173
- </body>
174
- </html>
@@ -1,115 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: base.rb</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>base.rb</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>lib/shipping/base.rb
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Fri May 13 04:18:08 PDT 2005</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
- <div id="description">
72
- <table>
73
- <tr><td valign="top">Author:</td><td>Lucas Carlson (<a href="mailto:lucas@rufy.com">lucas@rufy.com</a>)
74
-
75
- </td></tr>
76
- <tr><td valign="top">Copyright:</td><td>Copyright &#169; 2005 Lucas Carlson
77
-
78
- </td></tr>
79
- <tr><td valign="top">License:</td><td>LGPL
80
-
81
- </td></tr>
82
- </table>
83
-
84
- </div>
85
-
86
-
87
- </div>
88
-
89
-
90
- </div>
91
-
92
-
93
- <!-- if includes -->
94
-
95
- <div id="section">
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
- <!-- if method_list -->
105
-
106
-
107
- </div>
108
-
109
-
110
- <div id="validator-badges">
111
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
112
- </div>
113
-
114
- </body>
115
- </html>
@@ -1,120 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>File: fedex.rb</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="fileHeader">
50
- <h1>fedex.rb</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>lib/shipping/fedex.rb
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Thu Jun 02 01:41:40 PDT 2005</td>
60
- </tr>
61
- </table>
62
- </div>
63
- <!-- banner header -->
64
-
65
- <div id="bodyContent">
66
-
67
-
68
-
69
- <div id="contextContent">
70
-
71
- <div id="description">
72
- <table>
73
- <tr><td valign="top">Author:</td><td>Lucas Carlson (<a href="mailto:lucas@rufy.com">lucas@rufy.com</a>)
74
-
75
- </td></tr>
76
- <tr><td valign="top">Copyright:</td><td>Copyright &#169; 2005 Lucas Carlson
77
-
78
- </td></tr>
79
- <tr><td valign="top">License:</td><td>LGPL
80
-
81
- </td></tr>
82
- </table>
83
- <p>
84
- See <a
85
- href="http://www.fedex.com/us/solutions/wis/pdf/xml_transguide.pdf?link=4">www.fedex.com/us/solutions/wis/pdf/xml_transguide.pdf?link=4</a>
86
- for the full XML-based API
87
- </p>
88
-
89
- </div>
90
-
91
-
92
- </div>
93
-
94
-
95
- </div>
96
-
97
-
98
- <!-- if includes -->
99
-
100
- <div id="section">
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
- <!-- if method_list -->
110
-
111
-
112
- </div>
113
-
114
-
115
- <div id="validator-badges">
116
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
117
- </div>
118
-
119
- </body>
120
- </html>