wallee-ruby-sdk 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +21 -11
  3. data/lib/wallee-ruby-sdk/models/abstract_debt_collection_case_update.rb +270 -0
  4. data/lib/wallee-ruby-sdk/models/abstract_payment_link_update.rb +302 -0
  5. data/lib/wallee-ruby-sdk/models/abstract_subscription_affiliate_update.rb +230 -0
  6. data/lib/wallee-ruby-sdk/models/abstract_transaction_pending.rb +14 -4
  7. data/lib/wallee-ruby-sdk/models/criteria_operator.rb +1 -0
  8. data/lib/wallee-ruby-sdk/models/debt_collection_case.rb +502 -0
  9. data/lib/wallee-ruby-sdk/models/debt_collection_case_create.rb +310 -0
  10. data/lib/wallee-ruby-sdk/models/debt_collection_case_document.rb +300 -0
  11. data/lib/wallee-ruby-sdk/models/debt_collection_case_source.rb +232 -0
  12. data/lib/wallee-ruby-sdk/models/debt_collection_case_state.rb +48 -0
  13. data/lib/wallee-ruby-sdk/models/debt_collection_case_update.rb +300 -0
  14. data/lib/wallee-ruby-sdk/models/debt_collection_environment.rb +43 -0
  15. data/lib/wallee-ruby-sdk/models/debt_collection_receipt.rb +288 -0
  16. data/lib/wallee-ruby-sdk/models/debt_collection_receipt_source.rb +222 -0
  17. data/lib/wallee-ruby-sdk/models/debt_collector.rb +222 -0
  18. data/lib/wallee-ruby-sdk/models/debt_collector_condition.rb +258 -0
  19. data/lib/wallee-ruby-sdk/models/debt_collector_condition_type.rb +222 -0
  20. data/lib/wallee-ruby-sdk/models/debt_collector_configuration.rb +302 -0
  21. data/lib/wallee-ruby-sdk/models/document_template_type.rb +1 -11
  22. data/lib/wallee-ruby-sdk/models/entity_export_request.rb +215 -0
  23. data/lib/wallee-ruby-sdk/models/entity_query.rb +1 -1
  24. data/lib/wallee-ruby-sdk/models/entity_query_order_by.rb +10 -0
  25. data/lib/wallee-ruby-sdk/models/environment.rb +43 -0
  26. data/lib/wallee-ruby-sdk/models/metric_usage.rb +232 -0
  27. data/lib/wallee-ruby-sdk/models/payment_connector.rb +23 -1
  28. data/lib/wallee-ruby-sdk/models/payment_contract.rb +338 -0
  29. data/lib/wallee-ruby-sdk/models/payment_contract_state.rb +46 -0
  30. data/lib/wallee-ruby-sdk/models/payment_contract_type.rb +232 -0
  31. data/lib/wallee-ruby-sdk/models/payment_link.rb +382 -0
  32. data/lib/wallee-ruby-sdk/models/payment_link_active.rb +342 -0
  33. data/lib/wallee-ruby-sdk/models/payment_link_create.rb +337 -0
  34. data/lib/wallee-ruby-sdk/models/payment_link_protection_mode.rb +43 -0
  35. data/lib/wallee-ruby-sdk/models/payment_link_update.rb +332 -0
  36. data/lib/wallee-ruby-sdk/models/payment_method.rb +13 -1
  37. data/lib/wallee-ruby-sdk/models/payment_processor_configuration.rb +11 -1
  38. data/lib/wallee-ruby-sdk/models/refund.rb +11 -1
  39. data/lib/wallee-ruby-sdk/models/rest_address_format.rb +234 -0
  40. data/lib/wallee-ruby-sdk/models/rest_address_format_field.rb +51 -0
  41. data/lib/wallee-ruby-sdk/models/rest_country.rb +11 -1
  42. data/lib/wallee-ruby-sdk/models/subscription.rb +11 -1
  43. data/lib/wallee-ruby-sdk/models/subscription_affiliate.rb +290 -0
  44. data/lib/wallee-ruby-sdk/models/subscription_affiliate_create.rb +255 -0
  45. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleted.rb +290 -0
  46. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleting.rb +290 -0
  47. data/lib/wallee-ruby-sdk/models/subscription_affiliate_inactive.rb +260 -0
  48. data/lib/wallee-ruby-sdk/models/subscription_affiliate_update.rb +260 -0
  49. data/lib/wallee-ruby-sdk/models/subscription_change_request.rb +2 -2
  50. data/lib/wallee-ruby-sdk/models/subscription_create_request.rb +2 -2
  51. data/lib/wallee-ruby-sdk/models/subscription_pending.rb +11 -1
  52. data/lib/wallee-ruby-sdk/models/tokenizationn_mode.rb +44 -0
  53. data/lib/wallee-ruby-sdk/models/transaction.rb +63 -3
  54. data/lib/wallee-ruby-sdk/models/transaction_create.rb +41 -1
  55. data/lib/wallee-ruby-sdk/models/transaction_environment_selection_strategy.rb +43 -0
  56. data/lib/wallee-ruby-sdk/models/transaction_invoice.rb +11 -1
  57. data/lib/wallee-ruby-sdk/models/transaction_pending.rb +11 -1
  58. data/lib/wallee-ruby-sdk/models/unencrypted_card_data.rb +228 -0
  59. data/lib/wallee-ruby-sdk/models/unencrypted_card_data_create.rb +233 -0
  60. data/lib/wallee-ruby-sdk/models/webhook_listener_entity.rb +1 -11
  61. data/lib/wallee-ruby-sdk/services/account_service_api.rb +2 -2
  62. data/lib/wallee-ruby-sdk/services/application_user_service_api.rb +2 -2
  63. data/lib/wallee-ruby-sdk/services/card_processing_service_api.rb +176 -0
  64. data/lib/wallee-ruby-sdk/services/charge_attempt_service_api.rb +2 -2
  65. data/lib/wallee-ruby-sdk/services/charge_flow_level_service_api.rb +4 -4
  66. data/lib/wallee-ruby-sdk/services/charge_flow_service_api.rb +6 -6
  67. data/lib/wallee-ruby-sdk/services/condition_type_service_api.rb +4 -4
  68. data/lib/wallee-ruby-sdk/services/country_service_api.rb +2 -2
  69. data/lib/wallee-ruby-sdk/services/country_state_service_api.rb +4 -4
  70. data/lib/wallee-ruby-sdk/services/currency_service_api.rb +2 -2
  71. data/lib/wallee-ruby-sdk/services/debt_collection_case_service_api.rb +800 -0
  72. data/lib/wallee-ruby-sdk/services/debt_collector_configuration_service_api.rb +217 -0
  73. data/lib/wallee-ruby-sdk/services/debt_collector_service_api.rb +143 -0
  74. data/lib/wallee-ruby-sdk/services/delivery_indication_service_api.rb +6 -6
  75. data/lib/wallee-ruby-sdk/services/document_template_service_api.rb +2 -2
  76. data/lib/wallee-ruby-sdk/services/document_template_type_service_api.rb +4 -4
  77. data/lib/wallee-ruby-sdk/services/human_user_service_api.rb +59 -2
  78. data/lib/wallee-ruby-sdk/services/installment_payment_service_api.rb +4 -4
  79. data/lib/wallee-ruby-sdk/services/installment_payment_slice_service_api.rb +2 -2
  80. data/lib/wallee-ruby-sdk/services/installment_plan_calculation_service_api.rb +2 -2
  81. data/lib/wallee-ruby-sdk/services/installment_plan_configuration_service_api.rb +2 -2
  82. data/lib/wallee-ruby-sdk/services/installment_plan_slice_configuration_service_api.rb +2 -2
  83. data/lib/wallee-ruby-sdk/services/label_description_group_service_api.rb +4 -4
  84. data/lib/wallee-ruby-sdk/services/label_description_service_api.rb +4 -4
  85. data/lib/wallee-ruby-sdk/services/language_service_api.rb +2 -2
  86. data/lib/wallee-ruby-sdk/services/legal_organization_form_service_api.rb +201 -0
  87. data/lib/wallee-ruby-sdk/services/manual_task_service_api.rb +2 -2
  88. data/lib/wallee-ruby-sdk/services/mertic_usage_service_api.rb +100 -0
  89. data/lib/wallee-ruby-sdk/services/payment_connector_configuration_service_api.rb +2 -2
  90. data/lib/wallee-ruby-sdk/services/payment_connector_service_api.rb +4 -4
  91. data/lib/wallee-ruby-sdk/services/payment_link_service_api.rb +402 -0
  92. data/lib/wallee-ruby-sdk/services/payment_method_configuration_service_api.rb +2 -2
  93. data/lib/wallee-ruby-sdk/services/payment_method_service_api.rb +4 -4
  94. data/lib/wallee-ruby-sdk/services/payment_processor_configuration_service_api.rb +2 -2
  95. data/lib/wallee-ruby-sdk/services/payment_processor_service_api.rb +4 -4
  96. data/lib/wallee-ruby-sdk/services/permission_service_api.rb +4 -4
  97. data/lib/wallee-ruby-sdk/services/refund_service_api.rb +10 -10
  98. data/lib/wallee-ruby-sdk/services/space_service_api.rb +2 -2
  99. data/lib/wallee-ruby-sdk/services/static_value_service_api.rb +4 -4
  100. data/lib/wallee-ruby-sdk/services/subscriber_service_api.rb +2 -2
  101. data/lib/wallee-ruby-sdk/services/subscription_affiliate_service_api.rb +402 -0
  102. data/lib/wallee-ruby-sdk/services/subscription_charge_service_api.rb +4 -4
  103. data/lib/wallee-ruby-sdk/services/subscription_ledger_entry_service_api.rb +2 -2
  104. data/lib/wallee-ruby-sdk/services/subscription_metric_service_api.rb +2 -2
  105. data/lib/wallee-ruby-sdk/services/subscription_metric_usage_service_api.rb +2 -2
  106. data/lib/wallee-ruby-sdk/services/subscription_period_bill_service_api.rb +2 -2
  107. data/lib/wallee-ruby-sdk/services/subscription_product_component_group_service_api.rb +2 -2
  108. data/lib/wallee-ruby-sdk/services/subscription_product_component_service_api.rb +2 -2
  109. data/lib/wallee-ruby-sdk/services/subscription_product_fee_tier_service_api.rb +2 -2
  110. data/lib/wallee-ruby-sdk/services/subscription_product_metered_fee_service_api.rb +2 -2
  111. data/lib/wallee-ruby-sdk/services/subscription_product_period_fee_service_api.rb +2 -2
  112. data/lib/wallee-ruby-sdk/services/subscription_product_retirement_service_api.rb +2 -2
  113. data/lib/wallee-ruby-sdk/services/subscription_product_service_api.rb +2 -2
  114. data/lib/wallee-ruby-sdk/services/subscription_product_setup_fee_service_api.rb +2 -2
  115. data/lib/wallee-ruby-sdk/services/subscription_product_version_retirement_service_api.rb +2 -2
  116. data/lib/wallee-ruby-sdk/services/subscription_product_version_service_api.rb +2 -2
  117. data/lib/wallee-ruby-sdk/services/subscription_service_api.rb +12 -12
  118. data/lib/wallee-ruby-sdk/services/subscription_suspension_service_api.rb +2 -2
  119. data/lib/wallee-ruby-sdk/services/subscription_version_service_api.rb +2 -2
  120. data/lib/wallee-ruby-sdk/services/token_service_api.rb +2 -2
  121. data/lib/wallee-ruby-sdk/services/token_version_service_api.rb +4 -4
  122. data/lib/wallee-ruby-sdk/services/transaction_completion_service_api.rb +6 -6
  123. data/lib/wallee-ruby-sdk/services/transaction_invoice_service_api.rb +6 -6
  124. data/lib/wallee-ruby-sdk/services/transaction_service_api.rb +143 -18
  125. data/lib/wallee-ruby-sdk/services/transaction_void_service_api.rb +6 -6
  126. data/lib/wallee-ruby-sdk/services/user_account_role_service_api.rb +6 -6
  127. data/lib/wallee-ruby-sdk/services/user_space_role_service_api.rb +9 -9
  128. data/lib/wallee-ruby-sdk/services/webhook_listener_service_api.rb +2 -2
  129. data/lib/wallee-ruby-sdk/services/webhook_url_service_api.rb +2 -2
  130. data/lib/wallee-ruby-sdk/version.rb +1 -1
  131. data/lib/wallee-ruby-sdk.rb +47 -0
  132. metadata +50 -3
