vrpayment-ruby-sdk 6.2.0 → 6.3.0

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.
@@ -0,0 +1,372 @@
1
+ =begin
2
+ # VR Payment Ruby SDK
3
+ #
4
+ # This library allows to interact with the VR Payment payment service.
5
+ #
6
+ # Copyright owner: Wallee AG
7
+ # Website: https://www.vr-payment.de
8
+ # Developer email: ecosystem-team@wallee.com
9
+ #
10
+ # Licensed under the Apache License, Version 2.0 (the "License");
11
+ # you may not use this file except in compliance with the License.
12
+ # You may obtain a copy of the License at
13
+ #
14
+ # http://www.apache.org/licenses/LICENSE-2.0
15
+ #
16
+ # Unless required by applicable law or agreed to in writing, software
17
+ # distributed under the License is distributed on an "AS IS" BASIS,
18
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ # See the License for the specific language governing permissions and
20
+ # limitations under the License.
21
+ =end
22
+
23
+ require 'cgi'
24
+
25
+ module VrpaymentRubySdk
26
+ class PaymentTerminalTransactionSummariesService
27
+ attr_accessor :api_client
28
+
29
+
30
+ def initialize(api_client = ApiClient.default)
31
+ @api_client = api_client
32
+ end
33
+ # List all summaries
34
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [Integer] :after Set to an object's ID to retrieve the page of objects coming immediately after the named object.
37
+ # @option opts [Integer] :before Set to an object's ID to retrieve the page of objects coming immediately before the named object.
38
+ # @option opts [Array<String>] :expand
39
+ # @option opts [Integer] :limit A limit on the number of objects to be returned, between 1 and 100. Default is 10.
40
+ # @option opts [SortingOrder] :order Specify to retrieve objects in chronological (ASC) or reverse chronological (DESC) order.
41
+ # @return [TerminalTransactionSummaryListResponse]
42
+ def get_payment_terminals_transaction_summaries(space, opts = {})
43
+ data, _status_code, _headers = get_payment_terminals_transaction_summaries_with_http_info(space, opts)
44
+ data
45
+ end
46
+
47
+ # List all summaries
48
+
49
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [Integer] :after Set to an object&#39;s ID to retrieve the page of objects coming immediately after the named object.
52
+ # @option opts [Integer] :before Set to an object&#39;s ID to retrieve the page of objects coming immediately before the named object.
53
+ # @option opts [Array<String>] :expand
54
+ # @option opts [Integer] :limit A limit on the number of objects to be returned, between 1 and 100. Default is 10.
55
+ # @option opts [SortingOrder] :order Specify to retrieve objects in chronological (ASC) or reverse chronological (DESC) order.
56
+ # @return [Array<(TerminalTransactionSummaryListResponse, Integer, Hash)>] TerminalTransactionSummaryListResponse data, response status code and response headers
57
+ def get_payment_terminals_transaction_summaries_with_http_info(space, opts = {})
58
+ if @api_client.config.debugging
59
+ @api_client.config.logger.debug 'Calling API: PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries ...'
60
+ end
61
+ # verify the required parameter 'space' is set
62
+ if @api_client.config.client_side_validation && space.nil?
63
+ fail ArgumentError, "Missing the required parameter 'space' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries"
64
+ end
65
+ if @api_client.config.client_side_validation && !opts[:'after'].nil? && opts[:'after'] < 1
66
+ fail ArgumentError, 'invalid value for "opts[:"after"]" when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries, must be greater than or equal to 1.'
67
+ end
68
+
69
+ if @api_client.config.client_side_validation && !opts[:'before'].nil? && opts[:'before'] < 1
70
+ fail ArgumentError, 'invalid value for "opts[:"before"]" when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries, must be greater than or equal to 1.'
71
+ end
72
+
73
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
74
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries, must be smaller than or equal to 100.'
75
+ end
76
+
77
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
78
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries, must be greater than or equal to 1.'
79
+ end
80
+
81
+ # resource path
82
+ local_var_path = '/payment/terminals/transaction-summaries'
83
+
84
+ # query parameters
85
+ query_params = opts[:query_params] || {}
86
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
87
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
88
+ query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
89
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
90
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
91
+
92
+ # header parameters
93
+ header_params = opts[:header_params] || {}
94
+ # HTTP header 'Accept' (if needed)
95
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
96
+ header_params[:'Space'] = space
97
+
98
+ # form parameters
99
+ form_params = opts[:form_params] || {}
100
+
101
+ # connection timeout
102
+ connection_timeout = @api_client.config.timeout
103
+
104
+ # http body (model)
105
+ post_body = opts[:debug_body]
106
+
107
+ # return_type
108
+ return_type = opts[:debug_return_type] || 'TerminalTransactionSummaryListResponse'
109
+
110
+ new_options = opts.merge(
111
+ :operation => :"PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries",
112
+ :header_params => header_params,
113
+ :query_params => query_params,
114
+ :form_params => form_params,
115
+ :body => post_body,
116
+ :return_type => return_type
117
+ )
118
+
119
+ data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug "API called: PaymentTerminalTransactionSummariesService#get_payment_terminals_transaction_summaries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
122
+ end
123
+ return data, status_code, headers
124
+ end
125
+
126
+
127
+ # Retrieve a summary
128
+ # @param id [Integer]
129
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
130
+ # @param [Hash] opts the optional parameters
131
+ # @option opts [Array<String>] :expand
132
+ # @return [PaymentTerminalTransactionSummary]
133
+ def get_payment_terminals_transaction_summaries_id(id, space, opts = {})
134
+ data, _status_code, _headers = get_payment_terminals_transaction_summaries_id_with_http_info(id, space, opts)
135
+ data
136
+ end
137
+
138
+ # Retrieve a summary
139
+
140
+ # @param id [Integer]
141
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
142
+ # @param [Hash] opts the optional parameters
143
+ # @option opts [Array<String>] :expand
144
+ # @return [Array<(PaymentTerminalTransactionSummary, Integer, Hash)>] PaymentTerminalTransactionSummary data, response status code and response headers
145
+ def get_payment_terminals_transaction_summaries_id_with_http_info(id, space, opts = {})
146
+ if @api_client.config.debugging
147
+ @api_client.config.logger.debug 'Calling API: PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id ...'
148
+ end
149
+ # verify the required parameter 'id' is set
150
+ if @api_client.config.client_side_validation && id.nil?
151
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id"
152
+ end
153
+ # verify the required parameter 'space' is set
154
+ if @api_client.config.client_side_validation && space.nil?
155
+ fail ArgumentError, "Missing the required parameter 'space' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id"
156
+ end
157
+ # resource path
158
+ local_var_path = '/payment/terminals/transaction-summaries/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
159
+
160
+ # query parameters
161
+ query_params = opts[:query_params] || {}
162
+ query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
163
+
164
+ # header parameters
165
+ header_params = opts[:header_params] || {}
166
+ # HTTP header 'Accept' (if needed)
167
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
168
+ header_params[:'Space'] = space
169
+
170
+ # form parameters
171
+ form_params = opts[:form_params] || {}
172
+
173
+ # connection timeout
174
+ connection_timeout = @api_client.config.timeout
175
+
176
+ # http body (model)
177
+ post_body = opts[:debug_body]
178
+
179
+ # return_type
180
+ return_type = opts[:debug_return_type] || 'PaymentTerminalTransactionSummary'
181
+
182
+ new_options = opts.merge(
183
+ :operation => :"PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id",
184
+ :header_params => header_params,
185
+ :query_params => query_params,
186
+ :form_params => form_params,
187
+ :body => post_body,
188
+ :return_type => return_type
189
+ )
190
+
191
+ data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
192
+ if @api_client.config.debugging
193
+ @api_client.config.logger.debug "API called: PaymentTerminalTransactionSummariesService#get_payment_terminals_transaction_summaries_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
194
+ end
195
+ return data, status_code, headers
196
+ end
197
+
198
+
199
+ # Retrieve a rendered summary receipt
200
+ # @param id [Integer]
201
+ # @param format [TerminalReceiptFormat] The format specifies how the receipt will be presented in the response.
202
+ # @param width [Integer] The width defines the dimensions for rendering the document. For PDF format, the width is specified in millimeters, while for text format, it represents the number of characters per line.
203
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
204
+ # @param [Hash] opts the optional parameters
205
+ # @return [RenderedTerminalTransactionSummary]
206
+ def get_payment_terminals_transaction_summaries_id_receipt(id, format, width, space, opts = {})
207
+ data, _status_code, _headers = get_payment_terminals_transaction_summaries_id_receipt_with_http_info(id, format, width, space, opts)
208
+ data
209
+ end
210
+
211
+ # Retrieve a rendered summary receipt
212
+
213
+ # @param id [Integer]
214
+ # @param format [TerminalReceiptFormat] The format specifies how the receipt will be presented in the response.
215
+ # @param width [Integer] The width defines the dimensions for rendering the document. For PDF format, the width is specified in millimeters, while for text format, it represents the number of characters per line.
216
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
217
+ # @param [Hash] opts the optional parameters
218
+ # @return [Array<(RenderedTerminalTransactionSummary, Integer, Hash)>] RenderedTerminalTransactionSummary data, response status code and response headers
219
+ def get_payment_terminals_transaction_summaries_id_receipt_with_http_info(id, format, width, space, opts = {})
220
+ if @api_client.config.debugging
221
+ @api_client.config.logger.debug 'Calling API: PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id_receipt ...'
222
+ end
223
+ # verify the required parameter 'id' is set
224
+ if @api_client.config.client_side_validation && id.nil?
225
+ fail ArgumentError, "Missing the required parameter 'id' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id_receipt"
226
+ end
227
+ # verify the required parameter 'format' is set
228
+ if @api_client.config.client_side_validation && format.nil?
229
+ fail ArgumentError, "Missing the required parameter 'format' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id_receipt"
230
+ end
231
+ # verify the required parameter 'width' is set
232
+ if @api_client.config.client_side_validation && width.nil?
233
+ fail ArgumentError, "Missing the required parameter 'width' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id_receipt"
234
+ end
235
+ # verify the required parameter 'space' is set
236
+ if @api_client.config.client_side_validation && space.nil?
237
+ fail ArgumentError, "Missing the required parameter 'space' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id_receipt"
238
+ end
239
+ # resource path
240
+ local_var_path = '/payment/terminals/transaction-summaries/{id}/receipt'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+ query_params[:'format'] = format
245
+ query_params[:'width'] = width
246
+
247
+ # header parameters
248
+ header_params = opts[:header_params] || {}
249
+ # HTTP header 'Accept' (if needed)
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
251
+ header_params[:'Space'] = space
252
+
253
+ # form parameters
254
+ form_params = opts[:form_params] || {}
255
+
256
+ # connection timeout
257
+ connection_timeout = @api_client.config.timeout
258
+
259
+ # http body (model)
260
+ post_body = opts[:debug_body]
261
+
262
+ # return_type
263
+ return_type = opts[:debug_return_type] || 'RenderedTerminalTransactionSummary'
264
+
265
+ new_options = opts.merge(
266
+ :operation => :"PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_id_receipt",
267
+ :header_params => header_params,
268
+ :query_params => query_params,
269
+ :form_params => form_params,
270
+ :body => post_body,
271
+ :return_type => return_type
272
+ )
273
+
274
+ data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug "API called: PaymentTerminalTransactionSummariesService#get_payment_terminals_transaction_summaries_id_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
277
+ end
278
+ return data, status_code, headers
279
+ end
280
+
281
+
282
+ # Search summaries
283
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
284
+ # @param [Hash] opts the optional parameters
285
+ # @option opts [Array<String>] :expand
286
+ # @option opts [Integer] :limit A limit on the number of objects to be returned, between 1 and 100. Default is 10.
287
+ # @option opts [Integer] :offset A cursor for pagination, specifies the number of objects to skip.
288
+ # @option opts [String] :order The fields and order to sort the objects by.
289
+ # @option opts [String] :query The search query to filter the objects by.
290
+ # @return [TerminalTransactionSummarySearchResponse]
291
+ def get_payment_terminals_transaction_summaries_search(space, opts = {})
292
+ data, _status_code, _headers = get_payment_terminals_transaction_summaries_search_with_http_info(space, opts)
293
+ data
294
+ end
295
+
296
+ # Search summaries
297
+
298
+ # @param space [Integer] Specifies the ID of the space the operation should be executed in.
299
+ # @param [Hash] opts the optional parameters
300
+ # @option opts [Array<String>] :expand
301
+ # @option opts [Integer] :limit A limit on the number of objects to be returned, between 1 and 100. Default is 10.
302
+ # @option opts [Integer] :offset A cursor for pagination, specifies the number of objects to skip.
303
+ # @option opts [String] :order The fields and order to sort the objects by.
304
+ # @option opts [String] :query The search query to filter the objects by.
305
+ # @return [Array<(TerminalTransactionSummarySearchResponse, Integer, Hash)>] TerminalTransactionSummarySearchResponse data, response status code and response headers
306
+ def get_payment_terminals_transaction_summaries_search_with_http_info(space, opts = {})
307
+ if @api_client.config.debugging
308
+ @api_client.config.logger.debug 'Calling API: PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_search ...'
309
+ end
310
+ # verify the required parameter 'space' is set
311
+ if @api_client.config.client_side_validation && space.nil?
312
+ fail ArgumentError, "Missing the required parameter 'space' when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_search"
313
+ end
314
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
315
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_search, must be smaller than or equal to 100.'
316
+ end
317
+
318
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
319
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_search, must be greater than or equal to 1.'
320
+ end
321
+
322
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] > 10000
323
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_search, must be smaller than or equal to 10000.'
324
+ end
325
+
326
+ # resource path
327
+ local_var_path = '/payment/terminals/transaction-summaries/search'
328
+
329
+ # query parameters
330
+ query_params = opts[:query_params] || {}
331
+ query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?
332
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
333
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
334
+ query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
335
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
336
+
337
+ # header parameters
338
+ header_params = opts[:header_params] || {}
339
+ # HTTP header 'Accept' (if needed)
340
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
341
+ header_params[:'Space'] = space
342
+
343
+ # form parameters
344
+ form_params = opts[:form_params] || {}
345
+
346
+ # connection timeout
347
+ connection_timeout = @api_client.config.timeout
348
+
349
+ # http body (model)
350
+ post_body = opts[:debug_body]
351
+
352
+ # return_type
353
+ return_type = opts[:debug_return_type] || 'TerminalTransactionSummarySearchResponse'
354
+
355
+ new_options = opts.merge(
356
+ :operation => :"PaymentTerminalTransactionSummariesService.get_payment_terminals_transaction_summaries_search",
357
+ :header_params => header_params,
358
+ :query_params => query_params,
359
+ :form_params => form_params,
360
+ :body => post_body,
361
+ :return_type => return_type
362
+ )
363
+
364
+ data, status_code, headers = @api_client.call_api(:GET.to_sym.downcase, local_var_path, new_options, connection_timeout)
365
+ if @api_client.config.debugging
366
+ @api_client.config.logger.debug "API called: PaymentTerminalTransactionSummariesService#get_payment_terminals_transaction_summaries_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}\nConnection Timeout: #{connection_timeout}"
367
+ end
368
+ return data, status_code, headers
369
+ end
370
+
371
+ end
372
+ end
@@ -113,7 +113,7 @@ module VrpaymentRubySdk
113
113
  public_key = CACHE[public_key_id]
