postfinancecheckout-ruby-sdk 3.1.4 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/README.md +3 -1
  4. data/lib/postfinancecheckout-ruby-sdk/api/analytics_query_service_api.rb +381 -0
  5. data/lib/postfinancecheckout-ruby-sdk/api_client.rb +12 -0
  6. data/lib/postfinancecheckout-ruby-sdk/configuration.rb +4 -1
  7. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query.rb +272 -0
  8. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_execution.rb +293 -0
  9. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_execution_state.rb +37 -0
  10. data/lib/postfinancecheckout-ruby-sdk/models/analytics_query_result_batch.rb +225 -0
  11. data/lib/postfinancecheckout-ruby-sdk/models/analytics_schema_column.rb +263 -0
  12. data/lib/postfinancecheckout-ruby-sdk/models/analytics_schema_table.rb +215 -0
  13. data/lib/postfinancecheckout-ruby-sdk/models/rendered_document.rb +17 -5
  14. data/lib/postfinancecheckout-ruby-sdk/models/rendered_terminal_receipt.rb +17 -5
  15. data/lib/postfinancecheckout-ruby-sdk/models/rendered_terminal_transaction_summary.rb +17 -5
  16. data/lib/postfinancecheckout-ruby-sdk/models/transaction_completion.rb +26 -1
  17. data/lib/postfinancecheckout-ruby-sdk/models/transaction_completion_request.rb +26 -1
  18. data/lib/postfinancecheckout-ruby-sdk/version.rb +1 -1
  19. data/lib/postfinancecheckout-ruby-sdk.rb +7 -0
  20. data/test/condition_type_service_test.rb +1 -0
  21. data/test/transaction_create_service_test.rb +1 -0
  22. data/test/transaction_payment_page_service_test.rb +1 -0
  23. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.1.gem +0 -0
  24. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/ffi-1.15.5/gem_make.out +2 -2
  25. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/gem_make.out +1 -1
  26. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/mkmf.log +1 -1
  27. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/CHANGELOG.md +16 -0
  28. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Gemfile +4 -2
  29. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/LICENSE.txt +0 -0
  30. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/README.md +0 -0
  31. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Rakefile +0 -0
  32. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/data/unicode.data +0 -0
  33. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/native.rb +0 -1
  34. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/pure.rb +0 -1
  35. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna.rb +0 -1
  36. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/template.rb +3 -4
  37. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/uri.rb +57 -53
  38. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/version.rb +1 -2
  39. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable.rb +0 -0
  40. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/idna_spec.rb +0 -1
  41. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/net_http_compat_spec.rb +0 -1
  42. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/security_spec.rb +0 -1
  43. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/template_spec.rb +9 -1
  44. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/uri_spec.rb +81 -1
  45. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/spec_helper.rb +0 -0
  46. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/clobber.rake +0 -0
  47. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/gem.rake +5 -2
  48. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/git.rake +0 -0
  49. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/metrics.rake +0 -0
  50. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/profile.rake +0 -0
  51. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/rspec.rake +0 -0
  52. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/yard.rake +0 -0
  53. data/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +3 -3
  54. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/Makefile +2 -2
  55. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/generator/Makefile +2 -2
  56. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/parser/Makefile +2 -2
  57. data/vendor/bundle/ruby/2.4.0/specifications/{addressable-2.8.0.gemspec → addressable-2.8.1.gemspec} +8 -7
  58. metadata +37 -31
  59. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.0.gem +0 -0
  60. data/vendor/bundle/ruby/2.4.0/gems/addressable-2.8.0/addressable.gemspec +0 -37
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50b4017d8354bbbb5950cfd5904f01d5ae4a6fc2
4
- data.tar.gz: 81a95ec22f1f361c5a2a001114dac00c77a0acf3
3
+ metadata.gz: fe47f059c81b6761cfd9fb7e0a42401b2009d8cf
4
+ data.tar.gz: c0203015d18d0ac365b42f4b98dd3566c73cb0c9
5
5
  SHA512:
6
- metadata.gz: 73753905830f923a2322cccada648bf36b932f79d52f323ab0b1fe32ff296cbad307b0c0636b8fc05a160eb8b41b32c434f604132ad1523a3edcfade8e8fa0ce
7
- data.tar.gz: 22735830e6de0ce1dcc5dc1486959f6c2f43751f442ac14640469edbd23f30714823b3f22f61f2e6373e6a11e4a08753f0896bbd858dff464562eb680099e1d3
6
+ metadata.gz: ef7c006c7e6ba469ed5aad3b05125cccc20b3227ea3d47f7a31696af6f37f548c75a5a39ce900c6f45018e527a7f7eef8285ecb2c6699eb0585820587422883b
7
+ data.tar.gz: 07fbccd5c3b759f19c52e151857b1847c06043252ab972452e77de4b1bdcd732eb8d32867d8043347c38bb1a23ca4c4ae083aee6ec4d79bf647b13499debd555
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- postfinancecheckout-ruby-sdk (3.1.4)
4
+ postfinancecheckout-ruby-sdk (3.2.0)
5
5
  addressable (~> 2.3, >= 2.3.0)
