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.
Files changed (39) hide show
  1. data/CHANGELOG +8 -0
  2. data/README +8 -8
  3. data/VERSION +1 -1
  4. data/doc/classes/EWS/Transaction/FakeResponse.html +451 -0
  5. data/doc/classes/EWS/Transaction/Request.html +54 -81
  6. data/doc/classes/EWS/Transaction/Response.html +182 -14
  7. data/doc/classes/EWS/Transaction/Validator.html +168 -0
  8. data/doc/classes/EWS/Transporter.html +271 -0
  9. data/doc/created.rid +1 -1
  10. data/doc/files/CHANGELOG.html +15 -2
  11. data/doc/files/README.html +17 -9
  12. data/doc/files/VERSION.html +2 -2
  13. data/doc/files/lib/ews/transaction/fake_response_rb.html +101 -0
  14. data/doc/files/lib/ews/transaction/mapping_rb.html +1 -1
  15. data/doc/files/lib/ews/transaction/request_rb.html +8 -1
  16. data/doc/files/lib/ews/transaction/response_rb.html +1 -1
  17. data/doc/files/lib/ews/transaction/validator_rb.html +101 -0
  18. data/doc/files/lib/ews/{transaction/transporter_rb.html → transporter_rb.html} +3 -3
  19. data/doc/files/lib/exact4r_rb.html +4 -2
  20. data/doc/fr_class_index.html +3 -1
  21. data/doc/fr_file_index.html +3 -1
  22. data/doc/fr_method_index.html +18 -7
  23. data/lib/ews/transaction/fake_response.rb +137 -0
  24. data/lib/ews/transaction/mapping.rb +38 -15
  25. data/lib/ews/transaction/request.rb +10 -58
  26. data/lib/ews/transaction/response.rb +3 -3
  27. data/lib/ews/transaction/validator.rb +230 -0
  28. data/lib/ews/transporter.rb +143 -0
  29. data/lib/exact4r.rb +4 -1
  30. data/spec/donncha_spec.rb +13 -0
  31. data/spec/mapping_spec.rb +45 -4
  32. data/spec/request_spec.rb +96 -69
  33. data/spec/spec_helper.rb +20 -8
  34. data/spec/transporter_spec.rb +26 -2
  35. data/spec/validator_spec.rb +145 -0
  36. metadata +16 -7
  37. data/doc/classes/EWS/Transaction/Transporter.html +0 -250
  38. data/lib/ews/transaction/transporter.rb +0 -120
  39. data/output.log +0 -368
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri May 30 12:36:55 +1000 2008</td>
59
+ <td>Sun Jul 20 11:24:33 +1000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -71,10 +71,18 @@
71
71
  <div id="description">
72
72
  <h1>exact4r</h1>
73
73
  <p>
74
- A gem which rrovides access to E-xact&#8216;s Web Services API, allowing
74
+ A gem which provides access to E-xact&#8216;s Web Services API, allowing
75
75
  the submission of financial transactions via REST, JSON or SOAP.
76
76
  </p>
77
77
  <h2>Getting Started</h2>
78
+ <p>
79
+ To submit requests to our transaction processing service, you must first
80
+ have a Gateway ID, and a password. Test logins are as follows:
81
+ </p>
82
+ <pre>
83
+ Account 1: :gateway_id =&gt; &quot;A00049-01&quot;, :password =&gt; &quot;test1&quot;
84
+ Account 2: :gateway_id =&gt; &quot;A00427-01&quot;, :password =&gt; &quot;testus&quot;
85
+ </pre>
78
86
  <h1>1. Submit a transaction</h1>
79
87
  <pre>
80
88
  require 'rubygems'
@@ -86,12 +94,12 @@ the submission of financial transactions via REST, JSON or SOAP.
86
94
  :amount =&gt; 10.50,
87
95
  :cardholder_name =&gt; &quot;Simon Brown&quot;,
88
96
  :cc_number =&gt; &quot;4111111111111111&quot;,
89
- :cc_expiry =&gt; &quot;1005&quot;, # MUST be YYMM format
97
+ :cc_expiry =&gt; &quot;1012&quot;, # MUST be MMYY format
90
98
  :gateway_id =&gt; &quot;XXXXXXX&quot;, # which gateway to submit the request to
91
99
  :password =&gt; &quot;YYYYYY&quot; # your password for that gateway
92
100
  })
93
101
 
94
- transporter = EWS::Transaction::Transporter.new
102
+ transporter = EWS::Transporter.new
95
103
  response = transporter.submit(request) # submits using REST (XML) by default
96
104
 
97
105
  # submit using JSON, or
@@ -122,12 +130,12 @@ the submission of financial transactions via REST, JSON or SOAP.
122
130
  :amount =&gt; 10.50,
123
131
  :cardholder_name =&gt; &quot;Simon Brown&quot;,
124
132
  :cc_number =&gt; &quot;4111111111111111&quot;,
125
- :cc_expiry =&gt; &quot;1005&quot;, # MUST be YYMM format
133
+ :cc_expiry =&gt; &quot;1012&quot;, # MUST be MMYY format
126
134
  :gateway_id =&gt; &quot;XXXXXXX&quot;, # which gateway to submit the request to
