wallee-ruby-sdk 2.2.3 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/lib/wallee-ruby-sdk.rb +63 -8
  5. data/lib/wallee-ruby-sdk/api/bank_account_service_api.rb +213 -0
  6. data/lib/wallee-ruby-sdk/api/bank_transaction_service_api.rb +213 -0
  7. data/lib/wallee-ruby-sdk/api/charge_bank_transaction_service_api.rb +213 -0
  8. data/lib/wallee-ruby-sdk/api/currency_bank_account_service_api.rb +213 -0
  9. data/lib/wallee-ruby-sdk/api/external_transfer_bank_transaction_service_api.rb +213 -0
  10. data/lib/wallee-ruby-sdk/api/internal_transfer_bank_transaction_service_api.rb +213 -0
  11. data/lib/wallee-ruby-sdk/api/payment_terminal_till_service_api.rb +170 -0
  12. data/lib/wallee-ruby-sdk/api/refund_bank_transaction_service_api.rb +213 -0
  13. data/lib/wallee-ruby-sdk/api/refund_recovery_bank_transaction_service_api.rb +213 -0
  14. data/lib/wallee-ruby-sdk/api/shopify_subscriber_service_api.rb +62 -0
  15. data/lib/wallee-ruby-sdk/api/shopify_subscription_service_api.rb +124 -0
  16. data/lib/wallee-ruby-sdk/api/shopify_transaction_service_api.rb +213 -0
  17. data/lib/wallee-ruby-sdk/api/subscriber_service_api.rb +3 -3
  18. data/lib/wallee-ruby-sdk/api/subscription_service_api.rb +67 -0
  19. data/lib/wallee-ruby-sdk/api/token_service_api.rb +189 -0
  20. data/lib/wallee-ruby-sdk/api/transaction_terminal_service_api.rb +21 -32
  21. data/lib/wallee-ruby-sdk/api/web_app_service_api.rb +200 -0
  22. data/lib/wallee-ruby-sdk/api_client.rb +7 -4
  23. data/lib/wallee-ruby-sdk/configuration.rb +2 -2
  24. data/lib/wallee-ruby-sdk/models/abstract_account_update.rb +11 -1
  25. data/lib/wallee-ruby-sdk/models/abstract_payment_link_update.rb +15 -15
  26. data/lib/wallee-ruby-sdk/models/{abstract_shopify_subscription_product_active.rb → abstract_shopify_subscription_product_update.rb} +2 -12
  27. data/lib/wallee-ruby-sdk/models/abstract_space_update.rb +11 -1
  28. data/lib/wallee-ruby-sdk/models/abstract_subscription_product_active.rb +11 -1
  29. data/lib/wallee-ruby-sdk/models/abstract_transaction_pending.rb +59 -1
  30. data/lib/wallee-ruby-sdk/models/abstract_webhook_url_update.rb +24 -0
  31. data/lib/wallee-ruby-sdk/models/account.rb +31 -1
  32. data/lib/wallee-ruby-sdk/models/account_create.rb +11 -1
  33. data/lib/wallee-ruby-sdk/models/account_update.rb +11 -1
  34. data/lib/wallee-ruby-sdk/models/authenticated_card_data.rb +221 -0
  35. data/lib/wallee-ruby-sdk/models/{unencrypted_card_data.rb → authenticated_card_data_create.rb} +86 -12
  36. data/lib/wallee-ruby-sdk/models/bank_account.rb +291 -0
  37. data/lib/wallee-ruby-sdk/models/bank_account_environment.rb +35 -0
  38. data/lib/wallee-ruby-sdk/models/bank_account_state.rb +37 -0
  39. data/lib/wallee-ruby-sdk/models/bank_account_type.rb +227 -0
  40. data/lib/wallee-ruby-sdk/models/bank_transaction.rb +387 -0
  41. data/lib/wallee-ruby-sdk/models/bank_transaction_flow_direction.rb +35 -0
  42. data/lib/wallee-ruby-sdk/models/bank_transaction_source.rb +215 -0
  43. data/lib/wallee-ruby-sdk/models/bank_transaction_state.rb +35 -0
  44. data/lib/wallee-ruby-sdk/models/bank_transaction_type.rb +215 -0
  45. data/lib/wallee-ruby-sdk/models/card_authentication_response.rb +38 -0
  46. data/lib/wallee-ruby-sdk/models/card_authentication_version.rb +35 -0
  47. data/lib/wallee-ruby-sdk/models/card_cryptogram.rb +201 -0
  48. data/lib/wallee-ruby-sdk/models/card_cryptogram_create.rb +211 -0
  49. data/lib/wallee-ruby-sdk/models/card_cryptogram_type.rb +34 -0
  50. data/lib/wallee-ruby-sdk/models/cardholder_authentication.rb +231 -0
  51. data/lib/wallee-ruby-sdk/models/cardholder_authentication_create.rb +241 -0
  52. data/lib/wallee-ruby-sdk/models/charge_attempt.rb +11 -1
  53. data/lib/wallee-ruby-sdk/models/charge_bank_transaction.rb +291 -0
  54. data/lib/wallee-ruby-sdk/models/currency_bank_account.rb +241 -0
  55. data/lib/wallee-ruby-sdk/models/debt_collection_case.rb +1 -1
  56. data/lib/wallee-ruby-sdk/models/debt_collection_case_create.rb +1 -1
  57. data/lib/wallee-ruby-sdk/models/external_transfer_bank_transaction.rb +251 -0
  58. data/lib/wallee-ruby-sdk/models/internal_transfer_bank_transaction.rb +231 -0
  59. data/lib/wallee-ruby-sdk/models/payment_adjustment.rb +231 -0
  60. data/lib/wallee-ruby-sdk/models/payment_adjustment_type.rb +215 -0
  61. data/lib/wallee-ruby-sdk/models/payment_connector_configuration.rb +13 -1
  62. data/lib/wallee-ruby-sdk/models/payment_contract.rb +1 -25
  63. data/lib/wallee-ruby-sdk/models/payment_link.rb +16 -40
  64. data/lib/wallee-ruby-sdk/models/payment_link_active.rb +15 -15
  65. data/lib/wallee-ruby-sdk/models/payment_link_address_handling_mode.rb +36 -0
  66. data/lib/wallee-ruby-sdk/models/payment_link_create.rb +16 -44
  67. data/lib/wallee-ruby-sdk/models/payment_link_update.rb +15 -15
  68. data/lib/wallee-ruby-sdk/models/payment_terminal.rb +11 -1
  69. data/lib/wallee-ruby-sdk/models/payment_terminal_address.rb +0 -60
  70. data/lib/wallee-ruby-sdk/models/payment_terminal_configuration_version.rb +11 -1
  71. data/lib/wallee-ruby-sdk/models/payment_terminal_location.rb +2 -22
  72. data/lib/wallee-ruby-sdk/models/payment_terminal_receipt_type.rb +215 -0
  73. data/lib/wallee-ruby-sdk/models/permission.rb +14 -4
  74. data/lib/wallee-ruby-sdk/models/recurring_indicator.rb +37 -0
  75. data/lib/wallee-ruby-sdk/models/refund_bank_transaction.rb +281 -0
  76. data/lib/wallee-ruby-sdk/models/refund_recovery_bank_transaction.rb +293 -0
  77. data/lib/wallee-ruby-sdk/models/rendered_terminal_receipt.rb +26 -6
  78. data/lib/wallee-ruby-sdk/models/role.rb +1 -1
  79. data/lib/wallee-ruby-sdk/models/role_state.rb +37 -0
  80. data/lib/wallee-ruby-sdk/models/sales_channel.rb +34 -4
  81. data/lib/wallee-ruby-sdk/models/shopify_additional_line_item_data.rb +35 -0
  82. data/lib/wallee-ruby-sdk/models/shopify_integration.rb +73 -31
  83. data/lib/wallee-ruby-sdk/models/shopify_integration_payment_app_version.rb +34 -0
  84. data/lib/wallee-ruby-sdk/models/{shopify_integration_app_version.rb → shopify_integration_subscription_app_version.rb} +3 -3
  85. data/lib/wallee-ruby-sdk/models/shopify_subscriber.rb +1 -1
  86. data/lib/wallee-ruby-sdk/models/shopify_subscriber_active.rb +241 -0
  87. data/lib/wallee-ruby-sdk/models/shopify_subscriber_creation.rb +216 -0
  88. data/lib/wallee-ruby-sdk/models/shopify_subscription.rb +61 -7
  89. data/lib/wallee-ruby-sdk/models/shopify_subscription_address.rb +0 -60
  90. data/lib/wallee-ruby-sdk/models/{payment_terminal_contact_address.rb → shopify_subscription_address_create.rb} +152 -2
  91. data/lib/wallee-ruby-sdk/models/shopify_subscription_creation_request.rb +363 -0
  92. data/lib/wallee-ruby-sdk/models/shopify_subscription_model_billing_configuration.rb +271 -0
  93. data/lib/wallee-ruby-sdk/models/{shopify_subscription_edit_model_item.rb → shopify_subscription_model_item.rb} +2 -2
  94. data/lib/wallee-ruby-sdk/models/{shopify_subscription_edit_model_tax_line.rb → shopify_subscription_model_tax_line.rb} +1 -1
  95. data/lib/wallee-ruby-sdk/models/shopify_subscription_product_create.rb +9 -14
  96. data/lib/wallee-ruby-sdk/models/{shopify_subscription_product_active.rb → shopify_subscription_product_update.rb} +2 -12
  97. data/lib/wallee-ruby-sdk/models/shopify_subscription_update_addresses_request.rb +211 -0
  98. data/lib/wallee-ruby-sdk/models/shopify_subscription_update_request.rb +11 -81
  99. data/lib/wallee-ruby-sdk/models/shopify_subscription_version.rb +11 -1
  100. data/lib/wallee-ruby-sdk/models/space.rb +31 -1
  101. data/lib/wallee-ruby-sdk/models/space_create.rb +11 -1
  102. data/lib/wallee-ruby-sdk/models/space_update.rb +11 -1
  103. data/lib/wallee-ruby-sdk/models/subscriber.rb +1 -1
  104. data/lib/wallee-ruby-sdk/models/subscriber_create.rb +1 -1
  105. data/lib/wallee-ruby-sdk/models/subscription.rb +11 -1
  106. data/lib/wallee-ruby-sdk/models/subscription_affiliate.rb +1 -25
  107. data/lib/wallee-ruby-sdk/models/subscription_affiliate_create.rb +1 -29
  108. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleted.rb +1 -25
  109. data/lib/wallee-ruby-sdk/models/subscription_affiliate_deleting.rb +1 -25
  110. data/lib/wallee-ruby-sdk/models/subscription_charge.rb +49 -1
  111. data/lib/wallee-ruby-sdk/models/subscription_charge_create.rb +49 -1
  112. data/lib/wallee-ruby-sdk/models/subscription_create_request.rb +1 -1
  113. data/lib/wallee-ruby-sdk/models/subscription_ledger_entry.rb +12 -2
  114. data/lib/wallee-ruby-sdk/models/subscription_ledger_entry_create.rb +1 -1
  115. data/lib/wallee-ruby-sdk/models/subscription_product.rb +11 -1
  116. data/lib/wallee-ruby-sdk/models/subscription_product_active.rb +11 -1
  117. data/lib/wallee-ruby-sdk/models/subscription_product_component.rb +1 -1
  118. data/lib/wallee-ruby-sdk/models/subscription_product_component_update.rb +1 -1
  119. data/lib/wallee-ruby-sdk/models/subscription_product_create.rb +11 -1
  120. data/lib/wallee-ruby-sdk/models/subscription_product_version.rb +11 -1
  121. data/lib/wallee-ruby-sdk/models/subscription_product_version_pending.rb +14 -4
  122. data/lib/wallee-ruby-sdk/models/subscription_update_request.rb +206 -0
  123. data/lib/wallee-ruby-sdk/models/tax_calculation.rb +35 -0
  124. data/lib/wallee-ruby-sdk/models/terminal_receipt_fetch_request.rb +221 -0
  125. data/lib/wallee-ruby-sdk/models/terminal_receipt_format.rb +35 -0
  126. data/lib/wallee-ruby-sdk/models/token.rb +1 -25
  127. data/lib/wallee-ruby-sdk/models/token_create.rb +1 -29
  128. data/lib/wallee-ruby-sdk/models/tokenized_card_data.rb +211 -0
  129. data/lib/wallee-ruby-sdk/models/{unencrypted_card_data_create.rb → tokenized_card_data_create.rb} +60 -5
  130. data/lib/wallee-ruby-sdk/models/transaction.rb +132 -4
  131. data/lib/wallee-ruby-sdk/models/transaction_completion.rb +26 -1
  132. data/lib/wallee-ruby-sdk/models/transaction_completion_behavior.rb +36 -0
  133. data/lib/wallee-ruby-sdk/models/transaction_completion_request.rb +26 -1
  134. data/lib/wallee-ruby-sdk/models/transaction_create.rb +59 -1
  135. data/lib/wallee-ruby-sdk/models/transaction_pending.rb +59 -1
  136. data/lib/wallee-ruby-sdk/models/web_app_confirmation_request.rb +206 -0
  137. data/lib/wallee-ruby-sdk/models/web_app_confirmation_response.rb +231 -0
  138. data/lib/wallee-ruby-sdk/models/webhook_url.rb +35 -1
  139. data/lib/wallee-ruby-sdk/models/webhook_url_create.rb +24 -0
  140. data/lib/wallee-ruby-sdk/models/webhook_url_update.rb +24 -0
  141. data/lib/wallee-ruby-sdk/version.rb +1 -1
  142. data/test/condition_type_service_test.rb +22 -0
  143. data/wallee-ruby-sdk.gemspec +3 -2
  144. metadata +93 -17
