taxamo-ns 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -2
  3. data/lib/taxamo/models/additionalcurrencies.rb +2 -2
  4. data/lib/taxamo/models/additionalcurrency.rb +7 -7
  5. data/lib/taxamo/models/bycountry.rb +5 -5
  6. data/lib/taxamo/models/bystatus.rb +3 -3
  7. data/lib/taxamo/models/bytaxationtype.rb +6 -6
  8. data/lib/taxamo/models/c.rb +5 -5
  9. data/lib/taxamo/models/calculatesimpletaxout.rb +4 -4
  10. data/lib/taxamo/models/calculatetaxin.rb +2 -2
  11. data/lib/taxamo/models/calculatetaxlocationout.rb +9 -9
  12. data/lib/taxamo/models/calculatetaxout.rb +4 -4
  13. data/lib/taxamo/models/canceltransactionout.rb +2 -2
  14. data/lib/taxamo/models/capturepaymentout.rb +2 -2
  15. data/lib/taxamo/models/confirmtransactionin.rb +2 -2
  16. data/lib/taxamo/models/confirmtransactionout.rb +4 -4
  17. data/lib/taxamo/models/countries.rb +12 -12
  18. data/lib/taxamo/models/country.rb +13 -13
  19. data/lib/taxamo/models/countryschema.rb +13 -13
  20. data/lib/taxamo/models/createpaymentin.rb +4 -4
  21. data/lib/taxamo/models/createpaymentout.rb +2 -2
  22. data/lib/taxamo/models/createrefundin.rb +6 -6
  23. data/lib/taxamo/models/createrefundout.rb +5 -5
  24. data/lib/taxamo/models/createsmstokenin.rb +3 -3
  25. data/lib/taxamo/models/createsmstokenout.rb +2 -2
  26. data/lib/taxamo/models/createtransactionin.rb +3 -3
  27. data/lib/taxamo/models/createtransactionout.rb +4 -4
  28. data/lib/taxamo/models/currencyschema.rb +6 -6
  29. data/lib/taxamo/models/customfields.rb +3 -3
  30. data/lib/taxamo/models/emailinvoicein.rb +2 -2
  31. data/lib/taxamo/models/emailinvoiceout.rb +2 -2
  32. data/lib/taxamo/models/emailrefundin.rb +2 -2
  33. data/lib/taxamo/models/emailrefundout.rb +2 -2
  34. data/lib/taxamo/models/evidence.rb +12 -12
  35. data/lib/taxamo/models/evidenceschema.rb +5 -5
  36. data/lib/taxamo/models/getcountriesdictout.rb +2 -2
  37. data/lib/taxamo/models/getcurrenciesdictout.rb +2 -2
  38. data/lib/taxamo/models/getdailysettlementstatsout.rb +2 -2
  39. data/lib/taxamo/models/getdetailedrefundsout.rb +2 -2
  40. data/lib/taxamo/models/getdomesticsummaryreportout.rb +14 -14
  41. data/lib/taxamo/models/geteuviesreportout.rb +5 -5
  42. data/lib/taxamo/models/getproducttypesdictout.rb +2 -2
  43. data/lib/taxamo/models/getrefundsout.rb +2 -2
  44. data/lib/taxamo/models/getsettlementout.rb +6 -6
  45. data/lib/taxamo/models/getsettlementstatsbycountryout.rb +2 -2
  46. data/lib/taxamo/models/getsettlementstatsbytaxationtypeout.rb +2 -2
  47. data/lib/taxamo/models/getsettlementsummaryout.rb +2 -2
  48. data/lib/taxamo/models/gettransactionout.rb +4 -4
  49. data/lib/taxamo/models/gettransactionsstatsbycountryout.rb +2 -2
  50. data/lib/taxamo/models/gettransactionsstatsout.rb +2 -2
  51. data/lib/taxamo/models/inputtransaction.rb +33 -33
  52. data/lib/taxamo/models/inputtransactionline.rb +18 -18
  53. data/lib/taxamo/models/inputtransactionupdate.rb +33 -33
  54. data/lib/taxamo/models/invoiceaddress.rb +9 -9
  55. data/lib/taxamo/models/listpaymentsout.rb +2 -2
  56. data/lib/taxamo/models/listrefundsout.rb +2 -2
  57. data/lib/taxamo/models/listtransactionsout.rb +2 -2
  58. data/lib/taxamo/models/locategivenipout.rb +4 -4
  59. data/lib/taxamo/models/locatemyipout.rb +4 -4
  60. data/lib/taxamo/models/n.rb +5 -5
  61. data/lib/taxamo/models/payments.rb +4 -4
  62. data/lib/taxamo/models/producttypeschema.rb +2 -2
  63. data/lib/taxamo/models/refunds.rb +11 -11
  64. data/lib/taxamo/models/report.rb +10 -10
  65. data/lib/taxamo/models/settlementdailystatsschema.rb +10 -10
  66. data/lib/taxamo/models/storagerequiredfields.rb +2 -2
  67. data/lib/taxamo/models/summary.rb +9 -9
  68. data/lib/taxamo/models/taxdataschema.rb +2 -2
  69. data/lib/taxamo/models/taxrequiredfields.rb +2 -2
  70. data/lib/taxamo/models/transaction.rb +55 -55
  71. data/lib/taxamo/models/transactionlines.rb +24 -24
  72. data/lib/taxamo/models/transactions.rb +55 -55
  73. data/lib/taxamo/models/unconfirmtransactionin.rb +2 -2
  74. data/lib/taxamo/models/unconfirmtransactionout.rb +4 -4
  75. data/lib/taxamo/models/updatetransactionin.rb +2 -2
  76. data/lib/taxamo/models/updatetransactionout.rb +4 -4
  77. data/lib/taxamo/models/ustaxexemptioncertificatedetailsschema.rb +17 -17
  78. data/lib/taxamo/models/ustaxexemptioncertificateschema.rb +3 -3
  79. data/lib/taxamo/models/ustaxexemptstate.rb +4 -4
  80. data/lib/taxamo/models/ustaxid.rb +4 -4
  81. data/lib/taxamo/models/validatetaxnumberout.rb +5 -5
  82. data/lib/taxamo/models/verifysmstokenout.rb +2 -2
  83. data/lib/taxamo/version.rb +1 -1
  84. data/test/taxamo/dict_test.rb +36 -0
  85. data/test/taxamo/tax_test.rb +3 -1
  86. metadata +4 -2
