taxamo 1.0.5

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.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE +11 -0
  4. data/README.md +120 -0
  5. data/Rakefile +7 -0
  6. data/lib/monkey.rb +90 -0
  7. data/lib/swagger.rb +93 -0
  8. data/lib/swagger/configuration.rb +21 -0
  9. data/lib/swagger/request.rb +198 -0
  10. data/lib/swagger/response.rb +87 -0
  11. data/lib/taxamo.rb +999 -0
  12. data/lib/taxamo/models/additionalcurrencies.rb +62 -0
  13. data/lib/taxamo/models/additionalcurrency.rb +82 -0
  14. data/lib/taxamo/models/bycountry.rb +77 -0
  15. data/lib/taxamo/models/bystatus.rb +69 -0
  16. data/lib/taxamo/models/bytaxationtype.rb +82 -0
  17. data/lib/taxamo/models/c.rb +77 -0
  18. data/lib/taxamo/models/calculatesimpletaxout.rb +62 -0
  19. data/lib/taxamo/models/calculatetaxin.rb +62 -0
  20. data/lib/taxamo/models/calculatetaxlocationout.rb +97 -0
  21. data/lib/taxamo/models/calculatetaxout.rb +62 -0
  22. data/lib/taxamo/models/canceltransactionout.rb +62 -0
  23. data/lib/taxamo/models/capturepaymentout.rb +62 -0
  24. data/lib/taxamo/models/confirmtransactionin.rb +62 -0
  25. data/lib/taxamo/models/confirmtransactionout.rb +62 -0
  26. data/lib/taxamo/models/countries.rb +112 -0
  27. data/lib/taxamo/models/country.rb +114 -0
  28. data/lib/taxamo/models/countryschema.rb +114 -0
  29. data/lib/taxamo/models/createpaymentin.rb +72 -0
  30. data/lib/taxamo/models/createpaymentout.rb +62 -0
  31. data/lib/taxamo/models/createrefundin.rb +77 -0
  32. data/lib/taxamo/models/createrefundout.rb +77 -0
  33. data/lib/taxamo/models/createsmstokenin.rb +67 -0
  34. data/lib/taxamo/models/createsmstokenout.rb +62 -0
  35. data/lib/taxamo/models/createtransactionin.rb +67 -0
  36. data/lib/taxamo/models/createtransactionout.rb +62 -0
  37. data/lib/taxamo/models/currencyschema.rb +82 -0
  38. data/lib/taxamo/models/customfields.rb +67 -0
  39. data/lib/taxamo/models/emailinvoicein.rb +62 -0
  40. data/lib/taxamo/models/emailinvoiceout.rb +62 -0
  41. data/lib/taxamo/models/evidence.rb +112 -0
  42. data/lib/taxamo/models/evidenceschema.rb +77 -0
  43. data/lib/taxamo/models/getcountriesdictout.rb +63 -0
  44. data/lib/taxamo/models/getcurrenciesdictout.rb +63 -0
  45. data/lib/taxamo/models/getdailysettlementstatsout.rb +63 -0
  46. data/lib/taxamo/models/getproducttypesdictout.rb +63 -0
  47. data/lib/taxamo/models/getrefundsout.rb +63 -0
  48. data/lib/taxamo/models/getsettlementout.rb +83 -0
  49. data/lib/taxamo/models/getsettlementstatsbycountryout.rb +63 -0
  50. data/lib/taxamo/models/getsettlementstatsbytaxationtypeout.rb +62 -0
  51. data/lib/taxamo/models/getsettlementsummaryout.rb +62 -0
  52. data/lib/taxamo/models/gettransactionout.rb +62 -0
  53. data/lib/taxamo/models/gettransactionsstatsout.rb +62 -0
  54. data/lib/taxamo/models/inputtransaction.rb +184 -0
  55. data/lib/taxamo/models/inputtransactionline.rb +133 -0
  56. data/lib/taxamo/models/inputtransactionupdate.rb +184 -0
  57. data/lib/taxamo/models/invoiceaddress.rb +97 -0
  58. data/lib/taxamo/models/listpaymentsout.rb +63 -0
  59. data/lib/taxamo/models/listtransactionsout.rb +63 -0
  60. data/lib/taxamo/models/locategivenipout.rb +72 -0
  61. data/lib/taxamo/models/locatemyipout.rb +72 -0
  62. data/lib/taxamo/models/n.rb +77 -0
  63. data/lib/taxamo/models/payments.rb +72 -0
  64. data/lib/taxamo/models/producttypeschema.rb +62 -0
  65. data/lib/taxamo/models/report.rb +92 -0
  66. data/lib/taxamo/models/settlementdailystatsschema.rb +102 -0
  67. data/lib/taxamo/models/summary.rb +87 -0
  68. data/lib/taxamo/models/transaction.rb +279 -0
  69. data/lib/taxamo/models/transactionlines.rb +163 -0
  70. data/lib/taxamo/models/transactions.rb +279 -0
  71. data/lib/taxamo/models/unconfirmtransactionin.rb +62 -0
  72. data/lib/taxamo/models/unconfirmtransactionout.rb +62 -0
  73. data/lib/taxamo/models/updatetransactionin.rb +62 -0
  74. data/lib/taxamo/models/updatetransactionout.rb +62 -0
  75. data/lib/taxamo/models/validatetaxnumberout.rb +77 -0
  76. data/lib/taxamo/models/verifysmstokenout.rb +62 -0
  77. data/lib/taxamo/version.rb +17 -0
  78. data/taxamo.gemspec +31 -0
  79. data/test/taxamo/connectivity_test.rb +55 -0
  80. data/test/taxamo/tax_test.rb +147 -0
  81. data/test/taxamo/transactions_api_test.rb +308 -0
  82. metadata +226 -0