@@ -0,0 +1,35 @@
1
+ =begin
2
+ The wallee API allows an easy interaction with the wallee web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module Wallee
21
+ class TerminalReceiptFormat
22
+
23
+ PDF = 'PDF'.freeze
24
+ TXT = 'TXT'.freeze
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def build_from_hash(value)
30
+ constantValues = TerminalReceiptFormat.constants.select { |c| TerminalReceiptFormat::const_get(c) == value }
31
+ raise "Invalid ENUM value #{value} for class #TerminalReceiptFormat" if constantValues.empty?
32
+ value
33
+ end
34
+ end
35
+ end
@@ -32,7 +32,7 @@ module Wallee
32
32
  # When a token is enabled for one-click payments the buyer will be able to select the token within the iFrame or on the payment page to pay with the token. The usage of the token will reduce the number of steps the buyer has to go through. The buyer is linked via the customer ID on the transaction with the token. Means the token will be visible for buyers with the same customer ID. Additionally the payment method has to be configured to allow the one-click payments.
33
33
  attr_accessor :enabled_for_one_click_payment
34
34
 
35
- # 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.
35
+ # A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead.
36
36
  attr_accessor :external_id
37
37
 
38
38
  # The ID is the primary key of the entity. The ID identifies the entity uniquely.
