geti 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
source :rubygems
|
2
|
+
|
3
|
+
gem 'savon'
|
4
|
+
gem 'httpi'
|
5
|
+
gem 'httpclient'
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem 'rake', "< 0.9"
|
9
|
+
gem "bundler", "~> 1.0.0"
|
10
|
+
gem "jeweler", "~> 1.8.4"
|
11
|
+
gem "rcov"
|
12
|
+
end
|
13
|
+
|
14
|
+
group :test do
|
15
|
+
gem 'rspec'
|
16
|
+
gem 'fuubar'
|
17
|
+
gem 'guard'
|
18
|
+
gem 'guard-rspec'
|
19
|
+
gem 'rb-fsevent', '~> 0.9.1'
|
20
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
akami (1.2.0)
|
5
|
+
gyoku (>= 0.4.0)
|
6
|
+
nokogiri (>= 1.4.0)
|
7
|
+
builder (3.0.0)
|
8
|
+
diff-lcs (1.1.3)
|
9
|
+
fuubar (1.1.0)
|
10
|
+
rspec (~> 2.0)
|
11
|
+
rspec-instafail (~> 0.2.0)
|
12
|
+
ruby-progressbar (~> 1.0.0)
|
13
|
+
git (1.2.5)
|
14
|
+
guard (1.4.0)
|
15
|
+
listen (>= 0.4.2)
|
16
|
+
thor (>= 0.14.6)
|
17
|
+
guard-rspec (2.0.0)
|
18
|
+
guard (>= 1.1)
|
19
|
+
rspec (~> 2.11)
|
20
|
+
gyoku (0.4.6)
|
21
|
+
builder (>= 2.1.2)
|
22
|
+
httpclient (2.2.7)
|
23
|
+
httpi (1.1.1)
|
24
|
+
rack
|
25
|
+
jeweler (1.8.4)
|
26
|
+
bundler (~> 1.0)
|
27
|
+
git (>= 1.2.5)
|
28
|
+
rake
|
29
|
+
rdoc
|
30
|
+
json (1.7.4)
|
31
|
+
listen (0.5.3)
|
32
|
+
nokogiri (1.5.5)
|
33
|
+
nori (1.1.3)
|
34
|
+
rack (1.4.1)
|
35
|
+
rake (0.8.7)
|
36
|
+
rb-fsevent (0.9.2)
|
37
|
+
rcov (1.0.0)
|
38
|
+
rdoc (3.12)
|
39
|
+
json (~> 1.4)
|
40
|
+
rspec (2.11.0)
|
41
|
+
rspec-core (~> 2.11.0)
|
42
|
+
rspec-expectations (~> 2.11.0)
|
43
|
+
rspec-mocks (~> 2.11.0)
|
44
|
+
rspec-core (2.11.1)
|
45
|
+
rspec-expectations (2.11.3)
|
46
|
+
diff-lcs (~> 1.1.3)
|
47
|
+
rspec-instafail (0.2.4)
|
48
|
+
rspec-mocks (2.11.3)
|
49
|
+
ruby-progressbar (1.0.1)
|
50
|
+
savon (1.1.0)
|
51
|
+
akami (~> 1.2.0)
|
52
|
+
builder (>= 2.1.2)
|
53
|
+
gyoku (~> 0.4.5)
|
54
|
+
httpi (~> 1.1.0)
|
55
|
+
nokogiri (>= 1.4.0)
|
56
|
+
nori (~> 1.1.0)
|
57
|
+
wasabi (~> 2.5.0)
|
58
|
+
thor (0.16.0)
|
59
|
+
wasabi (2.5.0)
|
60
|
+
httpi (~> 1.0)
|
61
|
+
nokogiri (>= 1.4.0)
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
ruby
|
65
|
+
|
66
|
+
DEPENDENCIES
|
67
|
+
bundler (~> 1.0.0)
|
68
|
+
fuubar
|
69
|
+
guard
|
70
|
+
guard-rspec
|
71
|
+
httpclient
|
72
|
+
httpi
|
73
|
+
jeweler (~> 1.8.4)
|
74
|
+
rake (< 0.9)
|
75
|
+
rb-fsevent (~> 0.9.1)
|
76
|
+
rcov
|
77
|
+
rspec
|
78
|
+
savon
|
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2012 VersaPay Corp
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
= geti
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Running Specs
|
6
|
+
|
7
|
+
Just run `rspec`. If you want to run the specs in the remote dir, you'll need to provide `config/test_credentials.yml` (an example file is present).
|
8
|
+
|
9
|
+
== Contributing to geti
|
10
|
+
|
11
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
12
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
13
|
+
* Fork the project.
|
14
|
+
* Start a feature/bugfix branch.
|
15
|
+
* Commit and push until you are happy with your contribution.
|
16
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
17
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
18
|
+
|
19
|
+
== Copyright
|
20
|
+
|
21
|
+
Copyright (c) 2012 VersaPay Corp. See LICENSE.txt for further details.
|
22
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "geti"
|
18
|
+
gem.homepage = "http://github.com/jamie/geti"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{API wrapper for GETI, an ACH provider}
|
21
|
+
gem.description = %Q{API wrapper for GETI, an ACH provider}
|
22
|
+
gem.email = "jamie@tracefunc.com"
|
23
|
+
gem.authors = ["Jamie Macey"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rcov/rcovtask'
|
29
|
+
Rcov::RcovTask.new do |test|
|
30
|
+
test.libs << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
test.rcov_opts << '--exclude "gems/*"'
|
34
|
+
end
|
35
|
+
|
36
|
+
task :default => :spec
|
37
|
+
|
38
|
+
require 'rdoc/task'
|
39
|
+
Rake::RDocTask.new do |rdoc|
|
40
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
41
|
+
|
42
|
+
rdoc.rdoc_dir = 'rdoc'
|
43
|
+
rdoc.title = "geti #{version}"
|
44
|
+
rdoc.rdoc_files.include('README*')
|
45
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
46
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/doc/.DS_Store
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Notes received from Brooklynne Rukse <brukse@globaletelecom.com> (our
|
2
|
+
technical contact) while planning for realtime integration.
|
3
|
+
|
4
|
+
> > 14 Aug, "RE: GETI Authorization Gateway Integration & Documentation"
|
5
|
+
>
|
6
|
+
> The SEC code is not determined by the type of services you offer, it is determined by how you receive payment. Please let me know which of the following applies to your business.
|
7
|
+
>
|
8
|
+
> · PPD - Authorization is made in person and Merchant initiates transaction at a later time. A check is not present.
|
9
|
+
> · CCD - Authorization is made between two companies to transfer funds.
|
10
|
+
> · POP - Payment is made in person at the point of sale.
|
11
|
+
> · TEL - Payment is made by phone or fax. A check is not present.
|
12
|
+
> · WEB - Payment is made through the internet. A check is not present.
|
13
|
+
>
|
14
|
+
> The DL Requirement, Check Verification and Identity Verification are turned on or off for each merchant based on their risk. This is decided during merchant underwriting and is not determined by the gateway. For this reason you want to test against all terminal ids related to the transaction types you are processing.
|
15
|
+
|
16
|
+
We're all online, so we'll be doing WEB. But, we should be handling all
|
17
|
+
verification cases as that determination is not in Geti's hands.
|
18
|
+
|
19
|
+
> > > 17 Aug, "RE: Certification Credentials for VersaPay"
|
20
|
+
> >
|
21
|
+
> > The api gives real time responses (Approved/Declined) immediately however the transactions are not processed until the next business day. Any file transactions that is submitted before Noon CST are processed the same day.
|
22
|
+
>
|
23
|
+
> [Jamie] Oh. So a transaction submitted Monday 8am via FTP goes through same day, but one submitted at the same time over SOAP isn't processed until Tuesday?
|
24
|
+
>
|
25
|
+
> > That is correct
|
26
|
+
|
27
|
+
So doing batch file uploads will process (before noon) a day sooner or
|
28
|
+
(after noon) at the same time. We don't have any expectations regarding
|
29
|
+
realtime approval currently, so giving up on the realtime aspect makes sense.
|
data/doc/readme.txt
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# This is incomplete software
|
2
|
+
|
3
|
+
Done:
|
4
|
+
|
5
|
+
- SOAP requests are all hooked up (authentication, xml format, etc)
|
6
|
+
- Can make debug/info and authorize calls
|
7
|
+
- Handles success/failure and exception responses
|
8
|
+
|
9
|
+
|
10
|
+
To Do:
|
11
|
+
|
12
|
+
- Parse response to decode bitfields
|
13
|
+
- Make response wrapper useful to users of this library
|
14
|
+
- Limit Exceeded/Manager Needed overrides
|
15
|
+
- Confirm decline behaviour
|
16
|
+
- Re-presented checks
|
17
|
+
- Voids
|
18
|
+
- Certification
|
19
|
+
- Bundle into a gem
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
### Application Processing
|
25
|
+
|
26
|
+
New Merchant Application XSD is https://demo.eftchecks.com/webservices/Schemas/App/NewMerchApp_ACH.xsd
|
27
|
+
|
28
|
+
Sample data is https://demo.eftchecks.com/webservices/Schemas/App/Example/NewMerchAppSample_ACH.xml
|
data/lib/geti.rb
ADDED
@@ -0,0 +1,277 @@
|
|
1
|
+
class Geti::AppClient < Geti::Client
|
2
|
+
MERCHANT_OWNERSHIP = {
|
3
|
+
"1" => "Corporation",
|
4
|
+
"2" => "Partnership",
|
5
|
+
"3" => "Sole Proprietorship"
|
6
|
+
}
|
7
|
+
MERCHANT_SERVICE_TYPES = {
|
8
|
+
"GOLD" => "Service_Level_Used_For_Guaranteed_ACHed_Transaction_Processing",
|
9
|
+
"SILVER" => "Service_Level_Used_For_Non-Guaranteed_ACHed_Transaction_Processing",
|
10
|
+
"BRONZE" => "Service_Level_Used_For_Non-Guaranteed_Verification-Only_Processing",
|
11
|
+
"TRADITIONAL" => "Service_Level_Used_For_Guaranteed_Verification-Only_Processing",
|
12
|
+
}
|
13
|
+
MERCHANT_TYPES = {
|
14
|
+
"1" => "Antique_Shops",
|
15
|
+
"2" => "Applicances_Electrical_Repair",
|
16
|
+
"3" => "Art_Dealers_Art_Galleries",
|
17
|
+
"4" => "Artists_Supplies",
|
18
|
+
"5" => "Auto_Dealers_New_All_Depts",
|
19
|
+
"6" => "Auto_And_Home_Supplies",
|
20
|
+
"7" => "Auto_Parking_Lots_Garages",
|
21
|
+
"8" => "Auto_Parts_Stores",
|
22
|
+
"9" => "Auto_Rentals_And_Leasing",
|
23
|
+
"10" => "Auto_Paint_Top_Body",
|
24
|
+
"11" => "Auto_Repair",
|
25
|
+
"12" => "Auto_Sales_Used_Only",
|
26
|
+
"13" => "Automotive_Glass",
|
27
|
+
"14" => "Automotive_Tire_Stores",
|
28
|
+
"16" => "Bakeries",
|
29
|
+
"17" => "Barber_Beauty_Shops",
|
30
|
+
"18" => "Bicycle_Sales_Service",
|
31
|
+
"19" => "Billiards_Tables_And_Supplies",
|
32
|
+
"20" => "Boats_Dealers_All",
|
33
|
+
"21" => "Boats_Dealers_Parts_Service",
|
34
|
+
"22" => "Book_Stores",
|
35
|
+
"23" => "Bridal_Shops_And_Accessories",
|
36
|
+
"24" => "Building_Materials",
|
37
|
+
"25" => "Camera_And_Photo_Supplies",
|
38
|
+
"26" => "Car_Stero_Cellular_Phones_And_Pagers",
|
39
|
+
"27" => "Car_Washes",
|
40
|
+
"28" => "Card_Gift_Shops",
|
41
|
+
"29" => "Cigar_Stores",
|
42
|
+
"30" => "Clothing",
|
43
|
+
"31" => "Computers_And_Software_Retail_Only",
|
44
|
+
"32" => "Contractors",
|
45
|
+
"33" => "Convenience_Stores",
|
46
|
+
"34" => "Cosmetic_Beauty_Supplies",
|
47
|
+
"35" => "Department_Stores",
|
48
|
+
"36" => "Drug_Stores_And_Pharmacies",
|
49
|
+
"37" => "Dry_Cleaners",
|
50
|
+
"38" => "Electrical_Contractors",
|
51
|
+
"39" => "Eyeglass_Stores",
|
52
|
+
"40" => "Fabric_Stores",
|
53
|
+
"41" => "Floor_Covering",
|
54
|
+
"42" => "Florists",
|
55
|
+
"43" => "Funeral_Homes_Crematories",
|
56
|
+
"44" => "Furniture_Stores",
|
57
|
+
"45" => "Garden_Lawn_Supply",
|
58
|
+
"46" => "Gas_Stations",
|
59
|
+
"47" => "Glass_Stores",
|
60
|
+
"48" => "Golf_Course_Pro_Shop",
|
61
|
+
"49" => "Grocery_Supermarket",
|
62
|
+
"50" => "Hardware_Stores",
|
63
|
+
"51" => "Health_Food_Stores",
|
64
|
+
"52" => "Heating_Air",
|
65
|
+
"53" => "Heavy_Equipment_Truck_Repair",
|
66
|
+
"54" => "Heavy_Equipment_Rentals",
|
67
|
+
"55" => "Heavy_Equipment_Sales",
|
68
|
+
"56" => "Hospitals_Clinics",
|
69
|
+
"57" => "Hotels_Motels",
|
70
|
+
"58" => "Housewares",
|
71
|
+
"59" => "Jewelry_Sales",
|
72
|
+
"60" => "Liquor_Stores",
|
73
|
+
"61" => "Locksmiths",
|
74
|
+
"62" => "Maintenance_Cleaning_Service",
|
75
|
+
"63" => "Motorcycle_Dealers_All",
|
76
|
+
"64" => "Motorhome_Dealers",
|
77
|
+
"65" => "Moving_Storage_Delivery",
|
78
|
+
"66" => "Muffler_Shops",
|
79
|
+
"67" => "Music_Stores_Instruments",
|
80
|
+
"68" => "Office_Supply",
|
81
|
+
"69" => "Oil_Change_Shop",
|
82
|
+
"70" => "Optometrists",
|
83
|
+
"71" => "Pet_Shops",
|
84
|
+
"72" => "Physicians",
|
85
|
+
"73" => "Pizza_Parlors",
|
86
|
+
"74" => "Postal_Shipping_Services",
|
87
|
+
"75" => "Print_Shops",
|
88
|
+
"76" => "Record_Shops",
|
89
|
+
"77" => "Rental_Trucks_And_Trailers",
|
90
|
+
"78" => "Restaurants",
|
91
|
+
"79" => "Salvage_And_Wrecking",
|
92
|
+
"80" => "Secondhand_Stores",
|
93
|
+
"81" => "Sporting_Goods_Stores",
|
94
|
+
"82" => "Stereo_Sales_Radio_Sales",
|
95
|
+
"83" => "Swimming_Pool_Sales",
|
96
|
+
"84" => "Tack_Shop_Equestrian_Supplies",
|
97
|
+
"85" => "Towing_Services",
|
98
|
+
"87" => "Transmission_Repair",
|
99
|
+
"88" => "Vacuum_Cleaner_Sales",
|
100
|
+
"89" => "Veterinary_Clinics_Hospitals",
|
101
|
+
"90" => "Video_Stores",
|
102
|
+
"91" => "Childcare_Daycare_Preschool",
|
103
|
+
"92" => "Meat_And_Seafood",
|
104
|
+
"93" => "Dental",
|
105
|
+
"94" => "Plumbing_Contractors",
|
106
|
+
"95" => "Employment_Agency",
|
107
|
+
"96" => "Sign_Shops",
|
108
|
+
"97" => "Carpentry",
|
109
|
+
"98" => "Physical_Therapy",
|
110
|
+
"99" => "Motorcycle_Repair",
|
111
|
+
"100" => "Nail_Products_Manicures",
|
112
|
+
"101" => "Meetings_Events_Banquets_Parties",
|
113
|
+
"102" => "Accounting_Firms",
|
114
|
+
"103" => "Uniforms",
|
115
|
+
"104" => "Bar_Lounge",
|
116
|
+
"105" => "Tanning_Salons",
|
117
|
+
"106" => "Hospital_Equipment_Supplies",
|
118
|
+
"107" => "Metal_Fabricators",
|
119
|
+
"108" => "Transportation_Services",
|
120
|
+
"109" => "Fitness_Spa_Gym",
|
121
|
+
"110" => "Pawn_Shop",
|
122
|
+
"111" => "Bowling_Alley",
|
123
|
+
"112" => "Legal_Services",
|
124
|
+
"113" => "Religious_Organizations",
|
125
|
+
"115" => "School",
|
126
|
+
"116" => "Pet_Grooming",
|
127
|
+
"117" => "Electronics_Electronic_Repair",
|
128
|
+
"118" => "Travel_Agency",
|
129
|
+
"119" => "Tatto_Body_Piercing_Parlor",
|
130
|
+
"120" => "Insurance_Agency",
|
131
|
+
"121" => "Recreational",
|
132
|
+
"122" => "Real_Estate",
|
133
|
+
"123" => "Trailer_Sales",
|
134
|
+
"124" => "Exterminators",
|
135
|
+
"125" => "Party_Supply_Store",
|
136
|
+
"126" => "Entertainment",
|
137
|
+
"127" => "Bail_Bonds",
|
138
|
+
"128" => "Hobbie_Shop",
|
139
|
+
"129" => "Craft_Shop",
|
140
|
+
"130" => "Photo_Studio",
|
141
|
+
"131" => "Marina",
|
142
|
+
"132" => "Security_And_Alarms",
|
143
|
+
"133" => "Auto_Detailing",
|
144
|
+
"134" => "Furniture_Rental",
|
145
|
+
"135" => "General_Merchandise",
|
146
|
+
"136" => "Leather_Goods_Lugguage",
|
147
|
+
"137" => "Waste_Removal",
|
148
|
+
"138" => "Tool_Rentals",
|
149
|
+
"139" => "Other",
|
150
|
+
"140" => "Casino_Gambling"
|
151
|
+
}
|
152
|
+
|
153
|
+
def board_merchant_ach(application)
|
154
|
+
response = soap_request("BoardCertificationMerchant_ACH", "board_certification_merchant_ach") do |xml|
|
155
|
+
data_packet(xml, application)
|
156
|
+
end
|
157
|
+
annotate_board_merchant_ach_response(response[:response])
|
158
|
+
end
|
159
|
+
|
160
|
+
def data_packet(xml, opts)
|
161
|
+
xml.Envelope do
|
162
|
+
xml.Body :FileName => "261407_28_May_2009_12_05_00_590.xml", :FileDate => Time.now.iso8601 do
|
163
|
+
xml.NewMerchant({
|
164
|
+
:isoID => "9999",
|
165
|
+
:merchCrossRefID => opts[:id],
|
166
|
+
:merchName => opts[:name], # Legal Name
|
167
|
+
:merchTypeID => MERCHANT_TYPES.index(opts[:industry]), # "Type of goods sold"
|
168
|
+
:merchServiceType => "GOLD",
|
169
|
+
# TODO: Tax ID
|
170
|
+
:merchAddress1 => opts[:address], # TODO: Is this mailing or DBA address?
|
171
|
+
:merchCity => opts[:city],
|
172
|
+
:merchState => opts[:state],
|
173
|
+
:merchZip => opts[:zip],
|
174
|
+
:merchPhone => opts[:phone],
|
175
|
+
# TODO: Fax number
|
176
|
+
:merchAchFlatFee => "",
|
177
|
+
:merchNonAchFlatFee => "",
|
178
|
+
:merchPercentFee => "",
|
179
|
+
:merchComments => taxpayer_info(opts),
|
180
|
+
:merchReturnFee => "",
|
181
|
+
# TODO: Web Address
|
182
|
+
# TODO: Email address
|
183
|
+
}) do
|
184
|
+
xml.BusinessInfo({
|
185
|
+
:merchOwnership => MERCHANT_OWNERSHIP.index(opts[:business_type]),
|
186
|
+
:merchAvgCheckAmount => opts[:average_amount],
|
187
|
+
:merchMaxCheckAmount => opts[:max_amount],
|
188
|
+
:merchTotalTimeInBusiness => opts[:days_in_business],
|
189
|
+
})
|
190
|
+
xml.NewLocation({
|
191
|
+
:locName => opts[:name], # DBA name?
|
192
|
+
:locCrossRefID => opts[:id],
|
193
|
+
:locAddress1 => opts[:physical_address], # TODO: Is this mailing or DBA address?
|
194
|
+
:locCity => opts[:physical_city],
|
195
|
+
:locState => opts[:physical_state],
|
196
|
+
:locZip => opts[:physical_zip],
|
197
|
+
:locPhone => opts[:physical_phone],
|
198
|
+
:locStatementFee => "0",
|
199
|
+
:locMinimumFee => "0",
|
200
|
+
:locFeesRoutingNum => opts[:routing_number],
|
201
|
+
:locFeesAccountNum => opts[:account_number],
|
202
|
+
# TODO: Days in operation at this location?
|
203
|
+
}) do
|
204
|
+
xml.Statement({
|
205
|
+
:locStatementAttn => opts[:contact_name], # TODO: Where does title/alternate go?
|
206
|
+
:locStatementAddress1 => opts[:physical_address], # TODO: Is this mailing or DBA address?
|
207
|
+
:locStatementCity => opts[:physical_city],
|
208
|
+
:locStatementState => opts[:physical_state],
|
209
|
+
:locStatementZip => opts[:physical_zip],
|
210
|
+
})
|
211
|
+
xml.NewPOC({
|
212
|
+
:pocFirstName => opts[:principal_first_name],
|
213
|
+
:pocLastName => opts[:principal_last_name],
|
214
|
+
:pocTitle => opts[:principal_title],
|
215
|
+
# TODO: % Ownership
|
216
|
+
:pocAddress => opts[:principal_address], # TODO: Is this mailing or DBA address?
|
217
|
+
:pocCity => opts[:principal_city],
|
218
|
+
:pocState => opts[:principal_state],
|
219
|
+
:pocZip => opts[:principal_zip],
|
220
|
+
:pocDOB => opts[:principal_dob], # Y-M-D
|
221
|
+
:pocSSN => opts[:principal_ssn], # 9-digits?
|
222
|
+
# TODO: Driver's License
|
223
|
+
|
224
|
+
:pocPrimary => "1",
|
225
|
+
:pocComments => "",
|
226
|
+
})
|
227
|
+
xml.NewTerminal({
|
228
|
+
:termCrossRefID => opts[:id],
|
229
|
+
:termCheckLimit => "500.00",
|
230
|
+
:termPeripheral => "63",
|
231
|
+
:termTypeID => "16",
|
232
|
+
:termVerificationOnly => "0",
|
233
|
+
})
|
234
|
+
# More NewTerminal entries
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
def service_address
|
242
|
+
"https://demo.eftchecks.com/webservices/AppGateway.asmx?WSDL"
|
243
|
+
end
|
244
|
+
|
245
|
+
def soap_header
|
246
|
+
{ "RemoteAccessHeader" => {
|
247
|
+
"UserName" => @user,
|
248
|
+
"Password" => @pass
|
249
|
+
},
|
250
|
+
:attributes! => { "RemoteAccessHeader" => {"xmlns"=>"http://tempuri.org/GETI.eMagnus.WebServices/AppGateway"}}
|
251
|
+
}
|
252
|
+
end
|
253
|
+
|
254
|
+
def taxpayer_info(opts)
|
255
|
+
"Tax Info: %s - %d" % [opts[:taxpayer_name], opts[:taxpayer_id]]
|
256
|
+
end
|
257
|
+
|
258
|
+
private
|
259
|
+
def annotate_board_merchant_ach_response(response)
|
260
|
+
response[:success] = response[:validation_message][:result] == "Passed"
|
261
|
+
response.delete(:"@xmlns:xsd")
|
262
|
+
response.delete(:"@xmlns:xsi")
|
263
|
+
remove_key_at_signs!(response)
|
264
|
+
response
|
265
|
+
end
|
266
|
+
|
267
|
+
def remove_key_at_signs!(hash)
|
268
|
+
hash.keys.each do |key|
|
269
|
+
if hash[key].kind_of? Hash
|
270
|
+
remove_key_at_signs!(hash[key])
|
271
|
+
end
|
272
|
+
if key.to_s[0..0] == '@'
|
273
|
+
hash[key.to_s.sub('@','').to_sym] = hash.delete(key)
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|