exact4r 0.9.3 → 1.0

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.
Files changed (62) hide show
  1. data/CHANGELOG +3 -0
  2. data/README +0 -11
  3. data/Rakefile +38 -6
  4. data/VERSION +1 -1
  5. data/lib/ews/transaction/request.rb +4 -0
  6. data/lib/ews/transaction/validator.rb +2 -0
  7. data/lib/ews/transporter.rb +4 -2
  8. data/test/credentials.rb +62 -0
  9. data/test/credentials.yml +53 -0
  10. data/test/exhaustive/batch_query_close_test.rb +193 -0
  11. data/test/exhaustive/forced_post_test.rb +3 -3
  12. data/test/exhaustive/online_debit_purchase_test.rb +9 -5
  13. data/test/exhaustive/online_debit_refund_test.rb +9 -5
  14. data/test/exhaustive/pre_auth_completion_test.rb +3 -3
  15. data/test/exhaustive/pre_auth_only_test.rb +9 -3
  16. data/test/exhaustive/pre_auth_test.rb +3 -3
  17. data/test/exhaustive/purchase_correction_test.rb +13 -7
  18. data/test/exhaustive/purchase_test.rb +3 -3
  19. data/test/exhaustive/recurring_seed_pre_auth_test.rb +3 -3
  20. data/test/exhaustive/recurring_seed_purchase_test.rb +3 -3
  21. data/test/exhaustive/refund_correction_test.rb +12 -6
  22. data/test/exhaustive/refund_test.rb +3 -3
  23. data/test/exhaustive/secure_storage_test.rb +3 -3
  24. data/test/exhaustive/tagged_online_debit_refund_test.rb +64 -37
  25. data/test/exhaustive/tagged_pre_auth_completion_test.rb +8 -8
  26. data/test/exhaustive/tagged_pre_auth_test.rb +8 -8
  27. data/test/exhaustive/tagged_purchase_test.rb +8 -8
  28. data/test/exhaustive/tagged_refund_test.rb +9 -9
  29. data/test/exhaustive/tagged_void_test.rb +24 -10
  30. data/test/exhaustive/transaction_details_test.rb +8 -6
  31. data/test/exhaustive/void_test.rb +9 -3
  32. data/test/general/avs_test.rb +7 -7
  33. data/test/general/request_test.rb +20 -37
  34. data/test/general/transporter_test.rb +6 -6
  35. data/test/general/validator_test.rb +2 -2
  36. data/test/test_helper.rb +8 -18
  37. metadata +5 -27
  38. data/doc/classes/EWS/Transaction/FakeResponse.html +0 -451
  39. data/doc/classes/EWS/Transaction/Request.html +0 -469
  40. data/doc/classes/EWS/Transaction/Response.html +0 -472
  41. data/doc/classes/EWS/Transaction/Validator.html +0 -182
  42. data/doc/classes/EWS/Transporter.html +0 -269
  43. data/doc/classes/REXML/Document.html +0 -176
  44. data/doc/classes/REXML/Entity.html +0 -150
  45. data/doc/classes/REXML.html +0 -112
  46. data/doc/created.rid +0 -1
  47. data/doc/files/CHANGELOG.html +0 -156
  48. data/doc/files/LICENCE.html +0 -109
  49. data/doc/files/README.html +0 -371
  50. data/doc/files/VERSION.html +0 -107
  51. data/doc/files/lib/ews/transaction/fake_response_rb.html +0 -101
  52. data/doc/files/lib/ews/transaction/mapping_rb.html +0 -108
  53. data/doc/files/lib/ews/transaction/request_rb.html +0 -108
  54. data/doc/files/lib/ews/transaction/response_rb.html +0 -101
  55. data/doc/files/lib/ews/transaction/validator_rb.html +0 -101
  56. data/doc/files/lib/ews/transporter_rb.html +0 -108
  57. data/doc/files/lib/exact4r_rb.html +0 -117
  58. data/doc/fr_class_index.html +0 -34
  59. data/doc/fr_file_index.html +0 -37
  60. data/doc/fr_method_index.html +0 -48
  61. data/doc/index.html +0 -24
  62. data/doc/rdoc-style.css +0 -208
