taxamo-ns 2.3.3 → 2.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ee9fb69cbc6137fa0db9bc7864687e916160c46
4
- data.tar.gz: 11f055ff30f784eaad541568bbbabfe70a376e60
3
+ metadata.gz: c7c53636022e0c11dcbd034960570314362aece5
4
+ data.tar.gz: 8b0d54057aa999764d79127409a05efaf46946d7
5
5
  SHA512:
6
- metadata.gz: 38742d612539788710c4cd8f0500b3a3b4d9d2965f867affac76ce9e803a3c21b4a85445862b61a73af624c5544919ed969509546f27a628300c1fb52ad53461
7
- data.tar.gz: cd291f5bf42d3ff5b6288e823fd1a85cf1e2819cea8f3f552a7f20368a54ea361f725a519cc556fde936de75d9bc08c3bc54809e12e33ca6ae1df8c2b7ce067d
6
+ metadata.gz: 61eab6790549b2b40cda899eba4ca74fd53756aefef780a9d313084e5ad323f55de58140d2af20e6065c3c5629fec5211727b1f5e14abe935d89046c44418ec9
7
+ data.tar.gz: 9ede7a0291d735782c2d9a2bcb491814a50aec503ca5b4f9a7cc92bfe3ee9da559f51e1f1cdf1ca5d0b6fa3307850042322ed78521b045b4eaa07fe571d296f2
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.2.gem
23
+ $ gem install taxamo-ns-2.3.4.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.4 (2017-06-09):
41
+ * allow configuration to be overridden when making the api call. See `connectivity_test.rb` for examples.
42
+
40
43
  2.3.3 (2017-05-26):
41
44
  * remove not needed camel case applied to 1st level attributes in request map
42
45
 
@@ -16,6 +16,47 @@ module Swagger
16
16
  @camelize_params = false
17
17
  end
18
18
 
19
+ def update(params)
20
+ if params[:format]
21
+ @format = params[:format]
22
+ end
23
+ if params[:scheme]
24
+ @scheme = params[:scheme]
25
+ end
26
+ if params[:host]
27
+ @host = params[:host]
28
+ end
29
+ if params[:base_path]
30
+ @base_path = params[:base_path]
31
+ end
32
+ if params[:user_agent]
33
+ @user_agent = params[:user_agent]
34
+ end
35
+ if params[:inject_format]
36
+ @inject_format = params[:inject_format]
37
+ end
38
+ if params[:force_ending_format]
39
+ @force_ending_format = params[:force_ending_format]
40
+ end
41
+ if params[:camelize_params]
42
+ @camelize_params = params[:camelize_params]
43
+ end
44
+ if params[:api_key]
45
+ @api_key = params[:api_key]
46
+ end
47
+ if params[:username]
48
+ @username = params[:username]
49
+ end
50
+ if params[:password]
51
+ @password = params[:password]
52
+ end
53
+ if params[:auth_token]
54
+ @auth_token = params[:auth_token]
55
+ end
56
+ if params[:logger]
57
+ @logger = params[:logger]
58
+ end
59
+ end
19
60
  end
20
61
 
21
62
  end
@@ -5,20 +5,23 @@ module Swagger
5
5
  require 'addressable/uri'
6
6
  require 'typhoeus'
7
7
 
8
- attr_accessor :host, :path, :format, :params, :body, :http_method, :headers
8
+ attr_accessor :host, :path, :format, :params, :body, :http_method, :headers, :configuration
9
9
 
10
10
 
11
11
  # All requests must have an HTTP method and a path
12
12
  # Optionals parameters are :params, :headers, :body, :format, :host
13
13
  #
14
- def initialize(http_method, path, attributes={})
15
- attributes[:format] ||= Swagger.configuration.format
14
+ def initialize(http_method, path, attributes={}, configuration={})
15
+ self.configuration = Swagger.configuration.clone()
16
+ self.configuration.update(configuration || {})
17
+
18
+ attributes[:format] ||= self.configuration.format
16
19
  attributes[:params] ||= {}
17
20
 
18
21
  # Set default headers
19
22
  default_headers = {
20
23
  'Content-Type' => "application/#{attributes[:format].downcase}",
21
- 'Token' => Swagger.configuration.api_key,
24
+ 'Token' => self.configuration.api_key,
22
25
  'Source-Id' => "taxamo-ruby/" + Taxamo::VERSION
23
26
  }
24
27
 
@@ -26,20 +29,15 @@ module Swagger
26
29
  if attributes[:headers].present? && attributes[:headers].has_key?(:api_key)
27
30
  default_headers.delete(:api_key)
28
31
  end
29
-
32
+
30
33
  # api_key from params hash trumps all others (headers and default_headers)
31
34
  if attributes[:params].present? && attributes[:params].has_key?(:api_key)
32
35
  default_headers.delete(:api_key)
