geti 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = geti
2
2
 
3
- Description goes here.
3
+ A middleware gem for interfacing with Global eTelecom's ACH processing service.
4
4
 
5
5
  == Running Specs
6
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 1.0.0
data/certify.rb ADDED
@@ -0,0 +1,66 @@
1
+ $: << 'lib'
2
+ require 'rubygems'
3
+ require 'bundler/setup'
4
+ require 'geti'
5
+ require 'pp'
6
+
7
+
8
+ def merchant_params
9
+ { :id => 12345,
10
+ :name => "ACH Merchant Cert",
11
+ :industry => "Metal_Fabricators",
12
+ :address => "123 Main St",
13
+ :city => "Vancouver",
14
+ :state => "WA",
15
+ :zip => "10120",
16
+ :phone => "5555551234",
17
+ :business_type => "Corporation",
18
+ :days_in_business => 404,
19
+
20
+ :contact_name => 'George Jetson',
21
+ :physical_address => "123 Main St",
22
+ :physical_city => "Vancouver",
23
+ :physical_state => "WA",
24
+ :physical_zip => "10120",
25
+ :physical_phone => "5555551234",
26
+
27
+ :principal_first_name => "Carl",
28
+ :principal_last_name => "Cogsley",
29
+ :principal_title => 'President',
30
+ :principal_address => "123 Main St",
31
+ :principal_city => "Vancouver",
32
+ :principal_state => "WA",
33
+ :principal_zip => "10120",
34
+ :principal_dob => "1965-04-28",
35
+ :principal_ssn => '111222123',
36
+
37
+ :average_amount => "4000",
38
+ :max_amount => "7600",
39
+
40
+ :taxpayer_name => "Carl Cogsley",
41
+ :taxpayer_id => "123456789",
42
+
43
+ :routing_number => "490000018",
44
+ :account_number => "123456789",
45
+ }
46
+ end
47
+
48
+ def test_credentials
49
+ YAML.load(File.read('config/test_credentials.yml'))
50
+ end
51
+
52
+ client = Geti::AppClient.new(test_credentials)
53
+
54
+ # Step 2: Create and board a new ACH merchant named “ACH Merchant Cert”. This merchant should have 1 Location and 1 Terminal.
55
+ # Step 3: Email GETI the Merchant ID received for “ACH Merchant Cert”.
56
+ #response = client.board_merchant_ach(merchant_params)
57
+ id = '26'
58
+
59
+ # Step 4: GETI will activate this merchant and email back when complete.
60
+ # Step 5: Run “Retrieve Merchant Status” with the Merchant ID you received for “ACH Merchant Cert ” and email GETI the Location ID and Terminal ID.
61
+ #response = client.retrieve_merchant_status(id)
62
+
63
+ # Step 6: Upload a pdf to “ACH Merchant Cert” (this would be a signed merchant application in production) and email GETI when complete.
64
+ #response = client.upload_supporting_docs(id, File.read('./spec/remote/sample.pdf'))
65
+
66
+ pp response
@@ -1,2 +1,6 @@
1
- user: SomeUser
2
- pass: password
1
+ app:
2
+ user: SomeUser
3
+ pass: password
4
+ auth:
5
+ user: SomeUser
6
+ pass: password
@@ -174,14 +174,15 @@ class Geti::AppClient < Geti::Client
174
174
  end
175
175
 
176
176
  def data(xml, opts)
177
+ filename = "%s_%s.xml" % [opts[:id].to_s, Time.now.strftime("%d_%b_%Y_%H_%M_%S")]
177
178
  xml.Envelope do
