taxamo-ns 2.3.4 → 2.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c7c53636022e0c11dcbd034960570314362aece5
4
- data.tar.gz: 8b0d54057aa999764d79127409a05efaf46946d7
3
+ metadata.gz: d1099262fd43990e995e29ddbf20ac25978cd57f
4
+ data.tar.gz: ad728960e0cc78a323674fb04631203af416fbc7
5
5
  SHA512:
6
- metadata.gz: 61eab6790549b2b40cda899eba4ca74fd53756aefef780a9d313084e5ad323f55de58140d2af20e6065c3c5629fec5211727b1f5e14abe935d89046c44418ec9
7
- data.tar.gz: 9ede7a0291d735782c2d9a2bcb491814a50aec503ca5b4f9a7cc92bfe3ee9da559f51e1f1cdf1ca5d0b6fa3307850042322ed78521b045b4eaa07fe571d296f2
6
+ metadata.gz: 5e52926bf9c175ffc57f26de106fd8d8038f674f90dd561880bfabad8981ae4bab9ef742f66dbac6fb92a3e2f0dcdcc5640f5a334fc3095f6d2cab05fa0a933e
7
+ data.tar.gz: cff2e9df040625abaefddd422fdb9e3ca020deb0726c589d55ad9265b760a1188e6d24055cfe566bae8bdf77d7f87c8fcf3a965ebd1f6ecef013a181430111cc
data/README.md CHANGED
@@ -20,7 +20,7 @@ The library can also be installed directy - just fetch this repository and issue
20
20
 
21
21
  ```shell
22
22
  $ gem build taxamo.gemspec
23
- $ gem install taxamo-ns-2.3.4.gem
23
+ $ gem install taxamo-ns-2.3.5.gem
24
24
  ```
25
25
 
26
26
  Finally, you can use this github repo and add the following line to your project's `Gemfile` file:
@@ -37,6 +37,9 @@ gem "taxamo", github: "taxamo/taxamo-ruby", '~> 1.1'
37
37
 
38
38
  ## Changes
39
39
 
40
+ 2.3.5 (2017-11-01):
41
+ * add warnings and tax_entity_additional_id field to the transaction object
42
+
40
43
  2.3.4 (2017-06-09):
41
44
  * allow configuration to be overridden when making the api call. See `connectivity_test.rb` for examples.
42
45
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  module Taxamo
14
14
  class Transaction
15
- attr_accessor :confirm_timestamp, :fully_informative, :deducted_tax_amount, :order_date_type, :buyer_credit_card_prefix, :custom_data, :buyer_name, :invoice_date, :create_timestamp, :currency_code, :sub_account_id, :supply_date, :buyer_tax_number_normalized, :invoice_image_url, :key, :buyer_tax_number_format_valid, :tax_number_service, :invoice_address, :buyer_tax_number_valid, :verification_token, :note, :tax_supported, :tax_data, :transaction_lines, :buyer_tax_number, :external_key, :status, :custom_fields, :force_country_code, :countries, :invoice_number, :order_date, :customer_id, :kind, :source, :amount, :comments, :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
+ attr_accessor :confirm_timestamp, :fully_informative, :deducted_tax_amount, :order_date_type, :buyer_credit_card_prefix, :custom_data, :buyer_name, :invoice_date, :create_timestamp, :currency_code, :sub_account_id, :supply_date, :buyer_tax_number_normalized, :invoice_image_url, :key, :buyer_tax_number_format_valid, :tax_number_service, :invoice_address, :buyer_tax_number_valid, :verification_token, :note, :tax_supported, :tax_data, :transaction_lines, :buyer_tax_number, :external_key, :status, :custom_fields, :force_country_code, :countries, :invoice_number, :order_date, :customer_id, :kind, :source, :amount, :comments, :buyer_ip, :buyer_email, :original_transaction_key, :billing_country_code, :custom_id, :tax_amount, :tax_entity_additional_id, :warnings, :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
16
16
 
17
17
  # :internal => :external
18
18
  def self.attribute_map
@@ -60,6 +60,8 @@ class Transaction
60
60
  :billing_country_code => :billing_country_code,
61
61
  :custom_id => :custom_id,
62
62
  :tax_amount => :tax_amount,
63
+ :tax_entity_additional_id => :tax_entity_additional_id,
64
+ :warnings => :warnings,
63
65
  :additional_currencies => :additional_currencies,
64
66
  :invoice_place => :invoice_place,
65
67
  :total_amount => :total_amount,
@@ -254,6 +256,15 @@ class Transaction
254
256
  @tax_amount = attributes["tax_amount"]
255
257
 
256
258
  end
259
+ if attributes.key?("tax_entity_additional_id")
260
+ @tax_entity_additional_id = attributes["tax_entity_additional_id"]
261
+
262
+ end
263
+ if attributes.key?("warnings")
264
+ if (value = attributes["warnings"]).is_a?(Array)
265
+ @warnings = value.map{ |v| Warnings.new(v) }
266
+ end
267
+ end
257
268
  if attributes.key?("additional_currencies")
258
269
  @additional_currencies = AdditionalCurrencies.new(attributes["additional_currencies"])
259
270
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  module Taxamo
14
14
  class Transactions