114
114
  else
115
115
  fetched_key, = get_webhooks_encryption_keys_id_with_http_info(public_key_id)
116
- raise VRPaymentSdkException.new(ErrorCode::UNKNOWN_WEBHOOK_ENCRYPTION_PUBLIC_KEY,
116
+ raise VRPaymentSdkException.new(SdkExceptionErrorCodes::UNKNOWN_WEBHOOK_ENCRYPTION_PUBLIC_KEY,
117
117
  "Could not retrieve public key with ID: #{public_key_id}") if fetched_key.nil? || fetched_key.strip.empty?
118
118
 
119
119
  CACHE[public_key_id] = fetched_key
@@ -127,7 +127,7 @@ module VrpaymentRubySdk
127
127
  signature_algorithm
128
128
  )
129
129
  else
130
- raise VRPaymentSdkException.new(ErrorCode::INVALID_WEBHOOK_ENCRYPTION_HEADER_FORMAT,
130
+ raise VRPaymentSdkException.new(SdkExceptionErrorCodes::INVALID_WEBHOOK_ENCRYPTION_HEADER_FORMAT,
131
131
  "Invalid webhook encryption header format. Expected format: 'algorithm=<algorithm>, keyId=<keyId>, signature=<signature>'")
132
132
  end
133
133
  end
@@ -29,14 +29,14 @@ module VrpaymentRubySdk
29
29
 
30
30
  if encryption_algorithm.nil? || encryption_algorithm.empty?
31
31
  raise VRPaymentSdkException.new(
32
- ErrorCode::MISSING_WEBHOOK_ENCRYPTION_ALGORYTHM,
32
+ SdkExceptionErrorCodes::MISSING_WEBHOOK_ENCRYPTION_ALGORYTHM,
33
33
  "Webhook signature algorithm was not provided"
34
34
  )
35
35
  end
36
36
 
37
37
  algorithm_class = get_algorithm_class(encryption_algorithm)
38
38
  if algorithm_class.nil?
39
- raise WalleeSdkException.new(ErrorCode::UNSUPPORTED_WEBHOOK_ENCRYPTION_ALGORYTHM,
39
+ raise WalleeSdkException.new(SdkExceptionErrorCodes::UNSUPPORTED_WEBHOOK_ENCRYPTION_ALGORYTHM,
40
40
  "Unsupported webhook signature algorithm: '#{encryption_algorithm}'. " \
41
41
  "This may indicate that the REST API is using a new encryption algorithm for webhooks. " \
42
42
  "Please check whether a newer version of the SDK is available.")
@@ -45,20 +45,20 @@ module VrpaymentRubySdk
45
45
  begin
46
46
  signature = Base64.decode64(signature)
47
47
  rescue ArgumentError
48
- raise VRPaymentSdkException.new(ErrorCode::INVALID_WEBHOOK_ENCRYPTION_CONTENT_SIGNATURE, 'Invalid signature value format')
48
+ raise VRPaymentSdkException.new(SdkExceptionErrorCodes::INVALID_WEBHOOK_ENCRYPTION_CONTENT_SIGNATURE, 'Invalid signature value format')
49
49
  end
50
50
 
51
51
  begin
52
52
  public_key_bytes = Base64.decode64(public_key)
53
53
  rescue ArgumentError
54
- raise VRPaymentSdkException.new(ErrorCode::INVALID_WEBHOOK_ENCRYPTION_PUBLIC_KEY, 'Invalid public key value format')
54
+ raise VRPaymentSdkException.new(SdkExceptionErrorCodes::INVALID_WEBHOOK_ENCRYPTION_PUBLIC_KEY, 'Invalid public key value format')
55
55
  end
56
56
 
57
57
  begin
58
58
  public_key = OpenSSL::PKey.read(public_key_bytes)
59
59
  rescue OpenSSL::PKey::PKeyError
60
60
  raise VRPaymentSdkException.new(
61
- ErrorCode::INVALID_WEBHOOK_ENCRYPTION_PUBLIC_KEY,
61
+ SdkExceptionErrorCodes::INVALID_WEBHOOK_ENCRYPTION_PUBLIC_KEY,
62
62
  'Invalid public key: unsupported or unparseable format'
63
63
  )
64
64
  end
@@ -21,5 +21,5 @@
21
21
  =end
22
22
 
23
23
  module VrpaymentRubySdk
24
- VERSION = '6.2.0'
24
+ VERSION = '6.3.0'
25
25
  end
@@ -20,42 +20,11 @@
20
20
  # limitations under the License.
21
21
  =end
22
22
 
23
- # The `ErrorCode` module defines potential error codes that may be raised by the VRPayment SDK.
24
- #
25
- # ## Error Code Ranges:
26
- # - **1000–1999**: Client-side errors – typically due to invalid input (e.g., malformed headers, bad keys).
27
- # - **2000–2999**: Server-side errors – typically due to incorrect data provided by the server.
28
- # - **404**: Not Found – used when an endpoint returns an empty response.
29
- #
30
- module ErrorCode
31
- # 404
32
- UNKNOWN_WEBHOOK_ENCRYPTION_PUBLIC_KEY = { code: 404, description: "Unknown webhook signature public key" }
33
-
34
- # 1000–1999
35
- WEBHOOK_ENCRYPTION_GENERAL_ERROR = { code: 1000, description: "General webhook encryption error" }
36
- INVALID_WEBHOOK_ENCRYPTION_PUBLIC_KEY = { code: 1001, description: "Invalid webhook signature public key" }
37
- INVALID_WEBHOOK_ENCRYPTION_HEADER_FORMAT = { code: 1002, description: "Invalid webhook signature header" }
38
- UNSUPPORTED_WEBHOOK_ENCRYPTION_ALGORYTHM = { code: 1003, description: "Unsupported webhook signature algorithm" }
39
- UNKNOWN_WEBHOOK_ENCRYPTION_PROVIDER = { code: 1004, description: "Unknown webhook encryption provider" }
40
- WEBHOOK_ENCRYPTION_VERIFIER_INIT_ERROR = { code: 1005, description: "Encryption verifier initialization error" }
41
- WEBHOOK_ENCRYPTION_VERIFIER_CONTENT_UPDATE_ERROR = { code: 1006, description: "Error during content update in encryption verifier" }
42
- WEBHOOK_ENCRYPTION_SIGNATURE_VERIFICATION_FAILED = { code: 1007, description: "Encryption signature verification failed" }
43
- INVALID_WEBHOOK_ENCRYPTION_CONTENT_SIGNATURE = { code: 1008, description: "Invalid webhook content signature" }
44
-
45
- # 2000–2999
46
- MISSING_WEBHOOK_ENCRYPTION_ALGORYTHM = { code: 2000, description: "Missing webhook signature algorithm value" }
47
-
48
- def self.to_s(error)
49
- "#{error[:code]}: #{error[:description]}"
50
- end
51
- end
52
-
53
23
  class VRPaymentSdkException < StandardError
54
24
  attr_reader :code
55
25
 
56
26
  def initialize(code, message)
57
27
  @code = code
58
- full_message = "Error code: #{code[:code]}. #{message}"
59
- super(full_message)
28
+ super("Error code: #{code}. #{message}")
60
29
  end
61
- end
30
+ end
@@ -25,8 +25,12 @@ require 'vrpayment-ruby-sdk/api_client'
25
25
  require 'vrpayment-ruby-sdk/api_error'
26
26
  require 'vrpayment-ruby-sdk/version'
27
27
  require 'vrpayment-ruby-sdk/configuration'
28
- require 'vrpayment-ruby-sdk/utils/encryption_util'
29
28
  require 'vrpayment-ruby-sdk/vrpayment_sdk_exception'
29
+ require 'vrpayment-ruby-sdk/sdk_exception_error_codes'
30
+ require 'vrpayment-ruby-sdk/api_exception_error_codes'
31
+
32
+ # Utils
33
+ require 'vrpayment-ruby-sdk/utils/encryption_util'
30
34
 
31
35
  # Models
32
36
  require 'vrpayment-ruby-sdk/models/abstract_account_update'
@@ -325,6 +329,7 @@ require 'vrpayment-ruby-sdk/models/payment_terminal_configuration_state'
325
329
  require 'vrpayment-ruby-sdk/models/payment_terminal_configuration_version'
326
330
  require 'vrpayment-ruby-sdk/models/payment_terminal_configuration_version_state'
327
331
  require 'vrpayment-ruby-sdk/models/payment_terminal_create'
332
+ require 'vrpayment-ruby-sdk/models/payment_terminal_dcc_transaction_sum'
328
333
  require 'vrpayment-ruby-sdk/models/payment_terminal_location'
329
334
  require 'vrpayment-ruby-sdk/models/payment_terminal_location_state'
330
335
  require 'vrpayment-ruby-sdk/models/payment_terminal_location_version'
@@ -332,6 +337,8 @@ require 'vrpayment-ruby-sdk/models/payment_terminal_location_version_state'
332
337
  require 'vrpayment-ruby-sdk/models/payment_terminal_preparing'
333
338
  require 'vrpayment-ruby-sdk/models/payment_terminal_receipt_type'
334
339
  require 'vrpayment-ruby-sdk/models/payment_terminal_state'
340
+ require 'vrpayment-ruby-sdk/models/payment_terminal_transaction_sum'
341
+ require 'vrpayment-ruby-sdk/models/payment_terminal_transaction_summary'
335
342
  require 'vrpayment-ruby-sdk/models/payment_terminal_transaction_summary_reference'
336
343
  require 'vrpayment-ruby-sdk/models/payment_terminal_type'
337
344
  require 'vrpayment-ruby-sdk/models/payment_terminal_update'
@@ -391,6 +398,7 @@ require 'vrpayment-ruby-sdk/models/refund_type'
391
398
  require 'vrpayment-ruby-sdk/models/rendered_document'
392
399
  require 'vrpayment-ruby-sdk/models/rendered_terminal_receipt'
393
400
  require 'vrpayment-ruby-sdk/models/rendered_terminal_receipt_list_response'
401
+ require 'vrpayment-ruby-sdk/models/rendered_terminal_transaction_summary'
394
402
  require 'vrpayment-ruby-sdk/models/rest_address_format'
395
403
  require 'vrpayment-ruby-sdk/models/rest_address_format_field'
396
404
  require 'vrpayment-ruby-sdk/models/rest_api_bulk_operation_result'
@@ -514,6 +522,8 @@ require 'vrpayment-ruby-sdk/models/tenant_database'
514
522
  require 'vrpayment-ruby-sdk/models/terminal_list_response'
515
523
  require 'vrpayment-ruby-sdk/models/terminal_receipt_format'
516
524
  require 'vrpayment-ruby-sdk/models/terminal_search_response'
525
+ require 'vrpayment-ruby-sdk/models/terminal_transaction_summary_list_response'
526
+ require 'vrpayment-ruby-sdk/models/terminal_transaction_summary_search_response'
517
527
  require 'vrpayment-ruby-sdk/models/token'
518
528
  require 'vrpayment-ruby-sdk/models/token_create'
519
529
  require 'vrpayment-ruby-sdk/models/token_list_response'
@@ -629,6 +639,7 @@ require 'vrpayment-ruby-sdk/service/payment_methods_service'
629
639
  require 'vrpayment-ruby-sdk/service/payment_processor_configurations_service'
630
640
  require 'vrpayment-ruby-sdk/service/payment_processors_service'
631
641
  require 'vrpayment-ruby-sdk/service/payment_sales_channels_service'
642
+ require 'vrpayment-ruby-sdk/service/payment_terminal_transaction_summaries_service'
632
643
  require 'vrpayment-ruby-sdk/service/payment_terminals_service'
633
644
  require 'vrpayment-ruby-sdk/service/payment_web_apps_service'
634
645
  require 'vrpayment-ruby-sdk/service/permissions_service'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vrpayment-ruby-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - wallee AG
@@ -129,6 +129,7 @@ files:
129
129
  - lib/vrpayment-ruby-sdk.rb
130
130
  - lib/vrpayment-ruby-sdk/api_client.rb
131
131
  - lib/vrpayment-ruby-sdk/api_error.rb
132
+ - lib/vrpayment-ruby-sdk/api_exception_error_codes.rb
132
133
  - lib/vrpayment-ruby-sdk/configuration.rb
133
134
  - lib/vrpayment-ruby-sdk/models/abstract_account_update.rb
134
135
  - lib/vrpayment-ruby-sdk/models/abstract_application_user_update.rb
@@ -426,6 +427,7 @@ files:
426
427
  - lib/vrpayment-ruby-sdk/models/payment_terminal_configuration_version.rb
427
428
  - lib/vrpayment-ruby-sdk/models/payment_terminal_configuration_version_state.rb
428
429
  - lib/vrpayment-ruby-sdk/models/payment_terminal_create.rb
430
+ - lib/vrpayment-ruby-sdk/models/payment_terminal_dcc_transaction_sum.rb
429
431
  - lib/vrpayment-ruby-sdk/models/payment_terminal_location.rb
430
432
  - lib/vrpayment-ruby-sdk/models/payment_terminal_location_state.rb
431
433
  - lib/vrpayment-ruby-sdk/models/payment_terminal_location_version.rb
@@ -433,6 +435,8 @@ files:
433
435
  - lib/vrpayment-ruby-sdk/models/payment_terminal_preparing.rb
434
436
  - lib/vrpayment-ruby-sdk/models/payment_terminal_receipt_type.rb
435
437
  - lib/vrpayment-ruby-sdk/models/payment_terminal_state.rb
438
+ - lib/vrpayment-ruby-sdk/models/payment_terminal_transaction_sum.rb
439
+ - lib/vrpayment-ruby-sdk/models/payment_terminal_transaction_summary.rb
436
440
  - lib/vrpayment-ruby-sdk/models/payment_terminal_transaction_summary_reference.rb
437
441
  - lib/vrpayment-ruby-sdk/models/payment_terminal_type.rb
438
442
  - lib/vrpayment-ruby-sdk/models/payment_terminal_update.rb
@@ -492,6 +496,7 @@ files:
492
496
  - lib/vrpayment-ruby-sdk/models/rendered_document.rb
493
497
  - lib/vrpayment-ruby-sdk/models/rendered_terminal_receipt.rb
494
498
  - lib/vrpayment-ruby-sdk/models/rendered_terminal_receipt_list_response.rb
499
+ - lib/vrpayment-ruby-sdk/models/rendered_terminal_transaction_summary.rb
495
500
  - lib/vrpayment-ruby-sdk/models/rest_address_format.rb
496
501
  - lib/vrpayment-ruby-sdk/models/rest_address_format_field.rb
497
502
  - lib/vrpayment-ruby-sdk/models/rest_api_bulk_operation_result.rb
@@ -615,6 +620,8 @@ files:
615
620
  - lib/vrpayment-ruby-sdk/models/terminal_list_response.rb
616
621
  - lib/vrpayment-ruby-sdk/models/terminal_receipt_format.rb
617
622
  - lib/vrpayment-ruby-sdk/models/terminal_search_response.rb
623
+ - lib/vrpayment-ruby-sdk/models/terminal_transaction_summary_list_response.rb
624
+ - lib/vrpayment-ruby-sdk/models/terminal_transaction_summary_search_response.rb
618
625
  - lib/vrpayment-ruby-sdk/models/token.rb
619
626
  - lib/vrpayment-ruby-sdk/models/token_create.rb
620
627
  - lib/vrpayment-ruby-sdk/models/token_list_response.rb
@@ -686,6 +693,7 @@ files:
686
693
  - lib/vrpayment-ruby-sdk/models/webhook_url_list_response.rb
687
694
  - lib/vrpayment-ruby-sdk/models/webhook_url_search_response.rb
688
695
  - lib/vrpayment-ruby-sdk/models/webhook_url_update.rb
696
+ - lib/vrpayment-ruby-sdk/sdk_exception_error_codes.rb
689
697
  - lib/vrpayment-ruby-sdk/service/accounts_service.rb
690
698
  - lib/vrpayment-ruby-sdk/service/application_users_roles_service.rb
691
699
  - lib/vrpayment-ruby-sdk/service/application_users_service.rb
@@ -728,6 +736,7 @@ files:
728
736
  - lib/vrpayment-ruby-sdk/service/payment_processor_configurations_service.rb
729
737
  - lib/vrpayment-ruby-sdk/service/payment_processors_service.rb
730
738
  - lib/vrpayment-ruby-sdk/service/payment_sales_channels_service.rb
739
+ - lib/vrpayment-ruby-sdk/service/payment_terminal_transaction_summaries_service.rb
731
740
  - lib/vrpayment-ruby-sdk/service/payment_terminals_service.rb
732
741
  - lib/vrpayment-ruby-sdk/service/payment_web_apps_service.rb
733
742
  - lib/vrpayment-ruby-sdk/service/permissions_service.rb