exact4r 0.5.2 → 0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +8 -0
- data/README +8 -8
- data/VERSION +1 -1
- data/doc/classes/EWS/Transaction/FakeResponse.html +451 -0
- data/doc/classes/EWS/Transaction/Request.html +54 -81
- data/doc/classes/EWS/Transaction/Response.html +182 -14
- data/doc/classes/EWS/Transaction/Validator.html +168 -0
- data/doc/classes/EWS/Transporter.html +271 -0
- data/doc/created.rid +1 -1
- data/doc/files/CHANGELOG.html +15 -2
- data/doc/files/README.html +17 -9
- data/doc/files/VERSION.html +2 -2
- data/doc/files/lib/ews/transaction/fake_response_rb.html +101 -0
- data/doc/files/lib/ews/transaction/mapping_rb.html +1 -1
- data/doc/files/lib/ews/transaction/request_rb.html +8 -1
- data/doc/files/lib/ews/transaction/response_rb.html +1 -1
- data/doc/files/lib/ews/transaction/validator_rb.html +101 -0
- data/doc/files/lib/ews/{transaction/transporter_rb.html → transporter_rb.html} +3 -3
- data/doc/files/lib/exact4r_rb.html +4 -2
- data/doc/fr_class_index.html +3 -1
- data/doc/fr_file_index.html +3 -1
- data/doc/fr_method_index.html +18 -7
- data/lib/ews/transaction/fake_response.rb +137 -0
- data/lib/ews/transaction/mapping.rb +38 -15
- data/lib/ews/transaction/request.rb +10 -58
- data/lib/ews/transaction/response.rb +3 -3
- data/lib/ews/transaction/validator.rb +230 -0
- data/lib/ews/transporter.rb +143 -0
- data/lib/exact4r.rb +4 -1
- data/spec/donncha_spec.rb +13 -0
- data/spec/mapping_spec.rb +45 -4
- data/spec/request_spec.rb +96 -69
- data/spec/spec_helper.rb +20 -8
- data/spec/transporter_spec.rb +26 -2
- data/spec/validator_spec.rb +145 -0
- metadata +16 -7
- data/doc/classes/EWS/Transaction/Transporter.html +0 -250
- data/lib/ews/transaction/transporter.rb +0 -120
- data/output.log +0 -368
data/doc/files/README.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<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
|
74
|
+
A gem which provides access to E-xact‘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 => "A00049-01", :password => "test1"
|
84
|
+
Account 2: :gateway_id => "A00427-01", :password => "testus"
|
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 => 10.50,
|
87
95
|
:cardholder_name => "Simon Brown",
|
88
96
|
:cc_number => "4111111111111111",
|
89
|
-
:cc_expiry => "
|
97
|
+
:cc_expiry => "1012", # MUST be MMYY format
|
90
98
|
:gateway_id => "XXXXXXX", # which gateway to submit the request to
|
91
99
|
:password => "YYYYYY" # your password for that gateway
|
92
100
|
})
|
93
101
|
|
94
|
-
transporter = EWS::
|
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 => 10.50,
|
123
131
|
:cardholder_name => "Simon Brown",
|
124
132
|
:cc_number => "4111111111111111",
|
125
|
-
:cc_expiry => "
|
133
|
+
:cc_expiry => "1012", # MUST be MMYY format
|
126
134
|
:gateway_id => "XXXXXXX", # which gateway to submit the request to
|
127
135
|
:password => "YYYYYY" # your password for that gateway
|
128
136
|
})
|
129
137
|
|
130
|
-
transporter = EWS::
|
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::
|
162
|
+
transporter = EWS::Transporter.new("https://api.e-xact.com/", {:transaction_type => :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 => 12.00,
|
160
168
|
:cardholder_name => "Simon Brown",
|
161
169
|
:cc_number => "4111111111111111",
|
162
|
-
:cc_expiry => "
|
170
|
+
:cc_expiry => "1012",
|
163
171
|
:gateway_id => "XXXXXX",
|
164
172
|
:password => "YYYYYY"
|
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 => :tagged_refund,
|
174
182
|
:transaction_tag => rsp_resp.transaction_tag, # need to know which transaction we're refunding against...
|
175
|
-
:
|
183
|
+
:authorization_num => rsp_resp.authorization_num, # and its authorization_num
|
176
184
|
:amount => 1.00, # refund a dollar at a time
|
177
185
|
:gateway_id => "XXXXXX",
|
178
186
|
:password => "YYYYYY"
|
data/doc/files/VERSION.html
CHANGED
@@ -56,7 +56,7 @@
|
|
56
56
|
</tr>
|
57
57
|
<tr class="top-aligned-row">
|
58
58
|
<td><strong>Last Update:</strong></td>
|
59
|
-
<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.
|
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>
|
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
|
77
|
+
</div>
|
78
|
+
</div>
|
72
79
|
|
73
80
|
</div>
|
74
81
|
|
@@ -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="
|
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/
|
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>
|
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>
|
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
|
78
78
|
ews/transaction/request
|
79
79
|
ews/transaction/response
|
80
|
-
ews/transaction/
|
80
|
+
ews/transaction/validator
|
81
|
+
ews/transporter
|
82
|
+
ews/transaction/fake_response
|
81
83
|
</div>
|
82
84
|
</div>
|
83
85
|
|
data/doc/fr_class_index.html
CHANGED
@@ -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/
|
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>
|
data/doc/fr_file_index.html
CHANGED
@@ -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/
|
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>
|
data/doc/fr_method_index.html
CHANGED
@@ -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#
|
24
|
-
<a href="classes/EWS/Transaction/
|
25
|
-
<a href="classes/EWS/Transaction/
|
26
|
-
<a href="classes/EWS/Transaction/
|
27
|
-
<a href="classes/EWS/Transaction/
|
28
|
-
<a href="classes/EWS/Transaction/
|
29
|
-
<a href="classes/EWS/Transaction/
|
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>
|