taxamo 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/LICENSE +11 -0
- data/README.md +120 -0
- data/Rakefile +7 -0
- data/lib/monkey.rb +90 -0
- data/lib/swagger.rb +93 -0
- data/lib/swagger/configuration.rb +21 -0
- data/lib/swagger/request.rb +198 -0
- data/lib/swagger/response.rb +87 -0
- data/lib/taxamo.rb +999 -0
- data/lib/taxamo/models/additionalcurrencies.rb +62 -0
- data/lib/taxamo/models/additionalcurrency.rb +82 -0
- data/lib/taxamo/models/bycountry.rb +77 -0
- data/lib/taxamo/models/bystatus.rb +69 -0
- data/lib/taxamo/models/bytaxationtype.rb +82 -0
- data/lib/taxamo/models/c.rb +77 -0
- data/lib/taxamo/models/calculatesimpletaxout.rb +62 -0
- data/lib/taxamo/models/calculatetaxin.rb +62 -0
- data/lib/taxamo/models/calculatetaxlocationout.rb +97 -0
- data/lib/taxamo/models/calculatetaxout.rb +62 -0
- data/lib/taxamo/models/canceltransactionout.rb +62 -0
- data/lib/taxamo/models/capturepaymentout.rb +62 -0
- data/lib/taxamo/models/confirmtransactionin.rb +62 -0
- data/lib/taxamo/models/confirmtransactionout.rb +62 -0
- data/lib/taxamo/models/countries.rb +112 -0
- data/lib/taxamo/models/country.rb +114 -0
- data/lib/taxamo/models/countryschema.rb +114 -0
- data/lib/taxamo/models/createpaymentin.rb +72 -0
- data/lib/taxamo/models/createpaymentout.rb +62 -0
- data/lib/taxamo/models/createrefundin.rb +77 -0
- data/lib/taxamo/models/createrefundout.rb +77 -0
- data/lib/taxamo/models/createsmstokenin.rb +67 -0
- data/lib/taxamo/models/createsmstokenout.rb +62 -0
- data/lib/taxamo/models/createtransactionin.rb +67 -0
- data/lib/taxamo/models/createtransactionout.rb +62 -0
- data/lib/taxamo/models/currencyschema.rb +82 -0
- data/lib/taxamo/models/customfields.rb +67 -0
- data/lib/taxamo/models/emailinvoicein.rb +62 -0
- data/lib/taxamo/models/emailinvoiceout.rb +62 -0
- data/lib/taxamo/models/evidence.rb +112 -0
- data/lib/taxamo/models/evidenceschema.rb +77 -0
- data/lib/taxamo/models/getcountriesdictout.rb +63 -0
- data/lib/taxamo/models/getcurrenciesdictout.rb +63 -0
- data/lib/taxamo/models/getdailysettlementstatsout.rb +63 -0
- data/lib/taxamo/models/getproducttypesdictout.rb +63 -0
- data/lib/taxamo/models/getrefundsout.rb +63 -0
- data/lib/taxamo/models/getsettlementout.rb +83 -0
- data/lib/taxamo/models/getsettlementstatsbycountryout.rb +63 -0
- data/lib/taxamo/models/getsettlementstatsbytaxationtypeout.rb +62 -0
- data/lib/taxamo/models/getsettlementsummaryout.rb +62 -0
- data/lib/taxamo/models/gettransactionout.rb +62 -0
- data/lib/taxamo/models/gettransactionsstatsout.rb +62 -0
- data/lib/taxamo/models/inputtransaction.rb +184 -0
- data/lib/taxamo/models/inputtransactionline.rb +133 -0
- data/lib/taxamo/models/inputtransactionupdate.rb +184 -0
- data/lib/taxamo/models/invoiceaddress.rb +97 -0
- data/lib/taxamo/models/listpaymentsout.rb +63 -0
- data/lib/taxamo/models/listtransactionsout.rb +63 -0
- data/lib/taxamo/models/locategivenipout.rb +72 -0
- data/lib/taxamo/models/locatemyipout.rb +72 -0
- data/lib/taxamo/models/n.rb +77 -0
- data/lib/taxamo/models/payments.rb +72 -0
- data/lib/taxamo/models/producttypeschema.rb +62 -0
- data/lib/taxamo/models/report.rb +92 -0
- data/lib/taxamo/models/settlementdailystatsschema.rb +102 -0
- data/lib/taxamo/models/summary.rb +87 -0
- data/lib/taxamo/models/transaction.rb +279 -0
- data/lib/taxamo/models/transactionlines.rb +163 -0
- data/lib/taxamo/models/transactions.rb +279 -0
- data/lib/taxamo/models/unconfirmtransactionin.rb +62 -0
- data/lib/taxamo/models/unconfirmtransactionout.rb +62 -0
- data/lib/taxamo/models/updatetransactionin.rb +62 -0
- data/lib/taxamo/models/updatetransactionout.rb +62 -0
- data/lib/taxamo/models/validatetaxnumberout.rb +77 -0
- data/lib/taxamo/models/verifysmstokenout.rb +62 -0
- data/lib/taxamo/version.rb +17 -0
- data/taxamo.gemspec +31 -0
- data/test/taxamo/connectivity_test.rb +55 -0
- data/test/taxamo/tax_test.rb +147 -0
- data/test/taxamo/transactions_api_test.rb +308 -0
- metadata +226 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
# Copyright 2014-2015 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
|
+
class AdditionalCurrencies
|
14
|
+
attr_accessor :invoice
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:invoice => :invoice
|
20
|
+
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(attributes = {})
|
25
|
+
return if attributes.empty?
|
26
|
+
# Morph attribute keys into undescored rubyish style
|
27
|
+
if attributes["invoice"]
|
28
|
+
@invoice = AdditionalCurrency.new(attributes["invoice"])
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_body
|
36
|
+
body = {}
|
37
|
+
self.class.attribute_map.each_pair do |key, value|
|
38
|
+
v = self.send(key)
|
39
|
+
unless v.nil?
|
40
|
+
if v.is_a?(Array)
|
41
|
+
array = Array.new
|
42
|
+
v.each do |item|
|
43
|
+
if item.respond_to?("to_body".to_sym)
|
44
|
+
array.push item.to_body
|
45
|
+
else
|
46
|
+
array.push item
|
47
|
+
end
|
48
|
+
end
|
49
|
+
body[value] = array
|
50
|
+
else
|
51
|
+
if v.respond_to?("to_body".to_sym)
|
52
|
+
body[value] = v.to_body
|
53
|
+
else
|
54
|
+
body[value] = v
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
body
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Copyright 2014-2015 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
|
+
class AdditionalCurrency
|
14
|
+
attr_accessor :currency_code, :amount, :tax_amount, :fx_rate, :total_amount
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:currency_code => :currency_code,
|
20
|
+
:amount => :amount,
|
21
|
+
:tax_amount => :tax_amount,
|
22
|
+
:fx_rate => :fx_rate,
|
23
|
+
:total_amount => :total_amount
|
24
|
+
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(attributes = {})
|
29
|
+
return if attributes.empty?
|
30
|
+
# Morph attribute keys into undescored rubyish style
|
31
|
+
if attributes["currency_code"]
|
32
|
+
@currency_code = attributes["currency_code"]
|
33
|
+
|
34
|
+
end
|
35
|
+
if attributes["amount"]
|
36
|
+
@amount = attributes["amount"]
|
37
|
+
|
38
|
+
end
|
39
|
+
if attributes["tax_amount"]
|
40
|
+
@tax_amount = attributes["tax_amount"]
|
41
|
+
|
42
|
+
end
|
43
|
+
if attributes["fx_rate"]
|
44
|
+
@fx_rate = attributes["fx_rate"]
|
45
|
+
|
46
|
+
end
|
47
|
+
if attributes["total_amount"]
|
48
|
+
@total_amount = attributes["total_amount"]
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
def to_body
|
56
|
+
body = {}
|
57
|
+
self.class.attribute_map.each_pair do |key, value|
|
58
|
+
v = self.send(key)
|
59
|
+
unless v.nil?
|
60
|
+
if v.is_a?(Array)
|
61
|
+
array = Array.new
|
62
|
+
v.each do |item|
|
63
|
+
if item.respond_to?("to_body".to_sym)
|
64
|
+
array.push item.to_body
|
65
|
+
else
|
66
|
+
array.push item
|
67
|
+
end
|
68
|
+
end
|
69
|
+
body[value] = array
|
70
|
+
else
|
71
|
+
if v.respond_to?("to_body".to_sym)
|
72
|
+
body[value] = v.to_body
|
73
|
+
else
|
74
|
+
body[value] = v
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
body
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Copyright 2014-2015 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
|
+
class ByCountry
|
14
|
+
attr_accessor :value, :tax_country_name, :tax_country_code, :currency_code
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:value => :value,
|
20
|
+
:tax_country_name => :tax_country_name,
|
21
|
+
:tax_country_code => :tax_country_code,
|
22
|
+
:currency_code => :currency_code
|
23
|
+
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize(attributes = {})
|
28
|
+
return if attributes.empty?
|
29
|
+
# Morph attribute keys into undescored rubyish style
|
30
|
+
if attributes["value"]
|
31
|
+
@value = attributes["value"]
|
32
|
+
|
33
|
+
end
|
34
|
+
if attributes["tax_country_name"]
|
35
|
+
@tax_country_name = attributes["tax_country_name"]
|
36
|
+
|
37
|
+
end
|
38
|
+
if attributes["tax_country_code"]
|
39
|
+
@tax_country_code = attributes["tax_country_code"]
|
40
|
+
|
41
|
+
end
|
42
|
+
if attributes["currency_code"]
|
43
|
+
@currency_code = attributes["currency_code"]
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
def to_body
|
51
|
+
body = {}
|
52
|
+
self.class.attribute_map.each_pair do |key, value|
|
53
|
+
v = self.send(key)
|
54
|
+
unless v.nil?
|
55
|
+
if v.is_a?(Array)
|
56
|
+
array = Array.new
|
57
|
+
v.each do |item|
|
58
|
+
if item.respond_to?("to_body".to_sym)
|
59
|
+
array.push item.to_body
|
60
|
+
else
|
61
|
+
array.push item
|
62
|
+
end
|
63
|
+
end
|
64
|
+
body[value] = array
|
65
|
+
else
|
66
|
+
if v.respond_to?("to_body".to_sym)
|
67
|
+
body[value] = v.to_body
|
68
|
+
else
|
69
|
+
body[value] = v
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
body
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# Copyright 2014-2015 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
|
+
class ByStatus
|
14
|
+
attr_accessor :_n, :_c
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:_n => :N,
|
20
|
+
:_c => :C
|
21
|
+
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize(attributes = {})
|
26
|
+
return if attributes.empty?
|
27
|
+
# Morph attribute keys into undescored rubyish style
|
28
|
+
if attributes["_n"]
|
29
|
+
if (value = attributes["N"]).is_a?(Array)
|
30
|
+
@_n = value.map{ |v| N.new(v) }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
if attributes["_c"]
|
34
|
+
if (value = attributes["C"]).is_a?(Array)
|
35
|
+
@_c = value.map{ |v| C.new(v) }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_body
|
43
|
+
body = {}
|
44
|
+
self.class.attribute_map.each_pair do |key, value|
|
45
|
+
v = self.send(key)
|
46
|
+
unless v.nil?
|
47
|
+
if v.is_a?(Array)
|
48
|
+
array = Array.new
|
49
|
+
v.each do |item|
|
50
|
+
if item.respond_to?("to_body".to_sym)
|
51
|
+
array.push item.to_body
|
52
|
+
else
|
53
|
+
array.push item
|
54
|
+
end
|
55
|
+
end
|
56
|
+
body[value] = array
|
57
|
+
else
|
58
|
+
if v.respond_to?("to_body".to_sym)
|
59
|
+
body[value] = v.to_body
|
60
|
+
else
|
61
|
+
body[value] = v
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
body
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Copyright 2014-2015 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
|
+
class ByTaxationType
|
14
|
+
attr_accessor :taxed_count, :deducted_count, :transactions_count, :eu_b2b, :eu_taxed
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:taxed_count => :taxed_count,
|
20
|
+
:deducted_count => :deducted_count,
|
21
|
+
:transactions_count => :transactions_count,
|
22
|
+
:eu_b2b => :eu_b2b,
|
23
|
+
:eu_taxed => :eu_taxed
|
24
|
+
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(attributes = {})
|
29
|
+
return if attributes.empty?
|
30
|
+
# Morph attribute keys into undescored rubyish style
|
31
|
+
if attributes["taxed_count"]
|
32
|
+
@taxed_count = attributes["taxed_count"]
|
33
|
+
|
34
|
+
end
|
35
|
+
if attributes["deducted_count"]
|
36
|
+
@deducted_count = attributes["deducted_count"]
|
37
|
+
|
38
|
+
end
|
39
|
+
if attributes["transactions_count"]
|
40
|
+
@transactions_count = attributes["transactions_count"]
|
41
|
+
|
42
|
+
end
|
43
|
+
if attributes["eu_b2b"]
|
44
|
+
@eu_b2b = attributes["eu_b2b"]
|
45
|
+
|
46
|
+
end
|
47
|
+
if attributes["eu_taxed"]
|
48
|
+
@eu_taxed = attributes["eu_taxed"]
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
def to_body
|
56
|
+
body = {}
|
57
|
+
self.class.attribute_map.each_pair do |key, value|
|
58
|
+
v = self.send(key)
|
59
|
+
unless v.nil?
|
60
|
+
if v.is_a?(Array)
|
61
|
+
array = Array.new
|
62
|
+
v.each do |item|
|
63
|
+
if item.respond_to?("to_body".to_sym)
|
64
|
+
array.push item.to_body
|
65
|
+
else
|
66
|
+
array.push item
|
67
|
+
end
|
68
|
+
end
|
69
|
+
body[value] = array
|
70
|
+
else
|
71
|
+
if v.respond_to?("to_body".to_sym)
|
72
|
+
body[value] = v.to_body
|
73
|
+
else
|
74
|
+
body[value] = v
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
body
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# Copyright 2014-2015 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
|
+
class C
|
14
|
+
attr_accessor :day_raw, :value, :status, :day
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:day_raw => :day_raw,
|
20
|
+
:value => :value,
|
21
|
+
:status => :status,
|
22
|
+
:day => :day
|
23
|
+
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize(attributes = {})
|
28
|
+
return if attributes.empty?
|
29
|
+
# Morph attribute keys into undescored rubyish style
|
30
|
+
if attributes["day_raw"]
|
31
|
+
@day_raw = attributes["day_raw"]
|
32
|
+
|
33
|
+
end
|
34
|
+
if attributes["value"]
|
35
|
+
@value = attributes["value"]
|
36
|
+
|
37
|
+
end
|
38
|
+
if attributes["status"]
|
39
|
+
@status = attributes["status"]
|
40
|
+
|
41
|
+
end
|
42
|
+
if attributes["day"]
|
43
|
+
@day = attributes["day"]
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
def to_body
|
51
|
+
body = {}
|
52
|
+
self.class.attribute_map.each_pair do |key, value|
|
53
|
+
v = self.send(key)
|
54
|
+
unless v.nil?
|
55
|
+
if v.is_a?(Array)
|
56
|
+
array = Array.new
|
57
|
+
v.each do |item|
|
58
|
+
if item.respond_to?("to_body".to_sym)
|
59
|
+
array.push item.to_body
|
60
|
+
else
|
61
|
+
array.push item
|
62
|
+
end
|
63
|
+
end
|
64
|
+
body[value] = array
|
65
|
+
else
|
66
|
+
if v.respond_to?("to_body".to_sym)
|
67
|
+
body[value] = v.to_body
|
68
|
+
else
|
69
|
+
body[value] = v
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
body
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|