wallee-ruby-sdk 6.2.0 → 6.4.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +56 -14
- data/LICENSE +1 -1
- data/README.md +57 -29
- data/lib/wallee-ruby-sdk/api_client.rb +1 -1
- data/lib/wallee-ruby-sdk/api_exception_error_codes.rb +60 -0
- data/lib/wallee-ruby-sdk/models/bogus_express_checkout_approval_request.rb +230 -0
- data/lib/wallee-ruby-sdk/models/bogus_express_checkout_payment_data.rb +241 -0
- data/lib/wallee-ruby-sdk/models/express_checkout_approval_response.rb +270 -0
- data/lib/wallee-ruby-sdk/models/express_checkout_create_response.rb +13 -4
- data/lib/wallee-ruby-sdk/models/express_checkout_session.rb +39 -1
- data/lib/wallee-ruby-sdk/models/express_checkout_session_create.rb +21 -1
- data/lib/wallee-ruby-sdk/models/express_checkout_shipping_address_change_request.rb +239 -0
- data/lib/wallee-ruby-sdk/models/express_checkout_shipping_address_change_response.rb +241 -0
- data/lib/wallee-ruby-sdk/models/express_checkout_shipping_method_change_request.rb +231 -0
- data/lib/wallee-ruby-sdk/models/express_checkout_shipping_method_change_response.rb +241 -0
- data/lib/wallee-ruby-sdk/models/express_checkout_shipping_option.rb +1 -1
- data/lib/wallee-ruby-sdk/models/payment_terminal_address.rb +43 -5
- data/lib/wallee-ruby-sdk/models/payment_terminal_dcc_transaction_sum.rb +302 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_transaction_sum.rb +332 -0
- data/lib/wallee-ruby-sdk/models/payment_terminal_transaction_summary.rb +347 -0
- data/lib/wallee-ruby-sdk/models/refund.rb +13 -1
- data/lib/wallee-ruby-sdk/models/refund_create.rb +13 -1
- data/lib/wallee-ruby-sdk/models/rendered_terminal_transaction_summary.rb +241 -0
- data/lib/wallee-ruby-sdk/models/scope.rb +15 -15
- data/lib/wallee-ruby-sdk/models/terminal_transaction_summary_list_response.rb +253 -0
- data/lib/wallee-ruby-sdk/models/terminal_transaction_summary_search_response.rb +263 -0
- data/lib/wallee-ruby-sdk/models/transaction_completion.rb +13 -1
- data/lib/wallee-ruby-sdk/models/transaction_completion_details.rb +26 -4
- data/lib/wallee-ruby-sdk/models/transaction_user_interface_type.rb +2 -1
- data/lib/wallee-ruby-sdk/sdk_exception_error_codes.rb +55 -0
- data/lib/wallee-ruby-sdk/service/bogus_express_checkout_service.rb +114 -0
- data/lib/wallee-ruby-sdk/service/express_checkout_service.rb +162 -0
- data/lib/wallee-ruby-sdk/service/payment_terminal_transaction_summaries_service.rb +372 -0
- data/lib/wallee-ruby-sdk/service/webhook_encryption_keys_service.rb +2 -2
- data/lib/wallee-ruby-sdk/utils/encryption_util.rb +5 -5
- data/lib/wallee-ruby-sdk/version.rb +1 -1
- data/lib/wallee-ruby-sdk/wallee_sdk_exception.rb +2 -33
- data/lib/wallee-ruby-sdk.rb +20 -1
- data/test/test_querying.rb +11 -0
- metadata +19 -2
|
@@ -239,20 +239,20 @@ module WalleeRubySdk
|
|
|
239
239
|
invalid_properties.push('invalid value for "port", must be greater than or equal to 1.')
|
|
240
240
|
end
|
|
241
241
|
|
|
242
|
-
if !@preprod_domain_name.nil? && @preprod_domain_name.to_s.length >
|
|
243
|
-
invalid_properties.push('invalid value for "preprod_domain_name", the character length must be smaller than or equal to
|
|
242
|
+
if !@preprod_domain_name.nil? && @preprod_domain_name.to_s.length > 100
|
|
243
|
+
invalid_properties.push('invalid value for "preprod_domain_name", the character length must be smaller than or equal to 100.')
|
|
244
244
|
end
|
|
245
245
|
|
|
246
|
-
if !@domain_name.nil? && @domain_name.to_s.length >
|
|
247
|
-
invalid_properties.push('invalid value for "domain_name", the character length must be smaller than or equal to
|
|
246
|
+
if !@domain_name.nil? && @domain_name.to_s.length > 100
|
|
247
|
+
invalid_properties.push('invalid value for "domain_name", the character length must be smaller than or equal to 100.')
|
|
248
248
|
end
|
|
249
249
|
|
|
250
250
|
if !@name.nil? && @name.to_s.length > 50
|
|
251
251
|
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.')
|
|
252
252
|
end
|
|
253
253
|
|
|
254
|
-
if !@sandbox_domain_name.nil? && @sandbox_domain_name.to_s.length >
|
|
255
|
-
invalid_properties.push('invalid value for "sandbox_domain_name", the character length must be smaller than or equal to
|
|
254
|
+
if !@sandbox_domain_name.nil? && @sandbox_domain_name.to_s.length > 100
|
|
255
|
+
invalid_properties.push('invalid value for "sandbox_domain_name", the character length must be smaller than or equal to 100.')
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
invalid_properties
|
|
@@ -265,10 +265,10 @@ module WalleeRubySdk
|
|
|
265
265
|
return false if !@machine_name.nil? && @machine_name.to_s.length > 50
|
|
266
266
|
return false if !@machine_name.nil? && @machine_name !~ Regexp.new(/([A-Z][A-Za-z0-9]+)(_([A-Z][A-Za-z0-9]+))*/)
|
|
267
267
|
return false if !@port.nil? && @port < 1
|
|
268
|
-
return false if !@preprod_domain_name.nil? && @preprod_domain_name.to_s.length >
|
|
269
|
-
return false if !@domain_name.nil? && @domain_name.to_s.length >
|
|
268
|
+
return false if !@preprod_domain_name.nil? && @preprod_domain_name.to_s.length > 100
|
|
269
|
+
return false if !@domain_name.nil? && @domain_name.to_s.length > 100
|
|
270
270
|
return false if !@name.nil? && @name.to_s.length > 50
|
|
271
|
-
return false if !@sandbox_domain_name.nil? && @sandbox_domain_name.to_s.length >
|
|
271
|
+
return false if !@sandbox_domain_name.nil? && @sandbox_domain_name.to_s.length > 100
|
|
272
272
|
true
|
|
273
273
|
end
|
|
274
274
|
|
|
@@ -322,8 +322,8 @@ module WalleeRubySdk
|
|
|
322
322
|
fail ArgumentError, 'preprod_domain_name cannot be nil'
|
|
323
323
|
end
|
|
324
324
|
|
|
325
|
-
if preprod_domain_name.to_s.length >
|
|
326
|
-
fail ArgumentError, 'invalid value for "preprod_domain_name", the character length must be smaller than or equal to
|
|
325
|
+
if preprod_domain_name.to_s.length > 100
|
|
326
|
+
fail ArgumentError, 'invalid value for "preprod_domain_name", the character length must be smaller than or equal to 100.'
|
|
327
327
|
end
|
|
328
328
|
|
|
329
329
|
@preprod_domain_name = preprod_domain_name
|
|
@@ -336,8 +336,8 @@ module WalleeRubySdk
|
|
|
336
336
|
fail ArgumentError, 'domain_name cannot be nil'
|
|
337
337
|
end
|
|
338
338
|
|
|
339
|
-
if domain_name.to_s.length >
|
|
340
|
-
fail ArgumentError, 'invalid value for "domain_name", the character length must be smaller than or equal to
|
|
339
|
+
if domain_name.to_s.length > 100
|
|
340
|
+
fail ArgumentError, 'invalid value for "domain_name", the character length must be smaller than or equal to 100.'
|
|
341
341
|
end
|
|
342
342
|
|
|
343
343
|
@domain_name = domain_name
|
|
@@ -364,8 +364,8 @@ module WalleeRubySdk
|
|
|
364
364
|
fail ArgumentError, 'sandbox_domain_name cannot be nil'
|
|
365
365
|
end
|
|
366
366
|
|
|
367
|
-
if sandbox_domain_name.to_s.length >
|
|
368
|
-
fail ArgumentError, 'invalid value for "sandbox_domain_name", the character length must be smaller than or equal to
|
|
367
|
+
if sandbox_domain_name.to_s.length > 100
|
|
368
|
+
fail ArgumentError, 'invalid value for "sandbox_domain_name", the character length must be smaller than or equal to 100.'
|
|
369
369
|
end
|
|
370
370
|
|
|
371
371
|
@sandbox_domain_name = sandbox_domain_name
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
# Wallee AG Ruby SDK
|
|
3
|
+
#
|
|
4
|
+
# This library allows to interact with the Wallee AG payment service.
|
|
5
|
+
#
|
|
6
|
+
# Copyright owner: Wallee AG
|
|
7
|
+
# Website: https://en.wallee.com
|
|
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 'date'
|
|
24
|
+
require 'time'
|
|
25
|
+
|
|
26
|
+
module WalleeRubySdk
|
|
27
|
+
class TerminalTransactionSummaryListResponse
|
|
28
|
+
# An array containing the actual response objects.
|
|
29
|
+
attr_accessor :data
|
|
30
|
+
|
|
31
|
+
# Whether there are more objects available after this set. If false, there are no more objects to retrieve.
|
|
32
|
+
attr_accessor :has_more
|
|
33
|
+
|
|
34
|
+
# The applied limit on the number of objects returned.
|
|
35
|
+
attr_accessor :limit
|
|
36
|
+
|
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
|
+
def self.attribute_map
|
|
39
|
+
{
|
|
40
|
+
:'data' => :'data',
|
|
41
|
+
:'has_more' => :'hasMore',
|
|
42
|
+
:'limit' => :'limit'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns attribute mapping this model knows about
|
|
47
|
+
def self.acceptable_attribute_map
|
|
48
|
+
attribute_map
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Returns all the JSON keys this model knows about
|
|
52
|
+
def self.acceptable_attributes
|
|
53
|
+
acceptable_attribute_map.values
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Attribute type mapping.
|
|
57
|
+
def self.openapi_types
|
|
58
|
+
{
|
|
59
|
+
:'data' => :'Array<PaymentTerminalTransactionSummary>',
|
|
60
|
+
:'has_more' => :'Boolean',
|
|
61
|
+
:'limit' => :'Integer'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `WalleeRubySdk::TerminalTransactionSummaryListResponse` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `WalleeRubySdk::TerminalTransactionSummaryListResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'data')
|
|
88
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
89
|
+
self.data = value
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'has_more')
|
|
94
|
+
self.has_more = attributes[:'has_more']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'limit')
|
|
98
|
+
self.limit = attributes[:'limit']
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
# @return Array for valid properties with the reasons
|
|
104
|
+
def list_invalid_properties
|
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
106
|
+
invalid_properties = Array.new
|
|
107
|
+
invalid_properties
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Check to see if the all the properties in the model are valid
|
|
111
|
+
# @return true if the model is valid
|
|
112
|
+
def valid?
|
|
113
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
114
|
+
true
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
data == o.data &&
|
|
123
|
+
has_more == o.has_more &&
|
|
124
|
+
limit == o.limit
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# @see the `==` method
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def eql?(o)
|
|
130
|
+
self == o
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Calculates hash code according to all attributes.
|
|
134
|
+
# @return [Integer] Hash code
|
|
135
|
+
def hash
|
|
136
|
+
[data, has_more, limit].hash
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Builds the object from hash
|
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
141
|
+
# @return [Object] Returns the model itself
|
|
142
|
+
def self.build_from_hash(attributes)
|
|
143
|
+
return nil unless attributes.is_a?(Hash)
|
|
144
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
145
|
+
transformed_hash = {}
|
|
146
|
+
openapi_types.each_pair do |key, type|
|
|
147
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
148
|
+
transformed_hash["#{key}"] = nil
|
|
149
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
150
|
+
# check to ensure the input is an array given that the attribute
|
|
151
|
+
# is documented as an array but the input is not
|
|
152
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
153
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
154
|
+
end
|
|
155
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
156
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
new(transformed_hash)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Deserializes the data based on type
|
|
163
|
+
# @param string type Data type
|
|
164
|
+
# @param string value Value to be deserialized
|
|
165
|
+
# @return [Object] Deserialized data
|
|
166
|
+
def self._deserialize(type, value)
|
|
167
|
+
case type.to_sym
|
|
168
|
+
when :Time
|
|
169
|
+
Time.parse(value)
|
|
170
|
+
when :Date
|
|
171
|
+
Date.parse(value)
|
|
172
|
+
when :String
|
|
173
|
+
value.to_s
|
|
174
|
+
when :Integer
|
|
175
|
+
value.to_i
|
|
176
|
+
when :Float
|
|
177
|
+
value.to_f
|
|
178
|
+
when :Boolean
|
|
179
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
180
|
+
true
|
|
181
|
+
else
|
|
182
|
+
false
|
|
183
|
+
end
|
|
184
|
+
when :Object
|
|
185
|
+
# generic object (usually a Hash), return directly
|
|
186
|
+
value
|
|
187
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
188
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
189
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
190
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
191
|
+
k_type = Regexp.last_match[:k_type]
|
|
192
|
+
v_type = Regexp.last_match[:v_type]
|
|
193
|
+
{}.tap do |hash|
|
|
194
|
+
value.each do |k, v|
|
|
195
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
else # model
|
|
199
|
+
# models (e.g. Pet) or oneOf
|
|
200
|
+
klass = WalleeRubySdk.const_get(type)
|
|
201
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Returns the string representation of the object
|
|
206
|
+
# @return [String] String presentation of the object
|
|
207
|
+
def to_s
|
|
208
|
+
to_hash.to_s
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
212
|
+
# @return [Hash] Returns the object in the form of hash
|
|
213
|
+
def to_body
|
|
214
|
+
to_hash
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Returns the object in the form of hash
|
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
|
219
|
+
def to_hash
|
|
220
|
+
hash = {}
|
|
221
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
222
|
+
value = self.send(attr)
|
|
223
|
+
if value.nil?
|
|
224
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
225
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
hash[param] = _to_hash(value)
|
|
229
|
+
end
|
|
230
|
+
hash
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Outputs non-array value in the form of hash
|
|
234
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
235
|
+
# @param [Object] value Any valid value
|
|
236
|
+
# @return [Hash] Returns the value in the form of hash
|
|
237
|
+
def _to_hash(value)
|
|
238
|
+
if value.is_a?(Array)
|
|
239
|
+
value.compact.map { |v| _to_hash(v) }
|
|
240
|
+
elsif value.is_a?(Hash)
|
|
241
|
+
{}.tap do |hash|
|
|
242
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
243
|
+
end
|
|
244
|
+
elsif value.respond_to? :to_hash
|
|
245
|
+
value.to_hash
|
|
246
|
+
else
|
|
247
|
+
value
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
end
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
# Wallee AG Ruby SDK
|
|
3
|
+
#
|
|
4
|
+
# This library allows to interact with the Wallee AG payment service.
|
|
5
|
+
#
|
|
6
|
+
# Copyright owner: Wallee AG
|
|
7
|
+
# Website: https://en.wallee.com
|
|
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 'date'
|
|
24
|
+
require 'time'
|
|
25
|
+
|
|
26
|
+
module WalleeRubySdk
|
|
27
|
+
class TerminalTransactionSummarySearchResponse
|
|
28
|
+
# An array containing the actual response objects.
|
|
29
|
+
attr_accessor :data
|
|
30
|
+
|
|
31
|
+
# The number of skipped objects.
|
|
32
|
+
attr_accessor :offset
|
|
33
|
+
|
|
34
|
+
# Whether there are more objects available after this set. If false, there are no more objects to retrieve.
|
|
35
|
+
attr_accessor :has_more
|
|
36
|
+
|
|
37
|
+
# The applied limit on the number of objects returned.
|
|
38
|
+
attr_accessor :limit
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'data' => :'data',
|
|
44
|
+
:'offset' => :'offset',
|
|
45
|
+
:'has_more' => :'hasMore',
|
|
46
|
+
:'limit' => :'limit'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns attribute mapping this model knows about
|
|
51
|
+
def self.acceptable_attribute_map
|
|
52
|
+
attribute_map
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns all the JSON keys this model knows about
|
|
56
|
+
def self.acceptable_attributes
|
|
57
|
+
acceptable_attribute_map.values
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.openapi_types
|
|
62
|
+
{
|
|
63
|
+
:'data' => :'Array<PaymentTerminalTransactionSummary>',
|
|
64
|
+
:'offset' => :'Integer',
|
|
65
|
+
:'has_more' => :'Boolean',
|
|
66
|
+
:'limit' => :'Integer'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `WalleeRubySdk::TerminalTransactionSummarySearchResponse` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `WalleeRubySdk::TerminalTransactionSummarySearchResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
|
+
end
|
|
89
|
+
h[k.to_sym] = v
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'data')
|
|
93
|
+
if (value = attributes[:'data']).is_a?(Array)
|
|
94
|
+
self.data = value
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'offset')
|
|
99
|
+
self.offset = attributes[:'offset']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'has_more')
|
|
103
|
+
self.has_more = attributes[:'has_more']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'limit')
|
|
107
|
+
self.limit = attributes[:'limit']
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
112
|
+
# @return Array for valid properties with the reasons
|
|
113
|
+
def list_invalid_properties
|
|
114
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
115
|
+
invalid_properties = Array.new
|
|
116
|
+
invalid_properties
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Check to see if the all the properties in the model are valid
|
|
120
|
+
# @return true if the model is valid
|
|
121
|
+
def valid?
|
|
122
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Checks equality by comparing each attribute.
|
|
127
|
+
# @param [Object] Object to be compared
|
|
128
|
+
def ==(o)
|
|
129
|
+
return true if self.equal?(o)
|
|
130
|
+
self.class == o.class &&
|
|
131
|
+
data == o.data &&
|
|
132
|
+
offset == o.offset &&
|
|
133
|
+
has_more == o.has_more &&
|
|
134
|
+
limit == o.limit
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# @see the `==` method
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def eql?(o)
|
|
140
|
+
self == o
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Calculates hash code according to all attributes.
|
|
144
|
+
# @return [Integer] Hash code
|
|
145
|
+
def hash
|
|
146
|
+
[data, offset, has_more, limit].hash
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Builds the object from hash
|
|
150
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
151
|
+
# @return [Object] Returns the model itself
|
|
152
|
+
def self.build_from_hash(attributes)
|
|
153
|
+
return nil unless attributes.is_a?(Hash)
|
|
154
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
155
|
+
transformed_hash = {}
|
|
156
|
+
openapi_types.each_pair do |key, type|
|
|
157
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = nil
|
|
159
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
160
|
+
# check to ensure the input is an array given that the attribute
|
|
161
|
+
# is documented as an array but the input is not
|
|
162
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
163
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
164
|
+
end
|
|
165
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
166
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
new(transformed_hash)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Deserializes the data based on type
|
|
173
|
+
# @param string type Data type
|
|
174
|
+
# @param string value Value to be deserialized
|
|
175
|
+
# @return [Object] Deserialized data
|
|
176
|
+
def self._deserialize(type, value)
|
|
177
|
+
case type.to_sym
|
|
178
|
+
when :Time
|
|
179
|
+
Time.parse(value)
|
|
180
|
+
when :Date
|
|
181
|
+
Date.parse(value)
|
|
182
|
+
when :String
|
|
183
|
+
value.to_s
|
|
184
|
+
when :Integer
|
|
185
|
+
value.to_i
|
|
186
|
+
when :Float
|
|
187
|
+
value.to_f
|
|
188
|
+
when :Boolean
|
|
189
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
190
|
+
true
|
|
191
|
+
else
|
|
192
|
+
false
|
|
193
|
+
end
|
|
194
|
+
when :Object
|
|
195
|
+
# generic object (usually a Hash), return directly
|
|
196
|
+
value
|
|
197
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
198
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
199
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
200
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
201
|
+
k_type = Regexp.last_match[:k_type]
|
|
202
|
+
v_type = Regexp.last_match[:v_type]
|
|
203
|
+
{}.tap do |hash|
|
|
204
|
+
value.each do |k, v|
|
|
205
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
else # model
|
|
209
|
+
# models (e.g. Pet) or oneOf
|
|
210
|
+
klass = WalleeRubySdk.const_get(type)
|
|
211
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# Returns the string representation of the object
|
|
216
|
+
# @return [String] String presentation of the object
|
|
217
|
+
def to_s
|
|
218
|
+
to_hash.to_s
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
|
223
|
+
def to_body
|
|
224
|
+
to_hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Returns the object in the form of hash
|
|
228
|
+
# @return [Hash] Returns the object in the form of hash
|
|
229
|
+
def to_hash
|
|
230
|
+
hash = {}
|
|
231
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
232
|
+
value = self.send(attr)
|
|
233
|
+
if value.nil?
|
|
234
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
235
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
hash[param] = _to_hash(value)
|
|
239
|
+
end
|
|
240
|
+
hash
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Outputs non-array value in the form of hash
|
|
244
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
245
|
+
# @param [Object] value Any valid value
|
|
246
|
+
# @return [Hash] Returns the value in the form of hash
|
|
247
|
+
def _to_hash(value)
|
|
248
|
+
if value.is_a?(Array)
|
|
249
|
+
value.compact.map { |v| _to_hash(v) }
|
|
250
|
+
elsif value.is_a?(Hash)
|
|
251
|
+
{}.tap do |hash|
|
|
252
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
253
|
+
end
|
|
254
|
+
elsif value.respond_to? :to_hash
|
|
255
|
+
value.to_hash
|
|
256
|
+
else
|
|
257
|
+
value
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
end
|
|
@@ -53,6 +53,9 @@ module WalleeRubySdk
|
|
|
53
53
|
|
|
54
54
|
attr_accessor :mode
|
|
55
55
|
|
|
56
|
+
# Allow to store additional information about the object.
|
|
57
|
+
attr_accessor :meta_data
|
|
58
|
+
|
|
56
59
|
# The date and time when the transaction completion succeeded.
|
|
57
60
|
attr_accessor :succeeded_on
|
|
58
61
|
|
|
@@ -149,6 +152,7 @@ module WalleeRubySdk
|
|
|
149
152
|
:'created_on' => :'createdOn',
|
|
150
153
|
:'line_items' => :'lineItems',
|
|
151
154
|
:'mode' => :'mode',
|
|
155
|
+
:'meta_data' => :'metaData',
|
|
152
156
|
:'succeeded_on' => :'succeededOn',
|
|
153
157
|
:'id' => :'id',
|
|
154
158
|
:'state' => :'state',
|
|
@@ -196,6 +200,7 @@ module WalleeRubySdk
|
|
|
196
200
|
:'created_on' => :'Time',
|
|
197
201
|
:'line_items' => :'Array<LineItem>',
|
|
198
202
|
:'mode' => :'TransactionCompletionMode',
|
|
203
|
+
:'meta_data' => :'Hash<String, String>',
|
|
199
204
|
:'succeeded_on' => :'Time',
|
|
200
205
|
:'id' => :'Integer',
|
|
201
206
|
:'state' => :'TransactionCompletionState',
|
|
@@ -288,6 +293,12 @@ module WalleeRubySdk
|
|
|
288
293
|
self.mode = attributes[:'mode']
|
|
289
294
|
end
|
|
290
295
|
|
|
296
|
+
if attributes.key?(:'meta_data')
|
|
297
|
+
if (value = attributes[:'meta_data']).is_a?(Hash)
|
|
298
|
+
self.meta_data = value
|
|
299
|
+
end
|
|
300
|
+
end
|
|
301
|
+
|
|
291
302
|
if attributes.key?(:'succeeded_on')
|
|
292
303
|
self.succeeded_on = attributes[:'succeeded_on']
|
|
293
304
|
end
|
|
@@ -514,6 +525,7 @@ module WalleeRubySdk
|
|
|
514
525
|
created_on == o.created_on &&
|
|
515
526
|
line_items == o.line_items &&
|
|
516
527
|
mode == o.mode &&
|
|
528
|
+
meta_data == o.meta_data &&
|
|
517
529
|
succeeded_on == o.succeeded_on &&
|
|
518
530
|
id == o.id &&
|
|
519
531
|
state == o.state &&
|
|
@@ -546,7 +558,7 @@ module WalleeRubySdk
|
|
|
546
558
|
# Calculates hash code according to all attributes.
|
|
547
559
|
# @return [Integer] Hash code
|
|
548
560
|
def hash
|
|
549
|
-
[line_item_version, statement_descriptor, base_line_items, processing_on, invoice_merchant_reference, language, remaining_line_items, created_on, line_items, mode, succeeded_on, id, state, linked_transaction, payment_information, amount, last_completion, planned_purge_date, external_id, time_zone, space_view_id, version, labels, linked_space_id, timeout_on, created_by, next_update_on, failure_reason, tax_amount, failed_on, processor_reference].hash
|
|
561
|
+
[line_item_version, statement_descriptor, base_line_items, processing_on, invoice_merchant_reference, language, remaining_line_items, created_on, line_items, mode, meta_data, succeeded_on, id, state, linked_transaction, payment_information, amount, last_completion, planned_purge_date, external_id, time_zone, space_view_id, version, labels, linked_space_id, timeout_on, created_by, next_update_on, failure_reason, tax_amount, failed_on, processor_reference].hash
|
|
550
562
|
end
|
|
551
563
|
|
|
552
564
|
# Builds the object from hash
|