15
- attr_accessor :confirm_timestamp, :fully_informative, :deducted_tax_amount, :order_date_type, :buyer_credit_card_prefix, :custom_data, :buyer_name, :invoice_date, :create_timestamp, :currency_code, :sub_account_id, :supply_date, :buyer_tax_number_normalized, :invoice_image_url, :key, :buyer_tax_number_format_valid, :tax_number_service, :invoice_address, :buyer_tax_number_valid, :verification_token, :note, :tax_supported, :tax_data, :transaction_lines, :buyer_tax_number, :external_key, :status, :custom_fields, :force_country_code, :countries, :invoice_number, :order_date, :customer_id, :kind, :source, :amount, :comments, :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
+ attr_accessor :confirm_timestamp, :fully_informative, :deducted_tax_amount, :order_date_type, :buyer_credit_card_prefix, :custom_data, :buyer_name, :invoice_date, :create_timestamp, :currency_code, :sub_account_id, :supply_date, :buyer_tax_number_normalized, :invoice_image_url, :key, :buyer_tax_number_format_valid, :tax_number_service, :invoice_address, :buyer_tax_number_valid, :verification_token, :note, :tax_supported, :tax_data, :transaction_lines, :buyer_tax_number, :external_key, :status, :custom_fields, :force_country_code, :countries, :invoice_number, :order_date, :customer_id, :kind, :source, :amount, :comments, :buyer_ip, :buyer_email, :original_transaction_key, :billing_country_code, :custom_id, :tax_amount, :tax_entity_additional_id, :warnings, :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
16
16
 
17
17
  # :internal => :external
18
18
  def self.attribute_map
@@ -60,6 +60,8 @@ class Transactions
60
60
  :billing_country_code => :billing_country_code,
61
61
  :custom_id => :custom_id,
62
62
  :tax_amount => :tax_amount,
63
+ :tax_entity_additional_id => :tax_entity_additional_id,
64
+ :warnings => :warnings,
63
65
  :additional_currencies => :additional_currencies,
64
66
  :invoice_place => :invoice_place,
65
67
  :total_amount => :total_amount,
@@ -254,6 +256,15 @@ class Transactions
254
256
  @tax_amount = attributes["tax_amount"]
255
257
 
256
258
  end
259
+ if attributes.key?("tax_entity_additional_id")
260
+ @tax_entity_additional_id = attributes["tax_entity_additional_id"]
261
+
262
+ end
263
+ if attributes.key?("warnings")
264
+ if (value = attributes["warnings"]).is_a?(Array)
265
+ @warnings = value.map{ |v| Warnings.new(v) }
266
+ end
267
+ end
257
268
  if attributes.key?("additional_currencies")
258
269
  @additional_currencies = AdditionalCurrencies.new(attributes["additional_currencies"])
259
270
 
@@ -0,0 +1,68 @@
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
+ module Taxamo
14
+ class Warnings
15
+ attr_accessor :type, :message
16
+
17
+ # :internal => :external
18
+ def self.attribute_map
19
+ {
20
+ :type => :type,
21
+ :message => :message
22
+
23
+ }
24
+ end
25
+
26
+ def initialize(attributes = {})
27
+ return if attributes.nil? or attributes.empty?
28
+ # Morph attribute keys into undescored rubyish style
29
+ if attributes.key?("type")
30
+ @type = attributes["type"]
31
+
32
+ end
33
+ if attributes.key?("message")
34
+ @message = attributes["message"]
35
+
36
+ end
37
+
38
+
39
+ end
40
+
41
+ def to_body
42
+ body = {}
43
+ self.class.attribute_map.each_pair do |key, value|
44
+ v = self.send(key)
45
+ unless v.nil?
46
+ if v.is_a?(Array)
47
+ array = Array.new
48
+ v.each do |item|
49
+ if item.respond_to?("to_body".to_sym)
50
+ array.push item.to_body
51
+ else
52
+ array.push item
53
+ end
54
+ end
55
+ body[value] = array
56
+ else
57
+ if v.respond_to?("to_body".to_sym)
58
+ body[value] = v.to_body
59
+ else
60
+ body[value] = v
61
+ end
62
+ end
63
+ end
64
+ end
65
+ body
66
+ end
67
+ end
68
+ end
@@ -11,7 +11,7 @@
11
11
  # limitations under the License.
12
12
 
13
13
  module Taxamo
14
- VERSION = "2.3.4"
14
+ VERSION = "2.3.5"
15
15
  end
16
16
 
17
17
 
@@ -111,8 +111,13 @@ class TransactionsApiTest < Test::Unit::TestCase
111
111
  createRefundIn.custom_id='line1'
112
112
 
113
113
  refundResp = Taxamo.create_refund(resp.transaction.key, {'total_amount' => 100, 'custom_id' => 'line1'})
114
+ assert_equal refundResp.total_amount, 100
115
+ assert_equal refundResp.refunded_total_amount, 100
116
+
114
117
  refundResp = Taxamo.create_refund(resp.transaction.key, createRefundIn)
115
118
 
119
+ assert_equal refundResp.total_amount, 100
120
+ assert_equal refundResp.refunded_total_amount, 200
116
121
  resp = Taxamo.get_transaction(resp.transaction.key)
117
122
 
118
123
  assert_false resp.transaction.key.nil?
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.4
4
+ version: 2.3.5
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-06-09 00:00:00.000000000 Z
11
+ date: 2017-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -206,6 +206,7 @@ files:
206
206
  - lib/taxamo/models/ustaxid.rb
207
207
  - lib/taxamo/models/validatetaxnumberout.rb
208
208
  - lib/taxamo/models/verifysmstokenout.rb
209
+ - lib/taxamo/models/warnings.rb
209
210
  - lib/taxamo/version.rb
210
211
  - taxamo.gemspec
211
212
  - test/taxamo/connectivity_test.rb