exact4r 0.5

Sign up to get free protection for your applications and to get access to all the features.
data/doc/created.rid ADDED
@@ -0,0 +1 @@
1
+ Fri, 30 May 2008 00:08:04 +1000
@@ -0,0 +1,230 @@
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 28 17:24:48 +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>exact4r</h1>
73
+ <p>
74
+ Provides access to E-xact Web Services API, which allows the submission via
75
+ REST, JSON or SOAP.
76
+ </p>
77
+ <h2>Getting Started</h2>
78
+ <h1>1. Submit a transaction</h1>
79
+ <pre>
80
+ # build a purchase request
81
+ request = EWS::Transaction::Request.new({
82
+ :transaction_type =&gt; :purchase,
83
+ :amount =&gt; 10.50,
84
+ :cardholder_name =&gt; &quot;Simon Brown&quot;,
85
+ :cc_number =&gt; &quot;4111111111111111&quot;,
86
+ :cc_expiry =&gt; &quot;1005&quot;, # MUST be YYMM format
87
+ :gateway_id =&gt; &quot;XXXXXXX&quot;, # which gateway to submit the request to
88
+ :password =&gt; &quot;YYYYYY&quot; # your password for that gateway
89
+ })
90
+
91
+ transporter = EWS::Transaction::Transporter.new
92
+ response = transporter.send(request) # submits using REST (XML) by default
93
+
94
+ # submit using JSON, or
95
+ response = transporter.send(request, :json)
96
+
97
+ # submit using SOAP, or
98
+ response = transporter.send(request, :soap)
99
+
100
+ # submit explicitly via REST
101
+ response = transporter.send(request, :rest)
102
+
103
+ # The response object is independent of type of transport chosen.
104
+ # We decode the payload into a regular object
105
+ response.transaction_tag # 1234
106
+ response.exact_resp_code # &quot;00&quot;
107
+ response.exact_message # &quot;Transaction Normal&quot;
108
+ response.bank_resp_code # &quot;00&quot;
109
+ response.bank_message # &quot;APPROVED&quot;
110
+ </pre>
111
+ <h1>2. Find information on an existing transaction</h1>
112
+ <pre>
113
+ # build a purchase request
114
+ request = EWS::Transaction::Request.new({
115
+ :transaction_type =&gt; :purchase,
116
+ :amount =&gt; 10.50,
117
+ :cardholder_name =&gt; &quot;Simon Brown&quot;,
118
+ :cc_number =&gt; &quot;4111111111111111&quot;,
119
+ :cc_expiry =&gt; &quot;1005&quot;, # MUST be YYMM format
120
+ :gateway_id =&gt; &quot;XXXXXXX&quot;, # which gateway to submit the request to
121
+ :password =&gt; &quot;YYYYYY&quot; # your password for that gateway
122
+ })
123
+
124
+ transporter = EWS::Transaction::Transporter.new
125
+ response = transporter.send(request) # submits using REST (XML) by default
126
+
127
+ # you need to know the transaction tag of the transaction you are looking for
128
+ find_request = EWS::Transaction::Request.new({
129
+ :transaction_type =&gt; :transaction_details,
130
+ :transaction_tag =&gt; response.transaction_tag,
131
+ :gateway_id =&gt; &quot;XXXXXXX&quot;,
132
+ :password =&gt; &quot;YYYYYY&quot;
133
+ })
134
+
135
+ find_response = transporter.send(find_request, :json) # again, can choose your transport type as before
136
+ find_response.cc_number # 4111111111111111
137
+ find_response.amount # 10.50
138
+ </pre>
139
+ <h1>3. Re-using a Transporter</h1>
140
+ <pre>
141
+ # The transporter object can be re-used across multiple transactions, so set it up once
142
+ # and forget about it.
143
+ transporter = EWS::Transaction::Transporter.new
144
+
145
+ # now let's submit do a recurring seed purchase...
146
+ rsp_req = EWS::Transaction::Request.new({
147
+ :transaction_type =&gt; :recurring_seed_purchase,
148
+ :amount =&gt; 12.00,
149
+ :cardholder_name =&gt; &quot;Simon Brown&quot;,
150
+ :cc_number =&gt; &quot;4111111111111111&quot;,
151
+ :cc_expiry =&gt; &quot;1005&quot;,
152
+ :gateway_id =&gt; &quot;XXXXXX&quot;,
153
+ :password =&gt; &quot;YYYYYY&quot;
154
+ })
155
+
156
+ rsp_resp = transporter.send(rsp_req, :json)
157
+ raise &quot;Seed Purchase failed&quot; unless rsp_resp.approved?
158
+
159
+ # ...then do multiple refunds against it
160
+ 1.upto(10) do
161
+ rf_req = EWS::Transaction::Request.new({
162
+ :transaction_type =&gt; :tagged_refund,
163
+ :transaction_tag =&gt; rsp_resp.transaction_tag, # need to know which transaction we're refunding against...
164
+ :auth_number =&gt; rsp_resp.auth_number, # and its auth_number
165
+ :amount =&gt; 1.00, # refund a dollar at a time
166
+ :gateway_id =&gt; &quot;XXXXXX&quot;,
167
+ :password =&gt; &quot;YYYYYY&quot;
168
+ })
169
+ rf_resp = transporter.send(rf_req, :json)
170
+ raise &quot;Refund failed: #{rf_resp.exact_resp_code}, #{rf_resp.exact_message}&quot; unless rf_resp.approved?
171
+ end
172
+ </pre>
173
+ <h2>Rake tasks</h2>
174
+ <p>
175
+ spec
176
+ </p>
177
+ <pre>
178
+ Run all test in spec/ folder (default)
179
+ </pre>
180
+ <p>
181
+ rcov
182
+ </p>
183
+ <pre>
184
+ Run all test and generate coverage report in coverage/
185
+ </pre>
186
+ <p>
187
+ rdoc
188
+ </p>
189
+ <pre>
190
+ Generate rdoc html in doc/
191
+ </pre>
192
+ <p>
193
+ gem
194
+ </p>
195
+ <pre>
196
+ Build gem
197
+ </pre>
198
+
199
+ </div>
200
+
201
+
202
+ </div>
203
+
204
+
205
+ </div>
206
+
207
+
208
+ <!-- if includes -->
209
+
210
+ <div id="section">
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+ <!-- if method_list -->
220
+
221
+
222
+ </div>
223
+
224
+
225
+ <div id="validator-badges">
226
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
227
+ </div>
228
+
229
+ </body>
230
+ </html>
@@ -0,0 +1,108 @@
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: mapping.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>mapping.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ews/transaction/mapping.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Thu May 29 22:32:42 +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
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ builder&nbsp;&nbsp;
77
+ </div>
78
+ </div>
79
+
80
+ </div>
81
+
82
+
83
+ </div>
84
+
85
+
86
+ <!-- if includes -->
87
+
88
+ <div id="section">
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <!-- if method_list -->
98
+
99
+
100
+ </div>
101
+
102
+
103
+ <div id="validator-badges">
104
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
105
+ </div>
106
+
107
+ </body>
108
+ </html>
@@ -0,0 +1,101 @@
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: request.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>request.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ews/transaction/request.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Thu May 29 16:21:09 +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
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -0,0 +1,101 @@
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: response.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>response.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ews/transaction/response.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Thu May 29 22:32:55 +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
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>