@@ -1,472 +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>&nbsp;&nbsp;
96
- <a href="#M000014">transaction_error?</a>&nbsp;&nbsp;
97
- </div>
98
- </div>
99
-
100
- </div>
101
-
102
-
103
- <!-- if includes -->
104
-
105
- <div id="section">
106
-
107
-
108
-
109
-
110
-
111
- <div id="attribute-list">
112
- <h3 class="section-bar">Attributes</h3>
113
-
114
- <div class="name-list">
115
- <table>
116
- <tr class="top-aligned-row context-row">
117
- <td class="context-item-name">amount</td>
118
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
119
- <td class="context-item-desc"></td>
120
- </tr>
121
- <tr class="top-aligned-row context-row">
122
- <td class="context-item-name">authorization_num</td>
123
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
124
- <td class="context-item-desc"></td>
125
- </tr>
126
- <tr class="top-aligned-row context-row">
127
- <td class="context-item-name">avs</td>
128
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
129
- <td class="context-item-desc"></td>
130
- </tr>
131
- <tr class="top-aligned-row context-row">
132
- <td class="context-item-name">bank_message</td>
133
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
134
- <td class="context-item-desc"></td>
135
- </tr>
136
- <tr class="top-aligned-row context-row">
137
- <td class="context-item-name">bank_resp_code</td>
138
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
139
- <td class="context-item-desc"></td>
140
- </tr>
141
- <tr class="top-aligned-row context-row">
142
- <td class="context-item-name">bank_resp_code_2</td>
143
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
144
- <td class="context-item-desc"></td>
145
- </tr>
146
- <tr class="top-aligned-row context-row">
147
- <td class="context-item-name">cardholder_name</td>
148
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
149
- <td class="context-item-desc"></td>
150
- </tr>
151
- <tr class="top-aligned-row context-row">
152
- <td class="context-item-name">cavv</td>
153
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
154
- <td class="context-item-desc"></td>
155
- </tr>
156
- <tr class="top-aligned-row context-row">
157
- <td class="context-item-name">cavv_algorithm</td>
158
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
159
- <td class="context-item-desc"></td>
160
- </tr>
161
- <tr class="top-aligned-row context-row">
162
- <td class="context-item-name">cavv_response</td>
163
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
164
- <td class="context-item-desc"></td>
165
- </tr>
166
- <tr class="top-aligned-row context-row">
167
- <td class="context-item-name">cc_expiry</td>
168
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
169
- <td class="context-item-desc"></td>
170
- </tr>
171
- <tr class="top-aligned-row context-row">
172
- <td class="context-item-name">cc_number</td>
173
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
174
- <td class="context-item-desc"></td>
175
- </tr>
176
- <tr class="top-aligned-row context-row">
177
- <td class="context-item-name">cc_verification_str1</td>
178
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
179
- <td class="context-item-desc"></td>
180
- </tr>
181
- <tr class="top-aligned-row context-row">
182
- <td class="context-item-name">cc_verification_str2</td>
183
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
184
- <td class="context-item-desc"></td>
185
- </tr>
186
- <tr class="top-aligned-row context-row">
187
- <td class="context-item-name">client_email</td>
188
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
189
- <td class="context-item-desc"></td>
190
- </tr>
191
- <tr class="top-aligned-row context-row">
192
- <td class="context-item-name">client_ip</td>
193
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
194
- <td class="context-item-desc"></td>
195
- </tr>
196
- <tr class="top-aligned-row context-row">
197
- <td class="context-item-name">ctr</td>
198
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
199
- <td class="context-item-desc"></td>
200
- </tr>
201
- <tr class="top-aligned-row context-row">
202
- <td class="context-item-name">customer_ref</td>
203
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
204
- <td class="context-item-desc"></td>
205
- </tr>
206
- <tr class="top-aligned-row context-row">
207
- <td class="context-item-name">cvd_presence_ind</td>
208
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
209
- <td class="context-item-desc"></td>
210
- </tr>
211
- <tr class="top-aligned-row context-row">
212
- <td class="context-item-name">cvv2</td>
213
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
214
- <td class="context-item-desc"></td>
215
- </tr>
216
- <tr class="top-aligned-row context-row">
217
- <td class="context-item-name">ecommerce_flag</td>
218
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
219
- <td class="context-item-desc"></td>
220
- </tr>
221
- <tr class="top-aligned-row context-row">
222
- <td class="context-item-name">error_description</td>
223
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
224
- <td class="context-item-desc"></td>
225
- </tr>
226
- <tr class="top-aligned-row context-row">
227
- <td class="context-item-name">error_number</td>
228
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
229
- <td class="context-item-desc"></td>
230
- </tr>
231
- <tr class="top-aligned-row context-row">
232
- <td class="context-item-name">exact_message</td>
233
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
234
- <td class="context-item-desc"></td>
235
- </tr>
236
- <tr class="top-aligned-row context-row">
237
- <td class="context-item-name">exact_resp_code</td>
238
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
239
- <td class="context-item-desc"></td>
240
- </tr>
241
- <tr class="top-aligned-row context-row">
242
- <td class="context-item-name">gateway_id</td>
243
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
244
- <td class="context-item-desc"></td>
245
- </tr>
246
- <tr class="top-aligned-row context-row">
247
- <td class="context-item-name">language</td>
248
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
249
- <td class="context-item-desc"></td>
250
- </tr>
251
- <tr class="top-aligned-row context-row">
252
- <td class="context-item-name">logon_message</td>
253
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
254
- <td class="context-item-desc"></td>
255
- </tr>
256
- <tr class="top-aligned-row context-row">
257
- <td class="context-item-name">merchant_address</td>
258
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
259
- <td class="context-item-desc"></td>
260
- </tr>
261
- <tr class="top-aligned-row context-row">
262
- <td class="context-item-name">merchant_city</td>
263
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
264
- <td class="context-item-desc"></td>
265
- </tr>
266
- <tr class="top-aligned-row context-row">
267
- <td class="context-item-name">merchant_country</td>
268
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
269
- <td class="context-item-desc"></td>
270
- </tr>
271
- <tr class="top-aligned-row context-row">
272
- <td class="context-item-name">merchant_name</td>
273
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
274
- <td class="context-item-desc"></td>
275
- </tr>
276
- <tr class="top-aligned-row context-row">
277
- <td class="context-item-name">merchant_postal</td>
278
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
279
- <td class="context-item-desc"></td>
280
- </tr>
281
- <tr class="top-aligned-row context-row">
282
- <td class="context-item-name">merchant_province</td>
283
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
284
- <td class="context-item-desc"></td>
285
- </tr>
286
- <tr class="top-aligned-row context-row">
287
- <td class="context-item-name">merchant_url</td>
288
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
289
- <td class="context-item-desc"></td>
290
- </tr>
291
- <tr class="top-aligned-row context-row">
292
- <td class="context-item-name">pan</td>
293
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
294
- <td class="context-item-desc"></td>
295
- </tr>
296
- <tr class="top-aligned-row context-row">
297
- <td class="context-item-name">password</td>
298
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
299
- <td class="context-item-desc"></td>
300
- </tr>
301
- <tr class="top-aligned-row context-row">
302
- <td class="context-item-name">reference_3</td>
303
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
304
- <td class="context-item-desc"></td>
305
- </tr>
306
- <tr class="top-aligned-row context-row">
307
- <td class="context-item-name">reference_no</td>
308
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
309
- <td class="context-item-desc"></td>
310
- </tr>
311
- <tr class="top-aligned-row context-row">
312
- <td class="context-item-name">retrieval_ref_no</td>
313
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
314
- <td class="context-item-desc"></td>
315
- </tr>
316
- <tr class="top-aligned-row context-row">
317
- <td class="context-item-name">secure_auth_required</td>
318
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
319
- <td class="context-item-desc"></td>
320
- </tr>
321
- <tr class="top-aligned-row context-row">
322
- <td class="context-item-name">secure_auth_result</td>
323
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
324
- <td class="context-item-desc"></td>
325
- </tr>
326
- <tr class="top-aligned-row context-row">
327
- <td class="context-item-name">sequence_no</td>
328
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
329
- <td class="context-item-desc"></td>
330
- </tr>
331
- <tr class="top-aligned-row context-row">
332
- <td class="context-item-name">surcharge_amount</td>
333
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
334
- <td class="context-item-desc"></td>
335
- </tr>
336
- <tr class="top-aligned-row context-row">
337
- <td class="context-item-name">tax1_amount</td>
338
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
339
- <td class="context-item-desc"></td>
340
- </tr>
341
- <tr class="top-aligned-row context-row">
342
- <td class="context-item-name">tax1_number</td>
343
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
344
- <td class="context-item-desc"></td>
345
- </tr>
346
- <tr class="top-aligned-row context-row">
347
- <td class="context-item-name">tax2_amount</td>
348
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
349
- <td class="context-item-desc"></td>
350
- </tr>
351
- <tr class="top-aligned-row context-row">
352
- <td class="context-item-name">tax2_number</td>
353
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
354
- <td class="context-item-desc"></td>
355
- </tr>
356
- <tr class="top-aligned-row context-row">
357
- <td class="context-item-name">track1</td>
358
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
359
- <td class="context-item-desc"></td>
360
- </tr>
361
- <tr class="top-aligned-row context-row">
362
- <td class="context-item-name">track2</td>
363
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
364
- <td class="context-item-desc"></td>
365
- </tr>
366
- <tr class="top-aligned-row context-row">
367
- <td class="context-item-name">transaction_approved</td>
368
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
369
- <td class="context-item-desc"></td>
370
- </tr>
371
- <tr class="top-aligned-row context-row">
372
- <td class="context-item-name">transaction_error</td>
373
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
374
- <td class="context-item-desc"></td>
375
- </tr>
376
- <tr class="top-aligned-row context-row">
377
- <td class="context-item-name">transaction_tag</td>
378
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
379
- <td class="context-item-desc"></td>
380
- </tr>
381
- <tr class="top-aligned-row context-row">
382
- <td class="context-item-name">transaction_type</td>
383
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
384
- <td class="context-item-desc"></td>
385
- </tr>
386
- <tr class="top-aligned-row context-row">
387
- <td class="context-item-name">user_name</td>
388
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
389
- <td class="context-item-desc"></td>
390
- </tr>
391
- <tr class="top-aligned-row context-row">
392
- <td class="context-item-name">xid</td>
393
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
394
- <td class="context-item-desc"></td>
395
- </tr>
396
- <tr class="top-aligned-row context-row">
397
- <td class="context-item-name">zip_code</td>
398
- <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
399
- <td class="context-item-desc"></td>
400
- </tr>
401
- </table>
402
- </div>
403
- </div>
404
-
405
-
406
-
407
- <!-- if method_list -->
408
- <div id="methods">
409
- <h3 class="section-bar">Public Instance methods</h3>
410
-
411
- <div id="method-M000013" class="method-detail">
412
- <a name="M000013"></a>
413
-
414
- <div class="method-heading">
415
- <a href="#M000013" class="method-signature">
416
- <span class="method-name">approved?</span><span class="method-args">()</span>
417
- </a>
418
- </div>
419
-
420
- <div class="method-description">
421
- <p>
422
- Indicates whether or not the transaction was approved
423
- </p>
424
- <p><a class="source-toggle" href="#"
425
- onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
426
- <div class="method-source-code" id="M000013-source">
427
- <pre>
428
- <span class="ruby-comment cmt"># File lib/ews/transaction/response.rb, line 17</span>
429
- 17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">approved?</span>
430
- 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>
431
- 19: <span class="ruby-keyword kw">end</span>
432
- </pre>
433
- </div>
434
- </div>
435
- </div>
436
-
437
- <div id="method-M000014" class="method-detail">
438
- <a name="M000014"></a>
439
-
440
- <div class="method-heading">
441
- <a href="#M000014" class="method-signature">
442
- <span class="method-name">transaction_error?</span><span class="method-args">()</span>
443
- </a>
444
- </div>
445
-
446
- <div class="method-description">
447
- <p><a class="source-toggle" href="#"
448
- onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
449
- <div class="method-source-code" id="M000014-source">
450
- <pre>
451
- <span class="ruby-comment cmt"># File lib/ews/transaction/response.rb, line 21</span>
452
- 21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">transaction_error?</span>
453
- 22: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transaction_error</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
454
- 23: <span class="ruby-keyword kw">end</span>
455
- </pre>
456
- </div>
457
- </div>
458
- </div>
459
-
460
-
461
- </div>
462
-
463
-
464
- </div>
465
-
466
-
467
- <div id="validator-badges">
468
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
469
- </div>
470
-
471
- </body>
472
- </html>
@@ -1,182 +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>&nbsp;&nbsp;
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">append_error</span>(<span class="ruby-identifier">:transaction_type</span>, <span class="ruby-value str">&quot;transaction_type must be supplied&quot;</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>
124
- 34:
125
- 35: <span class="ruby-comment cmt"># need to authenticate</span>
126
- 36: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:gateway_id</span>, <span class="ruby-value str">&quot;gateway_id must be supplied&quot;</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>
127
- 37: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:password</span>, <span class="ruby-value str">&quot;password must be supplied&quot;</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>
128
- 38:
129
- 39: <span class="ruby-identifier">validate_lengths</span>
130
- 40:
131
- 41: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transaction_type</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;CR&quot;</span>
132
- 42: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:transaction_tag</span>, <span class="ruby-value str">&quot;transaction_tag must be supplied&quot;</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transaction_tag</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">1</span>
133
- 43: <span class="ruby-keyword kw">elsif</span> <span class="ruby-node">%w(50 54)</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transaction_type</span>)
134
- 44: <span class="ruby-identifier">validate_for_pan</span>
135
- 45: <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transaction_tag</span>.<span class="ruby-identifier">blank?</span>
136
- 46: <span class="ruby-identifier">validate_for_transaction_tag</span>
137
- 47: <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">cc_number</span>.<span class="ruby-identifier">blank?</span>
138
- 48: <span class="ruby-identifier">validate_for_cc_number</span>
139
- 49: <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track1</span>.<span class="ruby-identifier">blank?</span>
140
- 50: <span class="ruby-identifier">validate_for_track1</span>
141
- 51: <span class="ruby-keyword kw">elsif</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">track2</span>.<span class="ruby-identifier">blank?</span>
142
- 52: <span class="ruby-identifier">validate_for_track2</span>
143
- 53: <span class="ruby-keyword kw">else</span>
144
- 54: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:base</span>, <span class="ruby-value str">&quot;One of the following must be supplied: cc_number, track1, track2 or transaction_tag.&quot;</span>)
145
- 55: <span class="ruby-keyword kw">end</span>
146
- 56:
147
- 57: <span class="ruby-comment cmt"># ensure we've been given valid amounts</span>
148
- 58: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:amount</span>, <span class="ruby-value str">&quot;invalid amount supplied&quot;</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>)
149
- 59: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:surcharge_amount</span>, <span class="ruby-value str">&quot;invalid surcharge_amount supplied&quot;</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>)
150
- 60: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax1_amount</span>, <span class="ruby-value str">&quot;invalid tax1_amount supplied&quot;</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>)
151
- 61: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax2_amount</span>, <span class="ruby-value str">&quot;invalid tax2_amount supplied&quot;</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>)
152
- 62:
153
- 63: <span class="ruby-comment cmt"># ensure our amounts are within range</span>
154
- 64: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:amount</span>, <span class="ruby-value str">&quot;amount must be between 0.00 and 99999.99&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_in_range?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">amount</span>)
155
- 65: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:surcharge_amount</span>, <span class="ruby-value str">&quot;amount must be between 0.00 and 99999.99&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_in_range?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">surcharge_amount</span>)
156
- 66: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax1_amount</span>, <span class="ruby-value str">&quot;amount must be between 0.00 and 99999.99&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_in_range?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tax1_amount</span>)
157
- 67: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:tax2_amount</span>, <span class="ruby-value str">&quot;amount must be between 0.00 and 99999.99&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">amount_in_range?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">tax2_amount</span>)
158
- 68:
159
- 69: <span class="ruby-comment cmt"># ensure our credit card information is valid</span>
160
- 70: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:cc_number</span>, <span class="ruby-value str">&quot;invalid cc_number supplied&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_card_number?</span>
161
- 71: <span class="ruby-identifier">append_error</span>(<span class="ruby-identifier">:cc_expiry</span>, <span class="ruby-value str">&quot;invalid cc_expiry supplied&quot;</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid_expiry_date?</span>
162
- 72:
163
- 73: <span class="ruby-ivar">@errors</span>.<span class="ruby-identifier">empty?</span>
164
- 74: <span class="ruby-keyword kw">end</span>
165
- </pre>
166
- </div>
167
- </div>
168
- </div>
169
-
170
-
171
- </div>
172
-
173
-
174
- </div>
175
-
176
-
177
- <div id="validator-badges">
178
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
179
- </div>
180
-
181
- </body>
182
- </html>