@@ -25,18 +25,18 @@ class UpdateTransactionOut
25
25
  end
26
26
 
27
27
  def initialize(attributes = {})
28
- return if attributes.empty?
28
+ return if attributes.nil? or attributes.empty?
29
29
  # Morph attribute keys into undescored rubyish style
30
- unless attributes["transaction"].nil?
30
+ if attributes.key?("transaction")
31
31
  @transaction = Transaction.new(attributes["transaction"])
32
32
 
33
33
  end
34
- unless attributes["tax_required_fields"].nil?
34
+ if attributes.key?("tax_required_fields")
35
35
  if (value = attributes["tax_required_fields"]).is_a?(Array)
36
36
  @tax_required_fields = value.map{ |v| TaxRequiredFields.new(v) }
37
37
  end
38
38
  end
39
- unless attributes["storage_required_fields"].nil?
39
+ if attributes.key?("storage_required_fields")
40
40
  if (value = attributes["storage_required_fields"]).is_a?(Array)
41
41
  @storage_required_fields = value.map{ |v| StorageRequiredFields.new(v) }
42
42
  end
@@ -38,70 +38,70 @@ class UsTaxExemptionCertificateDetailsSchema
38
38
  end
39
39
 
40
40
  def initialize(attributes = {})
41
- return if attributes.empty?
41
+ return if attributes.nil? or attributes.empty?
42
42
  # Morph attribute keys into undescored rubyish style
43
- unless attributes["single_purchase_order_identifier"].nil?
43
+ if attributes.key?("single_purchase_order_identifier")
44
44
  @single_purchase_order_identifier = attributes["single_purchase_order_identifier"]
45
45
 
46
46
  end
47
- unless attributes["purchaser_business_type"].nil?
47
+ if attributes.key?("purchaser_business_type")
48
48
  @purchaser_business_type = attributes["purchaser_business_type"]
49
49
 
50
50
  end
51
- unless attributes["purchaser_exemption_reason_value"].nil?
51
+ if attributes.key?("purchaser_exemption_reason_value")
52
52
  @purchaser_exemption_reason_value = attributes["purchaser_exemption_reason_value"]
53
53
 
54
54
  end
55
- unless attributes["purchaser_state"].nil?
55
+ if attributes.key?("purchaser_state")
56
56
  @purchaser_state = attributes["purchaser_state"]
57
57
 
58
58
  end
59
- unless attributes["purchaser_zip"].nil?
59
+ if attributes.key?("purchaser_zip")
60
60
  @purchaser_zip = attributes["purchaser_zip"]
61
61
 
62
62
  end
63
- unless attributes["purchaser_city"].nil?
63
+ if attributes.key?("purchaser_city")
64
64
  @purchaser_city = attributes["purchaser_city"]
65
65
 
66
66
  end