6
6
  json (~> 2.3, >= 2.3.0)
7
7
  typhoeus (~> 1.0, >= 1.0.1)
@@ -9,8 +9,8 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.8.0)
13
- public_suffix (>= 2.0.2, < 5.0)
12
+ addressable (2.8.1)
13
+ public_suffix (>= 2.0.2, < 6.0)
14
14
  ethon (0.15.0)
15
15
  ffi (>= 1.15.0)
16
16
  ffi (1.15.5)
@@ -32,4 +32,4 @@ DEPENDENCIES
32
32
  test-unit (~> 3.2.5)
33
33
 
34
34
  BUNDLED WITH
35
- 2.3.19
35
+ 2.3.22
data/README.md CHANGED
@@ -20,7 +20,7 @@ $ gem install postfinancecheckout-ruby-sdk
20
20
 
21
21
  ## Usage
22
22
  The library needs to be configured with your account's space id, user id, and secret key which are available in your [PostFinance Checkout
23
- account dashboard](https://checkout.postfinance.ch/account/select). Set `space_id`, `user_id`, and `api_secret` to their values:
23
+ account dashboard](https://checkout.postfinance.ch/account/select). Set `space_id`, `user_id`, and `api_secret` to their values. You can also optionally set `default_headers` to set some headers that will be sent to all requests:
24
24
 
25
25
  ### Configuring a Service
26
26
 
@@ -31,9 +31,11 @@ space_id = 405
31
31
  app_user_id = 512
32
32
  app_user_key = "FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ="
33
33
 
34
+ # default_headers is an optional param, that represents headers sent to all requests
34
35
  PostFinanceCheckout.configure do |config|
35
36
  config.user_id = app_user_id
36
37
  config.authentication_key = app_user_key
38
+ config.default_headers = {"x-meta-custom-header": 'value-1', "x-meta-custom-header-2": 'value-2'}
37
39
  end
38
40
 
39
41
  # TransactionService
@@ -0,0 +1,381 @@
1
+ =begin
2
+ The PostFinance Checkout API allows an easy interaction with the PostFinance Checkout web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require "uri"
19
+
20
+ module PostFinanceCheckout
21
+ class AnalyticsQueryService
22
+ attr_accessor :api_client
23
+
24
+ def initialize(api_client = ApiClient.default)
25
+ @api_client = api_client
26
+ end
27
+
28
+ # Cancel Execution
29
+ # Cancels the specified query execution.
30
+ # @param id The ID of the query execution to cancel.
31
+ # @param [Hash] opts the optional parameters
32
+ # @return [nil]
33
+ def cancel_execution(id, opts = {})
34
+ cancel_execution_with_http_info(id, opts)
35
+ return nil
36
+ end
37
+
38
+ # Cancel Execution
39
+ # Cancels the specified query execution.
40
+ # @param id The ID of the query execution to cancel.
41
+ # @param [Hash] opts the optional parameters
42
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
43
+ def cancel_execution_with_http_info(id, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug "Calling API: AnalyticsQueryService.cancel_execution ..."
46
+ end
47
+ # verify the required parameter 'id' is set
48
+ fail ArgumentError, "Missing the required parameter 'id' when calling AnalyticsQueryService.cancel_execution" if id.nil?
49
+ # resource path
50
+ local_var_path = "/analytics-query/cancel-execution".sub('{format}','json')
51
+
52
+ # query parameters
53
+ query_params = {}
54
+ query_params[:'id'] = id
55
+
56
+ # header parameters
57
+ header_params = {}
58
+
59
+ # HTTP header 'Accept' (if needed)
60
+ local_header_accept = ['application/json;charset=utf-8']
61
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
62
+
63
+ # HTTP header 'Content-Type'
64
+ local_header_content_type = ['*/*']
65
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
66
+
67
+ # form parameters
68
+ form_params = {}
69
+
70
+ # http body (model)
71
+ post_body = nil
72
+ auth_names = []
73
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: AnalyticsQueryService#cancel_execution\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Fetch Result
86
+ # Fetches one batch of the result of a query execution.
87
+ # @param id The ID of the query execution for which to fetch the result.
88
+ # @param [Hash] opts the optional parameters
89
+ # @option opts [Integer] :timeout The maximal time in seconds to wait for the result if it is not yet available. Use 0 (the default) to return immediately without waiting.
90
+ # @option opts [Integer] :max_rows The maximum number of rows to return per batch. (Between 1 and 999. The default is 999.)
91
+ # @option opts [String] :next_token The next-token of the preceding batch to get the next result batch or null to get the first result batch.
92
+ # @return [AnalyticsQueryResultBatch]
93
+ def fetch_result(id, opts = {})
94
+ data, _status_code, _headers = fetch_result_with_http_info(id, opts)
95
+ return data
96
+ end
97
+
98
+ # Fetch Result
99
+ # Fetches one batch of the result of a query execution.
100
+ # @param id The ID of the query execution for which to fetch the result.
101
+ # @param [Hash] opts the optional parameters
102
+ # @option opts [Integer] :timeout The maximal time in seconds to wait for the result if it is not yet available. Use 0 (the default) to return immediately without waiting.
103
+ # @option opts [Integer] :max_rows The maximum number of rows to return per batch. (Between 1 and 999. The default is 999.)
104
+ # @option opts [String] :next_token The next-token of the preceding batch to get the next result batch or null to get the first result batch.
105
+ # @return [Array<(AnalyticsQueryResultBatch, Fixnum, Hash)>] AnalyticsQueryResultBatch data, response status code and response headers
106
+ def fetch_result_with_http_info(id, opts = {})
107
+ if @api_client.config.debugging
108
+ @api_client.config.logger.debug "Calling API: AnalyticsQueryService.fetch_result ..."
109
+ end
110
+ # verify the required parameter 'id' is set
111
+ fail ArgumentError, "Missing the required parameter 'id' when calling AnalyticsQueryService.fetch_result" if id.nil?
112
+ # resource path
113
+ local_var_path = "/analytics-query/fetch-result".sub('{format}','json')
114
+
115
+ # query parameters
116
+ query_params = {}
117
+ query_params[:'id'] = id
118
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
119
+ query_params[:'maxRows'] = opts[:'max_rows'] if !opts[:'max_rows'].nil?
120
+ query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
121
+
122
+ # header parameters
123
+ header_params = {}
124
+
125
+ # HTTP header 'Accept' (if needed)
126
+ local_header_accept = ['application/json;charset=utf-8']
127
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
128
+
129
+ # HTTP header 'Content-Type'
130
+ local_header_content_type = ['*/*']
131
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
132
+
133
+ # form parameters
134
+ form_params = {}
135
+
136
+ # http body (model)
137
+ post_body = nil
138
+ auth_names = []
139
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => 'AnalyticsQueryResultBatch')
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug "API called: AnalyticsQueryService#fetch_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
148
+ end
149
+ return data, status_code, headers
150
+ end
151
+
152
+ # Generate Download URL
153
+ # Generate a URL from which the results of a query execution can be downloaded in CSV format.
154
+ # @param id The ID of the query execution for which to generate the download URL.
155
+ # @param [Hash] opts the optional parameters
156
+ # @option opts [Integer] :timeout The maximal time in seconds to wait for the result if it is not yet available. Use 0 (the default) to return immediately without waiting.
157
+ # @return [String]
158
+ def generate_download_url(id, opts = {})
159
+ data, _status_code, _headers = generate_download_url_with_http_info(id, opts)
160
+ return data
161
+ end
162
+
163
+ # Generate Download URL
164
+ # Generate a URL from which the results of a query execution can be downloaded in CSV format.
165
+ # @param id The ID of the query execution for which to generate the download URL.
166
+ # @param [Hash] opts the optional parameters
167
+ # @option opts [Integer] :timeout The maximal time in seconds to wait for the result if it is not yet available. Use 0 (the default) to return immediately without waiting.
168
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
169
+ def generate_download_url_with_http_info(id, opts = {})
170
+ if @api_client.config.debugging
171
+ @api_client.config.logger.debug "Calling API: AnalyticsQueryService.generate_download_url ..."
172
+ end
173
+ # verify the required parameter 'id' is set
174
+ fail ArgumentError, "Missing the required parameter 'id' when calling AnalyticsQueryService.generate_download_url" if id.nil?
175
+ # resource path
176
+ local_var_path = "/analytics-query/generate-download-url".sub('{format}','json')
177
+
178
+ # query parameters
179
+ query_params = {}
180
+ query_params[:'id'] = id
181
+ query_params[:'timeout'] = opts[:'timeout'] if !opts[:'timeout'].nil?
182
+
183
+ # header parameters
184
+ header_params = {}
185
+
186
+ # HTTP header 'Accept' (if needed)
187
+ local_header_accept = ['text/plain']
188
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
189
+
190
+ # HTTP header 'Content-Type'
191
+ local_header_content_type = ['*/*']
192
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
193
+
194
+ # form parameters
195
+ form_params = {}
196
+
197
+ # http body (model)
198
+ post_body = nil
199
+ auth_names = []
200
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
201
+ :header_params => header_params,
202
+ :query_params => query_params,
203
+ :form_params => form_params,
204
+ :body => post_body,
205
+ :auth_names => auth_names,
206
+ :return_type => 'String')
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug "API called: AnalyticsQueryService#generate_download_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
+ end
210
+ return data, status_code, headers
211
+ end
212
+
213
+ # Get Schemas
214
+ # Get the schemas describing the available tables and their columns.
215
+ # @param [Hash] opts the optional parameters
216
+ # @return [Array<AnalyticsSchemaTable>]
217
+ def schema(opts = {})
218
+ data, _status_code, _headers = schema_with_http_info(opts)
219
+ return data
220
+ end
221
+
222
+ # Get Schemas
223
+ # Get the schemas describing the available tables and their columns.
224
+ # @param [Hash] opts the optional parameters
225
+ # @return [Array<(Array<AnalyticsSchemaTable>, Fixnum, Hash)>] Array<AnalyticsSchemaTable> data, response status code and response headers
226
+ def schema_with_http_info(opts = {})
227
+ if @api_client.config.debugging
228
+ @api_client.config.logger.debug "Calling API: AnalyticsQueryService.schema ..."
229
+ end
230
+ # resource path
231
+ local_var_path = "/analytics-query/schema".sub('{format}','json')
232
+
233
+ # query parameters
234
+ query_params = {}
235
+
236
+ # header parameters
237
+ header_params = {}
238
+
239
+ # HTTP header 'Accept' (if needed)
240
+ local_header_accept = ['application/json;charset=utf-8']
241
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
242
+
243
+ # HTTP header 'Content-Type'
244
+ local_header_content_type = ['*/*']
245
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
246
+
247
+ # form parameters
248
+ form_params = {}
249
+
250
+ # http body (model)
251
+ post_body = nil
252
+ auth_names = []
253
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
254
+ :header_params => header_params,
255
+ :query_params => query_params,
256
+ :form_params => form_params,
257
+ :body => post_body,
258
+ :auth_names => auth_names,
259
+ :return_type => 'Array<AnalyticsSchemaTable>')
260
+ if @api_client.config.debugging
261
+ @api_client.config.logger.debug "API called: AnalyticsQueryService#schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
262
+ end
263
+ return data, status_code, headers
264
+ end
265
+
266
+ # Execution Status
267
+ # Returns the current status of a query execution.
268
+ # @param id The ID of the query execution for which to get the status.
269
+ # @param [Hash] opts the optional parameters
270
+ # @return [AnalyticsQueryExecution]
271
+ def status(id, opts = {})
272
+ data, _status_code, _headers = status_with_http_info(id, opts)
273
+ return data
274
+ end
275
+
276
+ # Execution Status
277
+ # Returns the current status of a query execution.
278
+ # @param id The ID of the query execution for which to get the status.
279
+ # @param [Hash] opts the optional parameters
280
+ # @return [Array<(AnalyticsQueryExecution, Fixnum, Hash)>] AnalyticsQueryExecution data, response status code and response headers
281
+ def status_with_http_info(id, opts = {})
282
+ if @api_client.config.debugging
283
+ @api_client.config.logger.debug "Calling API: AnalyticsQueryService.status ..."
284
+ end
285
+ # verify the required parameter 'id' is set
286
+ fail ArgumentError, "Missing the required parameter 'id' when calling AnalyticsQueryService.status" if id.nil?
287
+ # resource path
288
+ local_var_path = "/analytics-query/status".sub('{format}','json')
289
+
290
+ # query parameters
291
+ query_params = {}
292
+ query_params[:'id'] = id
293
+
294
+ # header parameters
295
+ header_params = {}
296
+
297
+ # HTTP header 'Accept' (if needed)
298
+ local_header_accept = ['application/json;charset=utf-8']
299
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
300
+
301
+ # HTTP header 'Content-Type'
302
+ local_header_content_type = ['*/*']
303
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
304
+
305
+ # form parameters
306
+ form_params = {}
307
+
308
+ # http body (model)
309
+ post_body = nil
310
+ auth_names = []
311
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
312
+ :header_params => header_params,
313
+ :query_params => query_params,
314
+ :form_params => form_params,
315
+ :body => post_body,
316
+ :auth_names => auth_names,
317
+ :return_type => 'AnalyticsQueryExecution')
318
+ if @api_client.config.debugging
319
+ @api_client.config.logger.debug "API called: AnalyticsQueryService#status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ end
321
+ return data, status_code, headers
322
+ end
323
+
324
+ # Submit Query
325
+ # Submits a query for execution.
326
+ # @param query The query to submit.
327
+ # @param [Hash] opts the optional parameters
328
+ # @return [AnalyticsQueryExecution]
329
+ def submit_query(query, opts = {})
330
+ data, _status_code, _headers = submit_query_with_http_info(query, opts)
331
+ return data
332
+ end
333
+
334
+ # Submit Query
335
+ # Submits a query for execution.
336
+ # @param query The query to submit.
337
+ # @param [Hash] opts the optional parameters
338
+ # @return [Array<(AnalyticsQueryExecution, Fixnum, Hash)>] AnalyticsQueryExecution data, response status code and response headers
339
+ def submit_query_with_http_info(query, opts = {})
340
+ if @api_client.config.debugging
341
+ @api_client.config.logger.debug "Calling API: AnalyticsQueryService.submit_query ..."
342
+ end
343
+ # verify the required parameter 'query' is set
344
+ fail ArgumentError, "Missing the required parameter 'query' when calling AnalyticsQueryService.submit_query" if query.nil?
345
+ # resource path
346
+ local_var_path = "/analytics-query/submit-query".sub('{format}','json')
347
+
348
+ # query parameters
349
+ query_params = {}
350
+
351
+ # header parameters
352
+ header_params = {}
353
+
354
+ # HTTP header 'Accept' (if needed)
355
+ local_header_accept = ['application/json;charset=utf-8']
356
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
357
+
358
+ # HTTP header 'Content-Type'
359
+ local_header_content_type = ['application/json;charset=utf-8']
360
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
361
+
362
+ # form parameters
363
+ form_params = {}
364
+
365
+ # http body (model)
366
+ post_body = @api_client.object_to_http_body(query)
367
+ auth_names = []
368
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
369
+ :header_params => header_params,
370
+ :query_params => query_params,
371
+ :form_params => form_params,
372
+ :body => post_body,
373
+ :auth_names => auth_names,
374
+ :return_type => 'AnalyticsQueryExecution')
375
+ if @api_client.config.debugging
376
+ @api_client.config.logger.debug "API called: AnalyticsQueryService#submit_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
377
+ end
378
+ return data, status_code, headers
379
+ end
380
+ end
381
+ end
@@ -44,6 +44,9 @@ module PostFinanceCheckout
44
44
  'Content-Type' => "application/json",
