geti 0.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.
- data/.document +5 -0
- data/Gemfile +20 -0
- data/Gemfile.lock +78 -0
- data/Guardfile +4 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +22 -0
- data/Rakefile +46 -0
- data/VERSION +1 -0
- data/config/test_credentials.yml.example +2 -0
- data/doc/.DS_Store +0 -0
- data/doc/Application Gateway Doc.pdf +0 -0
- data/doc/Auth Gateway Doc.pdf +0 -0
- data/doc/Auth Gateway Implementation Guide.pdf +0 -0
- data/doc/implementation_notes.md +29 -0
- data/doc/readme.txt +28 -0
- data/lib/geti.rb +7 -0
- data/lib/geti/app_client.rb +277 -0
- data/lib/geti/auth_client.rb +133 -0
- data/lib/geti/client.rb +42 -0
- data/lib/geti/response.rb +24 -0
- data/lib/geti/terminal_settings.rb +7 -0
- data/spec/geti_app_client_spec.rb +166 -0
- data/spec/geti_auth_client_spec.rb +28 -0
- data/spec/helper.rb +37 -0
- data/spec/remote/geti_app_client_spec.rb +50 -0
- data/spec/remote/geti_auth_client_spec.rb +99 -0
- metadata +193 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
def routing_number(type)
|
4
|
+
{ :authorization => 490000018,
|
5
|
+
:decline => 490000034,
|
6
|
+
:manager_needed => 490000021,
|
7
|
+
:represented => 490000047
|
8
|
+
}[type]
|
9
|
+
end
|
10
|
+
|
11
|
+
describe Geti::AuthClient do
|
12
|
+
describe '#get_terminal_settings' do
|
13
|
+
it 'gets a successful WEB response' do
|
14
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
|
15
|
+
terminal_settings = client.get_terminal_settings
|
16
|
+
expect(terminal_settings.terminal_id).to eq("2310")
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'gets a successful PPD response' do
|
20
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'PPD', :verify => []})
|
21
|
+
terminal_settings = client.get_terminal_settings
|
22
|
+
expect(terminal_settings.terminal_id).to eq("1010")
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'gets a restricted WEB response' do
|
26
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => [:dl]})
|
27
|
+
terminal_settings = client.get_terminal_settings
|
28
|
+
expect(terminal_settings.terminal_id).to eq("2311")
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe '#validate' do
|
33
|
+
it 'gets a failed WEB response' do
|
34
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
|
35
|
+
response = client.validate({})
|
36
|
+
expect(response.validation.result).to eq("Failed")
|
37
|
+
expect(response).to_not be_success
|
38
|
+
expect(response.errors).to include("The 'CHECK_AMOUNT' element has an invalid value according to its data type.")
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'gets a successful WEB response' do
|
42
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
|
43
|
+
response = client.validate({
|
44
|
+
:type => :authorize,
|
45
|
+
:amount => 1000,
|
46
|
+
:first_name => 'Bob',
|
47
|
+
:last_name => 'Smith',
|
48
|
+
:account_type => 'Checking',
|
49
|
+
:routing_number => '123456778',
|
50
|
+
:account_number => '1234567890'
|
51
|
+
})
|
52
|
+
expect(response.validation.result).to eq("Passed")
|
53
|
+
expect(response).to be_success
|
54
|
+
expect(response.errors).to be_empty
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#process' do
|
59
|
+
it 'gets a failed WEB response' do
|
60
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
|
61
|
+
response = client.process({})
|
62
|
+
expect(response.validation.result).to eq("Failed")
|
63
|
+
expect(response).to_not be_success
|
64
|
+
expect(response.errors).to include("The 'CHECK_AMOUNT' element has an invalid value according to its data type.")
|
65
|
+
end
|
66
|
+
|
67
|
+
it 'gets an exception' do
|
68
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
|
69
|
+
response = client.process({
|
70
|
+
:type => :authorize,
|
71
|
+
:amount => 1000,
|
72
|
+
:first_name => 'Bob',
|
73
|
+
:last_name => 'Smith',
|
74
|
+
:account_type => 'Checking',
|
75
|
+
:routing_number => '123456778',
|
76
|
+
:account_number => '1234567890'
|
77
|
+
})
|
78
|
+
expect(response).to_not be_success
|
79
|
+
expect(response.exception.message).to_not be_empty
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'gets a successful WEB response' do
|
83
|
+
client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
|
84
|
+
response = client.process({
|
85
|
+
:type => :authorize,
|
86
|
+
:amount => 1000,
|
87
|
+
:first_name => 'Bob',
|
88
|
+
:last_name => 'Smith',
|
89
|
+
:account_type => 'Checking',
|
90
|
+
:routing_number => routing_number(:authorization),
|
91
|
+
:account_number => '1234567890'
|
92
|
+
})
|
93
|
+
expect(response.validation.result).to eq("Passed")
|
94
|
+
expect(response).to be_success
|
95
|
+
expect(response.errors).to be_empty
|
96
|
+
expect(response.authorization.message).to eq("APPROVAL")
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
metadata
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: geti
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Jamie Macey
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-10-10 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: savon
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
version: "0"
|
31
|
+
prerelease: false
|
32
|
+
requirement: *id001
|
33
|
+
type: :runtime
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: httpi
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
hash: 3
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
version: "0"
|
45
|
+
prerelease: false
|
46
|
+
requirement: *id002
|
47
|
+
type: :runtime
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: httpclient
|
50
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
prerelease: false
|
60
|
+
requirement: *id003
|
61
|
+
type: :runtime
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rake
|
64
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - <
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
hash: 25
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
- 9
|
73
|
+
version: "0.9"
|
74
|
+
prerelease: false
|
75
|
+
requirement: *id004
|
76
|
+
type: :development
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: bundler
|
79
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
80
|
+
none: false
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
hash: 23
|
85
|
+
segments:
|
86
|
+
- 1
|
87
|
+
- 0
|
88
|
+
- 0
|
89
|
+
version: 1.0.0
|
90
|
+
prerelease: false
|
91
|
+
requirement: *id005
|
92
|
+
type: :development
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: jeweler
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 63
|
101
|
+
segments:
|
102
|
+
- 1
|
103
|
+
- 8
|
104
|
+
- 4
|
105
|
+
version: 1.8.4
|
106
|
+
prerelease: false
|
107
|
+
requirement: *id006
|
108
|
+
type: :development
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: rcov
|
111
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
hash: 3
|
117
|
+
segments:
|
118
|
+
- 0
|
119
|
+
version: "0"
|
120
|
+
prerelease: false
|
121
|
+
requirement: *id007
|
122
|
+
type: :development
|
123
|
+
description: API wrapper for GETI, an ACH provider
|
124
|
+
email: jamie@tracefunc.com
|
125
|
+
executables: []
|
126
|
+
|
127
|
+
extensions: []
|
128
|
+
|
129
|
+
extra_rdoc_files:
|
130
|
+
- LICENSE.txt
|
131
|
+
- README.rdoc
|
132
|
+
files:
|
133
|
+
- .document
|
134
|
+
- Gemfile
|
135
|
+
- Gemfile.lock
|
136
|
+
- Guardfile
|
137
|
+
- LICENSE.txt
|
138
|
+
- README.rdoc
|
139
|
+
- Rakefile
|
140
|
+
- VERSION
|
141
|
+
- config/test_credentials.yml.example
|
142
|
+
- doc/.DS_Store
|
143
|
+
- doc/Application Gateway Doc.pdf
|
144
|
+
- doc/Auth Gateway Doc.pdf
|
145
|
+
- doc/Auth Gateway Implementation Guide.pdf
|
146
|
+
- doc/implementation_notes.md
|
147
|
+
- doc/readme.txt
|
148
|
+
- lib/geti.rb
|
149
|
+
- lib/geti/app_client.rb
|
150
|
+
- lib/geti/auth_client.rb
|
151
|
+
- lib/geti/client.rb
|
152
|
+
- lib/geti/response.rb
|
153
|
+
- lib/geti/terminal_settings.rb
|
154
|
+
- spec/geti_app_client_spec.rb
|
155
|
+
- spec/geti_auth_client_spec.rb
|
156
|
+
- spec/helper.rb
|
157
|
+
- spec/remote/geti_app_client_spec.rb
|
158
|
+
- spec/remote/geti_auth_client_spec.rb
|
159
|
+
homepage: http://github.com/jamie/geti
|
160
|
+
licenses:
|
161
|
+
- MIT
|
162
|
+
post_install_message:
|
163
|
+
rdoc_options: []
|
164
|
+
|
165
|
+
require_paths:
|
166
|
+
- lib
|
167
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
hash: 3
|
173
|
+
segments:
|
174
|
+
- 0
|
175
|
+
version: "0"
|
176
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
hash: 3
|
182
|
+
segments:
|
183
|
+
- 0
|
184
|
+
version: "0"
|
185
|
+
requirements: []
|
186
|
+
|
187
|
+
rubyforge_project:
|
188
|
+
rubygems_version: 1.8.24
|
189
|
+
signing_key:
|
190
|
+
specification_version: 3
|
191
|
+
summary: API wrapper for GETI, an ACH provider
|
192
|
+
test_files: []
|
193
|
+
|