@@ -166,14 +166,6 @@ module Wallee
166
166
  invalid_properties.push('invalid value for "customer_email_address", the character length must be smaller than or equal to 150.')
167
167
  end
168
168
 
169
- if !@external_id.nil? && @external_id.to_s.length > 100
170
- invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 100.')
171
- end
172
-
173
- if !@external_id.nil? && @external_id.to_s.length < 1
174
- invalid_properties.push('invalid value for "external_id", the character length must be great than or equal to 1.')
175
- end
176
-
177
169
  if !@token_reference.nil? && @token_reference.to_s.length > 100
178
170
  invalid_properties.push('invalid value for "token_reference", the character length must be smaller than or equal to 100.')
179
171
  end
@@ -185,8 +177,6 @@ module Wallee
185
177
  # @return true if the model is valid
186
178
  def valid?
187
179
  return false if !@customer_email_address.nil? && @customer_email_address.to_s.length > 150
188
- return false if !@external_id.nil? && @external_id.to_s.length > 100
189
- return false if !@external_id.nil? && @external_id.to_s.length < 1
190
180
  return false if !@token_reference.nil? && @token_reference.to_s.length > 100
191
181
  true
192
182
  end
@@ -201,20 +191,6 @@ module Wallee
201
191
  @customer_email_address = customer_email_address
