wallee-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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -4
  3. data/README.md +3 -1
  4. data/lib/wallee-ruby-sdk/api_client.rb +12 -0
  5. data/lib/wallee-ruby-sdk/configuration.rb +4 -1
  6. data/lib/wallee-ruby-sdk/models/rendered_document.rb +17 -5
  7. data/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb +17 -5
  8. data/lib/wallee-ruby-sdk/models/rendered_terminal_transaction_summary.rb +17 -5
  9. data/lib/wallee-ruby-sdk/models/transaction_completion.rb +26 -1
  10. data/lib/wallee-ruby-sdk/models/transaction_completion_request.rb +26 -1
  11. data/lib/wallee-ruby-sdk/version.rb +1 -1
  12. data/test/condition_type_service_test.rb +1 -0
  13. data/test/transaction_create_service_test.rb +1 -0
  14. data/test/transaction_payment_page_service_test.rb +1 -0
  15. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.1.gem +0 -0
  16. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/ffi-1.15.5/gem_make.out +2 -2
  17. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/gem_make.out +1 -1
  18. data/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/json-2.6.2/mkmf.log +1 -1
  19. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/CHANGELOG.md +16 -0
  20. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Gemfile +4 -2
  21. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/LICENSE.txt +0 -0
  22. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/README.md +0 -0
  23. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/Rakefile +0 -0
  24. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/data/unicode.data +0 -0
  25. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/native.rb +0 -1
  26. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna/pure.rb +0 -1
  27. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/idna.rb +0 -1
  28. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/template.rb +3 -4
  29. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/uri.rb +57 -53
  30. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable/version.rb +1 -2
  31. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/lib/addressable.rb +0 -0
  32. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/idna_spec.rb +0 -1
  33. 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
  34. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/security_spec.rb +0 -1
  35. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/template_spec.rb +9 -1
  36. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/addressable/uri_spec.rb +81 -1
  37. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/spec/spec_helper.rb +0 -0
  38. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/clobber.rake +0 -0
  39. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/gem.rake +5 -2
  40. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/git.rake +0 -0
  41. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/metrics.rake +0 -0
  42. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/profile.rake +0 -0
  43. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/rspec.rake +0 -0
  44. data/vendor/bundle/ruby/2.4.0/gems/{addressable-2.8.0 → addressable-2.8.1}/tasks/yard.rake +0 -0
  45. data/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +3 -3
  46. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/Makefile +2 -2
  47. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/generator/Makefile +2 -2
  48. data/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/parser/Makefile +2 -2
  49. data/vendor/bundle/ruby/2.4.0/specifications/{addressable-2.8.0.gemspec → addressable-2.8.1.gemspec} +8 -7
  50. metadata +30 -31
  51. data/vendor/bundle/ruby/2.4.0/cache/addressable-2.8.0.gem +0 -0
  52. 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: d4245eec7b9273e33d76944d1cec6233450829cd
4
- data.tar.gz: 9c0fa757290b8e291584c4a5ee876f7f6a57b076
3
+ metadata.gz: a31de5a2d4ecf147f1bf0f276703d68a2cad7310
4
+ data.tar.gz: 1098372b4106c6a26036fdb8c399555c581009dc
5
5
  SHA512:
6
- metadata.gz: 31de25748d1ffbc154e7c4ffa6b3fd5f97fed598e66160e605e68a7464a760d0ed6e4bc642d016e91ea97a1f358ef0151234a1bd98b5665ff9cd2177ec18f0c5
7
- data.tar.gz: 9889bce34ef6094472468852f33e42fb0184b904795a25fe97fdbc1a83d6028ac3cb8dbdb515e0be0986337c00e178f02e6d6506b3769def28348b5398af36ed
6
+ metadata.gz: 38198e35d5dd5f5e1d7805d6907499dd9edc59e1b7fccd25a71ce0b77a051973b806c239dc53a569527e9d489ba4bdcfa354e1982dfe1e7a0dc48e55a8a5edbf
7
+ data.tar.gz: 959901b14c320d5661b7e68f08b8115d9a7a1b511c52b17944f913a12739b9e1920ccce8aa23012b3ef7cd8b1ab633c1e23f634e802b17d85820a44612a4fafe
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wallee-ruby-sdk (3.1.4)
4
+ wallee-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
  wallee-ruby-sdk!