127
135
  :password =&gt; &quot;YYYYYY&quot; # your password for that gateway
128
136
  })
129
137
 
130
- transporter = EWS::Transaction::Transporter.new
138
+ transporter = EWS::Transporter.new
131
139
  response = transporter.submit(request) # submits using REST (XML) by default
132
140
 
133
141
  # you need to know the transaction tag of the transaction you are looking for
@@ -151,7 +159,7 @@ the submission of financial transactions via REST, JSON or SOAP.
151
159
  # and forget about it.
152
160
  # In this example, we will continue to use E-xact's default web-service URL, but we
153
161
  # will specify a default transport_type of :soap
154
- transporter = EWS::Transaction::Transporter.new(nil, {:transaction_type =&gt; :soap})
162
+ transporter = EWS::Transporter.new(&quot;https://api.e-xact.com/&quot;, {:transaction_type =&gt; :soap})
155
163
 
156
164
  # now let's submit do a recurring seed purchase...
157
165
  rsp_req = EWS::Transaction::Request.new({
@@ -159,7 +167,7 @@ the submission of financial transactions via REST, JSON or SOAP.
159
167
  :amount =&gt; 12.00,
160
168
  :cardholder_name =&gt; &quot;Simon Brown&quot;,
161
169
  :cc_number =&gt; &quot;4111111111111111&quot;,
162
- :cc_expiry =&gt; &quot;1005&quot;,
170
+ :cc_expiry =&gt; &quot;1012&quot;,
163
171
  :gateway_id =&gt; &quot;XXXXXX&quot;,
164
172
  :password =&gt; &quot;YYYYYY&quot;
165
173
  })
@@ -172,7 +180,7 @@ the submission of financial transactions via REST, JSON or SOAP.
172
180
  rf_req = EWS::Transaction::Request.new({
173
181
  :transaction_type =&gt; :tagged_refund,
174
182
  :transaction_tag =&gt; rsp_resp.transaction_tag, # need to know which transaction we're refunding against...
175
- :auth_number =&gt; rsp_resp.auth_number, # and its auth_number
183
+ :authorization_num =&gt; rsp_resp.authorization_num, # and its authorization_num
176
184
  :amount =&gt; 1.00, # refund a dollar at a time
177
185
  :gateway_id =&gt; &quot;XXXXXX&quot;,
178
186
  :password =&gt; &quot;YYYYYY&quot;
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri May 30 18:19:10 +1000 2008</td>
59
+ <td>Thu Jul 31 17:15:57 +1000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div id="description">
72
72
  <p>
73
- 0.5.2
73
+ 0.6
74
74
  </p>
75
75
 
76
76
  </div>
@@ -0,0 +1,101 @@
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>File: fake_response.rb</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="fileHeader">
50
+ <h1>fake_response.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ews/transaction/fake_response.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Fri Jun 27 10:54:58 +1000 2008</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri May 30 14:41:31 +1000 2008</td>
59
+ <td>Thu Jul 31 16:18:36 +1000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri May 30 17:36:33 +1000 2008</td>
59
+ <td>Thu Jul 31 16:52:55 +1000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -69,6 +69,13 @@
69
69
  <div id="contextContent">
70
70
 
71
71
 
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ ews/transaction/validator&nbsp;&nbsp;
77
+ </div>
78
+ </div>
72
79
 
73
80
  </div>
74
81
 
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Thu May 29 22:32:55 +1000 2008</td>
59
+ <td>Mon Jul 14 18:50:47 +1000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -0,0 +1,101 @@
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>File: validator.rb</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="fileHeader">
50
+ <h1>validator.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ews/transaction/validator.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Fri Aug 08 11:26:48 +1000 2008</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -8,7 +8,7 @@
8
8
  <title>File: transporter.rb</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
10
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
12
  <script type="text/javascript">
13
13
  // <![CDATA[
14
14
 
@@ -51,12 +51,12 @@
51
51
  <table class="header-table">
52
52
  <tr class="top-aligned-row">
53
53
  <td><strong>Path:</strong></td>
54
- <td>lib/ews/transaction/transporter.rb
54
+ <td>lib/ews/transporter.rb
55
55
  </td>
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri May 30 18:15:16 +1000 2008</td>
59
+ <td>Wed Jul 30 10:35:13 +1000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Fri May 30 14:41:35 +1000 2008</td>
59
+ <td>Thu Jul 31 17:15:31 +1000 2008</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -77,7 +77,9 @@
77
77
  ews/transaction/mapping&nbsp;&nbsp;
78
78
  ews/transaction/request&nbsp;&nbsp;
79
79
  ews/transaction/response&nbsp;&nbsp;
80
- ews/transaction/transporter&nbsp;&nbsp;
80
+ ews/transaction/validator&nbsp;&nbsp;
81
+ ews/transporter&nbsp;&nbsp;
82
+ ews/transaction/fake_response&nbsp;&nbsp;
81
83
  </div>
82
84
  </div>
83
85
 
@@ -20,9 +20,11 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Classes</h1>
22
22
  <div id="index-entries">
23
+ <a href="classes/EWS/Transaction/FakeResponse.html">EWS::Transaction::FakeResponse</a><br />
23
24
  <a href="classes/EWS/Transaction/Request.html">EWS::Transaction::Request</a><br />
24
25
  <a href="classes/EWS/Transaction/Response.html">EWS::Transaction::Response</a><br />
25
- <a href="classes/EWS/Transaction/Transporter.html">EWS::Transaction::Transporter</a><br />
26
+ <a href="classes/EWS/Transaction/Validator.html">EWS::Transaction::Validator</a><br />
27
+ <a href="classes/EWS/Transporter.html">EWS::Transporter</a><br />
26
28
  </div>
27
29
  </div>
28
30
  </body>
@@ -24,10 +24,12 @@
24
24
  <a href="files/LICENCE.html">LICENCE</a><br />
25
25
  <a href="files/README.html">README</a><br />
26
26
  <a href="files/VERSION.html">VERSION</a><br />
27
+ <a href="files/lib/ews/transaction/fake_response_rb.html">lib/ews/transaction/fake_response.rb</a><br />
27
28
  <a href="files/lib/ews/transaction/mapping_rb.html">lib/ews/transaction/mapping.rb</a><br />
28
29
  <a href="files/lib/ews/transaction/request_rb.html">lib/ews/transaction/request.rb</a><br />
29
30
  <a href="files/lib/ews/transaction/response_rb.html">lib/ews/transaction/response.rb</a><br />
30
- <a href="files/lib/ews/transaction/transporter_rb.html">lib/ews/transaction/transporter.rb</a><br />
31
+ <a href="files/lib/ews/transaction/validator_rb.html">lib/ews/transaction/validator.rb</a><br />
32
+ <a href="files/lib/ews/transporter_rb.html">lib/ews/transporter.rb</a><br />
31
33
  <a href="files/lib/exact4r_rb.html">lib/exact4r.rb</a><br />
32
34
  </div>
33
35
  </div>
@@ -20,13 +20,24 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/EWS/Transaction/Response.html#M000003">approved? (EWS::Transaction::Response)</a><br />
24
- <a href="classes/EWS/Transaction/Request.html#M000006">is_find_transaction? (EWS::Transaction::Request)</a><br />
25
- <a href="classes/EWS/Transaction/Transporter.html#M000001">new (EWS::Transaction::Transporter)</a><br />
26
- <a href="classes/EWS/Transaction/Request.html#M000004">new (EWS::Transaction::Request)</a><br />
27
- <a href="classes/EWS/Transaction/Transporter.html#M000002">submit (EWS::Transaction::Transporter)</a><br />
28
- <a href="classes/EWS/Transaction/Request.html#M000005">transaction_type= (EWS::Transaction::Request)</a><br />
29
- <a href="classes/EWS/Transaction/Request.html#M000007">valid? (EWS::Transaction::Request)</a><br />
23
+ <a href="classes/EWS/Transaction/Response.html#M000013">approved? (EWS::Transaction::Response)</a><br />
24
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000003">declined (EWS::Transaction::FakeResponse)</a><br />
25
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000006">invalid_amount (EWS::Transaction::FakeResponse)</a><br />
26
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000008">invalid_auth_num (EWS::Transaction::FakeResponse)</a><br />
27
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000012">invalid_avs (EWS::Transaction::FakeResponse)</a><br />
28
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000007">invalid_cardholder_name (EWS::Transaction::FakeResponse)</a><br />
29
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000005">invalid_cc_expiry (EWS::Transaction::FakeResponse)</a><br />
30
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000004">invalid_cc_number (EWS::Transaction::FakeResponse)</a><br />
31
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000009">invalid_cc_verification_str (EWS::Transaction::FakeResponse)</a><br />
32
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000011">invalid_reference_no (EWS::Transaction::FakeResponse)</a><br />
33
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000010">invalid_transaction_code (EWS::Transaction::FakeResponse)</a><br />
34
+ <a href="classes/EWS/Transaction/Request.html#M000016">is_find_transaction? (EWS::Transaction::Request)</a><br />
35
+ <a href="classes/EWS/Transporter.html#M000017">new (EWS::Transporter)</a><br />
36
+ <a href="classes/EWS/Transaction/Request.html#M000014">new (EWS::Transaction::Request)</a><br />
37
+ <a href="classes/EWS/Transporter.html#M000018">submit (EWS::Transporter)</a><br />
38
+ <a href="classes/EWS/Transaction/Request.html#M000015">transaction_type= (EWS::Transaction::Request)</a><br />
39
+ <a href="classes/EWS/Transaction/FakeResponse.html#M000002">valid (EWS::Transaction::FakeResponse)</a><br />
40
+ <a href="classes/EWS/Transaction/Validator.html#M000001">valid? (EWS::Transaction::Validator)</a><br />
30
41
  </div>
31
42
  </div>
32
43
  </body>