33
36
  attributes[:headers].delete(:api_key) if attributes[:headers].present?
34
37
  end
35
-
38
+
36
39
  # Merge argument headers into defaults
37
40
  attributes[:headers] = default_headers.merge(attributes[:headers] || {})
38
-
39
- # Stick in the auth token if there is one
40
- if Swagger.authenticated?
41
- attributes[:headers].merge!({:auth_token => Swagger.configuration.auth_token})
42
- end
43
41
 
44
42
  self.http_method = http_method.to_sym
45
43
  self.path = path
@@ -50,20 +48,20 @@ module Swagger
50
48
 
51
49
  # Construct a base URL
52
50
  #
53
- def url(options = {})
51
+ def url(options = {})
54
52
  u = Addressable::URI.new(
55
- :scheme => Swagger.configuration.scheme,
56
- :host => Swagger.configuration.host,
53
+ :scheme => self.configuration.scheme,
54
+ :host => self.configuration.host,
57
55
  :path => self.interpreted_path,
58
56
  :query => self.query_string.sub(/\?/, '')
59
57
  ).to_s
60
-
58
+
61
59
  # Drop trailing question mark, if present
62
60
  u.sub! /\?$/, ''
63
-
61
+
64
62
  # Obfuscate API key?
65
63
  u.sub! /api\_key=\w+/, 'api_key=YOUR_API_KEY' if options[:obfuscated]
66
-
64
+
67
65
  u
68
66
  end
69
67
 
@@ -98,13 +96,13 @@ module Swagger
98
96
  #
99
97
  # p = p.sub("{format}", self.format.to_s)
100
98
  #
101
- URI.encode [Swagger.configuration.base_path, p].join("/").gsub(/\/+/, '/')
99
+ URI.encode [self.configuration.base_path, p].join("/").gsub(/\/+/, '/')
102
100
  end
103
-
101
+
104
102
  # Massage the request body into a state of readiness
105
103
  # If body is a hash, camelize all keys then convert to a json string
106
104
  #
107
- def body=(value)
105
+ def body=(value)
108
106
  #if value.is_a?(Hash)
109
107
  # value = value.inject({}) do |memo, (k,v)|
110
108
  # memo[k.to_s.camelize(:lower).to_sym] = v
@@ -113,13 +111,13 @@ module Swagger
113
111
  #end
114
112
  @body = value
115
113
  end
116
-
114
+
117
115
  # If body is an object, JSONify it before making the actual request.
118
- #
116
+ #
119
117
  def outgoing_body
120
118
  body.is_a?(String) ? body : body.to_json
121
119
  end
122
-
120
+
123
121
  # Construct a query string from the query-string-type params
124
122
  def query_string
125
123
 
@@ -130,7 +128,7 @@ module Swagger
130
128
  self.params.each_pair do |key, value|
131
129
  next if self.path.include? "{#{key}}" # skip path params
132
130
  next if value.blank? && value.class != FalseClass # skip empties
133
- if Swagger.configuration.camelize_params
131
+ if self.configuration.camelize_params
134
132
  key = key.to_s.camelize(:lower).to_sym unless key.to_sym == :api_key # api_key is not a camelCased param
135
133
  end
136
134
  query_values[key.to_s] = value.to_s
@@ -147,6 +145,7 @@ module Swagger
147
145
  end
148
146
 
149
147
  def make
148
+ puts self.configuration
150
149
  logger = Logger.new STDOUT
151
150
  logger.debug self.url
152
151
  response = case self.http_method.to_sym
data/lib/taxamo.rb CHANGED
@@ -64,7 +64,7 @@ module Taxamo
64
64
  end
65
65
  end
66
66
  end
67
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
67
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
68
68
  CreateRefundOut.new(response)
69
69
 
70
70
  end
@@ -89,7 +89,7 @@ module Taxamo
89
89
 
90
90
  headers = nil
91
91
  post_body = nil
92
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
92
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
93
93
  ListRefundsOut.new(response)
94
94
 
95
95
  end
@@ -136,7 +136,7 @@ module Taxamo
136
136
  end
137
137
  end
138
138
  end
139
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
139
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
140
140
  CreatePaymentOut.new(response)
141
141
 
142
142
  end
@@ -163,7 +163,7 @@ module Taxamo
163
163
 
164
164
  headers = nil
165
165
  post_body = nil
166
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
166
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
167
167
  ListPaymentsOut.new(response)
168
168
 
169
169
  end
@@ -188,7 +188,7 @@ module Taxamo
188
188
 
189
189
  headers = nil
190
190
  post_body = nil
191
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
191
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
192
192
  CapturePaymentOut.new(response)
193
193
 
194
194
  end
@@ -235,7 +235,7 @@ module Taxamo
235
235
  end
236
236
  end
237
237
  end
