wallee-ruby-sdk 7.0.0 → 8.0.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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +16 -16
  3. data/README.md +38 -1
  4. data/lib/wallee-ruby-sdk/api_client.rb +1 -1
  5. data/lib/wallee-ruby-sdk/models/charge_attempt_projection.rb +13 -4
  6. data/lib/wallee-ruby-sdk/models/express_checkout_session.rb +449 -0
  7. data/lib/wallee-ruby-sdk/models/express_checkout_session_create.rb +381 -0
  8. data/lib/wallee-ruby-sdk/models/express_checkout_session_create_response.rb +241 -0
  9. data/lib/wallee-ruby-sdk/models/express_checkout_session_process_request.rb +329 -0
  10. data/lib/wallee-ruby-sdk/models/express_checkout_session_process_response.rb +231 -0
  11. data/lib/wallee-ruby-sdk/models/express_checkout_session_state.rb +53 -0
  12. data/lib/wallee-ruby-sdk/models/express_checkout_shipping_option.rb +303 -0
  13. data/lib/wallee-ruby-sdk/models/express_checkout_wallet_type.rb +255 -0
  14. data/lib/wallee-ruby-sdk/models/fulfillment_state.rb +2 -1
  15. data/lib/wallee-ruby-sdk/models/merchant_application_submit_request_dto.rb +232 -0
  16. data/lib/wallee-ruby-sdk/models/merchant_application_submitted_dto.rb +273 -0
  17. data/lib/wallee-ruby-sdk/models/{payment_terminal_update.rb → payment_terminal_update_request.rb} +15 -41
  18. data/lib/wallee-ruby-sdk/models/subscription_partial_update_request.rb +250 -0
  19. data/lib/wallee-ruby-sdk/models/subscription_update_request.rb +45 -22
  20. data/lib/wallee-ruby-sdk/models/transaction_amounts.rb +257 -0
  21. data/lib/wallee-ruby-sdk/models/walleejoin_create_partnership_api_request_dto.rb +20 -1
  22. data/lib/wallee-ruby-sdk/service/express_checkout_session_service.rb +255 -0
  23. data/lib/wallee-ruby-sdk/service/merchant_applications_service.rb +151 -0
  24. data/lib/wallee-ruby-sdk/service/payment_terminals_service.rb +9 -9
  25. data/lib/wallee-ruby-sdk/service/subscriptions_service.rb +9 -9
  26. data/lib/wallee-ruby-sdk/version.rb +1 -1
  27. data/lib/wallee-ruby-sdk.rb +14 -1
  28. data/wallee-ruby-sdk.gemspec +3 -3
  29. metadata +962 -931