202
192
  end
203
193
 
204
- # Custom attribute writer method with validation
205
- # @param [Object] external_id Value to be assigned
206
- def external_id=(external_id)
207
- if !external_id.nil? && external_id.to_s.length > 100
208
- fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 100.'
209
- end
210
-
211
- if !external_id.nil? && external_id.to_s.length < 1
212
- fail ArgumentError, 'invalid value for "external_id", the character length must be great than or equal to 1.'
213
- end
214
-
215
- @external_id = external_id
216
- end
217
-
218
194
  # Custom attribute writer method with validation
219
195
  # @param [Object] token_reference Value to be assigned
220
196
  def token_reference=(token_reference)
@@ -38,7 +38,7 @@ module Wallee
38
38
  # Use something that it is easy to identify and may help you find the token (e.g. customer id, email address).
39
39
  attr_accessor :token_reference
40
40
 
41
- # 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.
41
+ # A client generated nonce which identifies the entity to be created. Subsequent creation requests with the same external ID will not create new entities but return the initially created entity instead.
42
42
  attr_accessor :external_id
43
43
 
44
44
  #
@@ -129,14 +129,6 @@ module Wallee
129
129
  invalid_properties.push('invalid value for "external_id", external_id cannot be nil.')
130
130
  end
131
131
 