178
- xml.Body :FileName => "261407_28_May_2009_12_05_00_590.xml", :FileDate => Time.now.iso8601 do
179
+ xml.Body :FileName => filename, :FileDate => Time.now.iso8601 do
179
180
  xml.NewMerchant({
180
- :isoID => "9999",
181
+ :isoID => opts[:iso_id] || "9999",
181
182
  :merchCrossRefID => opts[:id],
182
183
  :merchName => opts[:name], # Legal Name
183
184
  :merchTypeID => MERCHANT_TYPES.index(opts[:industry]), # "Type of goods sold"
184
- :merchServiceType => "GOLD",
185
+ :merchServiceType => opts[:service_type] || "GOLD",
185
186
  # TODO: Tax ID
186
187
  :merchAddress1 => opts[:address], # TODO: Is this mailing or DBA address?
187
188
  :merchCity => opts[:city],
@@ -255,7 +256,7 @@ class Geti::AppClient < Geti::Client
255
256
  end
256
257
 
257
258
  def service_address
258
- "https://demo.eftchecks.com/webservices/AppGateway.asmx?WSDL"
259
+ "https://#{domain}/webservices/AppGateway.asmx?WSDL"
259
260
  end
260
261
 
261
262
  def soap_header
@@ -268,7 +269,7 @@ class Geti::AppClient < Geti::Client
268
269
  end
269
270
 
270
271
  def taxpayer_info(opts)
271
- "Tax Info: %s - %d" % [opts[:taxpayer_name], opts[:taxpayer_id]]
272
+ "Tax Info: %s - %s" % [opts[:taxpayer_name], opts[:taxpayer_id]]
272
273
  end
273
274
 
274
275
  private
@@ -87,7 +87,7 @@ class Geti::AuthClient < Geti::Client
87
87
  end
88
88
 
89
89
  def service_address
90
- "https://demo.eftchecks.com/webservices/AuthGateway.asmx?WSDL"
90
+ "https://#{domain}/webservices/AuthGateway.asmx?WSDL"
91
91
  end
92
92
 
93
93
  def soap_header
data/lib/geti/client.rb CHANGED
@@ -40,6 +40,14 @@ class Geti::Client
40
40
  @env != 'production'
41
41
  end
42
42
 
43
+ def domain
44
+ if certification?
45
+ 'demo.eftchecks.com'
46
+ else
47
+ 'getigateway.eftchecks.com'
48
+ end
49
+ end
50
+
43
51
  def xml_parser
44
52
  @xml_parser or Nori
45
53
  end
data/spec/helper.rb CHANGED
@@ -28,8 +28,8 @@ Savon.configure do |config|
28
28
  config.log = HTTPI.log = false unless ENV['SOAP_DEBUG']
29
29
  end
30
30
 
31
- def test_credentials
32
- YAML.load(File.read('config/test_credentials.yml'))
31
+ def test_credentials(env='app')
32
+ YAML.load(File.read('config/test_credentials.yml'))[env]
33
33
  end
34
34
 
35
35
  def xit(*args, &block)
@@ -9,21 +9,23 @@ def routing_number(type)
9
9
  end
10
10
 
11
11
  describe Geti::AuthClient do
12
+ let(:credentials) { test_credentials('auth') }
13
+
12
14
  describe '#get_terminal_settings' do
13
15
  it 'gets a successful WEB response' do
14
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
16
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'WEB', :verify => []})
15
17
  terminal_settings = client.get_terminal_settings
16
18
  expect(terminal_settings.terminal_id).to eq("2310")
17
19
  end
18
20
 
19
21
  it 'gets a successful PPD response' do
20
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'PPD', :verify => []})
22
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'PPD', :verify => []})
21
23
  terminal_settings = client.get_terminal_settings
22
24
  expect(terminal_settings.terminal_id).to eq("1010")
23
25
  end
24
26
 
25
27
  it 'gets a restricted WEB response' do
26
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => [:dl]})
28
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'WEB', :verify => [:dl]})
27
29
  terminal_settings = client.get_terminal_settings
28
30
  expect(terminal_settings.terminal_id).to eq("2311")
29
31
  end
@@ -31,7 +33,7 @@ describe Geti::AuthClient do
31
33
 
32
34
  describe '#validate' do
33
35
  it 'gets a failed WEB response' do
34
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
36
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'WEB', :verify => []})
35
37
  response = client.validate({})
36
38
  expect(response.validation.result).to eq("Failed")
37
39
  expect(response).to_not be_success
@@ -39,7 +41,7 @@ describe Geti::AuthClient do
39
41
  end
40
42
 
41
43
  it 'gets a successful WEB response' do
42
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
44
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'WEB', :verify => []})
43
45
  response = client.validate({
44
46
  :type => :authorize,
45
47
  :amount => 1000,
@@ -57,7 +59,7 @@ describe Geti::AuthClient do
57
59
 
58
60
  describe '#process' do
59
61
  it 'gets a failed WEB response' do
60
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
62
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'WEB', :verify => []})
61
63
  response = client.process({})
62
64
  expect(response.validation.result).to eq("Failed")
63
65
  expect(response).to_not be_success
@@ -65,7 +67,7 @@ describe Geti::AuthClient do
65
67
  end
66
68
 
67
69
  it 'gets an exception' do
68
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
70
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'WEB', :verify => []})
69
71
  response = client.process({
70
72
  :type => :authorize,
71
73
  :amount => 1000,
@@ -80,7 +82,7 @@ describe Geti::AuthClient do
80
82
  end
81
83
 
82
84
  it 'gets a successful WEB response' do
83
- client = Geti::AuthClient.new(test_credentials, {:sec_code => 'WEB', :verify => []})
85
+ client = Geti::AuthClient.new(credentials, {:sec_code => 'WEB', :verify => []})
84
86
  response = client.process({
85
87
  :type => :authorize,
86
88
  :amount => 1000,
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geti
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 3
9
9
  - 0
10
- version: 0.3.0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jamie Macey
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-10-22 00:00:00 Z
18
+ date: 2012-11-05 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: savon
@@ -138,6 +138,7 @@ files:
138
138
  - README.rdoc
139
139
  - Rakefile
140
140
  - VERSION
141
+ - certify.rb
141
142
  - config/test_credentials.yml.example
142
143
  - doc/.DS_Store
143
144
  - doc/implementation_notes.md