exact4r 0.9 → 0.9.1
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.
- data/CHANGELOG +4 -1
- data/VERSION +1 -1
- data/doc/classes/EWS/Transaction/Request.html +81 -54
- data/doc/classes/EWS/Transaction/Response.html +14 -182
- data/doc/classes/EWS/Transaction/Transporter.html +251 -0
- data/doc/created.rid +1 -1
- data/doc/files/README.html +24 -37
- data/doc/files/lib/ews/transaction/mapping_rb.html +1 -1
- data/doc/files/lib/ews/transaction/request_rb.html +1 -8
- data/doc/files/lib/ews/transaction/response_rb.html +1 -1
- data/doc/files/lib/ews/{transporter_rb.html → transaction/transporter_rb.html} +3 -3
- data/doc/files/lib/exact4r_rb.html +2 -4
- data/doc/fr_class_index.html +1 -3
- data/doc/fr_file_index.html +1 -6
- data/doc/fr_method_index.html +7 -18
- data/lib/ews/transaction/request.rb +33 -4
- data/pkg/exact4r-0.5.gem +0 -0
- data/spec/avs_spec.rb +94 -0
- data/spec/request_spec.rb +1 -4
- data/spec/spec_helper.rb +2 -2
- metadata +10 -29
- data/after.log +0 -6
- data/before.log +0 -17
- data/doc/classes/EWS/Transaction/FakeResponse.html +0 -451
- data/doc/classes/EWS/Transaction/Validator.html +0 -168
- data/doc/classes/EWS/Transporter.html +0 -269
- data/doc/files/CHANGELOG.html +0 -142
- data/doc/files/LICENCE.html +0 -109
- data/doc/files/VERSION.html +0 -107
- data/doc/files/lib/ews/transaction/fake_response_rb.html +0 -101
- data/doc/files/lib/ews/transaction/validator_rb.html +0 -101
- data/qa.log +0 -14
@@ -0,0 +1,251 @@
|
|
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::Transaction::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::Transaction::Transporter</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/ews/transaction/transporter_rb.html">
|
59
|
+
lib/ews/transaction/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
|
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 <a
|
95
|
+
href="Transporter.html#M000002">send</a> to the service, and decode
|
96
|
+
Responses received from the service.
|
97
|
+
</p>
|
98
|
+
<p>
|
99
|
+
Once configured to connect to a particular service, it can be used
|
100
|
+
repeatedly to <a href="Transporter.html#M000002">send</a> as many
|
101
|
+
transactions as required.
|
102
|
+
</p>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div id="method-list">
|
110
|
+
<h3 class="section-bar">Methods</h3>
|
111
|
+
|
112
|
+
<div class="name-list">
|
113
|
+
<a href="#M000001">new</a>
|
114
|
+
<a href="#M000002">send</a>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
<!-- if includes -->
|
122
|
+
|
123
|
+
<div id="section">
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<!-- if method_list -->
|
133
|
+
<div id="methods">
|
134
|
+
<h3 class="section-bar">Public Class methods</h3>
|
135
|
+
|
136
|
+
<div id="method-M000001" class="method-detail">
|
137
|
+
<a name="M000001"></a>
|
138
|
+
|
139
|
+
<div class="method-heading">
|
140
|
+
<a href="#M000001" class="method-signature">
|
141
|
+
<span class="method-name">new</span><span class="method-args">(url = "https://api.e-xact.com/", options = {})</span>
|
142
|
+
</a>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="method-description">
|
146
|
+
<p>
|
147
|
+
Initialize a <a href="Transporter.html">Transporter</a>.
|
148
|
+
</p>
|
149
|
+
<p>
|
150
|
+
You can specify the URL you would like the <a
|
151
|
+
href="Transporter.html">Transporter</a> to connect to, although it defaults
|
152
|
+
to <a href="https://api.e-xact.com">api.e-xact.com</a>, the location of our
|
153
|
+
web service.
|
154
|
+
</p>
|
155
|
+
<p>
|
156
|
+
You can also specify a hash of options as follows:
|
157
|
+
</p>
|
158
|
+
<pre>
|
159
|
+
:server_cert the path to the server's certificate
|
160
|
+
:issuer_cert the path to the certificate of the issuer of the server certificate
|
161
|
+
:transport_type the default transport_type for this transporter
|
162
|
+
</pre>
|
163
|
+
<p>
|
164
|
+
The default certificates are those required to connect to <a
|
165
|
+
href="https://api.e-xact.com">api.e-xact.com</a> and the default
|
166
|
+
<tt>transport_type</tt> is <tt>:rest</tt>. The default
|
167
|
+
<tt>transport_type</tt> can be overridden on a per-transaction basis, if
|
168
|
+
you choose to do so, by specifying it as a parameter to the <tt><a
|
169
|
+
href="Transporter.html#M000002">send</a></tt> method.
|
170
|
+
</p>
|
171
|
+
<p><a class="source-toggle" href="#"
|
172
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
173
|
+
<div class="method-source-code" id="M000001-source">
|
174
|
+
<pre>
|
175
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/transporter.rb, line 34</span>
|
176
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">url</span> = <span class="ruby-value str">"https://api.e-xact.com/"</span>, <span class="ruby-identifier">options</span> = {})
|
177
|
+
<span class="ruby-ivar">@url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">url</span>)
|
178
|
+
<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-value str">"certs/exact.cer"</span>
|
179
|
+
<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-value str">"certs/equifax_ca.cer"</span>
|
180
|
+
<span class="ruby-ivar">@transport_type</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:issuer_cert</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">:rest</span>
|
181
|
+
<span class="ruby-keyword kw">end</span>
|
182
|
+
</pre>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
188
|
+
|
189
|
+
<div id="method-M000002" class="method-detail">
|
190
|
+
<a name="M000002"></a>
|
191
|
+
|
192
|
+
<div class="method-heading">
|
193
|
+
<a href="#M000002" class="method-signature">
|
194
|
+
<span class="method-name">send</span><span class="method-args">(request, transport_type = nil)</span>
|
195
|
+
</a>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div class="method-description">
|
199
|
+
<p>
|
200
|
+
Send a transaction request to the server
|
201
|
+
</p>
|
202
|
+
<table>
|
203
|
+
<tr><td valign="top"><tt>request</tt>:</td><td>the <a href="Request.html">Request</a> object to encode for transmission to
|
204
|
+
the server
|
205
|
+
|
206
|
+
</td></tr>
|
207
|
+
<tr><td valign="top"><tt>transport_type</tt>:</td><td>(optional) the transport type to use for this transaction only. If it not
|
208
|
+
specified, the default transport type for this <a
|
209
|
+
href="Transporter.html">Transporter</a> will be used
|
210
|
+
|
211
|
+
</td></tr>
|
212
|
+
</table>
|
213
|
+
<p><a class="source-toggle" href="#"
|
214
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
215
|
+
<div class="method-source-code" id="M000002-source">
|
216
|
+
<pre>
|
217
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/transporter.rb, line 45</span>
|
218
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">transport_type</span> = <span class="ruby-keyword kw">nil</span>)
|
219
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Request not supplied"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request</span>.<span class="ruby-identifier">nil?</span>
|
220
|
+
<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">request</span>.<span class="ruby-identifier">valid?</span>
|
221
|
+
|
222
|
+
<span class="ruby-identifier">transport_type</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@transport_type</span>
|
223
|
+
|
224
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Transport type #{transport_type} is not supported"</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>
|
225
|
+
|
226
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">request</span>.<span class="ruby-identifier">is_find_transaction?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">transport_type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:soap</span>
|
227
|
+
<span class="ruby-identifier">content</span> = <span class="ruby-identifier">post</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">transport_type</span>)
|
228
|
+
<span class="ruby-keyword kw">else</span>
|
229
|
+
<span class="ruby-identifier">content</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">transport_type</span>)
|
230
|
+
<span class="ruby-keyword kw">end</span>
|
231
|
+
|
232
|
+
<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">"#{transport_type}_to_response"</span>, <span class="ruby-identifier">content</span>
|
233
|
+
<span class="ruby-keyword kw">end</span>
|
234
|
+
</pre>
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
|
240
|
+
</div>
|
241
|
+
|
242
|
+
|
243
|
+
</div>
|
244
|
+
|
245
|
+
|
246
|
+
<div id="validator-badges">
|
247
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
248
|
+
</div>
|
249
|
+
|
250
|
+
</body>
|
251
|
+
</html>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Thu, 29 May 2008 16:31:55 -0700
|
data/doc/files/README.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Thu May 29 14:10:27 -0700 2008</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -71,45 +71,34 @@
|
|
71
71
|
<div id="description">
|
72
72
|
<h1>exact4r</h1>
|
73
73
|
<p>
|
74
|
-
|
75
|
-
|
74
|
+
Provides access to E-xact Web Services API, which allows the submission via
|
75
|
+
REST, JSON or SOAP.
|
76
76
|
</p>
|
77
77
|
<h2>Getting Started</h2>
|
78
|
-
<p>
|
79
|
-
To submit requests to our transaction processing service, you must first
|
80
|
-
have a Gateway ID, and a password. Test logins are as follows:
|
81
|
-
</p>
|
82
|
-
<pre>
|
83
|
-
Account 1: :gateway_id => "A00049-01", :password => "test1"
|
84
|
-
Account 2: :gateway_id => "A00427-01", :password => "testus"
|
85
|
-
</pre>
|
86
78
|
<h1>1. Submit a transaction</h1>
|
87
79
|
<pre>
|
88
|
-
require 'rubygems'
|
89
|
-
require 'exact4r'
|
90
|
-
|
91
80
|
# build a purchase request
|
92
81
|
request = EWS::Transaction::Request.new({
|
93
82
|
:transaction_type => :purchase,
|
94
83
|
:amount => 10.50,
|
95
84
|
:cardholder_name => "Simon Brown",
|
96
85
|
:cc_number => "4111111111111111",
|
97
|
-
:cc_expiry => "
|
86
|
+
:cc_expiry => "1005", # MUST be YYMM format
|
98
87
|
:gateway_id => "XXXXXXX", # which gateway to submit the request to
|
99
88
|
:password => "YYYYYY" # your password for that gateway
|
100
89
|
})
|
101
90
|
|
102
|
-
transporter = EWS::Transporter.new
|
103
|
-
response = transporter.
|
91
|
+
transporter = EWS::Transaction::Transporter.new
|
92
|
+
response = transporter.send(request) # submits using REST (XML) by default
|
104
93
|
|
105
94
|
# submit using JSON, or
|
106
|
-
response = transporter.
|
95
|
+
response = transporter.send(request, :json)
|
107
96
|
|
108
97
|
# submit using SOAP, or
|
109
|
-
response = transporter.
|
98
|
+
response = transporter.send(request, :soap)
|
110
99
|
|
111
100
|
# submit explicitly via REST
|
112
|
-
response = transporter.
|
101
|
+
response = transporter.send(request, :rest)
|
113
102
|
|
114
103
|
# The response object is independent of type of transport chosen.
|
115
104
|
# We decode the payload into a regular object
|
@@ -121,22 +110,19 @@ have a Gateway ID, and a password. Test logins are as follows:
|
|
121
110
|
</pre>
|
122
111
|
<h1>2. Find information on an existing transaction</h1>
|
123
112
|
<pre>
|
124
|
-
require 'rubygems'
|
125
|
-
require 'exact4r'
|
126
|
-
|
127
113
|
# build a purchase request
|
128
114
|
request = EWS::Transaction::Request.new({
|
129
115
|
:transaction_type => :purchase,
|
130
116
|
:amount => 10.50,
|
131
117
|
:cardholder_name => "Simon Brown",
|
132
118
|
:cc_number => "4111111111111111",
|
133
|
-
:cc_expiry => "
|
119
|
+
:cc_expiry => "1005", # MUST be YYMM format
|
134
120
|
:gateway_id => "XXXXXXX", # which gateway to submit the request to
|
135
121
|
:password => "YYYYYY" # your password for that gateway
|
136
122
|
})
|
137
123
|
|
138
|
-
transporter = EWS::Transporter.new
|
139
|
-
response = transporter.
|
124
|
+
transporter = EWS::Transaction::Transporter.new
|
125
|
+
response = transporter.send(request) # submits using REST (XML) by default
|
140
126
|
|
141
127
|
# you need to know the transaction tag of the transaction you are looking for
|
142
128
|
find_request = EWS::Transaction::Request.new({
|
@@ -146,20 +132,15 @@ have a Gateway ID, and a password. Test logins are as follows:
|
|
146
132
|
:password => "YYYYYY"
|
147
133
|
})
|
148
134
|
|
149
|
-
find_response = transporter.
|
135
|
+
find_response = transporter.send(find_request, :json) # again, can choose your transport type as before
|
150
136
|
find_response.cc_number # 4111111111111111
|
151
137
|
find_response.amount # 10.50
|
152
138
|
</pre>
|
153
139
|
<h1>3. Re-using a Transporter</h1>
|
154
140
|
<pre>
|
155
|
-
require 'rubygems'
|
156
|
-
require 'exact4r'
|
157
|
-
|
158
141
|
# The transporter object can be re-used across multiple transactions, so set it up once
|
159
142
|
# and forget about it.
|
160
|
-
|
161
|
-
# will specify a default transport_type of :soap
|
162
|
-
transporter = EWS::Transporter.new("https://api.e-xact.com/", {:transaction_type => :soap})
|
143
|
+
transporter = EWS::Transaction::Transporter.new
|
163
144
|
|
164
145
|
# now let's submit do a recurring seed purchase...
|
165
146
|
rsp_req = EWS::Transaction::Request.new({
|
@@ -167,12 +148,12 @@ have a Gateway ID, and a password. Test logins are as follows:
|
|
167
148
|
:amount => 12.00,
|
168
149
|
:cardholder_name => "Simon Brown",
|
169
150
|
:cc_number => "4111111111111111",
|
170
|
-
:cc_expiry => "
|
151
|
+
:cc_expiry => "1005",
|
171
152
|
:gateway_id => "XXXXXX",
|
172
153
|
:password => "YYYYYY"
|
173
154
|
})
|
174
155
|
|
175
|
-
rsp_resp = transporter.
|
156
|
+
rsp_resp = transporter.send(rsp_req, :json)
|
176
157
|
raise "Seed Purchase failed" unless rsp_resp.approved?
|
177
158
|
|
178
159
|
# ...then do multiple refunds against it
|
@@ -180,12 +161,12 @@ have a Gateway ID, and a password. Test logins are as follows:
|
|
180
161
|
rf_req = EWS::Transaction::Request.new({
|
181
162
|
:transaction_type => :tagged_refund,
|
182
163
|
:transaction_tag => rsp_resp.transaction_tag, # need to know which transaction we're refunding against...
|
183
|
-
:
|
164
|
+
:auth_number => rsp_resp.auth_number, # and its auth_number
|
184
165
|
:amount => 1.00, # refund a dollar at a time
|
185
166
|
:gateway_id => "XXXXXX",
|
186
167
|
:password => "YYYYYY"
|
187
168
|
})
|
188
|
-
rf_resp = transporter.
|
169
|
+
rf_resp = transporter.send(rf_req, :json)
|
189
170
|
raise "Refund failed: #{rf_resp.exact_resp_code}, #{rf_resp.exact_message}" unless rf_resp.approved?
|
190
171
|
end
|
191
172
|
</pre>
|
@@ -197,6 +178,12 @@ spec
|
|
197
178
|
Run all test in spec/ folder (default)
|
198
179
|
</pre>
|
199
180
|
<p>
|
181
|
+
rcov
|
182
|
+
</p>
|
183
|
+
<pre>
|
184
|
+
Run all test and generate coverage report in coverage/
|
185
|
+
</pre>
|
186
|
+
<p>
|
200
187
|
rdoc
|
201
188
|
</p>
|
202
189
|
<pre>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Thu
|
59
|
+
<td>Thu May 29 14:10:27 -0700 2008</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -69,13 +69,6 @@
|
|
69
69
|
<div id="contextContent">
|
70
70
|
|
71
71
|
|
72
|
-
<div id="requires-list">
|
73
|
-
<h3 class="section-bar">Required files</h3>
|
74
|
-
|
75
|
-
<div class="name-list">
|
76
|
-
ews/transaction/validator
|
77
|
-
</div>
|
78
|
-
</div>
|
79
72
|
|
80
73
|
</div>
|
81
74
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<title>File: transporter.rb</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="
|
11
|
+
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
12
|
<script type="text/javascript">
|
13
13
|
// <![CDATA[
|
14
14
|
|
@@ -51,12 +51,12 @@
|
|
51
51
|
<table class="header-table">
|
52
52
|
<tr class="top-aligned-row">
|
53
53
|
<td><strong>Path:</strong></td>
|
54
|
-
<td>lib/ews/transporter.rb
|
54
|
+
<td>lib/ews/transaction/transporter.rb
|
55
55
|
</td>
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Thu May 29 14:35:29 -0700 2008</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>
|
59
|
+
<td>Thu May 29 14:10:27 -0700 2008</td>
|
60
60
|
</tr>
|
61
61
|
</table>
|
62
62
|
</div>
|
@@ -78,9 +78,7 @@
|
|
78
78
|
ews/transaction/mapping
|
79
79
|
ews/transaction/request
|
80
80
|
ews/transaction/response
|
81
|
-
ews/transaction/
|
82
|
-
ews/transporter
|
83
|
-
ews/transaction/fake_response
|
81
|
+
ews/transaction/transporter
|
84
82
|
</div>
|
85
83
|
</div>
|
86
84
|
|
data/doc/fr_class_index.html
CHANGED
@@ -20,11 +20,9 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Classes</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/EWS/Transaction/FakeResponse.html">EWS::Transaction::FakeResponse</a><br />
|
24
23
|
<a href="classes/EWS/Transaction/Request.html">EWS::Transaction::Request</a><br />
|
25
24
|
<a href="classes/EWS/Transaction/Response.html">EWS::Transaction::Response</a><br />
|
26
|
-
<a href="classes/EWS/Transaction/
|
27
|
-
<a href="classes/EWS/Transporter.html">EWS::Transporter</a><br />
|
25
|
+
<a href="classes/EWS/Transaction/Transporter.html">EWS::Transaction::Transporter</a><br />
|
28
26
|
</div>
|
29
27
|
</div>
|
30
28
|
</body>
|
data/doc/fr_file_index.html
CHANGED
@@ -20,16 +20,11 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Files</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="files/CHANGELOG.html">CHANGELOG</a><br />
|
24
|
-
<a href="files/LICENCE.html">LICENCE</a><br />
|
25
23
|
<a href="files/README.html">README</a><br />
|
26
|
-
<a href="files/VERSION.html">VERSION</a><br />
|
27
|
-
<a href="files/lib/ews/transaction/fake_response_rb.html">lib/ews/transaction/fake_response.rb</a><br />
|
28
24
|
<a href="files/lib/ews/transaction/mapping_rb.html">lib/ews/transaction/mapping.rb</a><br />
|
29
25
|
<a href="files/lib/ews/transaction/request_rb.html">lib/ews/transaction/request.rb</a><br />
|
30
26
|
<a href="files/lib/ews/transaction/response_rb.html">lib/ews/transaction/response.rb</a><br />
|
31
|
-
<a href="files/lib/ews/transaction/
|
32
|
-
<a href="files/lib/ews/transporter_rb.html">lib/ews/transporter.rb</a><br />
|
27
|
+
<a href="files/lib/ews/transaction/transporter_rb.html">lib/ews/transaction/transporter.rb</a><br />
|
33
28
|
<a href="files/lib/exact4r_rb.html">lib/exact4r.rb</a><br />
|
34
29
|
</div>
|
35
30
|
</div>
|
data/doc/fr_method_index.html
CHANGED
@@ -20,24 +20,13 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/EWS/Transaction/Response.html#
|
24
|
-
<a href="classes/EWS/Transaction/
|
25
|
-
<a href="classes/EWS/Transaction/
|
26
|
-
<a href="classes/EWS/Transaction/
|
27
|
-
<a href="classes/EWS/Transaction/
|
28
|
-
<a href="classes/EWS/Transaction/
|
29
|
-
<a href="classes/EWS/Transaction/
|
30
|
-
<a href="classes/EWS/Transaction/FakeResponse.html#M000004">invalid_cc_number (EWS::Transaction::FakeResponse)</a><br />
|
31
|
-
<a href="classes/EWS/Transaction/FakeResponse.html#M000009">invalid_cc_verification_str (EWS::Transaction::FakeResponse)</a><br />
|
32
|
-
<a href="classes/EWS/Transaction/FakeResponse.html#M000011">invalid_reference_no (EWS::Transaction::FakeResponse)</a><br />
|
33
|
-
<a href="classes/EWS/Transaction/FakeResponse.html#M000010">invalid_transaction_code (EWS::Transaction::FakeResponse)</a><br />
|
34
|
-
<a href="classes/EWS/Transaction/Request.html#M000016">is_find_transaction? (EWS::Transaction::Request)</a><br />
|
35
|
-
<a href="classes/EWS/Transporter.html#M000017">new (EWS::Transporter)</a><br />
|
36
|
-
<a href="classes/EWS/Transaction/Request.html#M000014">new (EWS::Transaction::Request)</a><br />
|
37
|
-
<a href="classes/EWS/Transporter.html#M000018">submit (EWS::Transporter)</a><br />
|
38
|
-
<a href="classes/EWS/Transaction/Request.html#M000015">transaction_type= (EWS::Transaction::Request)</a><br />
|
39
|
-
<a href="classes/EWS/Transaction/FakeResponse.html#M000002">valid (EWS::Transaction::FakeResponse)</a><br />
|
40
|
-
<a href="classes/EWS/Transaction/Validator.html#M000001">valid? (EWS::Transaction::Validator)</a><br />
|
23
|
+
<a href="classes/EWS/Transaction/Response.html#M000003">approved? (EWS::Transaction::Response)</a><br />
|
24
|
+
<a href="classes/EWS/Transaction/Request.html#M000006">is_find_transaction? (EWS::Transaction::Request)</a><br />
|
25
|
+
<a href="classes/EWS/Transaction/Transporter.html#M000001">new (EWS::Transaction::Transporter)</a><br />
|
26
|
+
<a href="classes/EWS/Transaction/Request.html#M000004">new (EWS::Transaction::Request)</a><br />
|
27
|
+
<a href="classes/EWS/Transaction/Transporter.html#M000002">send (EWS::Transaction::Transporter)</a><br />
|
28
|
+
<a href="classes/EWS/Transaction/Request.html#M000005">transaction_type= (EWS::Transaction::Request)</a><br />
|
29
|
+
<a href="classes/EWS/Transaction/Request.html#M000007">valid? (EWS::Transaction::Request)</a><br />
|
41
30
|
</div>
|
42
31
|
</div>
|
43
32
|
</body>
|
@@ -50,9 +50,24 @@ module EWS # :nodoc:
|
|
50
50
|
# yeah, it's ugly, but otherwise RDoc won't pick them up
|
51
51
|
attr_accessor :errors
|
52
52
|
attr_accessor :gateway_id, :password, :transaction_type, :amount, :surcharge_amount, :cc_number, :transaction_tag, :track1, :track2, :pan, :authorization_num, :cc_expiry, :cardholder_name
|
53
|
-
attr_accessor :
|
53
|
+
attr_accessor :cc_verification_str2, :cvd_presence_ind, :tax1_amount, :tax1_number, :tax2_amount, :tax2_number, :secure_auth_required, :secure_auth_result
|
54
|
+
|
55
|
+
# AVS - Address Verification,
|
56
|
+
attr_accessor :cc_verification_str1
|
57
|
+
[:avs_test_flag, :avs_street_address, :avs_unit_no, :avs_po_box, :avs_postal_code].each { |m|
|
58
|
+
class_eval <<-METHOD_EOS
|
59
|
+
def #{m.to_s}
|
60
|
+
@#{m.to_s}
|
61
|
+
end
|
62
|
+
def #{m.to_s}=(v)
|
63
|
+
@#{m.to_s} = v
|
64
|
+
calculate_verification_str1
|
65
|
+
end
|
66
|
+
METHOD_EOS
|
67
|
+
}
|
68
|
+
|
54
69
|
attr_accessor :ecommerce_flag, :xid, :cavv, :cavv_algorithm, :reference_no, :customer_ref, :reference_3, :language, :client_ip, :client_email, :zip_code
|
55
|
-
|
70
|
+
|
56
71
|
# Initialize a Request with a hash of values
|
57
72
|
def initialize(hash = {})
|
58
73
|
hash.each {|k,v| self.send "#{k.to_s}=", v}
|
@@ -104,7 +119,21 @@ module EWS # :nodoc:
|
|
104
119
|
:secure_storage_eft => '61',
|
105
120
|
:transaction_details => 'CR'
|
106
121
|
}.freeze unless defined?(@@transaction_codes)
|
107
|
-
|
122
|
+
|
123
|
+
# Calculate verification str1, callback method invoked after the avs_*= methods
|
124
|
+
def calculate_verification_str1
|
125
|
+
self.cc_verification_str1 = ''
|
126
|
+
self.cc_verification_str1 << (self.avs_test_flag || '')
|
127
|
+
unless self.avs_street_address.nil?
|
128
|
+
self.cc_verification_str1 << (self.avs_street_address || '')
|
129
|
+
self.cc_verification_str1 << (self.avs_unit_no || '')
|
130
|
+
else
|
131
|
+
self.cc_verification_str1 << (self.avs_po_box || '')
|
132
|
+
end
|
133
|
+
unless self.avs_postal_code.nil?
|
134
|
+
self.cc_verification_str1 << '|' << self.avs_postal_code
|
135
|
+
end
|
136
|
+
end
|
108
137
|
end
|
109
138
|
end
|
110
|
-
end
|
139
|
+
end
|
data/pkg/exact4r-0.5.gem
ADDED
Binary file
|