@@ -0,0 +1,87 @@
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 Summary
14
+ attr_accessor :quarter, :tax_amount, :currency_code, :indicative, :fx_rate_date, :tax_entity_name
15
+
16
+ # :internal => :external
17
+ def self.attribute_map
18
+ {
19
+ :quarter => :quarter,
20
+ :tax_amount => :tax_amount,
21
+ :currency_code => :currency_code,
22
+ :indicative => :indicative,
23
+ :fx_rate_date => :fx_rate_date,
24
+ :tax_entity_name => :tax_entity_name
25
+
26
+ }
27
+ end
28
+
29
+ def initialize(attributes = {})
30
+ return if attributes.empty?
31
+ # Morph attribute keys into undescored rubyish style
32
+ if attributes["quarter"]
33
+ @quarter = attributes["quarter"]
34
+
35
+ end
36
+ if attributes["tax_amount"]
37
+ @tax_amount = attributes["tax_amount"]
38
+
39
+ end
40
+ if attributes["currency_code"]
41
+ @currency_code = attributes["currency_code"]
42
+
43
+ end
44
+ if attributes["indicative"]
45
+ @indicative = attributes["indicative"]
46
+
47
+ end
48
+ if attributes["fx_rate_date"]
49
+ @fx_rate_date = attributes["fx_rate_date"]
50
+
51
+ end
52
+ if attributes["tax_entity_name"]
53
+ @tax_entity_name = attributes["tax_entity_name"]
54
+
55
+ end
56
+
57
+
58
+ end
59
+
60
+ def to_body
61
+ body = {}
62
+ self.class.attribute_map.each_pair do |key, value|
63
+ v = self.send(key)
64
+ unless v.nil?
65
+ if v.is_a?(Array)
66
+ array = Array.new
67
+ v.each do |item|
68
+ if item.respond_to?("to_body".to_sym)
69
+ array.push item.to_body
70
+ else
71
+ array.push item
72
+ end
73
+ end
74
+ body[value] = array
75
+ else
76
+ if v.respond_to?("to_body".to_sym)
77
+ body[value] = v.to_body
78
+ else
79
+ body[value] = v
80
+ end
81
+ end
82
+ end
83
+ end
84
+ body
85
+ end
86
+ end
87
+
@@ -0,0 +1,279 @@
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 Transaction
14
+ attr_accessor :confirm_timestamp, :deducted_tax_amount, :buyer_credit_card_prefix, :custom_data, :buyer_name, :invoice_date, :create_timestamp, :currency_code, :supply_date, :invoice_image_url, :key, :invoice_address, :buyer_tax_number_valid, :verification_token, :tax_supported, :transaction_lines, :buyer_tax_number, :status, :custom_fields, :force_country_code, :countries, :invoice_number, :order_date, :source, :amount, :buyer_ip, :buyer_email, :original_transaction_key, :billing_country_code, :custom_id, :tax_amount, :additional_currencies, :invoice_place, :total_amount, :tax_entity_name, :evidence, :refunded_tax_amount, :manual, :tax_timezone, :description, :test, :tax_deducted, :tax_country_code, :refunded_total_amount
15
+
16
+ # :internal => :external
17
+ def self.attribute_map
18
+ {
19
+ :confirm_timestamp => :confirm_timestamp,
20
+ :deducted_tax_amount => :deducted_tax_amount,
21
+ :buyer_credit_card_prefix => :buyer_credit_card_prefix,
22
+ :custom_data => :custom_data,
23
+ :buyer_name => :buyer_name,
24
+ :invoice_date => :invoice_date,
25
+ :create_timestamp => :create_timestamp,
26
+ :currency_code => :currency_code,
27
+ :supply_date => :supply_date,
28
+ :invoice_image_url => :invoice_image_url,
29
+ :key => :key,
30
+ :invoice_address => :invoice_address,
31
+ :buyer_tax_number_valid => :buyer_tax_number_valid,
32
+ :verification_token => :verification_token,
33
+ :tax_supported => :tax_supported,
34
+ :transaction_lines => :transaction_lines,
35
+ :buyer_tax_number => :buyer_tax_number,
36
+ :status => :status,
37
+ :custom_fields => :custom_fields,
38
+ :force_country_code => :force_country_code,
39
+ :countries => :countries,
40
+ :invoice_number => :invoice_number,
41
+ :order_date => :order_date,
42
+ :source => :source,
43
+ :amount => :amount,
44
+ :buyer_ip => :buyer_ip,
45
+ :buyer_email => :buyer_email,
46
+ :original_transaction_key => :original_transaction_key,
47
+ :billing_country_code => :billing_country_code,
48
+ :custom_id => :custom_id,
49
+ :tax_amount => :tax_amount,
50
+ :additional_currencies => :additional_currencies,
51
+ :invoice_place => :invoice_place,
52
+ :total_amount => :total_amount,
53
+ :tax_entity_name => :tax_entity_name,
54
+ :evidence => :evidence,
55
+ :refunded_tax_amount => :refunded_tax_amount,
56
+ :manual => :manual,
57
+ :tax_timezone => :tax_timezone,
58
+ :description => :description,
59
+ :test => :test,
60
+ :tax_deducted => :tax_deducted,
61
+ :tax_country_code => :tax_country_code,
62
+ :refunded_total_amount => :refunded_total_amount
63
+
64
+ }
65
+ end
66
+
67
+ def initialize(attributes = {})
68
+ return if attributes.empty?
69
+ # Morph attribute keys into undescored rubyish style
70
+ if attributes["confirm_timestamp"]
71
+ @confirm_timestamp = attributes["confirm_timestamp"]
72
+
73
+ end
74
+ if attributes["deducted_tax_amount"]
75
+ @deducted_tax_amount = attributes["deducted_tax_amount"]
76
+
77
+ end
78
+ if attributes["buyer_credit_card_prefix"]
79
+ @buyer_credit_card_prefix = attributes["buyer_credit_card_prefix"]
80
+
81
+ end
82
+ if attributes["custom_data"]
83
+ @custom_data = attributes["custom_data"]
84
+
85
+ end
86
+ if attributes["buyer_name"]
87
+ @buyer_name = attributes["buyer_name"]
88
+
89
+ end
90
+ if attributes["invoice_date"]
91
+ @invoice_date = attributes["invoice_date"]
92
+
93
+ end
94
+ if attributes["create_timestamp"]
95
+ @create_timestamp = attributes["create_timestamp"]
96
+
97
+ end
98
+ if attributes["currency_code"]
99
+ @currency_code = attributes["currency_code"]
100
+
101
+ end
102
+ if attributes["supply_date"]
103
+ @supply_date = attributes["supply_date"]
104
+
105
+ end
106
+ if attributes["invoice_image_url"]
107
+ @invoice_image_url = attributes["invoice_image_url"]
108
+
109
+ end
110
+ if attributes["key"]
111
+ @key = attributes["key"]
112
+
113
+ end
114
+ if attributes["invoice_address"]
115
+ @invoice_address = InvoiceAddress.new(attributes["invoice_address"])
116
+
117
+ end
118
+ if attributes["buyer_tax_number_valid"]
119
+ @buyer_tax_number_valid = attributes["buyer_tax_number_valid"]
120
+
121
+ end
122
+ if attributes["verification_token"]
123
+ @verification_token = attributes["verification_token"]
124
+
125
+ end
126
+ if attributes["tax_supported"]
127
+ @tax_supported = attributes["tax_supported"]
128
+
129
+ end
130
+ if attributes["transaction_lines"]
131
+ if (value = attributes["transaction_lines"]).is_a?(Array)
132
+ @transaction_lines = value.map{ |v| TransactionLines.new(v) }
133
+ end
134
+ end
135
+ if attributes["buyer_tax_number"]
136
+ @buyer_tax_number = attributes["buyer_tax_number"]
137
+
138
+ end
139
+ if attributes["status"]
140
+ @status = attributes["status"]
141
+
142
+ end
143
+ if attributes["custom_fields"]
144
+ if (value = attributes["custom_fields"]).is_a?(Array)
145
+ @custom_fields = value.map{ |v| CustomFields.new(v) }
146
+ end
147
+ end
148
+ if attributes["force_country_code"]
149
+ @force_country_code = attributes["force_country_code"]
150
+
151
+ end
152
+ if attributes["countries"]
153
+ @countries = Countries.new(attributes["countries"])
154
+
155
+ end
156
+ if attributes["invoice_number"]
157
+ @invoice_number = attributes["invoice_number"]
158
+
159
+ end
160
+ if attributes["order_date"]
161
+ @order_date = attributes["order_date"]
162
+
163
+ end
164
+ if attributes["source"]
165
+ @source = attributes["source"]
166
+
167
+ end
168
+ if attributes["amount"]
169
+ @amount = attributes["amount"]
170
+
171
+ end
172
+ if attributes["buyer_ip"]
173
+ @buyer_ip = attributes["buyer_ip"]
174
+
175
+ end
176
+ if attributes["buyer_email"]
177
+ @buyer_email = attributes["buyer_email"]
178
+
179
+ end
180
+ if attributes["original_transaction_key"]
181
+ @original_transaction_key = attributes["original_transaction_key"]
182
+
183
+ end
184
+ if attributes["billing_country_code"]
185
+ @billing_country_code = attributes["billing_country_code"]
186
+
187
+ end
188
+ if attributes["custom_id"]
189
+ @custom_id = attributes["custom_id"]
190
+
191
+ end
192
+ if attributes["tax_amount"]
193
+ @tax_amount = attributes["tax_amount"]
194
+
195
+ end
196
+ if attributes["additional_currencies"]
197
+ @additional_currencies = AdditionalCurrencies.new(attributes["additional_currencies"])
198
+
199
+ end
200
+ if attributes["invoice_place"]
201
+ @invoice_place = attributes["invoice_place"]
202
+
203
+ end
204
+ if attributes["total_amount"]
205
+ @total_amount = attributes["total_amount"]
206
+
207
+ end
208
+ if attributes["tax_entity_name"]
209
+ @tax_entity_name = attributes["tax_entity_name"]
210
+
211
+ end
212
+ if attributes["evidence"]
213
+ @evidence = Evidence.new(attributes["evidence"])
214
+
215
+ end
216
+ if attributes["refunded_tax_amount"]
217
+ @refunded_tax_amount = attributes["refunded_tax_amount"]
218
+
219
+ end
220
+ if attributes["manual"]
221
+ @manual = attributes["manual"]
222
+
223
+ end
224
+ if attributes["tax_timezone"]
225
+ @tax_timezone = attributes["tax_timezone"]
226
+
227
+ end
228
+ if attributes["description"]
229
+ @description = attributes["description"]
230
+
231
+ end
232
+ if attributes["test"]
233
+ @test = attributes["test"]
234
+
235
+ end
236
+ if attributes["tax_deducted"]
237
+ @tax_deducted = attributes["tax_deducted"]
238
+
239
+ end
240
+ if attributes["tax_country_code"]
241
+ @tax_country_code = attributes["tax_country_code"]
242
+
243
+ end
244
+ if attributes["refunded_total_amount"]
245
+ @refunded_total_amount = attributes["refunded_total_amount"]
246
+
247
+ end
248
+
249
+
250
+ end
251
+
252
+ def to_body
253
+ body = {}
254
+ self.class.attribute_map.each_pair do |key, value|
255
+ v = self.send(key)
256
+ unless v.nil?
257
+ if v.is_a?(Array)
258
+ array = Array.new
259
+ v.each do |item|
260
+ if item.respond_to?("to_body".to_sym)
261
+ array.push item.to_body
262
+ else
263
+ array.push item
264
+ end
265
+ end
266
+ body[value] = array
267
+ else
268
+ if v.respond_to?("to_body".to_sym)
269
+ body[value] = v.to_body
270
+ else
271
+ body[value] = v
272
+ end
273
+ end
274
+ end
275
+ end
276
+ body
277
+ end
278
+ end
279
+
@@ -0,0 +1,163 @@
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 TransactionLines
14
+ attr_accessor :product_type, :deducted_tax_amount, :supply_date, :id, :unit_price, :unit_of_measure, :quantity, :custom_fields, :line_key, :tax_name, :product_code, :amount, :custom_id, :informative, :tax_amount, :tax_rate, :additional_currencies, :total_amount, :refunded_tax_amount, :description, :refunded_total_amount
15
+
16
+ # :internal => :external
17
+ def self.attribute_map
18
+ {
19
+ :product_type => :product_type,
20
+ :deducted_tax_amount => :deducted_tax_amount,
21
+ :supply_date => :supply_date,
22
+ :id => :id,
23
+ :unit_price => :unit_price,
24
+ :unit_of_measure => :unit_of_measure,
25
+ :quantity => :quantity,
26
+ :custom_fields => :custom_fields,
27
+ :line_key => :line_key,
28
+ :tax_name => :tax_name,
29
+ :product_code => :product_code,
30
+ :amount => :amount,
31
+ :custom_id => :custom_id,
32
+ :informative => :informative,
33
+ :tax_amount => :tax_amount,
34
+ :tax_rate => :tax_rate,
35
+ :additional_currencies => :additional_currencies,
36
+ :total_amount => :total_amount,
37
+ :refunded_tax_amount => :refunded_tax_amount,
38
+ :description => :description,
39
+ :refunded_total_amount => :refunded_total_amount
40
+
41
+ }
42
+ end
43
+
44
+ def initialize(attributes = {})
45
+ return if attributes.empty?
46
+ # Morph attribute keys into undescored rubyish style
47
+ if attributes["product_type"]
48
+ @product_type = attributes["product_type"]
49
+
50
+ end
51
+ if attributes["deducted_tax_amount"]
52
+ @deducted_tax_amount = attributes["deducted_tax_amount"]
53
+
54
+ end
55
+ if attributes["supply_date"]
56
+ @supply_date = attributes["supply_date"]
57
+
58
+ end
59
+ if attributes["id"]
60
+ @id = attributes["id"]
61
+
62
+ end
63
+ if attributes["unit_price"]
64
+ @unit_price = attributes["unit_price"]
65
+
66
+ end
67
+ if attributes["unit_of_measure"]
68
+ @unit_of_measure = attributes["unit_of_measure"]
69
+
70
+ end
71
+ if attributes["quantity"]
72
+ @quantity = attributes["quantity"]
73
+
74
+ end
75
+ if attributes["custom_fields"]
76
+ if (value = attributes["custom_fields"]).is_a?(Array)
77
+ @custom_fields = value.map{ |v| CustomFields.new(v) }
78
+ end
79
+ end
80
+ if attributes["line_key"]
81
+ @line_key = attributes["line_key"]
82
+
83
+ end
84
+ if attributes["tax_name"]
85
+ @tax_name = attributes["tax_name"]
86
+
87
+ end
88
+ if attributes["product_code"]
89
+ @product_code = attributes["product_code"]
90
+
91
+ end
92
+ if attributes["amount"]
93
+ @amount = attributes["amount"]
94
+
95
+ end
96
+ if attributes["custom_id"]
97
+ @custom_id = attributes["custom_id"]
98
+
99
+ end
100
+ if attributes["informative"]
101
+ @informative = attributes["informative"]
102
+
103
+ end
104
+ if attributes["tax_amount"]
105
+ @tax_amount = attributes["tax_amount"]
106
+
107
+ end
108
+ if attributes["tax_rate"]
109
+ @tax_rate = attributes["tax_rate"]
110
+
111
+ end
112
+ if attributes["additional_currencies"]
113
+ @additional_currencies = AdditionalCurrencies.new(attributes["additional_currencies"])
114
+
115
+ end
116
+ if attributes["total_amount"]
117
+ @total_amount = attributes["total_amount"]
118
+
119
+ end
120
+ if attributes["refunded_tax_amount"]
121
+ @refunded_tax_amount = attributes["refunded_tax_amount"]
122
+
123
+ end
124
+ if attributes["description"]
125
+ @description = attributes["description"]
126
+
127
+ end
128
+ if attributes["refunded_total_amount"]
129
+ @refunded_total_amount = attributes["refunded_total_amount"]
130
+
131
+ end
132
+
133
+
134
+ end
135
+
136
+ def to_body
137
+ body = {}
138
+ self.class.attribute_map.each_pair do |key, value|
139
+ v = self.send(key)
140
+ unless v.nil?
141
+ if v.is_a?(Array)
142
+ array = Array.new
143
+ v.each do |item|
144
+ if item.respond_to?("to_body".to_sym)
145
+ array.push item.to_body
146
+ else
147
+ array.push item
148
+ end
149
+ end
150
+ body[value] = array
151
+ else
152
+ if v.respond_to?("to_body".to_sym)
153
+ body[value] = v.to_body
154
+ else
155
+ body[value] = v
156
+ end
157
+ end
158
+ end
159
+ end
160
+ body
161
+ end
162
+ end
163
+