67
- unless attributes["purchaser_last_name"].nil?
67
+ if attributes.key?("purchaser_last_name")
68
68
  @purchaser_last_name = attributes["purchaser_last_name"]
69
69
 
70
70
  end
71
- unless attributes["purchaser_exemption_reason"].nil?
71
+ if attributes.key?("purchaser_exemption_reason")
72
72
  @purchaser_exemption_reason = attributes["purchaser_exemption_reason"]
73
73
 
74
74
  end
75
- unless attributes["single_purchase"].nil?
75
+ if attributes.key?("single_purchase")
76
76
  @single_purchase = attributes["single_purchase"]
77
77
 
78
78
  end
79
- unless attributes["purchaser_tax_id"].nil?
79
+ if attributes.key?("purchaser_tax_id")
80
80
  @purchaser_tax_id = UsTaxId.new(attributes["purchaser_tax_id"])
81
81
 
82
82
  end
83
- unless attributes["purchaser_address2"].nil?
83
+ if attributes.key?("purchaser_address2")
84
84
  @purchaser_address2 = attributes["purchaser_address2"]
85
85
 
86
86
  end
87
- unless attributes["purchaser_address1"].nil?
87
+ if attributes.key?("purchaser_address1")
88
88
  @purchaser_address1 = attributes["purchaser_address1"]
89
89
 
90
90
  end
91
- unless attributes["purchaser_business_type_other_value"].nil?
91
+ if attributes.key?("purchaser_business_type_other_value")
92
92
  @purchaser_business_type_other_value = attributes["purchaser_business_type_other_value"]
93
93
 
94
94
  end
95
- unless attributes["purchaser_first_name"].nil?
95
+ if attributes.key?("purchaser_first_name")
96
96
  @purchaser_first_name = attributes["purchaser_first_name"]
97
97
 
98
98
  end
99
- unless attributes["exempt_states"].nil?
99
+ if attributes.key?("exempt_states")
100
100
  if (value = attributes["exempt_states"]).is_a?(Array)
101
101
  @exempt_states = value.map{ |v| UsTaxExemptState.new(v) }
102
102
  end
103
103
  end
104
- unless attributes["purchaser_title"].nil?
104
+ if attributes.key?("purchaser_title")
105
105
  @purchaser_title = attributes["purchaser_title"]
106
106
 
107
107
  end
@@ -24,13 +24,13 @@ class UsTaxExemptionCertificateSchema
24
24
  end
25
25
 
26
26
  def initialize(attributes = {})
27
- return if attributes.empty?
27
+ return if attributes.nil? or attributes.empty?
28
28
  # Morph attribute keys into undescored rubyish style
29
- unless attributes["certificate_id"].nil?
29
+ if attributes.key?("certificate_id")
30
30
  @certificate_id = attributes["certificate_id"]
31
31
 
32
32
  end
33
- unless attributes["detail"].nil?
33
+ if attributes.key?("detail")
34
34
  @detail = UsTaxExemptionCertificateDetailsSchema.new(attributes["detail"])
35
35
 
36
36
  end
@@ -25,17 +25,17 @@ class UsTaxExemptState
25
25
  end
26
26
 
27
27
  def initialize(attributes = {})
28
- return if attributes.empty?
28
+ return if attributes.nil? or attributes.empty?
29
29
  # Morph attribute keys into undescored rubyish style
30
- unless attributes["state_abbr"].nil?
30
+ if attributes.key?("state_abbr")
31
31
  @state_abbr = attributes["state_abbr"]
32
32
 
33
33
  end
34
- unless attributes["reason_for_exemption"].nil?
34
+ if attributes.key?("reason_for_exemption")
35
35
  @reason_for_exemption = attributes["reason_for_exemption"]
36
36
 
37
37
  end
38
- unless attributes["identifier_for_exemption_reason"].nil?
38
+ if attributes.key?("identifier_for_exemption_reason")
39
39
  @identifier_for_exemption_reason = attributes["identifier_for_exemption_reason"]
40
40
 
41
41
  end
@@ -25,17 +25,17 @@ class UsTaxId
25
25
  end
26
26
 
27
27
  def initialize(attributes = {})
28
- return if attributes.empty?
28
+ return if attributes.nil? or attributes.empty?
29
29
  # Morph attribute keys into undescored rubyish style
30
- unless attributes["tax_id_type"].nil?
30
+ if attributes.key?("tax_id_type")
31
31
  @tax_id_type = attributes["tax_id_type"]
32
32
 
33
33
  end
34
- unless attributes["tax_id"].nil?
34
+ if attributes.key?("tax_id")
35
35
  @tax_id = attributes["tax_id"]
36
36
 
