exact4r 0.9.1 → 0.9.2
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 +6 -1
- data/README +71 -3
- data/Rakefile +8 -7
- data/VERSION +1 -1
- data/doc/classes/EWS/Transaction/FakeResponse.html +451 -0
- data/doc/classes/EWS/Transaction/Request.html +61 -80
- data/doc/classes/EWS/Transaction/Response.html +206 -14
- data/doc/classes/EWS/Transaction/Validator.html +182 -0
- data/doc/classes/EWS/Transporter.html +269 -0
- data/doc/classes/REXML/Document.html +176 -0
- data/doc/classes/REXML/Entity.html +150 -0
- data/doc/classes/REXML.html +112 -0
- data/doc/created.rid +1 -1
- data/doc/files/CHANGELOG.html +156 -0
- data/doc/files/LICENCE.html +109 -0
- data/doc/files/README.html +164 -23
- data/doc/files/VERSION.html +107 -0
- 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 +6 -2
- data/doc/fr_class_index.html +6 -1
- data/doc/fr_file_index.html +6 -1
- data/doc/fr_method_index.html +22 -7
- data/lib/ews/transaction/mapping.rb +41 -40
- data/lib/ews/transaction/request.rb +3 -4
- data/lib/ews/transaction/response.rb +5 -0
- data/lib/ews/transaction/validator.rb +44 -34
- data/lib/ews/transporter.rb +3 -3
- data/lib/exact4r.rb +1 -1
- data/test/exhaustive/forced_post_test.rb +75 -0
- data/test/exhaustive/online_debit_purchase_test.rb +66 -0
- data/test/exhaustive/online_debit_refund_test.rb +66 -0
- data/test/exhaustive/pre_auth_completion_test.rb +99 -0
- data/test/exhaustive/pre_auth_only_test.rb +68 -0
- data/test/exhaustive/pre_auth_test.rb +68 -0
- data/test/exhaustive/purchase_correction_test.rb +79 -0
- data/test/exhaustive/purchase_test.rb +68 -0
- data/test/exhaustive/recurring_seed_pre_auth_test.rb +68 -0
- data/test/exhaustive/recurring_seed_purchase_test.rb +68 -0
- data/test/exhaustive/refund_correction_test.rb +79 -0
- data/test/exhaustive/refund_test.rb +68 -0
- data/test/exhaustive/secure_storage_test.rb +75 -0
- data/test/exhaustive/tagged_online_debit_refund_test.rb +168 -0
- data/test/exhaustive/tagged_pre_auth_completion_test.rb +119 -0
- data/test/exhaustive/tagged_pre_auth_test.rb +116 -0
- data/test/exhaustive/tagged_purchase_test.rb +116 -0
- data/test/exhaustive/tagged_refund_test.rb +144 -0
- data/test/exhaustive/transaction_details_test.rb +86 -0
- data/test/exhaustive/void_test.rb +75 -0
- data/{spec/avs_spec.rb → test/general/avs_test.rb} +33 -44
- data/test/general/json_encoding_test.rb +62 -0
- data/test/general/request_test.rb +185 -0
- data/test/general/rest_encoding_test.rb +174 -0
- data/test/general/soap_encoding_test.rb +211 -0
- data/test/general/transporter_test.rb +54 -0
- data/test/general/validator_test.rb +150 -0
- data/test/samples/rest.dodgy.response.xml +60 -0
- data/test/samples/rest.everything.response.xml +67 -0
- data/test/samples/rest.response.xml +60 -0
- data/test/samples/soap.deserialization.fault.xml +10 -0
- data/test/samples/soap.dodgy.response.xml +95 -0
- data/test/samples/soap.everything.response.xml +75 -0
- data/test/samples/soap.generalfailure.fault.xml +13 -0
- data/test/samples/soap.nulltransaction.fault.xml +14 -0
- data/test/samples/soap.response.xml +95 -0
- data/test/test_helper.rb +115 -0
- metadata +52 -12
- data/doc/classes/EWS/Transaction/Transporter.html +0 -251
- data/pkg/exact4r-0.5.gem +0 -0
- data/spec/mapping_spec.rb +0 -126
- data/spec/request_spec.rb +0 -154
- data/spec/spec_helper.rb +0 -55
- data/spec/transporter_spec.rb +0 -43
- data/spec/validator_spec.rb +0 -150
data/CHANGELOG
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
+
== v0.9.2
|
2
|
+
Converted tests to Test::Unit
|
3
|
+
Added complete test suite, testing all transaction types.
|
4
|
+
Enhanced validation of mandatory request information.
|
5
|
+
|
1
6
|
== v0.9.1
|
2
|
-
Added
|
7
|
+
Added unified Address Verification API
|
3
8
|
|
4
9
|
== v0.9
|
5
10
|
Fixed incorrect decoding of boolean attributes from SOAP response
|
data/README
CHANGED
@@ -116,11 +116,79 @@ and a password. Test logins are as follows:
|
|
116
116
|
rf_resp = transporter.submit(rf_req)
|
117
117
|
raise "Refund failed: #{rf_resp.exact_resp_code}, #{rf_resp.exact_message}" unless rf_resp.approved?
|
118
118
|
end
|
119
|
+
|
120
|
+
=4. Using the AVS API
|
121
|
+
|
122
|
+
Allowable AVS params are:
|
123
|
+
|
124
|
+
- :avs_street_address => "7501ELMST."
|
125
|
+
- :avs_unit_no => "801"
|
126
|
+
- :avs_po_box => nil # P.O. Box or street address may be specified, but not both
|
127
|
+
- :avs_postal_code => "90210"
|
128
|
+
- :avs_test_flag => "X" # AVS test flag (optional)
|
129
|
+
|
130
|
+
|
131
|
+
===Test Flags
|
132
|
+
In order to simulate an AVS response in the test environment, set the :+avs_test_flag+ to the AVS result code you would like
|
133
|
+
returned. The AVS result is a one-character response that indicates the degree of match for the provided address.
|
134
|
+
The following AVS responses are currently supported:
|
135
|
+
|
136
|
+
===North American Response Codes
|
137
|
+
AVS Code - ABS Definition - Explanation
|
138
|
+
- X - Exact match, 9 digit zip - Street Address, and 9 digit ZIP Code match
|
139
|
+
- Y - Exact match, 5 digit zip - Street Address, and 5 digit ZIP Code match
|
140
|
+
- A - Partial match - Street Address matches, ZIP Code does not
|
141
|
+
- W - Partial match - ZIP Code matches, Street Address does not
|
142
|
+
- Z - Partial match - 5 digit ZIP Code match only
|
143
|
+
- N - No match - No Address or ZIP Code match
|
144
|
+
- U - Unavailable - Address information is unavailable for that account number, or the card issuer does not support
|
145
|
+
- G - Service Not supported, non-US Issuer does not participate
|
146
|
+
- R - Retry - Issuer system unavailable, retry later
|
147
|
+
- E - Not a mail or phone order
|
148
|
+
- S - Service not supported
|
149
|
+
|
150
|
+
===International Response Codes
|
151
|
+
AVS Code - ABS Definition and Explanation
|
152
|
+
- G - Global non-AVS participant
|
153
|
+
- B - Address matches only
|
154
|
+
- C - Address and Postal Code do not match
|
155
|
+
- D - Address and Postal Code match
|
156
|
+
- F - Address and Postal Code match (UK only)
|
157
|
+
- I - Address information not verified for international transaction
|
158
|
+
- M - Address and Postal Code match
|
159
|
+
- P - Postal Code matches only
|
160
|
+
|
161
|
+
===Code Sample
|
162
|
+
avs_params = {
|
163
|
+
:avs_test_flag => 'N',
|
164
|
+
:avs_street_address => '123BROWNSTREET',
|
165
|
+
:avs_unit_no => '4,
|
166
|
+
:avs_po_box => nil,
|
167
|
+
:avs_postal_code => '902101234'
|
168
|
+
}
|
169
|
+
|
170
|
+
tx_params = {
|
171
|
+
:transaction_type => :purchase,
|
172
|
+
:amount => 10.50,
|
173
|
+
:cardholder_name => "Simon Brown",
|
174
|
+
:cc_number => "4111111111111111",
|
175
|
+
:cc_expiry => "1012",
|
176
|
+
:gateway_id => "XXXXXXX",
|
177
|
+
:password => "YYYYYY"
|
178
|
+
}.merge(avs_params)
|
179
|
+
|
180
|
+
request = EWS::Transaction::Request.new(tx_params)
|
181
|
+
|
182
|
+
transporter = EWS::Transporter.new("https://api.e-xact.com/")
|
183
|
+
response = transporter.submit(request)
|
119
184
|
|
120
|
-
==
|
185
|
+
response.cc_verification_str1.should == "N123BROWNSTREET4902101234"
|
186
|
+
response.avs.should == N
|
187
|
+
|
188
|
+
= Rake tasks
|
121
189
|
|
122
|
-
|
123
|
-
Run all
|
190
|
+
test
|
191
|
+
Run all tests (default)
|
124
192
|
|
125
193
|
rdoc
|
126
194
|
Generate rdoc html in doc/
|
data/Rakefile
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
require 'spec/rake/spectask'
|
2
1
|
require 'rake/rdoctask'
|
2
|
+
require 'rake/testtask'
|
3
3
|
require "rubygems"
|
4
|
-
# Gem::manage_gems
|
5
4
|
require "rake/gempackagetask"
|
6
5
|
|
7
|
-
task :default => :
|
6
|
+
task :default => :test
|
8
7
|
|
9
|
-
desc
|
10
|
-
|
11
|
-
t.
|
8
|
+
desc 'Run all the tests'
|
9
|
+
Rake::TestTask.new(:test) do |t|
|
10
|
+
t.libs << 'lib'
|
11
|
+
t.pattern = 'test/**/*_test.rb'
|
12
|
+
t.verbose = true
|
12
13
|
end
|
13
14
|
|
14
15
|
desc "Build the RDoc"
|
@@ -38,4 +39,4 @@ end
|
|
38
39
|
|
39
40
|
Rake::GemPackageTask.new(spec) do |pkg|
|
40
41
|
pkg.need_tar = true
|
41
|
-
end
|
42
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.2
|
@@ -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>
|