@@ -0,0 +1,250 @@
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 SubscriptionPartialUpdateRequest
28
+ # A description used to identify the subscription.
29
+ attr_accessor :description
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'description' => :'description'
35
+ }
36
+ end
37
+
38
+ # Returns attribute mapping this model knows about
39
+ def self.acceptable_attribute_map
40
+ attribute_map
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ acceptable_attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'description' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WalleeRubySdk::SubscriptionPartialUpdateRequest` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WalleeRubySdk::SubscriptionPartialUpdateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'description')
78
+ self.description = attributes[:'description']
79
+ end
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ invalid_properties = Array.new
87
+ if !@description.nil? && @description.to_s.length > 200
88
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 200.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ warn '[DEPRECATED] the `valid?` method is obsolete'
98
+ return false if !@description.nil? && @description.to_s.length > 200
99
+ true
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] description Value to be assigned
104
+ def description=(description)
105
+ if description.nil?
106
+ fail ArgumentError, 'description cannot be nil'
107
+ end
108
+
109
+ if description.to_s.length > 200
110
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 200.'
111
+ end
112
+
113
+ @description = description
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ description == o.description
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [description].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ transformed_hash = {}
143
+ openapi_types.each_pair do |key, type|
144
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = nil
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[attribute_map[key]].is_a?(Array)
150
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
151
+ end
152
+ elsif !attributes[attribute_map[key]].nil?
153
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
154
+ end
155
+ end
156
+ new(transformed_hash)
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def self._deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = WalleeRubySdk.const_get(type)
198
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -25,13 +25,25 @@ require 'time'
25
25
 
26
26
  module WalleeRubySdk
27
27
  class SubscriptionUpdateRequest
28
- # A description used to identify the subscription.
29
- attr_accessor :description
28
+ # The configurations of the subscription's components.
29
+ attr_accessor :component_configurations
30
+
31
+ # The product to subscribe to.
32
+ attr_accessor :product
33
+
34
+ # The three-letter code (ISO 4217 format) of the currency used to invoice the customer. Must be one of the currencies supported by the product.
35
+ attr_accessor :currency
36
+
37
+ # Whether the subscriptions' termination periods should be respected.
38
+ attr_accessor :respect_termination_period
30
39
 
31
40
  # Attribute mapping from ruby-style variable name to JSON key.
32
41
  def self.attribute_map
33
42
  {
34
- :'description' => :'description'
43
+ :'component_configurations' => :'componentConfigurations',
44
+ :'product' => :'product',
45
+ :'currency' => :'currency',
46
+ :'respect_termination_period' => :'respectTerminationPeriod'
35
47
  }
36
48
  end
37
49
 
@@ -48,7 +60,10 @@ module WalleeRubySdk
48
60
  # Attribute type mapping.
49
61
  def self.openapi_types
50
62
  {
51
- :'description' => :'String'
63
+ :'component_configurations' => :'Array<SubscriptionComponentReferenceConfiguration>',
64
+ :'product' => :'Integer',
65
+ :'currency' => :'String',
66
+ :'respect_termination_period' => :'Boolean'
52
67
  }
53
68
  end
54
69
 
@@ -74,8 +89,22 @@ module WalleeRubySdk
74
89
  h[k.to_sym] = v
75
90
  }
76
91
 
77
- if attributes.key?(:'description')
78
- self.description = attributes[:'description']
92
+ if attributes.key?(:'component_configurations')
93
+ if (value = attributes[:'component_configurations']).is_a?(Array)
94
+ self.component_configurations = value
95
+ end
96
+ end
97
+
98
+ if attributes.key?(:'product')
99
+ self.product = attributes[:'product']
100
+ end
101
+
102
+ if attributes.key?(:'currency')
103
+ self.currency = attributes[:'currency']
104
+ end
105
+
106
+ if attributes.key?(:'respect_termination_period')
107
+ self.respect_termination_period = attributes[:'respect_termination_period']
79
108
  end
80
109
  end
81
110
 
@@ -84,10 +113,6 @@ module WalleeRubySdk
84
113
  def list_invalid_properties
85
114
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
115
  invalid_properties = Array.new
87
- if !@description.nil? && @description.to_s.length > 200
88
- invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 200.')
89
- end
90
-
91
116
  invalid_properties
92
117
  end
93
118
 
@@ -95,22 +120,17 @@ module WalleeRubySdk
95
120
  # @return true if the model is valid
96
121
  def valid?
97
122
  warn '[DEPRECATED] the `valid?` method is obsolete'
98
- return false if !@description.nil? && @description.to_s.length > 200
99
123
  true
100
124
  end
101
125
 
102
126
  # Custom attribute writer method with validation
103
- # @param [Object] description Value to be assigned
104
- def description=(description)
105
- if description.nil?
106
- fail ArgumentError, 'description cannot be nil'
107
- end
108
-
109
- if description.to_s.length > 200
110
- fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 200.'
127
+ # @param [Object] component_configurations Value to be assigned
128
+ def component_configurations=(component_configurations)
129
+ if component_configurations.nil?
130
+ fail ArgumentError, 'component_configurations cannot be nil'
111
131
  end
112
132
 
113
- @description = description
133
+ @component_configurations = component_configurations
114
134
  end
115
135
 
116
136
  # Checks equality by comparing each attribute.
@@ -118,7 +138,10 @@ module WalleeRubySdk
118
138
  def ==(o)
119
139
  return true if self.equal?(o)
120
140
  self.class == o.class &&
121
- description == o.description
141
+ component_configurations == o.component_configurations &&
142
+ product == o.product &&
143
+ currency == o.currency &&
144
+ respect_termination_period == o.respect_termination_period
122
145
  end
123
146
 
124
147
  # @see the `==` method
@@ -130,7 +153,7 @@ module WalleeRubySdk
130
153
  # Calculates hash code according to all attributes.
131
154
  # @return [Integer] Hash code
132
155
  def hash
133
- [description].hash
156
+ [component_configurations, product, currency, respect_termination_period].hash
134
157
  end
135
158
 
136
159
  # Builds the object from hash
@@ -0,0 +1,257 @@
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 TransactionAmounts
28
+ attr_accessor :completed_amount
29
+
30
+ attr_accessor :authorization_amount
31
+
32
+ attr_accessor :currency
33
+
34
+ attr_accessor :refunded_amount
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'completed_amount' => :'completedAmount',
40
+ :'authorization_amount' => :'authorizationAmount',
41
+ :'currency' => :'currency',
42
+ :'refunded_amount' => :'refundedAmount'
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
+ :'completed_amount' => :'Float',
60
+ :'authorization_amount' => :'Float',
61
+ :'currency' => :'String',
62
+ :'refunded_amount' => :'Float'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `WalleeRubySdk::TransactionAmounts` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `WalleeRubySdk::TransactionAmounts`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'completed_amount')
89
+ self.completed_amount = attributes[:'completed_amount']
90
+ end
91
+
92
+ if attributes.key?(:'authorization_amount')
93
+ self.authorization_amount = attributes[:'authorization_amount']
94
+ end
95
+
96
+ if attributes.key?(:'currency')
97
+ self.currency = attributes[:'currency']
98
+ end
99
+
100
+ if attributes.key?(:'refunded_amount')
101
+ self.refunded_amount = attributes[:'refunded_amount']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ true
118
+ end
119
+
120
+ # Checks equality by comparing each attribute.
121
+ # @param [Object] Object to be compared
122
+ def ==(o)
123
+ return true if self.equal?(o)
124
+ self.class == o.class &&
125
+ completed_amount == o.completed_amount &&
126
+ authorization_amount == o.authorization_amount &&
127
+ currency == o.currency &&
128
+ refunded_amount == o.refunded_amount
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [completed_amount, authorization_amount, currency, refunded_amount].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def self._deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = WalleeRubySdk.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -29,6 +29,11 @@ module WalleeRubySdk
29
29
 
30
30
  attr_accessor :partner_account_id
31
31
 
32
+ # The name of the subaccount created for the merchant. Only used for ISV partnerships when a merchant email address is provided. If empty, a generated name is used.
33
+ attr_accessor :merchant_account_name
34
+
35
+ attr_accessor :merchant_address
36
+
32
37
  attr_accessor :pricing_profile_sell_rate_id
33
38
 
34
39
  attr_accessor :subscription_product_id
@@ -40,6 +45,8 @@ module WalleeRubySdk
40
45
  {
41
46
  :'email_message' => :'emailMessage',
42
47
  :'partner_account_id' => :'partnerAccountId',
48
+ :'merchant_account_name' => :'merchantAccountName',
49
+ :'merchant_address' => :'merchantAddress',
43
50
  :'pricing_profile_sell_rate_id' => :'pricingProfileSellRateId',
44
51
  :'subscription_product_id' => :'subscriptionProductId',
45
52
  :'merchant_email_address' => :'merchantEmailAddress'
@@ -61,6 +68,8 @@ module WalleeRubySdk
61
68
  {
62
69
  :'email_message' => :'String',
63
70
  :'partner_account_id' => :'Integer',
71
+ :'merchant_account_name' => :'String',
72
+ :'merchant_address' => :'SpaceAddressCreate',
64
73
  :'pricing_profile_sell_rate_id' => :'Integer',
65
74
  :'subscription_product_id' => :'Integer',
66
75
  :'merchant_email_address' => :'String'
@@ -97,6 +106,14 @@ module WalleeRubySdk
97
106
  self.partner_account_id = attributes[:'partner_account_id']
98
107
  end
99
108
 
109
+ if attributes.key?(:'merchant_account_name')
110
+ self.merchant_account_name = attributes[:'merchant_account_name']
111
+ end
112
+
113
+ if attributes.key?(:'merchant_address')
114
+ self.merchant_address = attributes[:'merchant_address']
115
+ end
116
+
100
117
  if attributes.key?(:'pricing_profile_sell_rate_id')
101
118
  self.pricing_profile_sell_rate_id = attributes[:'pricing_profile_sell_rate_id']
102
119
  end
@@ -132,6 +149,8 @@ module WalleeRubySdk
132
149
  self.class == o.class &&
133
150
  email_message == o.email_message &&
134
151
  partner_account_id == o.partner_account_id &&
152
+ merchant_account_name == o.merchant_account_name &&
153
+ merchant_address == o.merchant_address &&
135
154
  pricing_profile_sell_rate_id == o.pricing_profile_sell_rate_id &&
136
155
  subscription_product_id == o.subscription_product_id &&
137
156
  merchant_email_address == o.merchant_email_address
@@ -146,7 +165,7 @@ module WalleeRubySdk
146
165
  # Calculates hash code according to all attributes.
147
166
  # @return [Integer] Hash code
148
167
  def hash
149
- [email_message, partner_account_id, pricing_profile_sell_rate_id, subscription_product_id, merchant_email_address].hash
168
+ [email_message, partner_account_id, merchant_account_name, merchant_address, pricing_profile_sell_rate_id, subscription_product_id, merchant_email_address].hash
150
169
  end
151
170
 
152
171
  # Builds the object from hash