45
45
  'User-Agent' => @user_agent
46
46
  }
47
+ config.default_headers.each do |key, value|
48
+ @default_headers[key] = value
49
+ end
47
50
  end
48
51
 
49
52
  def self.default
@@ -98,7 +101,16 @@ module PostFinanceCheckout
98
101
  url = build_request_url(path)
99
102
  http_method = http_method.to_sym.downcase
100
103
 
104
+ default_headers = {
105
+ 'x-meta-sdk-version': "3.2.0",
106
+ 'x-meta-sdk-language': "ruby",
107
+ 'x-meta-sdk-provider': "PostFinance Checkout",
108
+ 'x-meta-sdk-language-version': RUBY_VERSION
109
+ }
110
+
101
111
  header_params = @default_headers.merge(opts[:header_params] || {})
112
+ header_params = header_params.merge(default_headers)
113
+
102
114
  query_params = opts[:query_params] || {}
103
115
  form_params = opts[:form_params] || {}
104
116
 
@@ -90,7 +90,9 @@ module PostFinanceCheckout
90
90
 
91
91
  attr_accessor :force_ending_format
92
92
 
93
- def initialize
93
+ attr_accessor :default_headers
94
+
95
+ def initialize(default_headers = {})
94
96
  @scheme = 'https'
95
97
  @host = 'checkout.postfinance.ch:443'
96
98
  @base_path = '/api'
@@ -102,6 +104,7 @@ module PostFinanceCheckout
102
104
  @inject_format = false
103
105
  @force_ending_format = false
104
106
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
107
+ @default_headers = default_headers
105
108
 
106
109
  yield(self) if block_given?
107
110
  end