132
- if @external_id.to_s.length > 100
133
- invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 100.')
134
- end
135
-
136
- if @external_id.to_s.length < 1
137
- invalid_properties.push('invalid value for "external_id", the character length must be great than or equal to 1.')
138
- end
139
-
140
132
  invalid_properties
141
133
  end
142
134
 
@@ -146,8 +138,6 @@ module Wallee
146
138
  return false if !@customer_email_address.nil? && @customer_email_address.to_s.length > 150
147
139
  return false if !@token_reference.nil? && @token_reference.to_s.length > 100
148
140
  return false if @external_id.nil?
149
- return false if @external_id.to_s.length > 100
150
- return false if @external_id.to_s.length < 1
151
141
  true
152
142
  end
153
143
 
@@ -171,24 +161,6 @@ module Wallee
171
161
  @token_reference = token_reference
172
162
  end
173
163
 
174
- # Custom attribute writer method with validation
175
- # @param [Object] external_id Value to be assigned
176
- def external_id=(external_id)
177
- if external_id.nil?
178
- fail ArgumentError, 'external_id cannot be nil'
179
- end
180
-
181
- if external_id.to_s.length > 100
182
- fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 100.'
183
- end
184
-
185
- if external_id.to_s.length < 1
186
- fail ArgumentError, 'invalid value for "external_id", the character length must be great than or equal to 1.'
187
- end
188
-
189
- @external_id = external_id
190
- end
191
-
192
164
  # Checks equality by comparing each attribute.
193
165
  # @param [Object] Object to be compared
194
166
  def ==(o)