@@ -0,0 +1,342 @@
1
+ =begin
2
+ Wallee API: 1.0.0
3
+
4
+ The wallee API allows an easy interaction with the wallee web service.
5
+
6
+
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module Wallee
25
+ # The payment link defines an URL to automatically create transactions.
26
+ class PaymentLinkActive
27
+ # The ID is the primary key of the entity. The ID identifies the entity uniquely.
28
+ attr_accessor :id
29
+
30
+ # The version number indicates the version of the entity. The version is incremented whenever the entity is changed.
31
+ attr_accessor :version
32
+
33
+ # The allowed payment method configurations restrict the payment methods which can be used with this payment link.
34
+ attr_accessor :allowed_payment_method_configurations
35
+
36
+ # The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page.
37
+ attr_accessor :applied_space_view
38
+
39
+ # The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction.
40
+ attr_accessor :available_from
41
+
42
+ # The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction.
43
+ attr_accessor :available_until
44
+
45
+ # By making the billing address required the transaction can only be created when a billing address is provided within the request.
46
+ attr_accessor :billing_address_required
47
+
48
+ # The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'.
49
+ attr_accessor :currency
50
+
51
+ # The language defines the language of the payment page. If no language is provided it can be provided through the request parameter.
52
+ attr_accessor :language
53
+
54
+ # The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters.
55
+ attr_accessor :line_items
56
+
57
+ # The maximal number of transactions limits the number of transactions which can be created with this payment link.
58
+ attr_accessor :maximal_number_of_transactions
59
+
60
+ # The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive.
61
+ attr_accessor :name
62
+
63
+ # By making the shipping address required the transaction can only be created when a shipping address is provided within the request.
64
+ attr_accessor :shipping_address_required
65
+
66
+ #
67
+ attr_accessor :state
68
+
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'id' => :'id',
74
+ :'version' => :'version',
75
+ :'allowed_payment_method_configurations' => :'allowedPaymentMethodConfigurations',
76
+ :'applied_space_view' => :'appliedSpaceView',
77
+ :'available_from' => :'availableFrom',
78
+ :'available_until' => :'availableUntil',
79
+ :'billing_address_required' => :'billingAddressRequired',
80
+ :'currency' => :'currency',
81
+ :'language' => :'language',
82
+ :'line_items' => :'lineItems',
83
+ :'maximal_number_of_transactions' => :'maximalNumberOfTransactions',
84
+ :'name' => :'name',
85
+ :'shipping_address_required' => :'shippingAddressRequired',
86
+ :'state' => :'state'
87
+ }
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.swagger_types
92
+ {
93
+ :'id' => :'Integer',
94
+ :'version' => :'Integer',
95
+ :'allowed_payment_method_configurations' => :'Array<PaymentMethodConfiguration>',
96
+ :'applied_space_view' => :'Integer',
97
+ :'available_from' => :'DateTime',
98
+ :'available_until' => :'DateTime',
99
+ :'billing_address_required' => :'BOOLEAN',
100
+ :'currency' => :'String',
101
+ :'language' => :'String',
102
+ :'line_items' => :'Array<LineItemCreate>',
103
+ :'maximal_number_of_transactions' => :'Integer',
104
+ :'name' => :'String',
105
+ :'shipping_address_required' => :'BOOLEAN',
106
+ :'state' => :'CreationEntityState'
107
+ }
108
+ end
109
+
110
+ # Initializes the object
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ def initialize(attributes = {})
113
+ return unless attributes.is_a?(Hash)
114
+
115
+ # convert string to symbol for hash key
116
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
117
+
118
+ if attributes.has_key?(:'id')
119
+ self.id = attributes[:'id']
120
+ end
121
+
122
+ if attributes.has_key?(:'version')
123
+ self.version = attributes[:'version']
124
+ end
125
+
126
+ if attributes.has_key?(:'allowedPaymentMethodConfigurations')
127
+ if (value = attributes[:'allowedPaymentMethodConfigurations']).is_a?(Array)
128
+ self.allowed_payment_method_configurations = value
129
+ end
130
+ end
131
+
132
+ if attributes.has_key?(:'appliedSpaceView')
133
+ self.applied_space_view = attributes[:'appliedSpaceView']
134
+ end
135
+
136
+ if attributes.has_key?(:'availableFrom')
137
+ self.available_from = attributes[:'availableFrom']
138
+ end
139
+
140
+ if attributes.has_key?(:'availableUntil')
141
+ self.available_until = attributes[:'availableUntil']
142
+ end
143
+
144
+ if attributes.has_key?(:'billingAddressRequired')
145
+ self.billing_address_required = attributes[:'billingAddressRequired']
146
+ end
147
+
148
+ if attributes.has_key?(:'currency')
149
+ self.currency = attributes[:'currency']
150
+ end
151
+
152
+ if attributes.has_key?(:'language')
153
+ self.language = attributes[:'language']
154
+ end
155
+
156
+ if attributes.has_key?(:'lineItems')
157
+ if (value = attributes[:'lineItems']).is_a?(Array)
158
+ self.line_items = value
159
+ end
160
+ end
161
+
162
+ if attributes.has_key?(:'maximalNumberOfTransactions')
163
+ self.maximal_number_of_transactions = attributes[:'maximalNumberOfTransactions']
164
+ end
165
+
166
+ if attributes.has_key?(:'name')
167
+ self.name = attributes[:'name']
168
+ end
169
+
170
+ if attributes.has_key?(:'shippingAddressRequired')
171
+ self.shipping_address_required = attributes[:'shippingAddressRequired']
172
+ end
173
+
174
+ if attributes.has_key?(:'state')
175
+ self.state = attributes[:'state']
176
+ end
177
+
178
+ end
179
+
180
+ # Show invalid properties with the reasons. Usually used together with valid?
181
+ # @return Array for valid properies with the reasons
182
+ def list_invalid_properties
183
+ invalid_properties = Array.new
184
+ if @id.nil?
185
+ invalid_properties.push("invalid value for 'id', id cannot be nil.")
186
+ end
187
+
188
+ if @version.nil?
189
+ invalid_properties.push("invalid value for 'version', version cannot be nil.")
190
+ end
191
+
192
+ return invalid_properties
193
+ end
194
+
195
+ # Check to see if the all the properties in the model are valid
196
+ # @return true if the model is valid
197
+ def valid?
198
+ return false if @id.nil?
199
+ return false if @version.nil?
200
+ return true
201
+ end
202
+
203
+ # Checks equality by comparing each attribute.
204
+ # @param [Object] Object to be compared
205
+ def ==(o)
206
+ return true if self.equal?(o)
207
+ self.class == o.class &&
208
+ id == o.id &&
209
+ version == o.version &&
210
+ allowed_payment_method_configurations == o.allowed_payment_method_configurations &&
211
+ applied_space_view == o.applied_space_view &&
212
+ available_from == o.available_from &&
213
+ available_until == o.available_until &&
214
+ billing_address_required == o.billing_address_required &&
215
+ currency == o.currency &&
216
+ language == o.language &&
217
+ line_items == o.line_items &&
218
+ maximal_number_of_transactions == o.maximal_number_of_transactions &&
219
+ name == o.name &&
220
+ shipping_address_required == o.shipping_address_required &&
221
+ state == o.state
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] Object to be compared
226
+ def eql?(o)
227
+ self == o
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Fixnum] Hash code
232
+ def hash
233
+ [id, version, allowed_payment_method_configurations, applied_space_view, available_from, available_until, billing_address_required, currency, language, line_items, maximal_number_of_transactions, name, shipping_address_required, state].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ self.class.swagger_types.each_pair do |key, type|
242
+ if type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
246
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
247
+ end
248
+ elsif !attributes[self.class.attribute_map[key]].nil?
249
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
250
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
251
+ end
252
+
253
+ self
254
+ end
255
+
256
+ # Deserializes the data based on type
257
+ # @param string type Data type
258
+ # @param string value Value to be deserialized
259
+ # @return [Object] Deserialized data
260
+ def _deserialize(type, value)
261
+ case type.to_sym
262
+ when :DateTime
263
+ DateTime.parse(value)
264
+ when :Date
265
+ Date.parse(value)
266
+ when :String
267
+ value.to_s
268
+ when :Integer
269
+ value.to_i
270
+ when :Float
271
+ value.to_f
272
+ when :BOOLEAN
273
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
274
+ true
275
+ else
276
+ false
277
+ end
278
+ when :Object
279
+ # generic object (usually a Hash), return directly
280
+ value
281
+ when /\AArray<(?<inner_type>.+)>\z/
282
+ inner_type = Regexp.last_match[:inner_type]
283
+ value.map { |v| _deserialize(inner_type, v) }
284
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
285
+ k_type = Regexp.last_match[:k_type]
286
+ v_type = Regexp.last_match[:v_type]
287
+ {}.tap do |hash|
288
+ value.each do |k, v|
289
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
290
+ end
291
+ end
292
+ else # model
293
+ temp_model = Wallee.const_get(type).new
294
+ temp_model.build_from_hash(value)
295
+ end
296
+ end
297
+
298
+ # Returns the string representation of the object
299
+ # @return [String] String presentation of the object
300
+ def to_s
301
+ to_hash.to_s
302
+ end
303
+
304
+ # to_body is an alias to to_hash (backward compatibility)
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_body
307
+ to_hash
308
+ end
309
+
310
+ # Returns the object in the form of hash
311
+ # @return [Hash] Returns the object in the form of hash
312
+ def to_hash
313
+ hash = {}
314
+ self.class.attribute_map.each_pair do |attr, param|
315
+ value = self.send(attr)
316
+ next if value.nil?
317
+ hash[param] = _to_hash(value)
318
+ end
319
+ hash
320
+ end
321
+
322
+ # Outputs non-array value in the form of hash
323
+ # For object, use to_hash. Otherwise, just return the value
324
+ # @param [Object] value Any valid value
325
+ # @return [Hash] Returns the value in the form of hash
326
+ def _to_hash(value)
327
+ if value.is_a?(Array)
328
+ value.compact.map{ |v| _to_hash(v) }
329
+ elsif value.is_a?(Hash)
330
+ {}.tap do |hash|
331
+ value.each { |k, v| hash[k] = _to_hash(v) }
332
+ end
333
+ elsif value.respond_to? :to_hash
334
+ value.to_hash
335
+ else
336
+ value
337
+ end
338
+ end
339
+
340
+ end
341
+
342
+ end
@@ -0,0 +1,337 @@
1
+ =begin
2
+ Wallee API: 1.0.0
3
+
4
+ The wallee API allows an easy interaction with the wallee web service.
5
+
6
+
7
+
8
+ Licensed under the Apache License, Version 2.0 (the "License");
9
+ you may not use this file except in compliance with the License.
10
+ You may obtain a copy of the License at
11
+
12
+ http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ Unless required by applicable law or agreed to in writing, software
15
+ distributed under the License is distributed on an "AS IS" BASIS,
16
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ See the License for the specific language governing permissions and
18
+ limitations under the License.
19
+
20
+ =end
21
+
22
+ require 'date'
23
+
24
+ module Wallee
25
+ # The payment link defines an URL to automatically create transactions.
26
+ class PaymentLinkCreate
27
+ # The allowed payment method configurations restrict the payment methods which can be used with this payment link.
28
+ attr_accessor :allowed_payment_method_configurations
29
+
30
+ # The payment link can be conducted in a specific space view. The space view may apply a specific design to the payment page.
31
+ attr_accessor :applied_space_view
32
+
33
+ # The available from date defines the earliest date on which the payment link can be used. When no date is specified there will be no restriction.
34
+ attr_accessor :available_from
35
+
36
+ # The available from date defines the latest date on which the payment link can be used to initialize a transaction. When no date is specified there will be no restriction.
37
+ attr_accessor :available_until
38
+
39
+ # By making the billing address required the transaction can only be created when a billing address is provided within the request.
40
+ attr_accessor :billing_address_required
41
+
42
+ # The currency defines in which currency the payment is executed in. If no currency is defined it has to be specified within the request parameter 'currency'.
43
+ attr_accessor :currency
44
+
45
+ # The language defines the language of the payment page. If no language is provided it can be provided through the request parameter.
46
+ attr_accessor :language
47
+
48
+ # The line items allows to define the line items for this payment link. When the line items are defined they cannot be overridden through the request parameters.
49
+ attr_accessor :line_items
50
+
51
+ # The maximal number of transactions limits the number of transactions which can be created with this payment link.
52
+ attr_accessor :maximal_number_of_transactions
53
+
54
+ # The payment link name is used internally to identify the payment link. For example the name is used within search fields and hence it should be distinct and descriptive.
55
+ attr_accessor :name
56
+
57
+ # By making the shipping address required the transaction can only be created when a shipping address is provided within the request.
58
+ attr_accessor :shipping_address_required
59
+
60
+ #
61
+ attr_accessor :state
62
+
63
+ # The external id helps to identify the entity and a subsequent creation of an entity with the same ID will not create a new entity.
64
+ attr_accessor :external_id
65
+
66
+ # The protection mode determines if the payment link is protected against tampering and in what way.
67
+ attr_accessor :protection_mode
68
+
69
+
70
+ # Attribute mapping from ruby-style variable name to JSON key.
71
+ def self.attribute_map
72
+ {
73
+ :'allowed_payment_method_configurations' => :'allowedPaymentMethodConfigurations',
74
+ :'applied_space_view' => :'appliedSpaceView',
75
+ :'available_from' => :'availableFrom',
76
+ :'available_until' => :'availableUntil',
77
+ :'billing_address_required' => :'billingAddressRequired',
78
+ :'currency' => :'currency',
79
+ :'language' => :'language',
80
+ :'line_items' => :'lineItems',
81
+ :'maximal_number_of_transactions' => :'maximalNumberOfTransactions',
82
+ :'name' => :'name',
83
+ :'shipping_address_required' => :'shippingAddressRequired',
84
+ :'state' => :'state',
85
+ :'external_id' => :'externalId',
86
+ :'protection_mode' => :'protectionMode'
87
+ }
88
+ end
89
+
90
+ # Attribute type mapping.
91
+ def self.swagger_types
92
+ {
93
+ :'allowed_payment_method_configurations' => :'Array<PaymentMethodConfiguration>',
94
+ :'applied_space_view' => :'Integer',
95
+ :'available_from' => :'DateTime',
96
+ :'available_until' => :'DateTime',
97
+ :'billing_address_required' => :'BOOLEAN',
98
+ :'currency' => :'String',
99
+ :'language' => :'String',
100
+ :'line_items' => :'Array<LineItemCreate>',
101
+ :'maximal_number_of_transactions' => :'Integer',
102
+ :'name' => :'String',
103
+ :'shipping_address_required' => :'BOOLEAN',
104
+ :'state' => :'CreationEntityState',
105
+ :'external_id' => :'String',
106
+ :'protection_mode' => :'PaymentLinkProtectionMode'
107
+ }
108
+ end
109
+
110
+ # Initializes the object
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ def initialize(attributes = {})
113
+ return unless attributes.is_a?(Hash)
114
+
115
+ # convert string to symbol for hash key
116
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
117
+
118
+ if attributes.has_key?(:'allowedPaymentMethodConfigurations')
119
+ if (value = attributes[:'allowedPaymentMethodConfigurations']).is_a?(Array)
120
+ self.allowed_payment_method_configurations = value
121
+ end
122
+ end
123
+
124
+ if attributes.has_key?(:'appliedSpaceView')
125
+ self.applied_space_view = attributes[:'appliedSpaceView']
126
+ end
127
+
128
+ if attributes.has_key?(:'availableFrom')
129
+ self.available_from = attributes[:'availableFrom']
130
+ end
131
+
132
+ if attributes.has_key?(:'availableUntil')
133
+ self.available_until = attributes[:'availableUntil']
134
+ end
135
+
136
+ if attributes.has_key?(:'billingAddressRequired')
137
+ self.billing_address_required = attributes[:'billingAddressRequired']
138
+ end
139
+
140
+ if attributes.has_key?(:'currency')
141
+ self.currency = attributes[:'currency']
142
+ end
143
+
144
+ if attributes.has_key?(:'language')
145
+ self.language = attributes[:'language']
146
+ end
147
+
148
+ if attributes.has_key?(:'lineItems')
149
+ if (value = attributes[:'lineItems']).is_a?(Array)
150
+ self.line_items = value
151
+ end
152
+ end
153
+
154
+ if attributes.has_key?(:'maximalNumberOfTransactions')
155
+ self.maximal_number_of_transactions = attributes[:'maximalNumberOfTransactions']
156
+ end
157
+
158
+ if attributes.has_key?(:'name')
159
+ self.name = attributes[:'name']
160
+ end
161
+
162
+ if attributes.has_key?(:'shippingAddressRequired')
163
+ self.shipping_address_required = attributes[:'shippingAddressRequired']
164
+ end
165
+
166
+ if attributes.has_key?(:'state')
167
+ self.state = attributes[:'state']
168
+ end
169
+
170
+ if attributes.has_key?(:'externalId')
171
+ self.external_id = attributes[:'externalId']
172
+ end
173
+
174
+ if attributes.has_key?(:'protectionMode')
175
+ self.protection_mode = attributes[:'protectionMode']
176
+ end
177
+
178
+ end
179
+
180
+ # Show invalid properties with the reasons. Usually used together with valid?
181
+ # @return Array for valid properies with the reasons
182
+ def list_invalid_properties
183
+ invalid_properties = Array.new
184
+ if @external_id.nil?
185
+ invalid_properties.push("invalid value for 'external_id', external_id cannot be nil.")
186
+ end
187
+
188
+ return invalid_properties
189
+ end
190
+
191
+ # Check to see if the all the properties in the model are valid
192
+ # @return true if the model is valid
193
+ def valid?
194
+ return false if @external_id.nil?
195
+ return true
196
+ end
197
+
198
+ # Checks equality by comparing each attribute.
199
+ # @param [Object] Object to be compared
200
+ def ==(o)
201
+ return true if self.equal?(o)
202
+ self.class == o.class &&
203
+ allowed_payment_method_configurations == o.allowed_payment_method_configurations &&
204
+ applied_space_view == o.applied_space_view &&
205
+ available_from == o.available_from &&
206
+ available_until == o.available_until &&
207
+ billing_address_required == o.billing_address_required &&
208
+ currency == o.currency &&
209
+ language == o.language &&
210
+ line_items == o.line_items &&
211
+ maximal_number_of_transactions == o.maximal_number_of_transactions &&
212
+ name == o.name &&
213
+ shipping_address_required == o.shipping_address_required &&
214
+ state == o.state &&
215
+ external_id == o.external_id &&
216
+ protection_mode == o.protection_mode
217
+ end
218
+
219
+ # @see the `==` method
220
+ # @param [Object] Object to be compared
221
+ def eql?(o)
222
+ self == o
223
+ end
224
+
225
+ # Calculates hash code according to all attributes.
226
+ # @return [Fixnum] Hash code
227
+ def hash
228
+ [allowed_payment_method_configurations, applied_space_view, available_from, available_until, billing_address_required, currency, language, line_items, maximal_number_of_transactions, name, shipping_address_required, state, external_id, protection_mode].hash
229
+ end
230
+
231
+ # Builds the object from hash
232
+ # @param [Hash] attributes Model attributes in the form of hash
233
+ # @return [Object] Returns the model itself
234
+ def build_from_hash(attributes)
235
+ return nil unless attributes.is_a?(Hash)
236
+ self.class.swagger_types.each_pair do |key, type|
237
+ if type =~ /\AArray<(.*)>/i
238
+ # check to ensure the input is an array given that the the attribute
239
+ # is documented as an array but the input is not
240
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
241
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
242
+ end
243
+ elsif !attributes[self.class.attribute_map[key]].nil?
244
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
245
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
246
+ end
247
+
248
+ self
249
+ end
250
+
251
+ # Deserializes the data based on type
252
+ # @param string type Data type
253
+ # @param string value Value to be deserialized
254
+ # @return [Object] Deserialized data
255
+ def _deserialize(type, value)
256
+ case type.to_sym
257
+ when :DateTime
258
+ DateTime.parse(value)
259
+ when :Date
260
+ Date.parse(value)
261
+ when :String
262
+ value.to_s
263
+ when :Integer
264
+ value.to_i
265
+ when :Float
266
+ value.to_f
267
+ when :BOOLEAN
268
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
269
+ true
270
+ else
271
+ false
272
+ end
273
+ when :Object
274
+ # generic object (usually a Hash), return directly
275
+ value
276
+ when /\AArray<(?<inner_type>.+)>\z/
277
+ inner_type = Regexp.last_match[:inner_type]
278
+ value.map { |v| _deserialize(inner_type, v) }
279
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
280
+ k_type = Regexp.last_match[:k_type]
281
+ v_type = Regexp.last_match[:v_type]
282
+ {}.tap do |hash|
283
+ value.each do |k, v|
284
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
285
+ end
286
+ end
287
+ else # model
288
+ temp_model = Wallee.const_get(type).new
289
+ temp_model.build_from_hash(value)
290
+ end
291
+ end
292
+
293
+ # Returns the string representation of the object
294
+ # @return [String] String presentation of the object
295
+ def to_s
296
+ to_hash.to_s
297
+ end
298
+
299
+ # to_body is an alias to to_hash (backward compatibility)
300
+ # @return [Hash] Returns the object in the form of hash
301
+ def to_body
302
+ to_hash
303
+ end
304
+
305
+ # Returns the object in the form of hash
306
+ # @return [Hash] Returns the object in the form of hash
307
+ def to_hash
308
+ hash = {}
309
+ self.class.attribute_map.each_pair do |attr, param|
310
+ value = self.send(attr)
311
+ next if value.nil?
312
+ hash[param] = _to_hash(value)
313
+ end
314
+ hash
315
+ end
316
+
317
+ # Outputs non-array value in the form of hash
318
+ # For object, use to_hash. Otherwise, just return the value
319
+ # @param [Object] value Any valid value
320
+ # @return [Hash] Returns the value in the form of hash
321
+ def _to_hash(value)
322
+ if value.is_a?(Array)
323
+ value.compact.map{ |v| _to_hash(v) }
324
+ elsif value.is_a?(Hash)
325
+ {}.tap do |hash|
326
+ value.each { |k, v| hash[k] = _to_hash(v) }
327
+ end
328
+ elsif value.respond_to? :to_hash
329
+ value.to_hash
330
+ else
331
+ value
332
+ end
333
+ end
334
+
335
+ end
336
+
337
+ end