238
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
238
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
239
239
  EmailInvoiceOut.new(response)
240
240
 
241
241
  end
@@ -284,7 +284,7 @@ module Taxamo
284
284
  end
285
285
  end
286
286
  end
287
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
287
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
288
288
  EmailRefundOut.new(response)
289
289
 
290
290
  end
@@ -329,7 +329,7 @@ module Taxamo
329
329
  end
330
330
  end
331
331
  end
332
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
332
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
333
333
  CreateTransactionOut.new(response)
334
334
 
335
335
  end
@@ -354,7 +354,7 @@ module Taxamo
354
354
 
355
355
  headers = nil
356
356
  post_body = nil
357
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
357
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
358
358
  GetTransactionOut.new(response)
359
359
 
360
360
  end
@@ -401,7 +401,7 @@ module Taxamo
401
401
  end
402
402
  end
403
403
  end
404
- response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
404
+ response = Swagger::Request.new(:PUT, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
405
405
  UpdateTransactionOut.new(response)
406
406
 
407
407
  end
@@ -448,7 +448,7 @@ module Taxamo
448
448
  end
449
449
  end
450
450
  end
451
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
451
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
452
452
  ConfirmTransactionOut.new(response)
453
453
 
454
454
  end
@@ -473,7 +473,7 @@ module Taxamo
473
473
 
474
474
  headers = nil
475
475
  post_body = nil
476
- response = Swagger::Request.new(:DELETE, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
476
+ response = Swagger::Request.new(:DELETE, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
477
477
  CancelTransactionOut.new(response)
478
478
 
479
479
  end
@@ -520,7 +520,7 @@ module Taxamo
520
520
  end
521
521
  end
522
522
  end
523
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
523
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
524
524
  UnconfirmTransactionOut.new(response)
525
525
 
526
526
  end
@@ -559,7 +559,7 @@ module Taxamo
559
559
 
560
560
  headers = nil
561
561
  post_body = nil
562
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
562
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
563
563
  ListTransactionsOut.new(response)
564
564
 
565
565
  end
@@ -604,7 +604,7 @@ module Taxamo
604
604
  end
605
605
  end
606
606
  end
607
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
607
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
608
608
  CalculateTaxOut.new(response)
609
609
 
610
610
  end
@@ -643,7 +643,7 @@ module Taxamo
643
643
 
644
644
  headers = nil
645
645
  post_body = nil
646
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
646
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
647
647
  CalculateSimpleTaxOut.new(response)
648
648
 
649
649
  end
@@ -669,7 +669,7 @@ module Taxamo
669
669
 
670
670
  headers = nil
671
671
  post_body = nil
672
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
672
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
673
673
  ValidateTaxNumberOut.new(response)
674
674
 
675
675
  end
@@ -693,7 +693,7 @@ module Taxamo
693
693
 
694
694
  headers = nil
695
695
  post_body = nil
696
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
696
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
697
697
  CalculateTaxLocationOut.new(response)
698
698
 
699
699
  end
@@ -716,7 +716,7 @@ module Taxamo
716
716
 
717
717
  headers = nil
718
718
  post_body = nil
719
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
719
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
720
720
  LocateMyIPOut.new(response)
721
721
 
722
722
  end
@@ -741,7 +741,7 @@ module Taxamo
741
741
 
742
742
  headers = nil
743
743
  post_body = nil
744
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
744
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
745
745
  LocateGivenIPOut.new(response)
746
746
 
747
747
  end
@@ -769,7 +769,7 @@ module Taxamo
769
769
 
770
770
  headers = nil
771
771
  post_body = nil
772
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
772
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
773
773
  GetTransactionsStatsByCountryOut.new(response)
774
774
 
775
775
  end
@@ -797,7 +797,7 @@ module Taxamo
797
797
 
798
798
  headers = nil
799
799
  post_body = nil
800
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
800
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
801
801
  GetTransactionsStatsOut.new(response)
802
802
 
803
803
  end
@@ -824,7 +824,7 @@ module Taxamo
824
824
 
825
825
  headers = nil
826
826
  post_body = nil
827
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
827
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
828
828
  GetSettlementStatsByCountryOut.new(response)
829
829
 
830
830
  end
@@ -851,7 +851,7 @@ module Taxamo
851
851
 
852
852
  headers = nil
853
853
  post_body = nil
854
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
854
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
855
855
  GetSettlementStatsByTaxationTypeOut.new(response)
856
856
 
857
857
  end
@@ -880,7 +880,7 @@ module Taxamo
880
880
 
881
881
  headers = nil
882
882
  post_body = nil
883
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
883
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
884
884
  GetDailySettlementStatsOut.new(response)
885
885
 
886
886
  end
@@ -916,7 +916,7 @@ module Taxamo
916
916
 
917
917
  headers = nil
918
918
  post_body = nil
919
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
919
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
920
920
  GetEuViesReportOut.new(response)
921
921
 
922
922
  end
@@ -948,7 +948,7 @@ module Taxamo
948
948
 
949
949
  headers = nil
950
950
  post_body = nil
951
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
951
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
952
952
  GetDomesticSummaryReportOut.new(response)
953
953
 
954
954
  end
@@ -976,7 +976,7 @@ module Taxamo
976
976
 
977
977
  headers = nil
978
978
  post_body = nil
979
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
979
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
980
980
  GetDetailedRefundsOut.new(response)
981
981
 
982
982
  end
@@ -1004,7 +1004,7 @@ module Taxamo
1004
1004
 
1005
1005
  headers = nil
1006
1006
  post_body = nil
1007
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1007
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1008
1008
  GetRefundsOut.new(response)
1009
1009
 
1010
1010
  end
@@ -1038,7 +1038,7 @@ module Taxamo
1038
1038
 
1039
1039
  headers = nil
1040
1040
  post_body = nil
1041
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1041
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1042
1042
  GetSettlementOut.new(response)
1043
1043
 
1044
1044
  end
@@ -1067,7 +1067,7 @@ module Taxamo
1067
1067
 
1068
1068
  headers = nil
1069
1069
  post_body = nil
1070
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1070
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1071
1071
  GetSettlementSummaryOut.new(response)
1072
1072
 
1073
1073
  end
@@ -1112,7 +1112,7 @@ module Taxamo
1112
1112
  end
1113
1113
  end
1114
1114
  end
1115
- response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1115
+ response = Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1116
1116
  CreateSMSTokenOut.new(response)
1117
1117
 
1118
1118
  end
@@ -1137,7 +1137,7 @@ module Taxamo
1137
1137
 
1138
1138
  headers = nil
1139
1139
  post_body = nil
1140
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1140
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1141
1141
  VerifySMSTokenOut.new(response)
1142
1142
 
1143
1143
  end
@@ -1160,7 +1160,7 @@ module Taxamo
1160
1160
 
1161
1161
  headers = nil
1162
1162
  post_body = nil
1163
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1163
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1164
1164
  GetCurrenciesDictOut.new(response)
1165
1165
 
1166
1166
  end
@@ -1183,7 +1183,7 @@ module Taxamo
1183
1183
 
1184
1184
  headers = nil
1185
1185
  post_body = nil
1186
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1186
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1187
1187
  GetProductTypesDictOut.new(response)
1188
1188
 
1189
1189
  end
@@ -1206,7 +1206,7 @@ module Taxamo
1206
1206
 
1207
1207
  headers = nil
1208
1208
  post_body = nil
1209
- response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }).make.body
1209
+ response = Swagger::Request.new(:GET, path, {:params=>queryopts,:headers=>headers, :body=>post_body }, opts[:configuration]).make.body
1210
1210
  GetCountriesDictOut.new(response)
1211
1211
 
1212
1212
  end
@@ -11,7 +11,7 @@
11
11
  # limitations under the License.
12
12
 
13
13
  module Taxamo
14
- VERSION = "2.3.3"
14
+ VERSION = "2.3.4"
15
15
  end
16
16
 
17
17
 
@@ -36,20 +36,19 @@ class ConnectivityTest < Test::Unit::TestCase
36
36
 
37
37
  should 'test_auth' do
38
38
  Swagger.configure do |config|
39
- config.api_key = 'SamplePrivateTestKey1!'
39
+ config.api_key = 'SamplePrivateTestKey1'
40
40
  end
41
41
  assert_raise(AuthenticationError) {
42
- Taxamo.calculate_tax ({'__transaction' => {
43
- 'currency_code' => 'USD',
44
- 'buyer_ip' => '127.0.0.1',
45
- 'billing_country_code' => 'IE',
46
- 'force_country_code' => 'FR',
47
- 'transaction_lines' => [{'amount' => 200,
48
- 'custom_id' => 'line1'},
49
- {'amount' => 100,
50
- 'product_type' => 'e-book',
51
- 'custom_id' => 'line2'}]}})}
52
-
53
-
42
+ Taxamo.calculate_tax({'transaction' => {
43
+ 'currency_code' => 'USD',
44
+ 'buyer_ip' => '127.0.0.1',
45
+ 'billing_country_code' => 'IE',
46
+ 'force_country_code' => 'FR',
47
+ 'transaction_lines' => [{'amount' => 200,
48
+ 'custom_id' => 'line1'},
49
+ {'amount' => 100,
50
+ 'product_type' => 'e-book',
51
+ 'custom_id' => 'line2'}]}},
52
+ {:configuration => {:api_key => 'SamplePrivateTestKey1!'}})}
54
53
  end
55
54
  end
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.3
4
+ version: 2.3.4
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-26 00:00:00.000000000 Z
11
+ date: 2017-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable