exact4r 0.6 → 0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,271 +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>Class: EWS::Transporter</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="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td><strong>Class</strong></td>
53
- <td class="class-name-in-header">EWS::Transporter</td>
54
- </tr>
55
- <tr class="top-aligned-row">
56
- <td><strong>In:</strong></td>
57
- <td>
58
- <a href="../../files/lib/ews/transporter_rb.html">
59
- lib/ews/transporter.rb
60
- </a>
61
- <br />
62
- </td>
63
- </tr>
64
-
65
- <tr class="top-aligned-row">
66
- <td><strong>Parent:</strong></td>
67
- <td>
68
- Object
69
- </td>
70
- </tr>
71
- </table>
72
- </div>
73
- <!-- banner header -->
74
-
75
- <div id="bodyContent">
76
-
77
-
78
-
79
- <div id="contextContent">
80
-
81
- <div id="description">
82
- <p>
83
- A <a href="Transporter.html">Transporter</a> is responsible for
84
- communicating with the E-xact Web Service in whichever dialect is chosen by
85
- the user. The available options are:
86
- </p>
87
- <pre>
88
- :json REST with JSON payload
89
- :rest REST with XML payload (default)
90
- :soap SOAP
91
- </pre>
92
- <p>
93
- The <a href="Transporter.html">Transporter</a> will connect to the service,
94
- using SSL if required, and will encode Reqests to send to the service, and
95
- decode Responses received from the service.
96
- </p>
97
- <p>
98
- Once configured to connect to a particular service, it can be used
99
- repeatedly to send as many transactions as required.
100
- </p>
101
-
102
- </div>
103
-
104
-
105
- </div>
106
-
107
- <div id="method-list">
108
- <h3 class="section-bar">Methods</h3>
109
-
110
- <div class="name-list">
111
- <a href="#M000017">new</a>&nbsp;&nbsp;
112
- <a href="#M000018">submit</a>&nbsp;&nbsp;
113
- </div>
114
- </div>
115
-
116
- </div>
117
-
118
-
119
- <!-- if includes -->
120
-
121
- <div id="section">
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
- <!-- if method_list -->
131
- <div id="methods">
132
- <h3 class="section-bar">Public Class methods</h3>
133
-
134
- <div id="method-M000017" class="method-detail">
135
- <a name="M000017"></a>
136
-
137
- <div class="method-heading">
138
- <a href="#M000017" class="method-signature">
139
- <span class="method-name">new</span><span class="method-args">(url = &quot;https://api.e-xact.com/&quot;, options = {})</span>
140
- </a>
141
- </div>
142
-
143
- <div class="method-description">
144
- <p>
145
- Initialize a <a href="Transporter.html">Transporter</a>.
146
- </p>
147
- <p>
148
- You can specify the URL you would like the <a
149
- href="Transporter.html">Transporter</a> to connect to, although it defaults
150
- to <a href="https://api.e-xact.com">api.e-xact.com</a>, the location of our
151
- transaction processing web service.
152
- </p>
153
- <p>
154
- You can also specify a hash of options as follows:
155
- </p>
156
- <pre>
157
- :server_cert the path to the server's certificate
158
- :issuer_cert the path to the certificate of the issuer of the server certificate
159
- :transport_type the transport_type for this transporter (defaults to :rest)
160
- </pre>
161
- <p>
162
- The default certificates are those required to connect to <a
163
- href="https://api.e-xact.com">api.e-xact.com</a> and the default
164
- <tt>transport_type</tt> is <tt>:rest</tt>. The default
165
- <tt>transport_type</tt> can be overridden on a per-transaction basis, if
166
- you choose to do so, by specifying it as a parameter to the <tt><a
167
- href="Transporter.html#M000018">submit</a></tt> method.
168
- </p>
169
- <p><a class="source-toggle" href="#"
170
- onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
171
- <div class="method-source-code" id="M000017-source">
172
- <pre>
173
- <span class="ruby-comment cmt"># File lib/ews/transporter.rb, line 32</span>
174
- 32: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">url</span> = <span class="ruby-value str">&quot;https://api.e-xact.com/&quot;</span>, <span class="ruby-identifier">options</span> = {})
175
- 33: <span class="ruby-ivar">@url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">url</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\/$/</span>,<span class="ruby-value str">''</span>))
176
- 34: <span class="ruby-identifier">base</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword kw">__FILE__</span>)
177
- 35: <span class="ruby-ivar">@server_cert</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:server_cert</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">base</span><span class="ruby-operator">+</span><span class="ruby-value str">&quot;/../../certs/exact.cer&quot;</span>
178
- 36: <span class="ruby-ivar">@issuer_cert</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:issuer_cert</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">base</span><span class="ruby-operator">+</span><span class="ruby-value str">&quot;/../../certs/equifax_ca.cer&quot;</span>
179
- 37: <span class="ruby-ivar">@transport_type</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:transport_type</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">:json</span>
180
- 38: <span class="ruby-keyword kw">end</span>
181
- </pre>
182
- </div>
183
- </div>
184
- </div>
185
-
186
- <h3 class="section-bar">Public Instance methods</h3>
187
-
188
- <div id="method-M000018" class="method-detail">
189
- <a name="M000018"></a>
190
-
191
- <div class="method-heading">
192
- <a href="#M000018" class="method-signature">
193
- <span class="method-name">submit</span><span class="method-args">(transaction, transport_type = nil)</span>
194
- </a>
195
- </div>
196
-
197
- <div class="method-description">
198
- <p>
199
- Submit a transaction request to the server
200
- </p>
201
- <table>
202
- <tr><td valign="top"><tt>transaction</tt>:</td><td>the Request object to encode for transmission to the server
203
-
204
- </td></tr>
205
- <tr><td valign="top"><tt>transport_type</tt>:</td><td>(optional) the transport type to use for this transaction only. If it is
206
- not specified, the <a href="Transporter.html">Transporter</a>&#8216;s
207
- transport type will be used
208
-
209
- </td></tr>
210
- </table>
211
- <p><a class="source-toggle" href="#"
212
- onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
213
- <div class="method-source-code" id="M000018-source">
214
- <pre>
215
- <span class="ruby-comment cmt"># File lib/ews/transporter.rb, line 44</span>
216
- 44: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">submit</span>(<span class="ruby-identifier">transaction</span>, <span class="ruby-identifier">transport_type</span> = <span class="ruby-keyword kw">nil</span>)
217
- 45: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Request not supplied&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">transaction</span>.<span class="ruby-identifier">nil?</span>
218
- 46: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">transaction</span>.<span class="ruby-identifier">valid?</span>
219
- 47:
220
- 48: <span class="ruby-identifier">transport_type</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@transport_type</span>
221
- 49:
222
- 50: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Transport type #{transport_type} is not supported&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@@transport_types</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">transport_type</span>
223
- 51:
224
- 52: <span class="ruby-identifier">transport_details</span> = <span class="ruby-ivar">@@transport_types</span>[<span class="ruby-identifier">transport_type</span>]
225
- 53:
226
- 54: <span class="ruby-identifier">request</span> = <span class="ruby-identifier">build_http_request</span>(<span class="ruby-identifier">transaction</span>, <span class="ruby-identifier">transport_type</span>, <span class="ruby-identifier">transport_details</span>[<span class="ruby-identifier">:suffix</span>])
227
- 55: <span class="ruby-identifier">request</span>.<span class="ruby-identifier">basic_auth</span>(<span class="ruby-identifier">transaction</span>.<span class="ruby-identifier">gateway_id</span>, <span class="ruby-identifier">transaction</span>.<span class="ruby-identifier">password</span>)
228
- 56: <span class="ruby-identifier">request</span>.<span class="ruby-identifier">add_field</span> <span class="ruby-value str">&quot;Accept&quot;</span>, <span class="ruby-identifier">transport_details</span>[<span class="ruby-identifier">:content_type</span>]
229
- 57: <span class="ruby-identifier">request</span>.<span class="ruby-identifier">add_field</span> <span class="ruby-value str">&quot;User-Agent&quot;</span>, <span class="ruby-value str">&quot;Ruby&quot;</span>
230
- 58: <span class="ruby-identifier">request</span>.<span class="ruby-identifier">add_field</span> <span class="ruby-value str">&quot;Content-type&quot;</span>, <span class="ruby-node">&quot;#{transport_details[:content_type]}; charset=UTF-8&quot;</span>
231
- 59:
232
- 60: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">get_connection</span>.<span class="ruby-identifier">request</span>(<span class="ruby-identifier">request</span>)
233
- 61:
234
- 62: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">response</span>
235
- 63: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPSuccess</span> <span class="ruby-keyword kw">then</span> <span class="ruby-constant">EWS</span><span class="ruby-operator">::</span><span class="ruby-constant">Transaction</span><span class="ruby-operator">::</span><span class="ruby-constant">Mapping</span>.<span class="ruby-identifier">send</span> <span class="ruby-node">&quot;#{transport_type}_to_response&quot;</span>, <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>
236
- 64: <span class="ruby-keyword kw">else</span>
237
- 65: <span class="ruby-identifier">r</span> = <span class="ruby-operator">::</span><span class="ruby-constant">EWS</span><span class="ruby-operator">::</span><span class="ruby-constant">Transaction</span><span class="ruby-operator">::</span><span class="ruby-constant">Response</span>.<span class="ruby-identifier">new</span>
238
- 66: <span class="ruby-keyword kw">if</span>(<span class="ruby-identifier">transport_type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:soap</span>)
239
- 67: <span class="ruby-comment cmt"># we may have a SOAP Fault</span>
240
- 68: <span class="ruby-identifier">r</span> = <span class="ruby-constant">EWS</span><span class="ruby-operator">::</span><span class="ruby-constant">Transaction</span><span class="ruby-operator">::</span><span class="ruby-constant">Mapping</span>.<span class="ruby-identifier">send</span> <span class="ruby-node">&quot;#{transport_type}_to_response&quot;</span>, <span class="ruby-identifier">response</span>.<span class="ruby-identifier">body</span>
241
- 69: <span class="ruby-keyword kw">end</span>
242
- 70:
243
- 71: <span class="ruby-comment cmt"># SOAP Fault may already have populated the error_number etc.</span>
244
- 72: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">r</span>.<span class="ruby-identifier">error_number</span>
245
- 73: <span class="ruby-comment cmt"># populate the error number and description</span>
246
- 74: <span class="ruby-identifier">r</span>.<span class="ruby-identifier">error_number</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">to_i</span>
247
- 75: <span class="ruby-identifier">r</span>.<span class="ruby-identifier">error_description</span> = <span class="ruby-identifier">response</span>.<span class="ruby-identifier">message</span>
248
- 76: <span class="ruby-keyword kw">end</span>
249
- 77:
250
- 78: <span class="ruby-identifier">r</span>
251
- 79: <span class="ruby-keyword kw">end</span>
252
- 80:
253
- 81: <span class="ruby-keyword kw">end</span>
254
- </pre>
255
- </div>
256
- </div>
257
- </div>
258
-
259
-
260
- </div>
261
-
262
-
263
- </div>
264
-
265
-
266
- <div id="validator-badges">
267
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
268
- </div>
269
-
270
- </body>
271
- </html>
data/doc/created.rid DELETED
@@ -1 +0,0 @@
1
- Thu, 14 Aug 2008 11:12:34 +1000
@@ -1,132 +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: CHANGELOG</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>CHANGELOG</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>CHANGELOG
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Thu Aug 14 11:12:08 +1000 2008</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>v0.6</h2>
73
- <pre>
74
- Added client-side request validation
75
- </pre>
76
- <h2>v0.5.3</h2>
77
- <pre>
78
- Added fake response messages for testing purposes
79
- Moved EWS::Transaction::Transporter to EWS::Transporter
80
- Fixed typos
81
- </pre>
82
- <h2>v0.5.2</h2>
83
- <pre>
84
- Updated Transporter to play nicely with mod_security
85
- Stripped trailing '/'s from URLs
86
- Transporter ow re-uses connection
87
- Updated RDoc with test login details
88
- </pre>
89
- <h2>v0.5.1</h2>
90
- <pre>
91
- Added CHANGELOG, LICENCE &amp; VERSION
92
- Ensured README etc. were included in gem and displayed as default in RDoc
93
- Renamed send() to submit() in Transporter
94
- Fixed path to default E-xact certificates
95
- </pre>
96
- <h2>v0.5</h2>
97
- <pre>
98
- Initial Release
99
- </pre>
100
-
101
- </div>
102
-
103
-
104
- </div>
105
-
106
-
107
- </div>
108
-
109
-
110
- <!-- if includes -->
111
-
112
- <div id="section">
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
- <!-- if method_list -->
122
-
123
-
124
- </div>
125
-
126
-
127
- <div id="validator-badges">
128
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
129
- </div>
130
-
131
- </body>
132
- </html>
@@ -1,109 +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: LICENCE</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>LICENCE</h1>
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td><strong>Path:</strong></td>
54
- <td>LICENCE
55
- </td>
56
- </tr>
57
- <tr class="top-aligned-row">
58
- <td><strong>Last Update:</strong></td>
59
- <td>Fri May 30 11:01:37 +1000 2008</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
- <h1>Licence Terms</h1>
73
- <p>
74
- Distributed under the Ruby software <a
75
- href="http://www.ruby-lang.org/en/LICENSE.txt">licence</a>
76
- </p>
77
-
78
- </div>
79
-
80
-
81
- </div>
82
-
83
-
84
- </div>
85
-
86
-
87
- <!-- if includes -->
88
-
89
- <div id="section">
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
- <!-- if method_list -->
99
-
100
-
101
- </div>
102
-
103
-
104
- <div id="validator-badges">
105
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
106
- </div>
107
-
108
- </body>
109
- </html>