taxamo 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/taxamo.rb +143 -2
- data/lib/taxamo/models/createrefundin.rb +7 -2
- data/lib/taxamo/models/emailrefundin.rb +62 -0
- data/lib/taxamo/models/emailrefundout.rb +62 -0
- data/lib/taxamo/models/getdomesticsummaryreportout.rb +122 -0
- data/lib/taxamo/models/geteuviesreportout.rb +78 -0
- data/lib/taxamo/models/listrefundsout.rb +63 -0
- data/lib/taxamo/models/refunds.rb +107 -0
- data/lib/taxamo/version.rb +1 -1
- data/test/taxamo/transactions_api_test.rb +17 -14
- metadata +25 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c9a6a5fdbac7a227565124a64ae8606d7b3c5c2
|
4
|
+
data.tar.gz: fdcae7d07f0b969b39bbf682597fd18fd8118213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e683c83e30e62cd462b8a38739b7f693929da2fa0677c761c8b78d17c3f91623b090a5d388c1b38090f45a6a2491d8c0a2c540b245844c5485c96d7582da31c
|
7
|
+
data.tar.gz: 6bd0eaae58036ac5a55040ceabf797dee571d7de53fb8babdcc62405d94ffe0e4cdbc176b00b8d96ca958555fab84d3080726934c78cee1f48a5c6fa95b9f958
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ To install it, just fetch this repository and issue the following command:
|
|
8
8
|
|
9
9
|
```shell
|
10
10
|
$ gem build taxamo.gemspec
|
11
|
-
$ gem install taxamo-1.
|
11
|
+
$ gem install taxamo-1.1.1.gem
|
12
12
|
```
|
13
13
|
|
14
14
|
Alternatively, add the following line to your project's `Gemfile` file:
|
@@ -19,6 +19,9 @@ gem "taxamo", github: "taxamo/taxamo-ruby"
|
|
19
19
|
|
20
20
|
## Changes
|
21
21
|
|
22
|
+
1.1.1 (2016-05-17):
|
23
|
+
* bring API client up-to-date with current api endpoints. Please note that the following methods have their arity changed: `list_transactions`
|
24
|
+
|
22
25
|
1.1.0 (2015-10-13):
|
23
26
|
* update API client with multiple region support. Please note that the following methods have their arity changed:
|
24
27
|
`list_transactions`, `calculate_simple_tax`, `get_refunds`, `get_settlement`, `get_settlement_summary`
|
data/lib/taxamo.rb
CHANGED
@@ -69,6 +69,31 @@ module Taxamo
|
|
69
69
|
|
70
70
|
end
|
71
71
|
|
72
|
+
def list_refunds (key,opts={})
|
73
|
+
query_param_keys = []
|
74
|
+
|
75
|
+
# verify existence of params
|
76
|
+
raise "key is required" if key.nil?
|
77
|
+
# set default values and merge with input
|
78
|
+
options = {
|
79
|
+
:key => key}.merge(opts)
|
80
|
+
|
81
|
+
#resource path
|
82
|
+
path = "/api/v1/transactions/{key}/refunds".sub('{format}','json').sub('{' + 'key' + '}', escapeString(key))
|
83
|
+
|
84
|
+
|
85
|
+
# pull querystring keys from options
|
86
|
+
queryopts = options.select do |key,value|
|
87
|
+
query_param_keys.include? key
|
88
|
+
end
|
89
|
+
|
90
|
+
headers = nil
|
91
|
+
post_body = nil
|
92
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
93
|
+
ListRefundsOut.new(response)
|
94
|
+
|
95
|
+
end
|
96
|
+
|
72
97
|
def create_payment (key,body,opts={})
|
73
98
|
query_param_keys = []
|
74
99
|
|
@@ -215,6 +240,55 @@ module Taxamo
|
|
215
240
|
|
216
241
|
end
|
217
242
|
|
243
|
+
def email_refund (key,refund_note_number,body,opts={})
|
244
|
+
query_param_keys = []
|
245
|
+
|
246
|
+
# verify existence of params
|
247
|
+
raise "key is required" if key.nil?
|
248
|
+
raise "refund_note_number is required" if refund_note_number.nil?
|
249
|
+
raise "body is required" if body.nil?
|
250
|
+
# set default values and merge with input
|
251
|
+
options = {
|
252
|
+
:key => key,
|
253
|
+
:refund_note_number => refund_note_number,
|
254
|
+
:body => body}.merge(opts)
|
255
|
+
|
256
|
+
#resource path
|
257
|
+
path = "/api/v1/transactions/{key}/invoice/refunds/{refund_note_number}/send_email".sub('{format}','json').sub('{' + 'key' + '}', escapeString(key)).sub('{' + 'refund_note_number' + '}', escapeString(refund_note_number))
|
258
|
+
|
259
|
+
|
260
|
+
# pull querystring keys from options
|
261
|
+
queryopts = options.select do |key,value|
|
262
|
+
query_param_keys.include? key
|
263
|
+
end
|
264
|
+
|
265
|
+
headers = nil
|
266
|
+
post_body = nil
|
267
|
+
if body != nil
|
268
|
+
if body.is_a?(Array)
|
269
|
+
array = Array.new
|
270
|
+
body.each do |item|
|
271
|
+
if item.respond_to?("to_body".to_sym)
|
272
|
+
array.push item.to_body
|
273
|
+
else
|
274
|
+
array.push item
|
275
|
+
end
|
276
|
+
end
|
277
|
+
post_body = array
|
278
|
+
|
279
|
+
else
|
280
|
+
if body.respond_to?("to_body".to_sym)
|
281
|
+
post_body = body.to_body
|
282
|
+
else
|
283
|
+
post_body = body
|
284
|
+
end
|
285
|
+
end
|
286
|
+
end
|
287
|
+
response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
288
|
+
EmailRefundOut.new(response)
|
289
|
+
|
290
|
+
end
|
291
|
+
|
218
292
|
def create_transaction (body,opts={})
|
219
293
|
query_param_keys = []
|
220
294
|
|
@@ -451,8 +525,8 @@ module Taxamo
|
|
451
525
|
|
452
526
|
end
|
453
527
|
|
454
|
-
def list_transactions (filter_text,offset,key_or_custom_id,currency_code,order_date_to,sort_reverse,limit,invoice_number,statuses,order_date_from,total_amount_greater_than,format,total_amount_less_than,tax_country_code,opts={})
|
455
|
-
query_param_keys = [:filter_text,:offset,:key_or_custom_id,:currency_code,:order_date_to,:sort_reverse,:limit,:invoice_number,:statuses,:order_date_from,:total_amount_greater_than,:format,:total_amount_less_than,:tax_country_code]
|
528
|
+
def list_transactions (filter_text,offset,key_or_custom_id,currency_code,order_date_to,sort_reverse,limit,invoice_number,statuses,order_date_from,total_amount_greater_than,format,total_amount_less_than,tax_country_code,original_transaction_key,opts={})
|
529
|
+
query_param_keys = [:filter_text,:offset,:key_or_custom_id,:currency_code,:order_date_to,:sort_reverse,:limit,:invoice_number,:statuses,:original_transaction_key,:order_date_from,:total_amount_greater_than,:format,:total_amount_less_than,:tax_country_code]
|
456
530
|
|
457
531
|
# set default values and merge with input
|
458
532
|
options = {
|
@@ -465,6 +539,7 @@ module Taxamo
|
|
465
539
|
:limit => limit,
|
466
540
|
:invoice_number => invoice_number,
|
467
541
|
:statuses => statuses,
|
542
|
+
:original_transaction_key => original_transaction_key,
|
468
543
|
:order_date_from => order_date_from,
|
469
544
|
:total_amount_greater_than => total_amount_greater_than,
|
470
545
|
:format => format,
|
@@ -808,6 +883,72 @@ module Taxamo
|
|
808
883
|
|
809
884
|
end
|
810
885
|
|
886
|
+
def get_eu_vies_report (format,transformation,eu_country_code,currency_code,tax_id,start_month,end_month,fx_date_type,opts={})
|
887
|
+
query_param_keys = [:format,:transformation,:eu_country_code,:currency_code,:tax_id,:start_month,:end_month,:fx_date_type]
|
888
|
+
|
889
|
+
# verify existence of params
|
890
|
+
raise "eu_country_code is required" if eu_country_code.nil?
|
891
|
+
raise "start_month is required" if start_month.nil?
|
892
|
+
raise "end_month is required" if end_month.nil?
|
893
|
+
# set default values and merge with input
|
894
|
+
options = {
|
895
|
+
:format => format,
|
896
|
+
:transformation => transformation,
|
897
|
+
:eu_country_code => eu_country_code,
|
898
|
+
:currency_code => currency_code,
|
899
|
+
:tax_id => tax_id,
|
900
|
+
:start_month => start_month,
|
901
|
+
:end_month => end_month,
|
902
|
+
:fx_date_type => fx_date_type}.merge(opts)
|
903
|
+
|
904
|
+
#resource path
|
905
|
+
path = "/api/v1/reports/eu/vies".sub('{format}','json')
|
906
|
+
|
907
|
+
|
908
|
+
# pull querystring keys from options
|
909
|
+
queryopts = options.select do |key,value|
|
910
|
+
query_param_keys.include? key
|
911
|
+
end
|
912
|
+
|
913
|
+
headers = nil
|
914
|
+
post_body = nil
|
915
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
916
|
+
GetEuViesReportOut.new(response)
|
917
|
+
|
918
|
+
end
|
919
|
+
|
920
|
+
def get_domestic_summary_report (format,country_code,currency_code,start_month,end_month,fx_date_type,opts={})
|
921
|
+
query_param_keys = [:format,:country_code,:currency_code,:start_month,:end_month,:fx_date_type]
|
922
|
+
|
923
|
+
# verify existence of params
|
924
|
+
raise "country_code is required" if country_code.nil?
|
925
|
+
raise "start_month is required" if start_month.nil?
|
926
|
+
raise "end_month is required" if end_month.nil?
|
927
|
+
# set default values and merge with input
|
928
|
+
options = {
|
929
|
+
:format => format,
|
930
|
+
:country_code => country_code,
|
931
|
+
:currency_code => currency_code,
|
932
|
+
:start_month => start_month,
|
933
|
+
:end_month => end_month,
|
934
|
+
:fx_date_type => fx_date_type}.merge(opts)
|
935
|
+
|
936
|
+
#resource path
|
937
|
+
path = "/api/v1/reports/domestic/summary".sub('{format}','json')
|
938
|
+
|
939
|
+
|
940
|
+
# pull querystring keys from options
|
941
|
+
queryopts = options.select do |key,value|
|
942
|
+
query_param_keys.include? key
|
943
|
+
end
|
944
|
+
|
945
|
+
headers = nil
|
946
|
+
post_body = nil
|
947
|
+
response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
|
948
|
+
GetDomesticSummaryReportOut.new(response)
|
949
|
+
|
950
|
+
end
|
951
|
+
|
811
952
|
def get_refunds (format,moss_country_code,tax_region,date_from,opts={})
|
812
953
|
query_param_keys = [:format,:moss_country_code,:tax_region,:date_from]
|
813
954
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# limitations under the License.
|
12
12
|
|
13
13
|
class CreateRefundIn
|
14
|
-
attr_accessor :line_key, :custom_id, :amount, :total_amount
|
14
|
+
attr_accessor :line_key, :custom_id, :amount, :total_amount, :refund_reason
|
15
15
|
|
16
16
|
# :internal => :external
|
17
17
|
def self.attribute_map
|
@@ -19,7 +19,8 @@ class CreateRefundIn
|
|
19
19
|
:line_key => :line_key,
|
20
20
|
:custom_id => :custom_id,
|
21
21
|
:amount => :amount,
|
22
|
-
:total_amount => :total_amount
|
22
|
+
:total_amount => :total_amount,
|
23
|
+
:refund_reason => :refund_reason
|
23
24
|
|
24
25
|
}
|
25
26
|
end
|
@@ -43,6 +44,10 @@ class CreateRefundIn
|
|
43
44
|
@total_amount = attributes["total_amount"]
|
44
45
|
|
45
46
|
end
|
47
|
+
if attributes["refund_reason"]
|
48
|
+
@refund_reason = attributes["refund_reason"]
|
49
|
+
|
50
|
+
end
|
46
51
|
|
47
52
|
|
48
53
|
end
|
@@ -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 EmailRefundIn
|
14
|
+
attr_accessor :buyer_email
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:buyer_email => :buyer_email
|
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["buyer_email"]
|
28
|
+
@buyer_email = attributes["buyer_email"]
|
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,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 EmailRefundOut
|
14
|
+
attr_accessor :success
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:success => :success
|
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["success"]
|
28
|
+
@success = attributes["success"]
|
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,122 @@
|
|
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 GetDomesticSummaryReportOut
|
14
|
+
attr_accessor :end_date, :domestic_refunds_amount, :currency_code, :global_refunds_tax_amount, :domestic_refunds_tax_amount, :eu_tax_deducted_refunds, :global_sales_amount, :global_refunds_amount, :global_sales_tax_amount, :eu_tax_deducted_sales, :start_date, :domestic_tax_amount, :domestic_sales_amount
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:end_date => :end_date,
|
20
|
+
:domestic_refunds_amount => :domestic_refunds_amount,
|
21
|
+
:currency_code => :currency_code,
|
22
|
+
:global_refunds_tax_amount => :global_refunds_tax_amount,
|
23
|
+
:domestic_refunds_tax_amount => :domestic_refunds_tax_amount,
|
24
|
+
:eu_tax_deducted_refunds => :eu_tax_deducted_refunds,
|
25
|
+
:global_sales_amount => :global_sales_amount,
|
26
|
+
:global_refunds_amount => :global_refunds_amount,
|
27
|
+
:global_sales_tax_amount => :global_sales_tax_amount,
|
28
|
+
:eu_tax_deducted_sales => :eu_tax_deducted_sales,
|
29
|
+
:start_date => :start_date,
|
30
|
+
:domestic_tax_amount => :domestic_tax_amount,
|
31
|
+
:domestic_sales_amount => :domestic_sales_amount
|
32
|
+
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return if attributes.empty?
|
38
|
+
# Morph attribute keys into undescored rubyish style
|
39
|
+
if attributes["end_date"]
|
40
|
+
@end_date = attributes["end_date"]
|
41
|
+
|
42
|
+
end
|
43
|
+
if attributes["domestic_refunds_amount"]
|
44
|
+
@domestic_refunds_amount = attributes["domestic_refunds_amount"]
|
45
|
+
|
46
|
+
end
|
47
|
+
if attributes["currency_code"]
|
48
|
+
@currency_code = attributes["currency_code"]
|
49
|
+
|
50
|
+
end
|
51
|
+
if attributes["global_refunds_tax_amount"]
|
52
|
+
@global_refunds_tax_amount = attributes["global_refunds_tax_amount"]
|
53
|
+
|
54
|
+
end
|
55
|
+
if attributes["domestic_refunds_tax_amount"]
|
56
|
+
@domestic_refunds_tax_amount = attributes["domestic_refunds_tax_amount"]
|
57
|
+
|
58
|
+
end
|
59
|
+
if attributes["eu_tax_deducted_refunds"]
|
60
|
+
@eu_tax_deducted_refunds = attributes["eu_tax_deducted_refunds"]
|
61
|
+
|
62
|
+
end
|
63
|
+
if attributes["global_sales_amount"]
|
64
|
+
@global_sales_amount = attributes["global_sales_amount"]
|
65
|
+
|
66
|
+
end
|
67
|
+
if attributes["global_refunds_amount"]
|
68
|
+
@global_refunds_amount = attributes["global_refunds_amount"]
|
69
|
+
|
70
|
+
end
|
71
|
+
if attributes["global_sales_tax_amount"]
|
72
|
+
@global_sales_tax_amount = attributes["global_sales_tax_amount"]
|
73
|
+
|
74
|
+
end
|
75
|
+
if attributes["eu_tax_deducted_sales"]
|
76
|
+
@eu_tax_deducted_sales = attributes["eu_tax_deducted_sales"]
|
77
|
+
|
78
|
+
end
|
79
|
+
if attributes["start_date"]
|
80
|
+
@start_date = attributes["start_date"]
|
81
|
+
|
82
|
+
end
|
83
|
+
if attributes["domestic_tax_amount"]
|
84
|
+
@domestic_tax_amount = attributes["domestic_tax_amount"]
|
85
|
+
|
86
|
+
end
|
87
|
+
if attributes["domestic_sales_amount"]
|
88
|
+
@domestic_sales_amount = attributes["domestic_sales_amount"]
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
end
|
94
|
+
|
95
|
+
def to_body
|
96
|
+
body = {}
|
97
|
+
self.class.attribute_map.each_pair do |key, value|
|
98
|
+
v = self.send(key)
|
99
|
+
unless v.nil?
|
100
|
+
if v.is_a?(Array)
|
101
|
+
array = Array.new
|
102
|
+
v.each do |item|
|
103
|
+
if item.respond_to?("to_body".to_sym)
|
104
|
+
array.push item.to_body
|
105
|
+
else
|
106
|
+
array.push item
|
107
|
+
end
|
108
|
+
end
|
109
|
+
body[value] = array
|
110
|
+
else
|
111
|
+
if v.respond_to?("to_body".to_sym)
|
112
|
+
body[value] = v.to_body
|
113
|
+
else
|
114
|
+
body[value] = v
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
body
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
@@ -0,0 +1,78 @@
|
|
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 GetEuViesReportOut
|
14
|
+
attr_accessor :report, :currency_code, :start_date, :end_date
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:report => :report,
|
20
|
+
:currency_code => :currency_code,
|
21
|
+
:start_date => :start_date,
|
22
|
+
:end_date => :end_date
|
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["report"]
|
31
|
+
if (value = attributes["report"]).is_a?(Array)
|
32
|
+
@report = value.map{ |v| Report.new(v) }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
if attributes["currency_code"]
|
36
|
+
@currency_code = attributes["currency_code"]
|
37
|
+
|
38
|
+
end
|
39
|
+
if attributes["start_date"]
|
40
|
+
@start_date = attributes["start_date"]
|
41
|
+
|
42
|
+
end
|
43
|
+
if attributes["end_date"]
|
44
|
+
@end_date = attributes["end_date"]
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_body
|
52
|
+
body = {}
|
53
|
+
self.class.attribute_map.each_pair do |key, value|
|
54
|
+
v = self.send(key)
|
55
|
+
unless v.nil?
|
56
|
+
if v.is_a?(Array)
|
57
|
+
array = Array.new
|
58
|
+
v.each do |item|
|
59
|
+
if item.respond_to?("to_body".to_sym)
|
60
|
+
array.push item.to_body
|
61
|
+
else
|
62
|
+
array.push item
|
63
|
+
end
|
64
|
+
end
|
65
|
+
body[value] = array
|
66
|
+
else
|
67
|
+
if v.respond_to?("to_body".to_sym)
|
68
|
+
body[value] = v.to_body
|
69
|
+
else
|
70
|
+
body[value] = v
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
body
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
@@ -0,0 +1,63 @@
|
|
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 ListRefundsOut
|
14
|
+
attr_accessor :refunds
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:refunds => :refunds
|
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["refunds"]
|
28
|
+
if (value = attributes["refunds"]).is_a?(Array)
|
29
|
+
@refunds = value.map{ |v| Refunds.new(v) }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_body
|
37
|
+
body = {}
|
38
|
+
self.class.attribute_map.each_pair do |key, value|
|
39
|
+
v = self.send(key)
|
40
|
+
unless v.nil?
|
41
|
+
if v.is_a?(Array)
|
42
|
+
array = Array.new
|
43
|
+
v.each do |item|
|
44
|
+
if item.respond_to?("to_body".to_sym)
|
45
|
+
array.push item.to_body
|
46
|
+
else
|
47
|
+
array.push item
|
48
|
+
end
|
49
|
+
end
|
50
|
+
body[value] = array
|
51
|
+
else
|
52
|
+
if v.respond_to?("to_body".to_sym)
|
53
|
+
body[value] = v.to_body
|
54
|
+
else
|
55
|
+
body[value] = v
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
body
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
@@ -0,0 +1,107 @@
|
|
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 Refunds
|
14
|
+
attr_accessor :refund_note_url, :refund_note_number, :line_key, :refund_timestamp, :amount, :informative, :tax_amount, :tax_rate, :total_amount, :refund_reason
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:refund_note_url => :refund_note_url,
|
20
|
+
:refund_note_number => :refund_note_number,
|
21
|
+
:line_key => :line_key,
|
22
|
+
:refund_timestamp => :refund_timestamp,
|
23
|
+
:amount => :amount,
|
24
|
+
:informative => :informative,
|
25
|
+
:tax_amount => :tax_amount,
|
26
|
+
:tax_rate => :tax_rate,
|
27
|
+
:total_amount => :total_amount,
|
28
|
+
:refund_reason => :refund_reason
|
29
|
+
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize(attributes = {})
|
34
|
+
return if attributes.empty?
|
35
|
+
# Morph attribute keys into undescored rubyish style
|
36
|
+
if attributes["refund_note_url"]
|
37
|
+
@refund_note_url = attributes["refund_note_url"]
|
38
|
+
|
39
|
+
end
|
40
|
+
if attributes["refund_note_number"]
|
41
|
+
@refund_note_number = attributes["refund_note_number"]
|
42
|
+
|
43
|
+
end
|
44
|
+
if attributes["line_key"]
|
45
|
+
@line_key = attributes["line_key"]
|
46
|
+
|
47
|
+
end
|
48
|
+
if attributes["refund_timestamp"]
|
49
|
+
@refund_timestamp = attributes["refund_timestamp"]
|
50
|
+
|
51
|
+
end
|
52
|
+
if attributes["amount"]
|
53
|
+
@amount = attributes["amount"]
|
54
|
+
|
55
|
+
end
|
56
|
+
if attributes["informative"]
|
57
|
+
@informative = attributes["informative"]
|
58
|
+
|
59
|
+
end
|
60
|
+
if attributes["tax_amount"]
|
61
|
+
@tax_amount = attributes["tax_amount"]
|
62
|
+
|
63
|
+
end
|
64
|
+
if attributes["tax_rate"]
|
65
|
+
@tax_rate = attributes["tax_rate"]
|
66
|
+
|
67
|
+
end
|
68
|
+
if attributes["total_amount"]
|
69
|
+
@total_amount = attributes["total_amount"]
|
70
|
+
|
71
|
+
end
|
72
|
+
if attributes["refund_reason"]
|
73
|
+
@refund_reason = attributes["refund_reason"]
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
def to_body
|
81
|
+
body = {}
|
82
|
+
self.class.attribute_map.each_pair do |key, value|
|
83
|
+
v = self.send(key)
|
84
|
+
unless v.nil?
|
85
|
+
if v.is_a?(Array)
|
86
|
+
array = Array.new
|
87
|
+
v.each do |item|
|
88
|
+
if item.respond_to?("to_body".to_sym)
|
89
|
+
array.push item.to_body
|
90
|
+
else
|
91
|
+
array.push item
|
92
|
+
end
|
93
|
+
end
|
94
|
+
body[value] = array
|
95
|
+
else
|
96
|
+
if v.respond_to?("to_body".to_sym)
|
97
|
+
body[value] = v.to_body
|
98
|
+
else
|
99
|
+
body[value] = v
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
body
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
data/lib/taxamo/version.rb
CHANGED
@@ -120,17 +120,18 @@ class TransactionsApiTest < Test::Unit::TestCase
|
|
120
120
|
resp = Taxamo.list_transactions(nil, #filter_text
|
121
121
|
0, #offset
|
122
122
|
nil, #key_or_custom_id
|
123
|
-
|
124
|
-
|
123
|
+
nil, #currency_code,
|
124
|
+
nil, #order_date_to,
|
125
125
|
'true', #sort_reverse
|
126
126
|
100, #limit
|
127
127
|
nil,#invoice_number
|
128
128
|
'C', #statuses
|
129
|
-
|
129
|
+
nil, #order_date_from
|
130
130
|
nil, #total_amount_greater_than
|
131
131
|
nil, #format,
|
132
132
|
nil, #total_amount_less_than
|
133
|
-
nil #tax_country_code
|
133
|
+
nil, #tax_country_code
|
134
|
+
nil #original_transaction_key
|
134
135
|
)
|
135
136
|
|
136
137
|
assert_true resp.transactions.length > 0
|
@@ -143,19 +144,20 @@ class TransactionsApiTest < Test::Unit::TestCase
|
|
143
144
|
resp = Taxamo.list_transactions(nil, #filter_text
|
144
145
|
0, #offset
|
145
146
|
nil, #key_or_custom_id
|
146
|
-
|
147
|
-
|
147
|
+
nil, #currency_code,
|
148
|
+
nil, #order_date_to,
|
148
149
|
'true', #sort_reverse
|
149
150
|
10, #limit
|
150
151
|
nil,#invoice_number
|
151
152
|
'N', #statuses
|
152
|
-
|
153
|
+
nil, #order_date_from
|
153
154
|
nil, #total_amount_greater_than
|
154
155
|
nil, #format,
|
155
156
|
nil, #total_amount_less_than
|
156
|
-
nil #tax_country_code
|
157
|
+
nil, #tax_country_code
|
158
|
+
nil #original_transaction_key
|
157
159
|
)
|
158
|
-
assert_true resp.transactions.length
|
160
|
+
assert_true resp.transactions.length != 0
|
159
161
|
|
160
162
|
end
|
161
163
|
|
@@ -291,17 +293,18 @@ class TransactionsApiTest < Test::Unit::TestCase
|
|
291
293
|
resp = Taxamo.list_transactions( nil, #filter_text
|
292
294
|
0, #offset
|
293
295
|
nil, #key_or_custom_id
|
294
|
-
|
295
|
-
|
296
|
+
nil, #currency_code,
|
297
|
+
nil, #order_date_to,
|
296
298
|
'true', #sort_reverse
|
297
299
|
10, #limit
|
298
300
|
nil,#invoice_number
|
299
301
|
'N', #statuses
|
300
|
-
|
302
|
+
nil, #order_date_from
|
301
303
|
nil, #total_amount_greater_than
|
302
304
|
nil, #format,
|
303
305
|
nil, #total_amount_less_than
|
304
|
-
nil #tax_country_code
|
306
|
+
nil, #tax_country_code
|
307
|
+
nil #original_transaction_key
|
305
308
|
)
|
306
309
|
|
307
310
|
assert_false resp.transactions[0].key.nil?
|
@@ -314,4 +317,4 @@ class TransactionsApiTest < Test::Unit::TestCase
|
|
314
317
|
|
315
318
|
end
|
316
319
|
|
317
|
-
end
|
320
|
+
end
|
metadata
CHANGED
@@ -1,111 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taxamo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.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:
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: typhoeus
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.6.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.6.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: require_all
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 1.3.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.3.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mocha
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.13.2
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.13.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: shoulda
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 3.4.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 3.4.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: test-unit
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
description: Taxamo provides a real-time Software as a Service (SaaS) solution for
|
@@ -155,11 +155,15 @@ files:
|
|
155
155
|
- lib/taxamo/models/customfields.rb
|
156
156
|
- lib/taxamo/models/emailinvoicein.rb
|
157
157
|
- lib/taxamo/models/emailinvoiceout.rb
|
158
|
+
- lib/taxamo/models/emailrefundin.rb
|
159
|
+
- lib/taxamo/models/emailrefundout.rb
|
158
160
|
- lib/taxamo/models/evidence.rb
|
159
161
|
- lib/taxamo/models/evidenceschema.rb
|
160
162
|
- lib/taxamo/models/getcountriesdictout.rb
|
161
163
|
- lib/taxamo/models/getcurrenciesdictout.rb
|
162
164
|
- lib/taxamo/models/getdailysettlementstatsout.rb
|
165
|
+
- lib/taxamo/models/getdomesticsummaryreportout.rb
|
166
|
+
- lib/taxamo/models/geteuviesreportout.rb
|
163
167
|
- lib/taxamo/models/getproducttypesdictout.rb
|
164
168
|
- lib/taxamo/models/getrefundsout.rb
|
165
169
|
- lib/taxamo/models/getsettlementout.rb
|
@@ -174,12 +178,14 @@ files:
|
|
174
178
|
- lib/taxamo/models/inputtransactionupdate.rb
|
175
179
|
- lib/taxamo/models/invoiceaddress.rb
|
176
180
|
- lib/taxamo/models/listpaymentsout.rb
|
181
|
+
- lib/taxamo/models/listrefundsout.rb
|
177
182
|
- lib/taxamo/models/listtransactionsout.rb
|
178
183
|
- lib/taxamo/models/locategivenipout.rb
|
179
184
|
- lib/taxamo/models/locatemyipout.rb
|
180
185
|
- lib/taxamo/models/n.rb
|
181
186
|
- lib/taxamo/models/payments.rb
|
182
187
|
- lib/taxamo/models/producttypeschema.rb
|
188
|
+
- lib/taxamo/models/refunds.rb
|
183
189
|
- lib/taxamo/models/report.rb
|
184
190
|
- lib/taxamo/models/settlementdailystatsschema.rb
|
185
191
|
- lib/taxamo/models/storagerequiredfields.rb
|
@@ -214,17 +220,17 @@ require_paths:
|
|
214
220
|
- lib
|
215
221
|
required_ruby_version: !ruby/object:Gem::Requirement
|
216
222
|
requirements:
|
217
|
-
- -
|
223
|
+
- - '>='
|
218
224
|
- !ruby/object:Gem::Version
|
219
225
|
version: '0'
|
220
226
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
227
|
requirements:
|
222
|
-
- -
|
228
|
+
- - '>='
|
223
229
|
- !ruby/object:Gem::Version
|
224
230
|
version: '0'
|
225
231
|
requirements: []
|
226
232
|
rubyforge_project:
|
227
|
-
rubygems_version: 2.
|
233
|
+
rubygems_version: 2.0.14.1
|
228
234
|
signing_key:
|
229
235
|
specification_version: 4
|
230
236
|
summary: Ruby bindings for the Taxamo API
|