exact4r 0.5.2 → 0.6
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 +8 -0
- data/README +8 -8
- data/VERSION +1 -1
- data/doc/classes/EWS/Transaction/FakeResponse.html +451 -0
- data/doc/classes/EWS/Transaction/Request.html +54 -81
- data/doc/classes/EWS/Transaction/Response.html +182 -14
- data/doc/classes/EWS/Transaction/Validator.html +168 -0
- data/doc/classes/EWS/Transporter.html +271 -0
- data/doc/created.rid +1 -1
- data/doc/files/CHANGELOG.html +15 -2
- data/doc/files/README.html +17 -9
- data/doc/files/VERSION.html +2 -2
- data/doc/files/lib/ews/transaction/fake_response_rb.html +101 -0
- data/doc/files/lib/ews/transaction/mapping_rb.html +1 -1
- data/doc/files/lib/ews/transaction/request_rb.html +8 -1
- data/doc/files/lib/ews/transaction/response_rb.html +1 -1
- data/doc/files/lib/ews/transaction/validator_rb.html +101 -0
- data/doc/files/lib/ews/{transaction/transporter_rb.html → transporter_rb.html} +3 -3
- data/doc/files/lib/exact4r_rb.html +4 -2
- data/doc/fr_class_index.html +3 -1
- data/doc/fr_file_index.html +3 -1
- data/doc/fr_method_index.html +18 -7
- data/lib/ews/transaction/fake_response.rb +137 -0
- data/lib/ews/transaction/mapping.rb +38 -15
- data/lib/ews/transaction/request.rb +10 -58
- data/lib/ews/transaction/response.rb +3 -3
- data/lib/ews/transaction/validator.rb +230 -0
- data/lib/ews/transporter.rb +143 -0
- data/lib/exact4r.rb +4 -1
- data/spec/donncha_spec.rb +13 -0
- data/spec/mapping_spec.rb +45 -4
- data/spec/request_spec.rb +96 -69
- data/spec/spec_helper.rb +20 -8
- data/spec/transporter_spec.rb +26 -2
- data/spec/validator_spec.rb +145 -0
- metadata +16 -7
- data/doc/classes/EWS/Transaction/Transporter.html +0 -250
- data/lib/ews/transaction/transporter.rb +0 -120
- data/output.log +0 -368
data/CHANGELOG
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== v0.6
|
2
|
+
Added client-side request validation
|
3
|
+
|
4
|
+
== v0.5.3
|
5
|
+
Added fake response messages for testing purposes
|
6
|
+
Moved EWS::Transaction::Transporter to EWS::Transporter
|
7
|
+
Fixed typos
|
8
|
+
|
1
9
|
== v0.5.2
|
2
10
|
Updated Transporter to play nicely with mod_security
|
3
11
|
Stripped trailing '/'s from URLs
|
data/README
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
= exact4r
|
2
|
-
A gem which
|
2
|
+
A gem which provides access to E-xact's Web Services API, allowing the submission
|
3
3
|
of financial transactions via REST, JSON or SOAP.
|
4
4
|
|
5
5
|
== Getting Started
|
@@ -22,12 +22,12 @@ and a password. Test logins are as follows:
|
|
22
22
|
:amount => 10.50,
|
23
23
|
:cardholder_name => "Simon Brown",
|
24
24
|
:cc_number => "4111111111111111",
|
25
|
-
:cc_expiry => "
|
25
|
+
:cc_expiry => "1012", # MUST be MMYY format
|
26
26
|
:gateway_id => "XXXXXXX", # which gateway to submit the request to
|
27
27
|
:password => "YYYYYY" # your password for that gateway
|
28
28
|
})
|
29
29
|
|
30
|
-
transporter = EWS::
|
30
|
+
transporter = EWS::Transporter.new
|
31
31
|
response = transporter.submit(request) # submits using REST (XML) by default
|
32
32
|
|
33
33
|
# submit using JSON, or
|
@@ -58,12 +58,12 @@ and a password. Test logins are as follows:
|
|
58
58
|
:amount => 10.50,
|
59
59
|
:cardholder_name => "Simon Brown",
|
60
60
|
:cc_number => "4111111111111111",
|
61
|
-
:cc_expiry => "
|
61
|
+
:cc_expiry => "1012", # MUST be MMYY format
|
62
62
|
:gateway_id => "XXXXXXX", # which gateway to submit the request to
|
63
63
|
:password => "YYYYYY" # your password for that gateway
|
64
64
|
})
|
65
65
|
|
66
|
-
transporter = EWS::
|
66
|
+
transporter = EWS::Transporter.new
|
67
67
|
response = transporter.submit(request) # submits using REST (XML) by default
|
68
68
|
|
69
69
|
# you need to know the transaction tag of the transaction you are looking for
|
@@ -87,7 +87,7 @@ and a password. Test logins are as follows:
|
|
87
87
|
# and forget about it.
|
88
88
|
# In this example, we will continue to use E-xact's default web-service URL, but we
|
89
89
|
# will specify a default transport_type of :soap
|
90
|
-
transporter = EWS::
|
90
|
+
transporter = EWS::Transporter.new("https://api.e-xact.com/", {:transaction_type => :soap})
|
91
91
|
|
92
92
|
# now let's submit do a recurring seed purchase...
|
93
93
|
rsp_req = EWS::Transaction::Request.new({
|
@@ -95,7 +95,7 @@ and a password. Test logins are as follows:
|
|
95
95
|
:amount => 12.00,
|
96
96
|
:cardholder_name => "Simon Brown",
|
97
97
|
:cc_number => "4111111111111111",
|
98
|
-
:cc_expiry => "
|
98
|
+
:cc_expiry => "1012",
|
99
99
|
:gateway_id => "XXXXXX",
|
100
100
|
:password => "YYYYYY"
|
101
101
|
})
|
@@ -108,7 +108,7 @@ and a password. Test logins are as follows:
|
|
108
108
|
rf_req = EWS::Transaction::Request.new({
|
109
109
|
:transaction_type => :tagged_refund,
|
110
110
|
:transaction_tag => rsp_resp.transaction_tag, # need to know which transaction we're refunding against...
|
111
|
-
:
|
111
|
+
:authorization_num => rsp_resp.authorization_num, # and its authorization_num
|
112
112
|
:amount => 1.00, # refund a dollar at a time
|
113
113
|
:gateway_id => "XXXXXX",
|
114
114
|
:password => "YYYYYY"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6
|
@@ -0,0 +1,451 @@
|
|
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::FakeResponse</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::FakeResponse</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/lib/ews/transaction/fake_response_rb.html">
|
59
|
+
lib/ews/transaction/fake_response.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
|
+
As its name suggests, this class allows you to generate fake responses,
|
84
|
+
allowing you to stub out the web service in your testing.
|
85
|
+
</p>
|
86
|
+
<p>
|
87
|
+
The most likely responses have been catered for here, but if you require a
|
88
|
+
fake response which is not provided for here, the best approach would be to
|
89
|
+
generate a fake <a href="FakeResponse.html#M000002">valid</a> response and
|
90
|
+
then adjust its attributes (in consultation with E-xact‘s Web Service
|
91
|
+
Programming Reference Guide) to match the particular response you want.
|
92
|
+
</p>
|
93
|
+
<p>
|
94
|
+
Example:
|
95
|
+
</p>
|
96
|
+
<pre>
|
97
|
+
describe "Fake requests" do
|
98
|
+
it "should stub sending" do
|
99
|
+
request = {:nonsense => "this is nonsense"}
|
100
|
+
fake_response = EWS::Transaction::FakeResponse.valid(request) # a fake valid response
|
101
|
+
transporter = EWS::Transporter.new
|
102
|
+
transporter.stubs(:submit).returns(fake_response)
|
103
|
+
|
104
|
+
response = transporter.submit(request)
|
105
|
+
response.should == fake_response
|
106
|
+
response.should be_approved
|
107
|
+
response.bank_message.should == "APPROVED"
|
108
|
+
end
|
109
|
+
end
|
110
|
+
</pre>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div id="method-list">
|
118
|
+
<h3 class="section-bar">Methods</h3>
|
119
|
+
|
120
|
+
<div class="name-list">
|
121
|
+
<a href="#M000003">declined</a>
|
122
|
+
<a href="#M000006">invalid_amount</a>
|
123
|
+
<a href="#M000008">invalid_auth_num</a>
|
124
|
+
<a href="#M000012">invalid_avs</a>
|
125
|
+
<a href="#M000007">invalid_cardholder_name</a>
|
126
|
+
<a href="#M000005">invalid_cc_expiry</a>
|
127
|
+
<a href="#M000004">invalid_cc_number</a>
|
128
|
+
<a href="#M000009">invalid_cc_verification_str</a>
|
129
|
+
<a href="#M000011">invalid_reference_no</a>
|
130
|
+
<a href="#M000010">invalid_transaction_code</a>
|
131
|
+
<a href="#M000002">valid</a>
|
132
|
+
</div>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
<!-- if includes -->
|
139
|
+
|
140
|
+
<div id="section">
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<!-- if method_list -->
|
150
|
+
<div id="methods">
|
151
|
+
<h3 class="section-bar">Public Class methods</h3>
|
152
|
+
|
153
|
+
<div id="method-M000003" class="method-detail">
|
154
|
+
<a name="M000003"></a>
|
155
|
+
|
156
|
+
<div class="method-heading">
|
157
|
+
<a href="#M000003" class="method-signature">
|
158
|
+
<span class="method-name">declined</span><span class="method-args">(request)</span>
|
159
|
+
</a>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="method-description">
|
163
|
+
<p>
|
164
|
+
fake a <a href="FakeResponse.html#M000003">declined</a> response
|
165
|
+
</p>
|
166
|
+
<p><a class="source-toggle" href="#"
|
167
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
168
|
+
<div class="method-source-code" id="M000003-source">
|
169
|
+
<pre>
|
170
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 34</span>
|
171
|
+
34: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">declined</span>(<span class="ruby-identifier">request</span>)
|
172
|
+
35: <span class="ruby-identifier">response</span> = <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:bank_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'200'</span>})
|
173
|
+
36: <span class="ruby-keyword kw">end</span>
|
174
|
+
</pre>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div id="method-M000006" class="method-detail">
|
180
|
+
<a name="M000006"></a>
|
181
|
+
|
182
|
+
<div class="method-heading">
|
183
|
+
<a href="#M000006" class="method-signature">
|
184
|
+
<span class="method-name">invalid_amount</span><span class="method-args">(request)</span>
|
185
|
+
</a>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div class="method-description">
|
189
|
+
<p>
|
190
|
+
fake a response indicating an invalid amount
|
191
|
+
</p>
|
192
|
+
<p><a class="source-toggle" href="#"
|
193
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
194
|
+
<div class="method-source-code" id="M000006-source">
|
195
|
+
<pre>
|
196
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 47</span>
|
197
|
+
47: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_amount</span>(<span class="ruby-identifier">request</span>)
|
198
|
+
48: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'26'</span>})
|
199
|
+
49: <span class="ruby-keyword kw">end</span>
|
200
|
+
</pre>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div id="method-M000008" class="method-detail">
|
206
|
+
<a name="M000008"></a>
|
207
|
+
|
208
|
+
<div class="method-heading">
|
209
|
+
<a href="#M000008" class="method-signature">
|
210
|
+
<span class="method-name">invalid_auth_num</span><span class="method-args">(request)</span>
|
211
|
+
</a>
|
212
|
+
</div>
|
213
|
+
|
214
|
+
<div class="method-description">
|
215
|
+
<p>
|
216
|
+
fake a response indicating an invalid authorisation number
|
217
|
+
</p>
|
218
|
+
<p><a class="source-toggle" href="#"
|
219
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
220
|
+
<div class="method-source-code" id="M000008-source">
|
221
|
+
<pre>
|
222
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 55</span>
|
223
|
+
55: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_auth_num</span>(<span class="ruby-identifier">request</span>)
|
224
|
+
56: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'28'</span>})
|
225
|
+
57: <span class="ruby-keyword kw">end</span>
|
226
|
+
</pre>
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
<div id="method-M000012" class="method-detail">
|
232
|
+
<a name="M000012"></a>
|
233
|
+
|
234
|
+
<div class="method-heading">
|
235
|
+
<a href="#M000012" class="method-signature">
|
236
|
+
<span class="method-name">invalid_avs</span><span class="method-args">(request)</span>
|
237
|
+
</a>
|
238
|
+
</div>
|
239
|
+
|
240
|
+
<div class="method-description">
|
241
|
+
<p>
|
242
|
+
fake a response indicating an invalid address verification string
|
243
|
+
</p>
|
244
|
+
<p><a class="source-toggle" href="#"
|
245
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
246
|
+
<div class="method-source-code" id="M000012-source">
|
247
|
+
<pre>
|
248
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 71</span>
|
249
|
+
71: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_avs</span>(<span class="ruby-identifier">request</span>)
|
250
|
+
72: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'58'</span>})
|
251
|
+
73: <span class="ruby-keyword kw">end</span>
|
252
|
+
</pre>
|
253
|
+
</div>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<div id="method-M000007" class="method-detail">
|
258
|
+
<a name="M000007"></a>
|
259
|
+
|
260
|
+
<div class="method-heading">
|
261
|
+
<a href="#M000007" class="method-signature">
|
262
|
+
<span class="method-name">invalid_cardholder_name</span><span class="method-args">(request)</span>
|
263
|
+
</a>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
<div class="method-description">
|
267
|
+
<p>
|
268
|
+
fake a response indicating an invalid credit card holder name
|
269
|
+
</p>
|
270
|
+
<p><a class="source-toggle" href="#"
|
271
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
272
|
+
<div class="method-source-code" id="M000007-source">
|
273
|
+
<pre>
|
274
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 51</span>
|
275
|
+
51: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_cardholder_name</span>(<span class="ruby-identifier">request</span>)
|
276
|
+
52: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'27'</span>})
|
277
|
+
53: <span class="ruby-keyword kw">end</span>
|
278
|
+
</pre>
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
<div id="method-M000005" class="method-detail">
|
284
|
+
<a name="M000005"></a>
|
285
|
+
|
286
|
+
<div class="method-heading">
|
287
|
+
<a href="#M000005" class="method-signature">
|
288
|
+
<span class="method-name">invalid_cc_expiry</span><span class="method-args">(request)</span>
|
289
|
+
</a>
|
290
|
+
</div>
|
291
|
+
|
292
|
+
<div class="method-description">
|
293
|
+
<p>
|
294
|
+
fake a response indicating an invalid credit card expiry date
|
295
|
+
</p>
|
296
|
+
<p><a class="source-toggle" href="#"
|
297
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
298
|
+
<div class="method-source-code" id="M000005-source">
|
299
|
+
<pre>
|
300
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 43</span>
|
301
|
+
43: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_cc_expiry</span>(<span class="ruby-identifier">request</span>)
|
302
|
+
44: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'25'</span>})
|
303
|
+
45: <span class="ruby-keyword kw">end</span>
|
304
|
+
</pre>
|
305
|
+
</div>
|
306
|
+
</div>
|
307
|
+
</div>
|
308
|
+
|
309
|
+
<div id="method-M000004" class="method-detail">
|
310
|
+
<a name="M000004"></a>
|
311
|
+
|
312
|
+
<div class="method-heading">
|
313
|
+
<a href="#M000004" class="method-signature">
|
314
|
+
<span class="method-name">invalid_cc_number</span><span class="method-args">(request)</span>
|
315
|
+
</a>
|
316
|
+
</div>
|
317
|
+
|
318
|
+
<div class="method-description">
|
319
|
+
<p>
|
320
|
+
fake a response indicating an invalid credit card number
|
321
|
+
</p>
|
322
|
+
<p><a class="source-toggle" href="#"
|
323
|
+
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
324
|
+
<div class="method-source-code" id="M000004-source">
|
325
|
+
<pre>
|
326
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 39</span>
|
327
|
+
39: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_cc_number</span>(<span class="ruby-identifier">request</span>)
|
328
|
+
40: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'22'</span>})
|
329
|
+
41: <span class="ruby-keyword kw">end</span>
|
330
|
+
</pre>
|
331
|
+
</div>
|
332
|
+
</div>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
<div id="method-M000009" class="method-detail">
|
336
|
+
<a name="M000009"></a>
|
337
|
+
|
338
|
+
<div class="method-heading">
|
339
|
+
<a href="#M000009" class="method-signature">
|
340
|
+
<span class="method-name">invalid_cc_verification_str</span><span class="method-args">(request)</span>
|
341
|
+
</a>
|
342
|
+
</div>
|
343
|
+
|
344
|
+
<div class="method-description">
|
345
|
+
<p>
|
346
|
+
fake a response indicating an invalid credit card verification string
|
347
|
+
</p>
|
348
|
+
<p><a class="source-toggle" href="#"
|
349
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
350
|
+
<div class="method-source-code" id="M000009-source">
|
351
|
+
<pre>
|
352
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 59</span>
|
353
|
+
59: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_cc_verification_str</span>(<span class="ruby-identifier">request</span>)
|
354
|
+
60: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'31'</span>})
|
355
|
+
61: <span class="ruby-keyword kw">end</span>
|
356
|
+
</pre>
|
357
|
+
</div>
|
358
|
+
</div>
|
359
|
+
</div>
|
360
|
+
|
361
|
+
<div id="method-M000011" class="method-detail">
|
362
|
+
<a name="M000011"></a>
|
363
|
+
|
364
|
+
<div class="method-heading">
|
365
|
+
<a href="#M000011" class="method-signature">
|
366
|
+
<span class="method-name">invalid_reference_no</span><span class="method-args">(request)</span>
|
367
|
+
</a>
|
368
|
+
</div>
|
369
|
+
|
370
|
+
<div class="method-description">
|
371
|
+
<p>
|
372
|
+
fake a response indicating an invalid reference number
|
373
|
+
</p>
|
374
|
+
<p><a class="source-toggle" href="#"
|
375
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
376
|
+
<div class="method-source-code" id="M000011-source">
|
377
|
+
<pre>
|
378
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 67</span>
|
379
|
+
67: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_reference_no</span>(<span class="ruby-identifier">request</span>)
|
380
|
+
68: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'57'</span>})
|
381
|
+
69: <span class="ruby-keyword kw">end</span>
|
382
|
+
</pre>
|
383
|
+
</div>
|
384
|
+
</div>
|
385
|
+
</div>
|
386
|
+
|
387
|
+
<div id="method-M000010" class="method-detail">
|
388
|
+
<a name="M000010"></a>
|
389
|
+
|
390
|
+
<div class="method-heading">
|
391
|
+
<a href="#M000010" class="method-signature">
|
392
|
+
<span class="method-name">invalid_transaction_code</span><span class="method-args">(request)</span>
|
393
|
+
</a>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
<div class="method-description">
|
397
|
+
<p>
|
398
|
+
fake a response indicating an invalid transaction code
|
399
|
+
</p>
|
400
|
+
<p><a class="source-toggle" href="#"
|
401
|
+
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
402
|
+
<div class="method-source-code" id="M000010-source">
|
403
|
+
<pre>
|
404
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 63</span>
|
405
|
+
63: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">invalid_transaction_code</span>(<span class="ruby-identifier">request</span>)
|
406
|
+
64: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>, {<span class="ruby-identifier">:exact_resp_code</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'32'</span>})
|
407
|
+
65: <span class="ruby-keyword kw">end</span>
|
408
|
+
</pre>
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
</div>
|
412
|
+
|
413
|
+
<div id="method-M000002" class="method-detail">
|
414
|
+
<a name="M000002"></a>
|
415
|
+
|
416
|
+
<div class="method-heading">
|
417
|
+
<a href="#M000002" class="method-signature">
|
418
|
+
<span class="method-name">valid</span><span class="method-args">(request)</span>
|
419
|
+
</a>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
<div class="method-description">
|
423
|
+
<p>
|
424
|
+
fake a <a href="FakeResponse.html#M000002">valid</a> response
|
425
|
+
</p>
|
426
|
+
<p><a class="source-toggle" href="#"
|
427
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
428
|
+
<div class="method-source-code" id="M000002-source">
|
429
|
+
<pre>
|
430
|
+
<span class="ruby-comment cmt"># File lib/ews/transaction/fake_response.rb, line 30</span>
|
431
|
+
30: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">valid</span>(<span class="ruby-identifier">request</span>)
|
432
|
+
31: <span class="ruby-identifier">build_response</span>(<span class="ruby-identifier">request</span>)
|
433
|
+
32: <span class="ruby-keyword kw">end</span>
|
434
|
+
</pre>
|
435
|
+
</div>
|
436
|
+
</div>
|
437
|
+
</div>
|
438
|
+
|
439
|
+
|
440
|
+
</div>
|
441
|
+
|
442
|
+
|
443
|
+
</div>
|
444
|
+
|
445
|
+
|
446
|
+
<div id="validator-badges">
|
447
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
448
|
+
</div>
|
449
|
+
|
450
|
+
</body>
|
451
|
+
</html>
|