Avatax_TaxService 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Avatax_TaxService.gemspec +2 -2
- data/lib/avatax_taxservice.rb +22 -22
- metadata +2 -2
data/Avatax_TaxService.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "Avatax_TaxService"
|
3
|
-
s.version = "1.0.
|
3
|
+
s.version = "1.0.2"
|
4
4
|
s.date = "2012-10-28"
|
5
5
|
s.author = "Graham S Wilson"
|
6
6
|
s.email = "support@Avalara.com"
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
"Avatax Ruby SDK Guide.docx", "LICENSE.txt"]
|
17
17
|
s.add_dependency "nokogiri", ">= 1.4.0", "< 1.6"
|
18
18
|
s.add_dependency "savon", ">= 2.3.0"
|
19
|
-
s.required_ruby_version = '>=1.9.
|
19
|
+
s.required_ruby_version = '>= 1.9.1'
|
20
20
|
s.post_install_message = 'Thanks for installing the Avalara AddressService Ruby SDK. Refer to "Avatax Ruby SDK User Guide.docx" to get started.'
|
21
21
|
end
|
22
22
|
|
data/lib/avatax_taxservice.rb
CHANGED
@@ -208,7 +208,7 @@ module AvaTax
|
|
208
208
|
@debug = debug == nil ? false : debug
|
209
209
|
@validate = validate == nil ? false : validate
|
210
210
|
|
211
|
-
# If
|
211
|
+
# If validate set to true then user has requested address validation before the tax call
|
212
212
|
if @validate
|
213
213
|
if @debug
|
214
214
|
#Use Ruby built in Benchmark function to record response times
|
@@ -243,7 +243,7 @@ module AvaTax
|
|
243
243
|
begin
|
244
244
|
# Call using debug
|
245
245
|
if debug
|
246
|
-
# Use Ruby built in Benchmark
|
246
|
+
# Use Ruby built in Benchmark function to record response times
|
247
247
|
@log.puts "#{Time.now}: Calling GetTax Service for DocCode: #{@doccode}"
|
248
248
|
time = Benchmark.measure do
|
249
249
|
# Call GetTax Service
|
@@ -256,7 +256,7 @@ module AvaTax
|
|
256
256
|
# Call GetTax Service
|
257
257
|
@response = @client.call(:get_tax, xml: @soap).to_s
|
258
258
|
end
|
259
|
-
#Capture
|
259
|
+
#Capture unexpected errors
|
260
260
|
rescue
|
261
261
|
@log.puts "#{Time.now}: Error calling GetTax service ... check that your account name and password are correct."
|
262
262
|
end
|
@@ -267,7 +267,7 @@ module AvaTax
|
|
267
267
|
|
268
268
|
# Call using debug
|
269
269
|
if debug
|
270
|
-
# Use Ruby built in Benchmark
|
270
|
+
# Use Ruby built in Benchmark function to record response times
|
271
271
|
@log.puts "#{Time.now}: Parsing the GeTax response:"
|
272
272
|
time = Benchmark.measure do
|
273
273
|
# Load the response into a Nokogiri object and remove namespaces
|
@@ -407,7 +407,7 @@ module AvaTax
|
|
407
407
|
begin
|
408
408
|
# Call using debug
|
409
409
|
if debug
|
410
|
-
# Use Ruby built in Benchmark
|
410
|
+
# Use Ruby built in Benchmark function to record response times
|
411
411
|
@log.puts "#{Time.now}: Calling AdjustTax Service for DocCode: #{@doccode}"
|
412
412
|
time = Benchmark.measure do
|
413
413
|
# Call AdjustTax Service
|
@@ -420,7 +420,7 @@ module AvaTax
|
|
420
420
|
# Call AdjustTax Service
|
421
421
|
@response = @client.call(:adjust_tax, xml: @soap).to_s
|
422
422
|
end
|
423
|
-
#Capture
|
423
|
+
#Capture unexpected errors
|
424
424
|
rescue
|
425
425
|
@log.puts "#{Time.now}: Error calling AdjustTax service ... check that your account name and password are correct."
|
426
426
|
end
|
@@ -431,7 +431,7 @@ module AvaTax
|
|
431
431
|
|
432
432
|
# Call using debug
|
433
433
|
if debug
|
434
|
-
# Use Ruby built in Benchmark
|
434
|
+
# Use Ruby built in Benchmark function to record response times
|
435
435
|
@log.puts "#{Time.now}: Parsing the AdjustTax response:"
|
436
436
|
time = Benchmark.measure do
|
437
437
|
# Load the response into a Nokogiri object and remove namespaces
|
@@ -501,7 +501,7 @@ module AvaTax
|
|
501
501
|
begin
|
502
502
|
# Call using debug
|
503
503
|
if debug
|
504
|
-
# Use Ruby built in Benchmark
|
504
|
+
# Use Ruby built in Benchmark function to record response times
|
505
505
|
@log.puts "#{Time.now}: Calling PostTax Service for DocCode: #{@doccode}"
|
506
506
|
time = Benchmark.measure do
|
507
507
|
# Call PostTax Service
|
@@ -514,7 +514,7 @@ module AvaTax
|
|
514
514
|
# Call PostTax Service
|
515
515
|
@response = @client.call(:post_tax, xml: @soap).to_s
|
516
516
|
end
|
517
|
-
#Capture
|
517
|
+
#Capture unexpected errors
|
518
518
|
rescue
|
519
519
|
@log.puts "#{Time.now}: Error calling PostTax service ... check that your account name and password are correct."
|
520
520
|
end
|
@@ -525,7 +525,7 @@ module AvaTax
|
|
525
525
|
|
526
526
|
# Call using debug
|
527
527
|
if debug
|
528
|
-
# Use Ruby built in Benchmark
|
528
|
+
# Use Ruby built in Benchmark function to record response times
|
529
529
|
@log.puts "#{Time.now}: Parsing the PostTax response:"
|
530
530
|
time = Benchmark.measure do
|
531
531
|
# Load the response into a Nokogiri object and remove namespaces
|
@@ -586,7 +586,7 @@ module AvaTax
|
|
586
586
|
begin
|
587
587
|
# Call using debug
|
588
588
|
if debug
|
589
|
-
# Use Ruby built in Benchmark
|
589
|
+
# Use Ruby built in Benchmark function to record response times
|
590
590
|
@log.puts "#{Time.now}: Calling CommitTax Service for DocCode: #{@doccode}"
|
591
591
|
time = Benchmark.measure do
|
592
592
|
# Call CommitTax Service
|
@@ -599,7 +599,7 @@ module AvaTax
|
|
599
599
|
# Call CommitTax Service
|
600
600
|
@response = @client.call(:commit_tax, xml: @soap).to_s
|
601
601
|
end
|
602
|
-
#Capture
|
602
|
+
#Capture unexpected errors
|
603
603
|
rescue
|
604
604
|
@log.puts "#{Time.now}: Error calling CommitTax service ... check that your account name and password are correct."
|
605
605
|
end
|
@@ -610,7 +610,7 @@ module AvaTax
|
|
610
610
|
|
611
611
|
# Call using debug
|
612
612
|
if debug
|
613
|
-
# Use Ruby built in Benchmark
|
613
|
+
# Use Ruby built in Benchmark function to record response times
|
614
614
|
@log.puts "#{Time.now}: Parsing the commitTax response:"
|
615
615
|
time = Benchmark.measure do
|
616
616
|
# Load the response into a Nokogiri object and remove namespaces
|
@@ -671,7 +671,7 @@ module AvaTax
|
|
671
671
|
begin
|
672
672
|
# Call using debug
|
673
673
|
if debug
|
674
|
-
# Use Ruby built in Benchmark
|
674
|
+
# Use Ruby built in Benchmark function to record response times
|
675
675
|
@log.puts "#{Time.now}: Calling CancelTax Service for DocCode: #{@doccode}"
|
676
676
|
time = Benchmark.measure do
|
677
677
|
# Call CancelTax Service
|
@@ -684,7 +684,7 @@ module AvaTax
|
|
684
684
|
# Call CancelTax Service
|
685
685
|
@response = @client.call(:cancel_tax, xml: @soap).to_s
|
686
686
|
end
|
687
|
-
#Capture
|
687
|
+
#Capture unexpected errors
|
688
688
|
rescue
|
689
689
|
@log.puts "#{Time.now}: Error calling CancelTax service ... check that your account name and password are correct."
|
690
690
|
end
|
@@ -695,7 +695,7 @@ module AvaTax
|
|
695
695
|
|
696
696
|
# Call using debug
|
697
697
|
if debug
|
698
|
-
# Use Ruby built in Benchmark
|
698
|
+
# Use Ruby built in Benchmark function to record response times
|
699
699
|
@log.puts "#{Time.now}: Parsing the CancelTax response:"
|
700
700
|
time = Benchmark.measure do
|
701
701
|
# Load the response into a Nokogiri object and remove namespaces
|
@@ -756,7 +756,7 @@ module AvaTax
|
|
756
756
|
begin
|
757
757
|
# Call using debug
|
758
758
|
if debug
|
759
|
-
# Use Ruby built in Benchmark
|
759
|
+
# Use Ruby built in Benchmark function to record response times
|
760
760
|
@log.puts "#{Time.now}: Calling GetTaxHistory Service"
|
761
761
|
time = Benchmark.measure do
|
762
762
|
# Call GetTaxHistory Service
|
@@ -769,7 +769,7 @@ module AvaTax
|
|
769
769
|
# Call GetTaxHistory Service
|
770
770
|
@response = @client.call(:get_tax_history, xml: @soap).to_s
|
771
771
|
end
|
772
|
-
#Capture
|
772
|
+
#Capture unexpected errors
|
773
773
|
rescue
|
774
774
|
@log.puts "#{Time.now}: Error calling GetTaxHistory service ... check that your account name and password are correct."
|
775
775
|
end
|
@@ -780,7 +780,7 @@ module AvaTax
|
|
780
780
|
|
781
781
|
# Call using debug
|
782
782
|
if debug
|
783
|
-
# Use Ruby built in Benchmark
|
783
|
+
# Use Ruby built in Benchmark function to record response times
|
784
784
|
@log.puts "#{Time.now}: Parsing the GetTaxHistory response:"
|
785
785
|
time = Benchmark.measure do
|
786
786
|
# Load the response into a Nokogiri object and remove namespaces
|
@@ -848,7 +848,7 @@ module AvaTax
|
|
848
848
|
begin
|
849
849
|
# Call using debug
|
850
850
|
if debug
|
851
|
-
# Use Ruby built in Benchmark
|
851
|
+
# Use Ruby built in Benchmark function to record response times
|
852
852
|
@log.puts "#{Time.now}: Calling ReconcileTaxHistory Service"
|
853
853
|
time = Benchmark.measure do
|
854
854
|
# Call ReconcileTaxHistory Service
|
@@ -861,7 +861,7 @@ module AvaTax
|
|
861
861
|
# Call ReconcileTaxHistory Service
|
862
862
|
@response = @client.call(:reconcile_tax_history, xml: @soap).to_s
|
863
863
|
end
|
864
|
-
#Capture
|
864
|
+
#Capture unexpected errors
|
865
865
|
rescue
|
866
866
|
@log.puts "#{Time.now}: Error calling ReconcileTaxHistory service ... check that your account name and password are correct."
|
867
867
|
end
|
@@ -872,7 +872,7 @@ module AvaTax
|
|
872
872
|
|
873
873
|
# Call using debug
|
874
874
|
if debug
|
875
|
-
# Use Ruby built in Benchmark
|
875
|
+
# Use Ruby built in Benchmark function to record response times
|
876
876
|
@log.puts "#{Time.now}: Parsing the ReconcileTaxHistory response:"
|
877
877
|
time = Benchmark.measure do
|
878
878
|
# Load the response into a Nokogiri object and remove namespaces
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Avatax_TaxService
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
97
97
|
- - ! '>='
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: 1.9.
|
99
|
+
version: 1.9.1
|
100
100
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
101
|
none: false
|
102
102
|
requirements:
|