exact4r 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/certs/exact.cer +10 -10
- data/lib/ews/transaction/mapping.rb +4 -9
- data/lib/ews/transaction/validator.rb +14 -18
- data/lib/ews/transporter.rb +13 -23
- data/lib/exact4r.rb +1 -0
- data/spec/spec_helper.rb +6 -4
- data/spec/transporter_spec.rb +0 -2
- data/spec/validator_spec.rb +5 -0
- metadata +3 -34
- data/doc/classes/EWS/Transaction/FakeResponse.html +0 -451
- data/doc/classes/EWS/Transaction/Request.html +0 -461
- data/doc/classes/EWS/Transaction/Response.html +0 -448
- data/doc/classes/EWS/Transaction/Validator.html +0 -168
- data/doc/classes/EWS/Transporter.html +0 -271
- data/doc/created.rid +0 -1
- data/doc/files/CHANGELOG.html +0 -132
- data/doc/files/LICENCE.html +0 -109
- data/doc/files/README.html +0 -243
- 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/mapping_rb.html +0 -109
- data/doc/files/lib/ews/transaction/request_rb.html +0 -108
- data/doc/files/lib/ews/transaction/response_rb.html +0 -101
- data/doc/files/lib/ews/transaction/validator_rb.html +0 -101
- data/doc/files/lib/ews/transporter_rb.html +0 -108
- data/doc/files/lib/exact4r_rb.html +0 -114
- data/doc/fr_class_index.html +0 -31
- data/doc/fr_file_index.html +0 -37
- data/doc/fr_method_index.html +0 -44
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/spec/donncha_spec.rb +0 -13
@@ -1,448 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: EWS::Transaction::Response</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::Response</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../files/lib/ews/transaction/response_rb.html">
|
59
|
-
lib/ews/transaction/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
|
-
This class encapsulates all the data returned from the E-xact Web Service.
|
84
|
-
</p>
|
85
|
-
|
86
|
-
</div>
|
87
|
-
|
88
|
-
|
89
|
-
</div>
|
90
|
-
|
91
|
-
<div id="method-list">
|
92
|
-
<h3 class="section-bar">Methods</h3>
|
93
|
-
|
94
|
-
<div class="name-list">
|
95
|
-
<a href="#M000013">approved?</a>
|
96
|
-
</div>
|
97
|
-
</div>
|
98
|
-
|
99
|
-
</div>
|
100
|
-
|
101
|
-
|
102
|
-
<!-- if includes -->
|
103
|
-
|
104
|
-
<div id="section">
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
<div id="attribute-list">
|
111
|
-
<h3 class="section-bar">Attributes</h3>
|
112
|
-
|
113
|
-
<div class="name-list">
|
114
|
-
<table>
|
115
|
-
<tr class="top-aligned-row context-row">
|
116
|
-
<td class="context-item-name">amount</td>
|
117
|
-
<td class="context-item-value"> [RW] </td>
|
118
|
-
<td class="context-item-desc"></td>
|
119
|
-
</tr>
|
120
|
-
<tr class="top-aligned-row context-row">
|
121
|
-
<td class="context-item-name">authorization_num</td>
|
122
|
-
<td class="context-item-value"> [RW] </td>
|
123
|
-
<td class="context-item-desc"></td>
|
124
|
-
</tr>
|
125
|
-
<tr class="top-aligned-row context-row">
|
126
|
-
<td class="context-item-name">avs</td>
|
127
|
-
<td class="context-item-value"> [RW] </td>
|
128
|
-
<td class="context-item-desc"></td>
|
129
|
-
</tr>
|
130
|
-
<tr class="top-aligned-row context-row">
|
131
|
-
<td class="context-item-name">bank_message</td>
|
132
|
-
<td class="context-item-value"> [RW] </td>
|
133
|
-
<td class="context-item-desc"></td>
|
134
|
-
</tr>
|
135
|
-
<tr class="top-aligned-row context-row">
|
136
|
-
<td class="context-item-name">bank_resp_code</td>
|
137
|
-
<td class="context-item-value"> [RW] </td>
|
138
|
-
<td class="context-item-desc"></td>
|
139
|
-
</tr>
|
140
|
-
<tr class="top-aligned-row context-row">
|
141
|
-
<td class="context-item-name">bank_resp_code_2</td>
|
142
|
-
<td class="context-item-value"> [RW] </td>
|
143
|
-
<td class="context-item-desc"></td>
|
144
|
-
</tr>
|
145
|
-
<tr class="top-aligned-row context-row">
|
146
|
-
<td class="context-item-name">cardholder_name</td>
|
147
|
-
<td class="context-item-value"> [RW] </td>
|
148
|
-
<td class="context-item-desc"></td>
|
149
|
-
</tr>
|
150
|
-
<tr class="top-aligned-row context-row">
|
151
|
-
<td class="context-item-name">cavv</td>
|
152
|
-
<td class="context-item-value"> [RW] </td>
|
153
|
-
<td class="context-item-desc"></td>
|
154
|
-
</tr>
|
155
|
-
<tr class="top-aligned-row context-row">
|
156
|
-
<td class="context-item-name">cavv_algorithm</td>
|
157
|
-
<td class="context-item-value"> [RW] </td>
|
158
|
-
<td class="context-item-desc"></td>
|
159
|
-
</tr>
|
160
|
-
<tr class="top-aligned-row context-row">
|
161
|
-
<td class="context-item-name">cavv_response</td>
|
162
|
-
<td class="context-item-value"> [RW] </td>
|
163
|
-
<td class="context-item-desc"></td>
|
164
|
-
</tr>
|
165
|
-
<tr class="top-aligned-row context-row">
|
166
|
-
<td class="context-item-name">cc_expiry</td>
|
167
|
-
<td class="context-item-value"> [RW] </td>
|
168
|
-
<td class="context-item-desc"></td>
|
169
|
-
</tr>
|
170
|
-
<tr class="top-aligned-row context-row">
|
171
|
-
<td class="context-item-name">cc_number</td>
|
172
|
-
<td class="context-item-value"> [RW] </td>
|
173
|
-
<td class="context-item-desc"></td>
|
174
|
-
</tr>
|
175
|
-
<tr class="top-aligned-row context-row">
|
176
|
-
<td class="context-item-name">cc_verification_str1</td>
|
177
|
-
<td class="context-item-value"> [RW] </td>
|
178
|
-
<td class="context-item-desc"></td>
|
179
|
-
</tr>
|
180
|
-
<tr class="top-aligned-row context-row">
|
181
|
-
<td class="context-item-name">cc_verification_str2</td>
|
182
|
-
<td class="context-item-value"> [RW] </td>
|
183
|
-
<td class="context-item-desc"></td>
|
184
|
-
</tr>
|
185
|
-
<tr class="top-aligned-row context-row">
|
186
|
-
<td class="context-item-name">client_email</td>
|
187
|
-
<td class="context-item-value"> [RW] </td>
|
188
|
-
<td class="context-item-desc"></td>
|
189
|
-
</tr>
|
190
|
-
<tr class="top-aligned-row context-row">
|
191
|
-
<td class="context-item-name">client_ip</td>
|
192
|
-
<td class="context-item-value"> [RW] </td>
|
193
|
-
<td class="context-item-desc"></td>
|
194
|
-
</tr>
|
195
|
-
<tr class="top-aligned-row context-row">
|
196
|
-
<td class="context-item-name">ctr</td>
|
197
|
-
<td class="context-item-value"> [RW] </td>
|
198
|
-
<td class="context-item-desc"></td>
|
199
|
-
</tr>
|
200
|
-
<tr class="top-aligned-row context-row">
|
201
|
-
<td class="context-item-name">customer_ref</td>
|
202
|
-
<td class="context-item-value"> [RW] </td>
|
203
|
-
<td class="context-item-desc"></td>
|
204
|
-
</tr>
|
205
|
-
<tr class="top-aligned-row context-row">
|
206
|
-
<td class="context-item-name">cvd_presence_ind</td>
|
207
|
-
<td class="context-item-value"> [RW] </td>
|
208
|
-
<td class="context-item-desc"></td>
|
209
|
-
</tr>
|
210
|
-
<tr class="top-aligned-row context-row">
|
211
|
-
<td class="context-item-name">cvv2</td>
|
212
|
-
<td class="context-item-value"> [RW] </td>
|
213
|
-
<td class="context-item-desc"></td>
|
214
|
-
</tr>
|
215
|
-
<tr class="top-aligned-row context-row">
|
216
|
-
<td class="context-item-name">ecommerce_flag</td>
|
217
|
-
<td class="context-item-value"> [RW] </td>
|
218
|
-
<td class="context-item-desc"></td>
|
219
|
-
</tr>
|
220
|
-
<tr class="top-aligned-row context-row">
|
221
|
-
<td class="context-item-name">error_description</td>
|
222
|
-
<td class="context-item-value"> [RW] </td>
|
223
|
-
<td class="context-item-desc"></td>
|
224
|
-
</tr>
|
225
|
-
<tr class="top-aligned-row context-row">
|
226
|
-
<td class="context-item-name">error_number</td>
|
227
|
-
<td class="context-item-value"> [RW] </td>
|
228
|
-
<td class="context-item-desc"></td>
|
229
|
-
</tr>
|
230
|
-
<tr class="top-aligned-row context-row">
|
231
|
-
<td class="context-item-name">exact_message</td>
|
232
|
-
<td class="context-item-value"> [RW] </td>
|
233
|
-
<td class="context-item-desc"></td>
|
234
|
-
</tr>
|
235
|
-
<tr class="top-aligned-row context-row">
|
236
|
-
<td class="context-item-name">exact_resp_code</td>
|
237
|
-
<td class="context-item-value"> [RW] </td>
|
238
|
-
<td class="context-item-desc"></td>
|
239
|
-
</tr>
|
240
|
-
<tr class="top-aligned-row context-row">
|
241
|
-
<td class="context-item-name">gateway_id</td>
|
242
|
-
<td class="context-item-value"> [RW] </td>
|
243
|
-
<td class="context-item-desc"></td>
|
244
|
-
</tr>
|
245
|
-
<tr class="top-aligned-row context-row">
|
246
|
-
<td class="context-item-name">language</td>
|
247
|
-
<td class="context-item-value"> [RW] </td>
|
248
|
-
<td class="context-item-desc"></td>
|
249
|
-
</tr>
|
250
|
-
<tr class="top-aligned-row context-row">
|
251
|
-
<td class="context-item-name">logon_message</td>
|
252
|
-
<td class="context-item-value"> [RW] </td>
|
253
|
-
<td class="context-item-desc"></td>
|
254
|
-
</tr>
|
255
|
-
<tr class="top-aligned-row context-row">
|
256
|
-
<td class="context-item-name">merchant_address</td>
|
257
|
-
<td class="context-item-value"> [RW] </td>
|
258
|
-
<td class="context-item-desc"></td>
|
259
|
-
</tr>
|
260
|
-
<tr class="top-aligned-row context-row">
|
261
|
-
<td class="context-item-name">merchant_city</td>
|
262
|
-
<td class="context-item-value"> [RW] </td>
|
263
|
-
<td class="context-item-desc"></td>
|
264
|
-
</tr>
|
265
|
-
<tr class="top-aligned-row context-row">
|
266
|
-
<td class="context-item-name">merchant_country</td>
|
267
|
-
<td class="context-item-value"> [RW] </td>
|
268
|
-
<td class="context-item-desc"></td>
|
269
|
-
</tr>
|
270
|
-
<tr class="top-aligned-row context-row">
|
271
|
-
<td class="context-item-name">merchant_name</td>
|
272
|
-
<td class="context-item-value"> [RW] </td>
|
273
|
-
<td class="context-item-desc"></td>
|
274
|
-
</tr>
|
275
|
-
<tr class="top-aligned-row context-row">
|
276
|
-
<td class="context-item-name">merchant_postal</td>
|
277
|
-
<td class="context-item-value"> [RW] </td>
|
278
|
-
<td class="context-item-desc"></td>
|
279
|
-
</tr>
|
280
|
-
<tr class="top-aligned-row context-row">
|
281
|
-
<td class="context-item-name">merchant_province</td>
|
282
|
-
<td class="context-item-value"> [RW] </td>
|
283
|
-
<td class="context-item-desc"></td>
|
284
|
-
</tr>
|
285
|
-
<tr class="top-aligned-row context-row">
|
286
|
-
<td class="context-item-name">merchant_url</td>
|
287
|
-
<td class="context-item-value"> [RW] </td>
|
288
|
-
<td class="context-item-desc"></td>
|
289
|
-
</tr>
|
290
|
-
<tr class="top-aligned-row context-row">
|
291
|
-
<td class="context-item-name">pan</td>
|
292
|
-
<td class="context-item-value"> [RW] </td>
|
293
|
-
<td class="context-item-desc"></td>
|
294
|
-
</tr>
|
295
|
-
<tr class="top-aligned-row context-row">
|
296
|
-
<td class="context-item-name">password</td>
|
297
|
-
<td class="context-item-value"> [RW] </td>
|
298
|
-
<td class="context-item-desc"></td>
|
299
|
-
</tr>
|
300
|
-
<tr class="top-aligned-row context-row">
|
301
|
-
<td class="context-item-name">reference_3</td>
|
302
|
-
<td class="context-item-value"> [RW] </td>
|
303
|
-
<td class="context-item-desc"></td>
|
304
|
-
</tr>
|
305
|
-
<tr class="top-aligned-row context-row">
|
306
|
-
<td class="context-item-name">reference_no</td>
|
307
|
-
<td class="context-item-value"> [RW] </td>
|
308
|
-
<td class="context-item-desc"></td>
|
309
|
-
</tr>
|
310
|
-
<tr class="top-aligned-row context-row">
|
311
|
-
<td class="context-item-name">retrieval_ref_no</td>
|
312
|
-
<td class="context-item-value"> [RW] </td>
|
313
|
-
<td class="context-item-desc"></td>
|
314
|
-
</tr>
|
315
|
-
<tr class="top-aligned-row context-row">
|
316
|
-
<td class="context-item-name">secure_auth_required</td>
|
317
|
-
<td class="context-item-value"> [RW] </td>
|
318
|
-
<td class="context-item-desc"></td>
|
319
|
-
</tr>
|
320
|
-
<tr class="top-aligned-row context-row">
|
321
|
-
<td class="context-item-name">secure_auth_result</td>
|
322
|
-
<td class="context-item-value"> [RW] </td>
|
323
|
-
<td class="context-item-desc"></td>
|
324
|
-
</tr>
|
325
|
-
<tr class="top-aligned-row context-row">
|
326
|
-
<td class="context-item-name">sequence_no</td>
|
327
|
-
<td class="context-item-value"> [RW] </td>
|
328
|
-
<td class="context-item-desc"></td>
|
329
|
-
</tr>
|
330
|
-
<tr class="top-aligned-row context-row">
|
331
|
-
<td class="context-item-name">surcharge_amount</td>
|
332
|
-
<td class="context-item-value"> [RW] </td>
|
333
|
-
<td class="context-item-desc"></td>
|
334
|
-
</tr>
|
335
|
-
<tr class="top-aligned-row context-row">
|
336
|
-
<td class="context-item-name">tax1_amount</td>
|
337
|
-
<td class="context-item-value"> [RW] </td>
|
338
|
-
<td class="context-item-desc"></td>
|
339
|
-
</tr>
|
340
|
-
<tr class="top-aligned-row context-row">
|
341
|
-
<td class="context-item-name">tax1_number</td>
|
342
|
-
<td class="context-item-value"> [RW] </td>
|
343
|
-
<td class="context-item-desc"></td>
|
344
|
-
</tr>
|
345
|
-
<tr class="top-aligned-row context-row">
|
346
|
-
<td class="context-item-name">tax2_amount</td>
|
347
|
-
<td class="context-item-value"> [RW] </td>
|
348
|
-
<td class="context-item-desc"></td>
|
349
|
-
</tr>
|
350
|
-
<tr class="top-aligned-row context-row">
|
351
|
-
<td class="context-item-name">tax2_number</td>
|
352
|
-
<td class="context-item-value"> [RW] </td>
|
353
|
-
<td class="context-item-desc"></td>
|
354
|
-
</tr>
|
355
|
-
<tr class="top-aligned-row context-row">
|
356
|
-
<td class="context-item-name">track1</td>
|
357
|
-
<td class="context-item-value"> [RW] </td>
|
358
|
-
<td class="context-item-desc"></td>
|
359
|
-
</tr>
|
360
|
-
<tr class="top-aligned-row context-row">
|
361
|
-
<td class="context-item-name">track2</td>
|
362
|
-
<td class="context-item-value"> [RW] </td>
|
363
|
-
<td class="context-item-desc"></td>
|
364
|
-
</tr>
|
365
|
-
<tr class="top-aligned-row context-row">
|
366
|
-
<td class="context-item-name">transaction_approved</td>
|
367
|
-
<td class="context-item-value"> [RW] </td>
|
368
|
-
<td class="context-item-desc"></td>
|
369
|
-
</tr>
|
370
|
-
<tr class="top-aligned-row context-row">
|
371
|
-
<td class="context-item-name">transaction_error</td>
|
372
|
-
<td class="context-item-value"> [RW] </td>
|
373
|
-
<td class="context-item-desc"></td>
|
374
|
-
</tr>
|
375
|
-
<tr class="top-aligned-row context-row">
|
376
|
-
<td class="context-item-name">transaction_tag</td>
|
377
|
-
<td class="context-item-value"> [RW] </td>
|
378
|
-
<td class="context-item-desc"></td>
|
379
|
-
</tr>
|
380
|
-
<tr class="top-aligned-row context-row">
|
381
|
-
<td class="context-item-name">transaction_type</td>
|
382
|
-
<td class="context-item-value"> [RW] </td>
|
383
|
-
<td class="context-item-desc"></td>
|
384
|
-
</tr>
|
385
|
-
<tr class="top-aligned-row context-row">
|
386
|
-
<td class="context-item-name">user_name</td>
|
387
|
-
<td class="context-item-value"> [RW] </td>
|
388
|
-
<td class="context-item-desc"></td>
|
389
|
-
</tr>
|
390
|
-
<tr class="top-aligned-row context-row">
|
391
|
-
<td class="context-item-name">xid</td>
|
392
|
-
<td class="context-item-value"> [RW] </td>
|
393
|
-
<td class="context-item-desc"></td>
|
394
|
-
</tr>
|
395
|
-
<tr class="top-aligned-row context-row">
|
396
|
-
<td class="context-item-name">zip_code</td>
|
397
|
-
<td class="context-item-value"> [RW] </td>
|
398
|
-
<td class="context-item-desc"></td>
|
399
|
-
</tr>
|
400
|
-
</table>
|
401
|
-
</div>
|
402
|
-
</div>
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
<!-- if method_list -->
|
407
|
-
<div id="methods">
|
408
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
409
|
-
|
410
|
-
<div id="method-M000013" class="method-detail">
|
411
|
-
<a name="M000013"></a>
|
412
|
-
|
413
|
-
<div class="method-heading">
|
414
|
-
<a href="#M000013" class="method-signature">
|
415
|
-
<span class="method-name">approved?</span><span class="method-args">()</span>
|
416
|
-
</a>
|
417
|
-
</div>
|
418
|
-
|
419
|
-
<div class="method-description">
|
420
|
-
<p>
|
421
|
-
Indicates whether or not the transaction was approved
|
422
|
-
</p>
|
423
|
-
<p><a class="source-toggle" href="#"
|
424
|
-
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
425
|
-
<div class="method-source-code" id="M000013-source">
|
426
|
-
<pre>
|
427
|
-
<span class="ruby-comment cmt"># File lib/ews/transaction/response.rb, line 17</span>
|
428
|
-
17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">approved?</span>
|
429
|
-
18: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transaction_approved</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
430
|
-
19: <span class="ruby-keyword kw">end</span>
|
431
|
-
</pre>
|
432
|
-
</div>
|
433
|
-
</div>
|
434
|
-
</div>
|
435
|
-
|
436
|
-
|
437
|
-
</div>
|
438
|
-
|
439
|
-
|
440
|
-
</div>
|
441
|
-
|
442
|
-
|
443
|
-
<div id="validator-badges">
|
444
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
445
|
-
</div>
|
446
|
-
|
447
|
-
</body>
|
448
|
-
</html>
|
@@ -1,168 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Module: EWS::Transaction::Validator</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>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">EWS::Transaction::Validator</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../../files/lib/ews/transaction/validator_rb.html">
|
59
|
-
lib/ews/transaction/validator.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
</table>
|
66
|
-
</div>
|
67
|
-
<!-- banner header -->
|
68
|
-
|
69
|
-
<div id="bodyContent">
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
<div id="contextContent">
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
</div>
|
78
|
-
|
79
|
-
<div id="method-list">
|
80
|
-
<h3 class="section-bar">Methods</h3>
|
81
|
-
|
82
|
-
<div class="name-list">
|
83
|
-
<a href="#M000001">valid?</a>
|
84
|
-
</div>
|
85
|
-
</div>
|
86
|
-
|
87
|
-
</div>
|
88
|
-
|
89
|
-
|
90
|
-
<!-- if includes -->
|
91
|
-
|
92
|
-
<div id="section">
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
<!-- if method_list -->
|
102
|
-
<div id="methods">
|
103
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
104
|
-
|
105
|
-
<div id="method-M000001" class="method-detail">
|
106
|
-
<a name="M000001"></a>
|
107
|
-
|
108
|
-
<div class="method-heading">
|
109
|
-
<a href="#M000001" class="method-signature">
|
110
|
-
<span class="method-name">valid?</span><span class="method-args">()</span>
|
111
|
-
</a>
|
112
|
-
</div>
|
113
|
-
|
114
|
-
<div class="method-description">
|
115
|
-
<p><a class="source-toggle" href="#"
|
116
|
-
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
117
|
-
<div class="method-source-code" id="M000001-source">
|
118
|
-
<pre>
|
119
|
-
<span class="ruby-comment cmt"># File lib/ews/transaction/validator.rb, line 30</span>
|
120
|
-
30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid?</span>
|
121
|
-
31: <span class="ruby-ivar">@errors</span> = {}
|
122
|
-
32:
|
123
|
-
33: <span class="ruby-identifier">validate_lengths</span>
|
124
|
-
34:
|
125
|
-
35: <span class="ruby-identifier">validate_mandatory_fields</span>
|
126
|
-
36:
|
127
|
-
37: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:transaction_type</span>, <span class="ruby-value str">"transaction_type must be supplied"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transaction_type</span>.<span class="ruby-identifier">blank?</span>
|
128
|
-
38:
|
129
|
-
39: <span class="ruby-comment cmt"># need to authenticate</span>
|
130
|
-
40: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:gateway_id</span>, <span class="ruby-value str">"gateway_id must be supplied"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">gateway_id</span>.<span class="ruby-identifier">blank?</span>
|
131
|
-
41: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:password</span>, <span class="ruby-value str">"password must be supplied"</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>.<span class="ruby-identifier">blank?</span>
|
132
|
-
42:
|
133
|
-
43: <span class="ruby-comment cmt"># ensure we've been given valid amounts</span>
|
134
|
-
44: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:amount</span>, <span class="ruby-value str">"invalid amount supplied"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_amount?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">amount</span>)
|
135
|
-
45: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:surcharge_amount</span>, <span class="ruby-value str">"invalid surcharge_amount supplied"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_amount?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">surcharge_amount</span>)
|
136
|
-
46: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax1_amount</span>, <span class="ruby-value str">"invalid tax1_amount supplied"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_amount?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tax1_amount</span>)
|
137
|
-
47: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax2_amount</span>, <span class="ruby-value str">"invalid tax2_amount supplied"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_amount?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tax2_amount</span>)
|
138
|
-
48:
|
139
|
-
49: <span class="ruby-comment cmt"># ensure our amounts are within range</span>
|
140
|
-
50: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:amount</span>, <span class="ruby-value str">"amount must be between 0.00 and 99999.99"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_too_big?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">amount</span>)
|
141
|
-
51: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:surcharge_amount</span>, <span class="ruby-value str">"amount must be between 0.00 and 99999.99"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_too_big?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">surcharge_amount</span>)
|
142
|
-
52: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax1_amount</span>, <span class="ruby-value str">"amount must be between 0.00 and 99999.99"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_too_big?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tax1_amount</span>)
|
143
|
-
53: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax2_amount</span>, <span class="ruby-value str">"amount must be between 0.00 and 99999.99"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_too_big?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tax2_amount</span>)
|
144
|
-
54:
|
145
|
-
55: <span class="ruby-comment cmt"># ensure our credit card information is valid</span>
|
146
|
-
56: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:cc_number</span>, <span class="ruby-value str">"invalid cc_number supplied"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_card_number?</span>
|
147
|
-
57: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:cc_expiry</span>, <span class="ruby-value str">"invalid cc_expiry supplied"</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_expiry_date?</span>
|
148
|
-
58:
|
149
|
-
59: <span class="ruby-ivar">@errors</span>.<span class="ruby-identifier">empty?</span>
|
150
|
-
60: <span class="ruby-keyword kw">end</span>
|
151
|
-
</pre>
|
152
|
-
</div>
|
153
|
-
</div>
|
154
|
-
</div>
|
155
|
-
|
156
|
-
|
157
|
-
</div>
|
158
|
-
|
159
|
-
|
160
|
-
</div>
|
161
|
-
|
162
|
-
|
163
|
-
<div id="validator-badges">
|
164
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
165
|
-
</div>
|
166
|
-
|
167
|
-
</body>
|
168
|
-
</html>
|