geti 1.8.1 → 1.9
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/Rakefile +0 -1
- data/lib/geti.rb +1 -1
- data/lib/geti/app_client.rb +10 -2
- data/spec/geti_app_client_spec.rb +23 -0
- metadata +4 -5
data/Rakefile
CHANGED
data/lib/geti.rb
CHANGED
data/lib/geti/app_client.rb
CHANGED
@@ -200,7 +200,7 @@ class Geti::AppClient < Geti::Client
|
|
200
200
|
# TODO: Email address
|
201
201
|
}) do
|
202
202
|
xml.BusinessInfo({
|
203
|
-
:merchOwnership =>
|
203
|
+
:merchOwnership => merchant_ownership(opts),
|
204
204
|
:merchAvgCheckAmount => opts[:average_amount],
|
205
205
|
:merchMaxCheckAmount => opts[:max_amount],
|
206
206
|
:merchTotalTimeInBusiness => opts[:days_in_business],
|
@@ -297,8 +297,16 @@ class Geti::AppClient < Geti::Client
|
|
297
297
|
"Signup IP: %s" % opts[:ip]
|
298
298
|
end
|
299
299
|
|
300
|
+
def merchant_ownership(opts)
|
301
|
+
MERCHANT_OWNERSHIP.index((opts[:business_type]||'').gsub('_', ' '))
|
302
|
+
end
|
303
|
+
|
300
304
|
def taxpayer_info(opts)
|
301
|
-
|
305
|
+
if merchant_ownership(opts) == '3' # Sole Proprietorship
|
306
|
+
["Tax Info: #{opts[:taxpayer_name]}", opts[:taxpayer_id], "SSN: #{opts[:principal_ssn]}"]
|
307
|
+
else
|
308
|
+
["Tax Info: #{opts[:taxpayer_name]}", opts[:taxpayer_id]]
|
309
|
+
end.join(" - ")
|
302
310
|
end
|
303
311
|
|
304
312
|
private
|
@@ -278,4 +278,27 @@ describe Geti::AppClient do
|
|
278
278
|
end
|
279
279
|
end
|
280
280
|
end
|
281
|
+
|
282
|
+
describe '#taxpayer_info' do
|
283
|
+
let(:client) { Geti::AppClient.new(test_credentials, {}) }
|
284
|
+
|
285
|
+
it 'includes taxpayer_name' do
|
286
|
+
expect(client.taxpayer_info(request_payload)).to include("Tax Info: Carl Cogsley")
|
287
|
+
end
|
288
|
+
|
289
|
+
it 'includes taxpayer_id' do
|
290
|
+
expect(client.taxpayer_info(request_payload)).to include("123456789")
|
291
|
+
end
|
292
|
+
|
293
|
+
it 'does not usually include SSN' do
|
294
|
+
expect(client.taxpayer_info(request_payload)).not_to include("111222123")
|
295
|
+
end
|
296
|
+
|
297
|
+
it 'includes SSN for sole proprietorships' do
|
298
|
+
payload = request_payload
|
299
|
+
payload[:business_type] = "Sole Proprietorship"
|
300
|
+
expect(client.taxpayer_info(payload)).to include("111222123")
|
301
|
+
end
|
302
|
+
|
303
|
+
end
|
281
304
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 1.8.1
|
8
|
+
- 9
|
9
|
+
version: "1.9"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Jamie Macey
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2013-
|
17
|
+
date: 2013-04-10 00:00:00 Z
|
19
18
|
dependencies:
|
20
19
|
- !ruby/object:Gem::Dependency
|
21
20
|
requirement: &id001 !ruby/object:Gem::Requirement
|