@@ -0,0 +1,211 @@
1
+ =begin
2
+ The wallee API allows an easy interaction with the wallee web service.
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+
16
+ =end
17
+
18
+ require 'date'
19
+
20
+ module Wallee
21
+ # This model holds the card data in plain.
22
+ class TokenizedCardData
23
+ # The additional authentication value used to secure the tokenized card transactions.
24
+ attr_accessor :cryptogram
25
+
26
+ #
27
+ attr_accessor :recurring_indicator
28
+
29
+ #
30
+ attr_accessor :token_requestor_id
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'cryptogram' => :'cryptogram',
36
+ :'recurring_indicator' => :'recurringIndicator',
37
+ :'token_requestor_id' => :'tokenRequestorId'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'cryptogram' => :'CardCryptogram',
45
+ :'recurring_indicator' => :'RecurringIndicator',
46
+ :'token_requestor_id' => :'String'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'cryptogram')
59
+ self.cryptogram = attributes[:'cryptogram']
60
+ end
61
+
62
+ if attributes.has_key?(:'recurringIndicator')
63
+ self.recurring_indicator = attributes[:'recurringIndicator']
64
+ end
65
+
66
+ if attributes.has_key?(:'tokenRequestorId')
67
+ self.token_requestor_id = attributes[:'tokenRequestorId']
68
+ end
69
+ end
70
+
71
+ # Show invalid properties with the reasons. Usually used together with valid?
72
+ # @return Array for valid properties with the reasons
73
+ def list_invalid_properties
74
+ invalid_properties = Array.new
75
+ invalid_properties
76
+ end
77
+
78
+ # Check to see if the all the properties in the model are valid
79
+ # @return true if the model is valid
80
+ def valid?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ cryptogram == o.cryptogram &&
90
+ recurring_indicator == o.recurring_indicator &&
91
+ token_requestor_id == o.token_requestor_id
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Fixnum] Hash code
102
+ def hash
103
+ [cryptogram, recurring_indicator, token_requestor_id].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :BOOLEAN
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ temp_model = Wallee.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map{ |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+
210
+ end
211
+ end
@@ -19,26 +19,42 @@ require 'date'
19
19
 
20
20
  module Wallee
21
21
  # This model holds the card data in plain.
22
- class UnencryptedCardDataCreate
22
+ class TokenizedCardDataCreate
23
23
  # The card holder name is the name printed onto the card. It identifies the person who owns the card.
24
24
  attr_accessor :card_holder_name
25
25
 
26
26
  # The card verification code (CVC) is a 3 to 4 digit code typically printed on the back of the card. It helps to ensure that the card holder is authorizing the transaction. For card not-present transactions this field is optional.
27
27
  attr_accessor :card_verification_code
28
28
 
29
+ # The additional authentication value used to secure the tokenized card transactions.
30
+ attr_accessor :cryptogram
31
+
29
32
  # The card expiry date indicates when the card expires. The format is the format yyyy-mm where yyyy is the year (e.g. 2019) and the mm is the month (e.g. 09).
30
33
  attr_accessor :expiry_date
31
34
 
32
35
  # The primary account number (PAN) identifies the card. The number is numeric and typically printed on the front of the card.
33
36
  attr_accessor :primary_account_number
34
37
 
38
+ #
39
+ attr_accessor :recurring_indicator
40
+
41
+ #
42
+ attr_accessor :scheme_transaction_reference
43
+
44
+ #
45
+ attr_accessor :token_requestor_id
46
+
35
47
  # Attribute mapping from ruby-style variable name to JSON key.
36
48
  def self.attribute_map
37
49
  {
38
50
  :'card_holder_name' => :'cardHolderName',
39
51
  :'card_verification_code' => :'cardVerificationCode',
52
+ :'cryptogram' => :'cryptogram',
40
53
  :'expiry_date' => :'expiryDate',
41
- :'primary_account_number' => :'primaryAccountNumber'
54
+ :'primary_account_number' => :'primaryAccountNumber',
55
+ :'recurring_indicator' => :'recurringIndicator',
56
+ :'scheme_transaction_reference' => :'schemeTransactionReference',
57
+ :'token_requestor_id' => :'tokenRequestorId'
42
58
  }
43
59
  end
44
60
 
@@ -47,8 +63,12 @@ module Wallee
47
63
  {
48
64
  :'card_holder_name' => :'String',
49
65
  :'card_verification_code' => :'String',
66
+ :'cryptogram' => :'CardCryptogramCreate',
50
67
  :'expiry_date' => :'String',
51
- :'primary_account_number' => :'String'
68
+ :'primary_account_number' => :'String',
69
+ :'recurring_indicator' => :'RecurringIndicator',
70
+ :'scheme_transaction_reference' => :'String',
71
+ :'token_requestor_id' => :'String'
52
72
  }
53
73
  end
54
74
 
@@ -68,6 +88,10 @@ module Wallee
68
88
  self.card_verification_code = attributes[:'cardVerificationCode']
69
89
  end
70
90
 
91
+ if attributes.has_key?(:'cryptogram')
92
+ self.cryptogram = attributes[:'cryptogram']
93
+ end
94
+
71
95
  if attributes.has_key?(:'expiryDate')
72
96
  self.expiry_date = attributes[:'expiryDate']
73
97
  end
@@ -75,6 +99,18 @@ module Wallee
75
99
  if attributes.has_key?(:'primaryAccountNumber')
76
100
  self.primary_account_number = attributes[:'primaryAccountNumber']
77
101
  end
102
+
103
+ if attributes.has_key?(:'recurringIndicator')
104
+ self.recurring_indicator = attributes[:'recurringIndicator']
105
+ end
106
+
107
+ if attributes.has_key?(:'schemeTransactionReference')
108
+ self.scheme_transaction_reference = attributes[:'schemeTransactionReference']
109
+ end
110
+
111
+ if attributes.has_key?(:'tokenRequestorId')
112
+ self.token_requestor_id = attributes[:'tokenRequestorId']
113
+ end
78
114
  end
79
115
 
80
116
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,6 +141,10 @@ module Wallee
105
141
  invalid_properties.push('invalid value for "primary_account_number", the character length must be great than or equal to 10.')
106
142
  end
107
143
 
144
+ if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100
145
+ invalid_properties.push('invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.')
146
+ end
147
+
108
148
  invalid_properties
109
149
  end
110
150
 
@@ -117,6 +157,7 @@ module Wallee
117
157
  return false if @primary_account_number.nil?
118
158
  return false if @primary_account_number.to_s.length > 30
119
159
  return false if @primary_account_number.to_s.length < 10
160
+ return false if !@scheme_transaction_reference.nil? && @scheme_transaction_reference.to_s.length > 100
120
161
  true
121
162
  end
122
163
 
@@ -162,6 +203,16 @@ module Wallee
162
203
  @primary_account_number = primary_account_number
163
204
  end
164
205
 
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] scheme_transaction_reference Value to be assigned
208
+ def scheme_transaction_reference=(scheme_transaction_reference)
209
+ if !scheme_transaction_reference.nil? && scheme_transaction_reference.to_s.length > 100
210
+ fail ArgumentError, 'invalid value for "scheme_transaction_reference", the character length must be smaller than or equal to 100.'
211
+ end
212
+
213
+ @scheme_transaction_reference = scheme_transaction_reference
214
+ end
215
+
165
216
  # Checks equality by comparing each attribute.
166
217
  # @param [Object] Object to be compared
167
218
  def ==(o)
@@ -169,8 +220,12 @@ module Wallee
169
220
  self.class == o.class &&
170
221
  card_holder_name == o.card_holder_name &&
171
222
  card_verification_code == o.card_verification_code &&
223
+ cryptogram == o.cryptogram &&
172
224
  expiry_date == o.expiry_date &&
173
- primary_account_number == o.primary_account_number
225
+ primary_account_number == o.primary_account_number &&
226
+ recurring_indicator == o.recurring_indicator &&
227
+ scheme_transaction_reference == o.scheme_transaction_reference &&
228
+ token_requestor_id == o.token_requestor_id
174
229
  end
175
230
 
176
231
  # @see the `==` method
@@ -182,7 +237,7 @@ module Wallee
182
237
  # Calculates hash code according to all attributes.
183
238
  # @return [Fixnum] Hash code
184
239
  def hash
185
- [card_holder_name, card_verification_code, expiry_date, primary_account_number].hash
240
+ [card_holder_name, card_verification_code, cryptogram, expiry_date, primary_account_number, recurring_indicator, scheme_transaction_reference, token_requestor_id].hash
186
241
  end
187
242
 
188
243
  # Builds the object from hash