33
33
 
34
34
  BUNDLED WITH
35
- 2.3.19
35
+ 2.3.22
data/README.md CHANGED
@@ -20,7 +20,7 @@ $ gem install wallee-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 [wallee
23
- account dashboard](https://app-wallee.com/account/select). Set `space_id`, `user_id`, and `api_secret` to their values:
23
+ account dashboard](https://app-wallee.com/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
  Wallee.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
@@ -44,6 +44,9 @@ module Wallee
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 Wallee
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': "wallee",
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 Wallee
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 = 'app-wallee.com:443'
96
98
  @base_path = '/api'
@@ -102,6 +104,7 @@ module Wallee
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
@@ -20,7 +20,6 @@ require 'date'
20
20
  module Wallee
21
21
  #
22
22
  class RenderedDocument
23
- #
24
23
  attr_accessor :data
25
24
 
26
25
  #
@@ -45,7 +44,7 @@ module Wallee
45
44
  # Attribute type mapping.
46
45
  def self.swagger_types
47
46
  {
48
- :'data' => :'Array<String>',
47
+ :'data' => :'String',
49
48
  :'document_template_type' => :'Integer',
50
49
  :'mime_type' => :'String',
51
50
  :'title' => :'String'
@@ -61,9 +60,7 @@ module Wallee
61
60
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
61
 
63
62
  if attributes.has_key?(:'data')
64
- if (value = attributes[:'data']).is_a?(Array)
65
- self.data = value
66
- end
63
+ self.data = attributes[:'data']
67
64
  end
68
65
 
69
66
  if attributes.has_key?(:'documentTemplateType')
@@ -83,15 +80,30 @@ module Wallee
83
80
  # @return Array for valid properties with the reasons
84
81
  def list_invalid_properties
85
82
  invalid_properties = Array.new
83
+ if !@data.nil? && @data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
84
+ invalid_properties.push('invalid value for "data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
85
+ end
86
+
86
87
  invalid_properties
87
88
  end
88
89
 
89
90
  # Check to see if the all the properties in the model are valid
90
91
  # @return true if the model is valid
91
92
  def valid?
93
+ return false if !@data.nil? && @data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
92
94
  true
93
95
  end
94
96
 
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] data Value to be assigned
99
+ def data=(data)
100
+ if !data.nil? && data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
101
+ fail ArgumentError, 'invalid value for "data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
102
+ end
103
+
104
+ @data = data
105
+ end
106
+
95
107
  # Checks equality by comparing each attribute.
96
108
  # @param [Object] Object to be compared
97
109
  def ==(o)
@@ -20,7 +20,6 @@ require 'date'
20
20
  module Wallee
21
21
  #
22
22
  class RenderedTerminalReceipt
23
- # The data property contains the binary data of the receipt document encoded as base 64 encoded string.
24
23
  attr_accessor :data
25
24
 
26
25
  # The mime type indicates the format of the receipt document. The mime type depends on the requested receipt format.
@@ -45,7 +44,7 @@ module Wallee
45
44
  # Attribute type mapping.
46
45
  def self.swagger_types
47
46
  {
48
- :'data' => :'Array<String>',
47
+ :'data' => :'String',
49
48
  :'mime_type' => :'String',
50
49
  :'printed' => :'BOOLEAN',
51
50
  :'receipt_type' => :'PaymentTerminalReceiptType'
@@ -61,9 +60,7 @@ module Wallee
61
60
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
61
 
63
62
  if attributes.has_key?(:'data')
64
- if (value = attributes[:'data']).is_a?(Array)
65
- self.data = value
66
- end
63
+ self.data = attributes[:'data']
67
64
  end
68
65
 
69
66
  if attributes.has_key?(:'mimeType')
@@ -83,15 +80,30 @@ module Wallee
83
80
  # @return Array for valid properties with the reasons
84
81
  def list_invalid_properties
85
82
  invalid_properties = Array.new
83
+ if !@data.nil? && @data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
84
+ invalid_properties.push('invalid value for "data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
85
+ end
86
+
86
87
  invalid_properties
87
88
  end
88
89
 
89
90
  # Check to see if the all the properties in the model are valid
90
91
  # @return true if the model is valid
91
92
  def valid?
93
+ return false if !@data.nil? && @data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
92
94
  true
93
95
  end
94
96
 
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] data Value to be assigned
99
+ def data=(data)
100
+ if !data.nil? && data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
101
+ fail ArgumentError, 'invalid value for "data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
102
+ end
103
+
104
+ @data = data
105
+ end
106
+
95
107
  # Checks equality by comparing each attribute.
96
108
  # @param [Object] Object to be compared
97
109
  def ==(o)
@@ -20,7 +20,6 @@ require 'date'
20
20
  module Wallee
21
21
  #
22
22
  class RenderedTerminalTransactionSummary
23
- # The data property contains the binary data of the receipt document encoded as base 64 encoded string.
24
23
  attr_accessor :data
25
24
 
26
25
  # The mime type indicates the format of the receipt document. The mime type depends on the requested receipt format.
@@ -37,7 +36,7 @@ module Wallee
37
36
  # Attribute type mapping.
38
37
  def self.swagger_types
39
38
  {
40
- :'data' => :'Array<String>',
39
+ :'data' => :'String',
41
40
  :'mime_type' => :'String'
42
41
  }
43
42
  end
@@ -51,9 +50,7 @@ module Wallee
51
50
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
51
 
53
52
  if attributes.has_key?(:'data')
54
- if (value = attributes[:'data']).is_a?(Array)
55
- self.data = value
56
- end
53
+ self.data = attributes[:'data']
57
54
  end
58
55
 
59
56
  if attributes.has_key?(:'mimeType')
@@ -65,15 +62,30 @@ module Wallee
65
62
  # @return Array for valid properties with the reasons
66
63
  def list_invalid_properties
67
64
  invalid_properties = Array.new
65
+ if !@data.nil? && @data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
66
+ invalid_properties.push('invalid value for "data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
67
+ end
68
+
68
69
  invalid_properties
69
70
  end
70
71
 
71
72
  # Check to see if the all the properties in the model are valid
72
73
  # @return true if the model is valid
73
74
  def valid?
75
+ return false if !@data.nil? && @data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
74
76
  true
75
77
  end
76
78
 
79
+ # Custom attribute writer method with validation
80
+ # @param [Object] data Value to be assigned
81
+ def data=(data)
82
+ if !data.nil? && data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
83
+ fail ArgumentError, 'invalid value for "data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
84
+ end
85
+
86
+ @data = data
87
+ end
88
+
77
89
  # Checks equality by comparing each attribute.
78
90
  # @param [Object] Object to be compared
79
91
  def ==(o)
@@ -95,6 +95,9 @@ module Wallee
95
95
  #
96
96
  attr_accessor :state
97
97
 
98
+ # The statement descriptor explain charges or payments on bank statements.
99
+ attr_accessor :statement_descriptor
100
+
98
101
  #
99
102
  attr_accessor :succeeded_on
100
103
 
@@ -138,6 +141,7 @@ module Wallee
138
141
  :'remaining_line_items' => :'remainingLineItems',
139
142
  :'space_view_id' => :'spaceViewId',
140
143
  :'state' => :'state',
144
+ :'statement_descriptor' => :'statementDescriptor',
141
145
  :'succeeded_on' => :'succeededOn',
142
146
  :'tax_amount' => :'taxAmount',
143
147
  :'time_zone' => :'timeZone',
@@ -174,6 +178,7 @@ module Wallee
174
178
  :'remaining_line_items' => :'Array<LineItem>',
175
179
  :'space_view_id' => :'Integer',
176
180
  :'state' => :'TransactionCompletionState',
181
+ :'statement_descriptor' => :'String',
177
182
  :'succeeded_on' => :'DateTime',
178
183
  :'tax_amount' => :'Float',
179
184
  :'time_zone' => :'String',
@@ -298,6 +303,10 @@ module Wallee
298
303
  self.state = attributes[:'state']
299
304
  end
300
305
 
306
+ if attributes.has_key?(:'statementDescriptor')
307
+ self.statement_descriptor = attributes[:'statementDescriptor']
308
+ end
309
+
301
310
  if attributes.has_key?(:'succeededOn')
302
311
  self.succeeded_on = attributes[:'succeededOn']
303
312
  end
@@ -335,6 +344,10 @@ module Wallee
335
344
  invalid_properties.push('invalid value for "invoice_merchant_reference", the character length must be smaller than or equal to 100.')
336
345
  end
337
346
 
347
+ if !@statement_descriptor.nil? && @statement_descriptor.to_s.length > 22
348
+ invalid_properties.push('invalid value for "statement_descriptor", the character length must be smaller than or equal to 22.')
349
+ end
350
+
338
351
  invalid_properties
339
352
  end
340
353
 
@@ -344,6 +357,7 @@ module Wallee
344
357
  return false if !@external_id.nil? && @external_id.to_s.length > 100
345
358
  return false if !@external_id.nil? && @external_id.to_s.length < 1
346
359
  return false if !@invoice_merchant_reference.nil? && @invoice_merchant_reference.to_s.length > 100
360
+ return false if !@statement_descriptor.nil? && @statement_descriptor.to_s.length > 22
347
361
  true
348
362
  end
349
363
 
@@ -371,6 +385,16 @@ module Wallee
371
385
  @invoice_merchant_reference = invoice_merchant_reference
372
386
  end
373
387
 
388
+ # Custom attribute writer method with validation
389
+ # @param [Object] statement_descriptor Value to be assigned
390
+ def statement_descriptor=(statement_descriptor)
391
+ if !statement_descriptor.nil? && statement_descriptor.to_s.length > 22
392
+ fail ArgumentError, 'invalid value for "statement_descriptor", the character length must be smaller than or equal to 22.'
393
+ end
394
+
395
+ @statement_descriptor = statement_descriptor
396
+ end
397
+
374
398
  # Checks equality by comparing each attribute.
375
399
  # @param [Object] Object to be compared
376
400
  def ==(o)
@@ -401,6 +425,7 @@ module Wallee
401
425
  remaining_line_items == o.remaining_line_items &&
402
426
  space_view_id == o.space_view_id &&
403
427
  state == o.state &&
428
+ statement_descriptor == o.statement_descriptor &&
404
429
  succeeded_on == o.succeeded_on &&
405
430
  tax_amount == o.tax_amount &&
406
431
  time_zone == o.time_zone &&
@@ -417,7 +442,7 @@ module Wallee
417
442
  # Calculates hash code according to all attributes.
418
443
  # @return [Fixnum] Hash code
419
444
  def hash
420
- [id, linked_space_id, linked_transaction, amount, base_line_items, created_by, created_on, external_id, failed_on, failure_reason, invoice_merchant_reference, labels, language, last_completion, line_item_version, line_items, mode, next_update_on, payment_information, planned_purge_date, processing_on, processor_reference, remaining_line_items, space_view_id, state, succeeded_on, tax_amount, time_zone, timeout_on, version].hash
445
+ [id, linked_space_id, linked_transaction, amount, base_line_items, created_by, created_on, external_id, failed_on, failure_reason, invoice_merchant_reference, labels, language, last_completion, line_item_version, line_items, mode, next_update_on, payment_information, planned_purge_date, processing_on, processor_reference, remaining_line_items, space_view_id, state, statement_descriptor, succeeded_on, tax_amount, time_zone, timeout_on, version].hash
421
446
  end
422
447
 
423
448
  # Builds the object from hash
@@ -32,6 +32,9 @@ module Wallee
32
32
  # The line items which will be used to complete the transaction.
33
33
  attr_accessor :line_items
34
34
 
35
+ # The statement descriptor explain charges or payments on bank statements.
36
+ attr_accessor :statement_descriptor
37
+
35
38
  # The ID of the transaction which should be completed.
36
39
  attr_accessor :transaction_id
37
40
 
@@ -42,6 +45,7 @@ module Wallee
42
45
  :'invoice_merchant_reference' => :'invoiceMerchantReference',
43
46
  :'last_completion' => :'lastCompletion',
44
47
  :'line_items' => :'lineItems',
48
+ :'statement_descriptor' => :'statementDescriptor',
45
49
  :'transaction_id' => :'transactionId'
46
50
  }
47
51
  end
@@ -53,6 +57,7 @@ module Wallee
53
57
  :'invoice_merchant_reference' => :'String',
54
58
  :'last_completion' => :'BOOLEAN',
55
59
  :'line_items' => :'Array<CompletionLineItemCreate>',
60
+ :'statement_descriptor' => :'String',
56
61
  :'transaction_id' => :'Integer'
57
62
  }
58
63
  end
@@ -83,6 +88,10 @@ module Wallee
83
88
  end
84
89
  end
85
90
 
91
+ if attributes.has_key?(:'statementDescriptor')
92
+ self.statement_descriptor = attributes[:'statementDescriptor']
93
+ end
94
+
86
95
  if attributes.has_key?(:'transactionId')
87
96
  self.transaction_id = attributes[:'transactionId']
88
97
  end
@@ -112,6 +121,10 @@ module Wallee
112
121
  invalid_properties.push('invalid value for "last_completion", last_completion cannot be nil.')
113
122
  end
114
123
 
124
+ if !@statement_descriptor.nil? && @statement_descriptor.to_s.length > 22
125
+ invalid_properties.push('invalid value for "statement_descriptor", the character length must be smaller than or equal to 22.')
126
+ end
127
+
115
128
  if @transaction_id.nil?
116
129
  invalid_properties.push('invalid value for "transaction_id", transaction_id cannot be nil.')
117
130
  end
@@ -127,6 +140,7 @@ module Wallee
127
140
  return false if @external_id.to_s.length < 1
128
141
  return false if !@invoice_merchant_reference.nil? && @invoice_merchant_reference.to_s.length > 100
129
142
  return false if @last_completion.nil?
143
+ return false if !@statement_descriptor.nil? && @statement_descriptor.to_s.length > 22
130
144
  return false if @transaction_id.nil?
131
145
  true
132
146
  end
@@ -159,6 +173,16 @@ module Wallee
159
173
  @invoice_merchant_reference = invoice_merchant_reference
160
174
  end
161
175
 
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] statement_descriptor Value to be assigned
178
+ def statement_descriptor=(statement_descriptor)
179
+ if !statement_descriptor.nil? && statement_descriptor.to_s.length > 22
180
+ fail ArgumentError, 'invalid value for "statement_descriptor", the character length must be smaller than or equal to 22.'
181
+ end
182
+
183
+ @statement_descriptor = statement_descriptor
184
+ end
185
+
162
186
  # Checks equality by comparing each attribute.
163
187
  # @param [Object] Object to be compared
164
188
  def ==(o)
@@ -168,6 +192,7 @@ module Wallee
168
192
  invoice_merchant_reference == o.invoice_merchant_reference &&
169
193
  last_completion == o.last_completion &&
170
194
  line_items == o.line_items &&
195
+ statement_descriptor == o.statement_descriptor &&
171
196
  transaction_id == o.transaction_id
172
197
  end
173
198
 
@@ -180,7 +205,7 @@ module Wallee
180
205
  # Calculates hash code according to all attributes.
181
206
  # @return [Fixnum] Hash code
182
207
  def hash
183
- [external_id, invoice_merchant_reference, last_completion, line_items, transaction_id].hash
208
+ [external_id, invoice_merchant_reference, last_completion, line_items, statement_descriptor, transaction_id].hash
184
209
  end
185
210
 
186
211
  # Builds the object from hash
@@ -16,5 +16,5 @@ limitations under the License.
16
16
  =end
17
17
 
18
18
  module Wallee
19
- VERSION = '3.1.4'
19
+ VERSION = '3.2.0'
20
20
  end
@@ -11,6 +11,7 @@ class TestConditionTypeAll < Test::Unit::TestCase
11
11
  Wallee.configure do |config|
12
12
  config.user_id = app_user_id
13
13
  config.authentication_key = app_user_key
14
+ config.default_headers = {"x-meta-header-ruby": 'value', "x-meta-header-ruby-2": 'value2'}
14
15
  end
15
16
 
16
17
  condition_type_service = Wallee::ConditionTypeService.new
@@ -12,6 +12,7 @@ class TestTransactionCreate < Test::Unit::TestCase
12
12
  Wallee.configure do |config|
13
13
  config.user_id = app_user_id
14
14
  config.authentication_key = app_user_key
15
+ config.default_headers = {"x-meta-header-ruby": 'value', "x-meta-header-ruby-2": 'value2'}
15
16
  end
16
17
 
17
18
  transaction_service = Wallee::TransactionService.new
@@ -12,6 +12,7 @@ class TestTransactionCreate < Test::Unit::TestCase
12
12
  Wallee.configure do |config|
13
13
  config.user_id = app_user_id
14
14
  config.authentication_key = app_user_key
15
+ config.default_headers = {"x-meta-header-ruby": 'value', "x-meta-header-ruby-2": 'value2'}
15
16
  end
16
17
 
17
18
  transaction_service = Wallee::TransactionService.new
@@ -1,5 +1,5 @@
1
1
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c
2
- /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20220808-1628-1a9hxv8.rb extconf.rb
2
+ /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20221004-1674-18xqn89.rb extconf.rb
3
3
  checking for ffi.h... yes
4
4
  checking for ffi_prep_closure_loc() in -lffi... yes
5
5
  checking for ffi_prep_cif_var()... yes
@@ -367,4 +367,4 @@ linking shared-object ffi_c.so
367
367
 
368
368
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/ffi-1.15.5/ext/ffi_c
369
369
  make "DESTDIR=" install
370
- /usr/bin/install -c -m 0755 ffi_c.so ./.gem.20220808-1628-1h33zqf
370
+ /usr/bin/install -c -m 0755 ffi_c.so ./.gem.20221004-1674-1ii22zc
@@ -1,5 +1,5 @@
1
1
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json
2
- /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20220808-1628-ql0wo3.rb extconf.rb
2
+ /opt/hostedtoolcache/Ruby/2.4.1/x64/bin/ruby -r ./siteconf20221004-1674-55h4z.rb extconf.rb
3
3
  creating Makefile
4
4
 
5
5
  current directory: /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json
@@ -176,7 +176,7 @@ In file included from /opt/hostedtoolcache/Ruby/2.4.1/x64/include/ruby-2.4.0/rub
176
176
  cc1: warning: unrecognized command line option ‘-Wno-self-assign’
177
177
  cc1: warning: unrecognized command line option ‘-Wno-constant-logical-operand’
178
178
  cc1: warning: unrecognized command line option ‘-Wno-parentheses-equality’
179
- /usr/bin/ld: /tmp/ccsqa8n8.o: in function `t':
179
+ /usr/bin/ld: /tmp/ccJuc7FH.o: in function `t':
180
180
  /home/runner/work/ruby-sdk/ruby-sdk/vendor/bundle/ruby/2.4.0/gems/json-2.6.2/ext/json/ext/parser/conftest.c:16: undefined reference to `rb_enc_interned_str'
181
181
  collect2: error: ld returned 1 exit status
182
182
  checked program was:
@@ -1,3 +1,19 @@
1
+ # Addressable 2.8.1
2
+ - refactor `Addressable::URI.normalize_path` to address linter offenses ([#430](https://github.com/sporkmonger/addressable/pull/430))
3
+ - remove redundant colon in `Addressable::URI::CharacterClasses::AUTHORITY` regex ([#438](https://github.com/sporkmonger/addressable/pull/438))
4
+ - update gemspec to reflect supported Ruby versions ([#466], [#464], [#463])
5
+ - compatibility w/ public_suffix 5.x ([#466], [#465], [#460])
6
+ - fixes "invalid byte sequence in UTF-8" exception when unencoding URLs containing non UTF-8 characters ([#459](https://github.com/sporkmonger/addressable/pull/459))
7
+ - `Ractor` compatibility ([#449](https://github.com/sporkmonger/addressable/pull/449))
8
+ - use the whole string instead of a single line for template match ([#431](https://github.com/sporkmonger/addressable/pull/431))
9
+ - force UTF-8 encoding only if needed ([#341](https://github.com/sporkmonger/addressable/pull/341))
10
+
11
+ [#460]: https://github.com/sporkmonger/addressable/pull/460
12
+ [#463]: https://github.com/sporkmonger/addressable/pull/463
13
+ [#464]: https://github.com/sporkmonger/addressable/pull/464
14
+ [#465]: https://github.com/sporkmonger/addressable/pull/465
15
+ [#466]: https://github.com/sporkmonger/addressable/pull/466
16
+
1
17
  # Addressable 2.8.0
2
18
  - fixes ReDoS vulnerability in Addressable::Template#match
3
19
  - no longer replaces `+` with spaces in queries for non-http(s) schemes
@@ -2,7 +2,7 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- gemspec(path: __FILE__ == "(eval)" ? ".." : ".")
5
+ gemspec
6
6
 
7
7
  group :test do
8
8
  gem 'rspec', '~> 3.8'
@@ -25,4 +25,6 @@ group :test, :development do
25
25
  gem "rake", ">= 12.3.3"
26
26
  end
27
27
 
28
- gem "idn-ruby", platform: :mri
28
+ unless ENV["IDNA_MODE"] == "pure"
29
+ gem "idn-ruby", platform: :mri
30
+ end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # encoding:utf-8
4
3
  #--
5
4
  # Copyright (C) Bob Aman
6
5
  #
@@ -657,12 +656,12 @@ module Addressable
657
656
  def ordered_variable_defaults
658
657
  @ordered_variable_defaults ||= begin
659
658
  expansions, _ = parse_template_pattern(pattern)
660
- expansions.map do |capture|
659
+ expansions.flat_map do |capture|
661
660
  _, _, varlist = *capture.match(EXPRESSION)
662
661
  varlist.split(',').map do |varspec|
663
662
  varspec[VARSPEC, 1]
664
663
  end
665
- end.flatten
664
+ end
666
665
  end
667
666
  end
668
667
 
@@ -1023,7 +1022,7 @@ module Addressable
1023
1022
  end
1024
1023
 
1025
1024
  # Ensure that the regular expression matches the whole URI.
1026
- regexp_string = "^#{regexp_string}$"
1025
+ regexp_string = "\\A#{regexp_string}\\z"
1027
1026
  return expansions, Regexp.new(regexp_string)
1028
1027
  end
1029
1028