37
37
  end
38
- unless attributes["state_of_issue"].nil?
38
+ if attributes.key?("state_of_issue")
39
39
  @state_of_issue = attributes["state_of_issue"]
40
40
 
41
41
  end
@@ -26,21 +26,21 @@ class ValidateTaxNumberOut
26
26
  end
27
27
 
28
28
  def initialize(attributes = {})
29
- return if attributes.empty?
29
+ return if attributes.nil? or attributes.empty?
30
30
  # Morph attribute keys into undescored rubyish style
31
- unless attributes["tax_deducted"].nil?
31
+ if attributes.key?("tax_deducted")
32
32
  @tax_deducted = attributes["tax_deducted"]
33
33
 
34
34
  end
35
- unless attributes["buyer_tax_number"].nil?
35
+ if attributes.key?("buyer_tax_number")
36
36
  @buyer_tax_number = attributes["buyer_tax_number"]
37
37
 
38
38
  end
39
- unless attributes["buyer_tax_number_valid"].nil?
39
+ if attributes.key?("buyer_tax_number_valid")
40
40
  @buyer_tax_number_valid = attributes["buyer_tax_number_valid"]
41
41
 
42
42
  end
43
- unless attributes["billing_country_code"].nil?
43
+ if attributes.key?("billing_country_code")
44
44
  @billing_country_code = attributes["billing_country_code"]
45
45
 
46
46
  end
@@ -23,9 +23,9 @@ class VerifySMSTokenOut
23
23
  end
24
24
 
25
25
  def initialize(attributes = {})
26
- return if attributes.empty?
26
+ return if attributes.nil? or attributes.empty?
27
27
  # Morph attribute keys into undescored rubyish style
28
- unless attributes["country_code"].nil?
28
+ if attributes.key?("country_code")
29
29
  @country_code = attributes["country_code"]
30
30
 
31
31
  end
@@ -11,7 +11,7 @@
11
11
  # limitations under the License.
12
12
 
13
13
  module Taxamo
14
- VERSION = "2.3.0"
14
+ VERSION = "2.3.1"
15
15
  end
16
16
 
17
17
 
@@ -0,0 +1,36 @@
1
+ # Copyright 2014-2017 Taxamo, Ltd.
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ require 'test/unit'
14
+ require 'shoulda'
15
+ require 'taxamo'
16
+
17
+
18
+ class DictTest < Test::Unit::TestCase
19
+
20
+ should 'return countries dictionaries with some attrs present ' do
21
+
22
+ Swagger.configure do |config|
23
+ config.api_key = 'SamplePrivateTestKey1'
24
+ end
25
+ resp = Taxamo.get_countries_dict(nil)
26
+
27
+ assert_equal resp.dictionary[0].code, "00"
28
+ assert_equal resp.dictionary[0].tax_region, nil
29
+ assert_true resp.dictionary[0].instance_variable_defined?(:@tax_region)
30
+
31
+
32
+ end
33
+
34
+
35
+
36
+ end
@@ -87,7 +87,7 @@ class TaxTest < Test::Unit::TestCase
87
87
  Swagger.configure do |config|
88
88
  config.api_key = 'SamplePrivateTestKey1'
89
89
  end
90
- #,,,,,
90
+
91
91
  resp = Taxamo.calculate_simple_tax('e-book', #product_type
92
92
  nil, #invoice_address_city
93
93
  nil, #buyer_credit_card_prefix
@@ -136,6 +136,8 @@ class TaxTest < Test::Unit::TestCase
136
136
  resp = Taxamo.validate_tax_number(nil, 'FR00300076967')
137
137
 
138
138
  assert_equal resp.tax_deducted, false
139
+
140
+ assert_true resp.instance_variable_defined?(:@tax_deducted)
139
141
  end
140
142
 
141
143
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taxamo-ns
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomek Lipski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2017-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -209,6 +209,7 @@ files:
209
209
  - lib/taxamo/version.rb
210
210
  - taxamo.gemspec
211
211
  - test/taxamo/connectivity_test.rb
212
+ - test/taxamo/dict_test.rb
212
213
  - test/taxamo/tax_test.rb
213
214
  - test/taxamo/transactions_api_test.rb
214
215
  homepage: https://www.taxamo.com/apidocs/index.html
@@ -237,5 +238,6 @@ specification_version: 4
237
238
  summary: Ruby bindings for the Taxamo API (namespaced)
238
239
  test_files:
239
240
  - test/taxamo/connectivity_test.rb
241
+ - test/taxamo/dict_test.rb
240
242
  - test/taxamo/tax_test.rb
241
243
  - test/taxamo/transactions_api_test.rb