citypay_api_client 1.1.1 → 1.1.2

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 (151) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +15 -14
  3. data/citypay_api_client.gemspec +4 -3
  4. data/docs/AirlineAdvice.md +1 -1
  5. data/docs/AuthRequest.md +3 -1
  6. data/docs/AuthResponse.md +5 -1
  7. data/docs/AuthorisationAndPaymentApi.md +300 -9
  8. data/docs/BatchProcessingApi.md +15 -11
  9. data/docs/BatchTransactionResultModel.md +5 -1
  10. data/docs/Card.md +1 -1
  11. data/docs/CardHolderAccountApi.md +64 -9
  12. data/docs/ChargeRequest.md +2 -0
  13. data/docs/ContactDetails.md +11 -11
  14. data/docs/DirectPostApi.md +40 -16
  15. data/docs/DirectPostRequest.md +3 -1
  16. data/docs/OperationalFunctionsApi.md +28 -8
  17. data/docs/PaylinkApi.md +249 -73
  18. data/docs/PaylinkCustomParam.md +3 -1
  19. data/docs/PaylinkFieldGuardModel.md +1 -1
  20. data/docs/PaylinkTokenRequestModel.md +4 -0
  21. data/docs/RegisterCard.md +1 -1
  22. data/docs/ThreeDSecure.md +1 -1
  23. data/docs/TokenisationResponseModel.md +2 -2
  24. data/docs/images/3dsv1-challenge.png +0 -0
  25. data/docs/images/3dsv2-challenge.png +0 -0
  26. data/docs/images/3dsv2-frictionless.png +0 -0
  27. data/docs/images/3dsv2-method-challenge.png +0 -0
  28. data/docs/images/3dsv2-method-frictionless.png +0 -0
  29. data/docs/images/3dsv2-no3d.png +0 -0
  30. data/docs/images/citypay-logo.svg +1 -0
  31. data/docs/images/direct-post-flow.png +0 -0
  32. data/docs/images/favicon.ico +0 -0
  33. data/docs/images/header.png +0 -0
  34. data/docs/images/logo.ai +1913 -4
  35. data/docs/images/logo.png +0 -0
  36. data/docs/images/logo.svg +1 -0
  37. data/docs/images/merchant-BPS-workflow.png +0 -0
  38. data/docs/images/paylink-field-guards.png +0 -0
  39. data/lib/.DS_Store +0 -0
  40. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +4 -4
  41. data/lib/citypay_api_client/api/batch_processing_api__.rb +11 -11
  42. data/lib/citypay_api_client/api/card_holder_account_api__.rb +2 -2
  43. data/lib/citypay_api_client/api/direct_post_api__.rb +5 -5
  44. data/lib/citypay_api_client/api/operational_functions_api__.rb +3 -3
  45. data/lib/citypay_api_client/api/paylink_api__.rb +74 -74
  46. data/lib/citypay_api_client/api_client.rb +24 -22
  47. data/lib/citypay_api_client/api_error.rb +3 -2
  48. data/lib/citypay_api_client/configuration.rb +28 -9
  49. data/lib/citypay_api_client/models/account_create.rb +17 -20
  50. data/lib/citypay_api_client/models/account_status.rb +15 -20
  51. data/lib/citypay_api_client/models/acknowledgement.rb +27 -24
  52. data/lib/citypay_api_client/models/acl_check_request.rb +17 -20
  53. data/lib/citypay_api_client/models/acl_check_response_model.rb +15 -20
  54. data/lib/citypay_api_client/models/airline_advice.rb +45 -29
  55. data/lib/citypay_api_client/models/airline_segment.rb +35 -22
  56. data/lib/citypay_api_client/models/auth_reference.rb +41 -26
  57. data/lib/citypay_api_client/models/auth_references.rb +15 -20
  58. data/lib/citypay_api_client/models/auth_request.rb +66 -29
  59. data/lib/citypay_api_client/models/auth_response.rb +45 -22
  60. data/lib/citypay_api_client/models/authen_required.rb +15 -20
  61. data/lib/citypay_api_client/models/batch.rb +24 -21
  62. data/lib/citypay_api_client/models/batch_report_request.rb +23 -22
  63. data/lib/citypay_api_client/models/batch_report_response_model.rb +27 -20
  64. data/lib/citypay_api_client/models/batch_transaction.rb +25 -22
  65. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +53 -22
  66. data/lib/citypay_api_client/models/bin.rb +15 -20
  67. data/lib/citypay_api_client/models/bin_lookup.rb +17 -20
  68. data/lib/citypay_api_client/models/c_res_auth_request.rb +15 -20
  69. data/lib/citypay_api_client/models/capture_request.rb +27 -22
  70. data/lib/citypay_api_client/models/card.rb +33 -26
  71. data/lib/citypay_api_client/models/card_holder_account.rb +19 -20
  72. data/lib/citypay_api_client/models/card_status.rb +15 -20
  73. data/lib/citypay_api_client/models/charge_request.rb +66 -29
  74. data/lib/citypay_api_client/models/check_batch_status.rb +23 -22
  75. data/lib/citypay_api_client/models/check_batch_status_response.rb +15 -20
  76. data/lib/citypay_api_client/models/contact_details.rb +77 -42
  77. data/lib/citypay_api_client/models/decision.rb +15 -20
  78. data/lib/citypay_api_client/models/direct_post_request.rb +66 -29
  79. data/lib/citypay_api_client/models/direct_token_auth_request.rb +15 -20
  80. data/lib/citypay_api_client/models/domain_key_check_request.rb +17 -20
  81. data/lib/citypay_api_client/models/domain_key_request.rb +19 -20
  82. data/lib/citypay_api_client/models/domain_key_response.rb +25 -22
  83. data/lib/citypay_api_client/models/error.rb +27 -24
  84. data/lib/citypay_api_client/models/event_data_model.rb +15 -20
  85. data/lib/citypay_api_client/models/exists.rb +17 -20
  86. data/lib/citypay_api_client/models/external_mpi.rb +39 -24
  87. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -22
  88. data/lib/citypay_api_client/models/mcc6012.rb +15 -20
  89. data/lib/citypay_api_client/models/merchant.rb +15 -20
  90. data/lib/citypay_api_client/models/pa_res_auth_request.rb +19 -20
  91. data/lib/citypay_api_client/models/paylink_address.rb +52 -29
  92. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +25 -22
  93. data/lib/citypay_api_client/models/paylink_attachment_request.rb +19 -20
  94. data/lib/citypay_api_client/models/paylink_attachment_result.rb +19 -20
  95. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +17 -20
  96. data/lib/citypay_api_client/models/paylink_card_holder.rb +30 -23
  97. data/lib/citypay_api_client/models/paylink_cart.rb +15 -20
  98. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +15 -20
  99. data/lib/citypay_api_client/models/paylink_config.rb +15 -20
  100. data/lib/citypay_api_client/models/paylink_custom_param.rb +29 -22
  101. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +17 -20
  102. data/lib/citypay_api_client/models/paylink_error_code.rb +19 -20
  103. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +16 -21
  104. data/lib/citypay_api_client/models/paylink_part_payments.rb +15 -20
  105. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +17 -20
  106. data/lib/citypay_api_client/models/paylink_state_event.rb +15 -20
  107. data/lib/citypay_api_client/models/paylink_token_created.rb +21 -20
  108. data/lib/citypay_api_client/models/paylink_token_request_model.rb +75 -22
  109. data/lib/citypay_api_client/models/paylink_token_status.rb +15 -20
  110. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +19 -20
  111. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +17 -20
  112. data/lib/citypay_api_client/models/paylink_ui.rb +15 -20
  113. data/lib/citypay_api_client/models/ping.rb +21 -22
  114. data/lib/citypay_api_client/models/process_batch_request.rb +27 -22
  115. data/lib/citypay_api_client/models/process_batch_response.rb +17 -20
  116. data/lib/citypay_api_client/models/refund_request.rb +28 -21
  117. data/lib/citypay_api_client/models/register_card.rb +27 -22
  118. data/lib/citypay_api_client/models/request_challenged.rb +15 -20
  119. data/lib/citypay_api_client/models/retrieve_request.rb +23 -22
  120. data/lib/citypay_api_client/models/three_d_secure.rb +16 -21
  121. data/lib/citypay_api_client/models/tokenisation_response_model.rb +23 -24
  122. data/lib/citypay_api_client/models/void_request.rb +23 -22
  123. data/lib/citypay_api_client/version.rb +3 -3
  124. data/lib/citypay_api_client.rb +2 -2
  125. data/spec/.DS_Store +0 -0
  126. data/spec/it_api_sandbox_spec.rb +5 -11
  127. data/spec/models/account_create_spec.rb +1 -2
  128. data/spec/models/account_status_spec.rb +2 -2
  129. data/spec/models/airline_advice_spec.rb +0 -2
  130. data/spec/models/airline_segment_spec.rb +0 -2
  131. data/spec/models/auth_request_spec.rb +0 -2
  132. data/spec/models/auth_response_spec.rb +75 -30
  133. data/spec/models/batch_report_request_spec.rb +0 -2
  134. data/spec/models/batch_report_response_model_spec.rb +0 -2
  135. data/spec/models/batch_spec.rb +0 -2
  136. data/spec/models/batch_transaction_result_model_spec.rb +0 -2
  137. data/spec/models/batch_transaction_spec.rb +0 -2
  138. data/spec/models/bin_lookup_spec.rb +0 -2
  139. data/spec/models/capture_request_spec.rb +0 -2
  140. data/spec/models/card_holder_account_spec.rb +0 -2
  141. data/spec/models/charge_request_spec.rb +0 -2
  142. data/spec/models/direct_post_request_spec.rb +0 -2
  143. data/spec/models/domain_key_check_request_spec.rb +0 -2
  144. data/spec/models/paylink_token_request_model_spec.rb +0 -2
  145. data/spec/models/process_batch_request_spec.rb +0 -2
  146. data/spec/models/refund_request_spec.rb +0 -2
  147. data/spec/models/register_card_spec.rb +0 -2
  148. data/spec/spec_helper.rb +2 -2
  149. metadata +25 -12
  150. data/docs/OperationalApi.md +0 -214
  151. data/docs/PaymentProcessingApi.md +0 -559
@@ -1,11 +1,11 @@
1
1
  =begin
2
2
  #CityPay Payment API
3
3
 
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
4
+ # This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 6.2.1
8
+ OpenAPI Generator version: 7.2.0
9
9
 
10
10
  =end
11
11
 
@@ -65,6 +65,7 @@ module CityPayApiClient
65
65
  # Show invalid properties with the reasons. Usually used together with valid?
66
66
  # @return Array for valid properties with the reasons
67
67
  def list_invalid_properties
68
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
68
69
  invalid_properties = Array.new
69
70
  if !@identifier.nil? && @identifier.to_s.length > 50
70
71
  invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
@@ -80,6 +81,7 @@ module CityPayApiClient
80
81
  # Check to see if the all the properties in the model are valid
81
82
  # @return true if the model is valid
82
83
  def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
83
85
  return false if !@identifier.nil? && @identifier.to_s.length > 50
84
86
  return false if !@identifier.nil? && @identifier.to_s.length < 4
85
87
  true
@@ -88,11 +90,15 @@ module CityPayApiClient
88
90
  # Custom attribute writer method with validation
89
91
  # @param [Object] identifier Value to be assigned
90
92
  def identifier=(identifier)
91
- if !identifier.nil? && identifier.to_s.length > 50
93
+ if identifier.nil?
94
+ fail ArgumentError, 'identifier cannot be nil'
95
+ end
96
+
97
+ if identifier.to_s.length > 50
92
98
  fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
93
99
  end
94
100
 
95
- if !identifier.nil? && identifier.to_s.length < 4
101
+ if identifier.to_s.length < 4
96
102
  fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
97
103
  end
98
104
 
@@ -123,37 +129,30 @@ module CityPayApiClient
123
129
  # @param [Hash] attributes Model attributes in the form of hash
124
130
  # @return [Object] Returns the model itself
125
131
  def self.build_from_hash(attributes)
126
- new.build_from_hash(attributes)
127
- end
128
-
129
- # Builds the object from hash
130
- # @param [Hash] attributes Model attributes in the form of hash
131
- # @return [Object] Returns the model itself
132
- def build_from_hash(attributes)
133
132
  return nil unless attributes.is_a?(Hash)
134
133
  attributes = attributes.transform_keys(&:to_sym)
135
- self.class.openapi_types.each_pair do |key, type|
136
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
137
- self.send("#{key}=", nil)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
138
  elsif type =~ /\AArray<(.*)>/i
139
139
  # check to ensure the input is an array given that the attribute
140
140
  # is documented as an array but the input is not
141
- if attributes[self.class.attribute_map[key]].is_a?(Array)
142
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
143
  end
144
- elsif !attributes[self.class.attribute_map[key]].nil?
145
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
146
  end
147
147
  end
148
-
149
- self
148
+ new(transformed_hash)
150
149
  end
151
150
 
152
151
  # Deserializes the data based on type
153
152
  # @param string type Data type
154
153
  # @param string value Value to be deserialized
155
154
  # @return [Object] Deserialized data
156
- def _deserialize(type, value)
155
+ def self._deserialize(type, value)
157
156
  case type.to_sym
158
157
  when :Time
159
158
  Time.parse(value)
@@ -188,7 +187,7 @@ module CityPayApiClient
188
187
  else # model
189
188
  # models (e.g. Pet) or oneOf
190
189
  klass = CityPayApiClient.const_get(type)
191
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
190
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
192
191
  end
193
192
  end
194
193
 
@@ -1,11 +1,11 @@
1
1
  =begin
2
2
  #CityPay Payment API
3
3
 
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
4
+ # This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 6.2.1
8
+ OpenAPI Generator version: 7.2.0
9
9
 
10
10
  =end
11
11
 
@@ -73,10 +73,14 @@ module CityPayApiClient
73
73
 
74
74
  if attributes.key?(:'batch_date')
75
75
  self.batch_date = attributes[:'batch_date']
76
+ else
77
+ self.batch_date = nil
76
78
  end
77
79
 
78
80
  if attributes.key?(:'batch_id')
79
81
  self.batch_id = attributes[:'batch_id']
82
+ else
83
+ self.batch_id = nil
80
84
  end
81
85
 
82
86
  if attributes.key?(:'client_account_id')
@@ -87,12 +91,15 @@ module CityPayApiClient
87
91
  if (value = attributes[:'transactions']).is_a?(Array)
88
92
  self.transactions = value
89
93
  end
94
+ else
95
+ self.transactions = nil
90
96
  end
91
97
  end
92
98
 
93
99
  # Show invalid properties with the reasons. Usually used together with valid?
94
100
  # @return Array for valid properties with the reasons
95
101
  def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
96
103
  invalid_properties = Array.new
97
104
  if @batch_date.nil?
98
105
  invalid_properties.push('invalid value for "batch_date", batch_date cannot be nil.')
@@ -124,6 +131,7 @@ module CityPayApiClient
124
131
  # Check to see if the all the properties in the model are valid
125
132
  # @return true if the model is valid
126
133
  def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
127
135
  return false if @batch_date.nil?
128
136
  return false if @batch_id.nil?
129
137
  return false if @batch_id < 1
@@ -150,11 +158,15 @@ module CityPayApiClient
150
158
  # Custom attribute writer method with validation
151
159
  # @param [Object] client_account_id Value to be assigned
152
160
  def client_account_id=(client_account_id)
153
- if !client_account_id.nil? && client_account_id.to_s.length > 20
161
+ if client_account_id.nil?
162
+ fail ArgumentError, 'client_account_id cannot be nil'
163
+ end
164
+
165
+ if client_account_id.to_s.length > 20
154
166
  fail ArgumentError, 'invalid value for "client_account_id", the character length must be smaller than or equal to 20.'
155
167
  end
156
168
 
157
- if !client_account_id.nil? && client_account_id.to_s.length < 3
169
+ if client_account_id.to_s.length < 3
158
170
  fail ArgumentError, 'invalid value for "client_account_id", the character length must be great than or equal to 3.'
159
171
  end
160
172
 
@@ -188,37 +200,30 @@ module CityPayApiClient
188
200
  # @param [Hash] attributes Model attributes in the form of hash
189
201
  # @return [Object] Returns the model itself
190
202
  def self.build_from_hash(attributes)
191
- new.build_from_hash(attributes)
192
- end
193
-
194
- # Builds the object from hash
195
- # @param [Hash] attributes Model attributes in the form of hash
196
- # @return [Object] Returns the model itself
197
- def build_from_hash(attributes)
198
203
  return nil unless attributes.is_a?(Hash)
199
204
  attributes = attributes.transform_keys(&:to_sym)
200
- self.class.openapi_types.each_pair do |key, type|
201
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
202
- self.send("#{key}=", nil)
205
+ transformed_hash = {}
206
+ openapi_types.each_pair do |key, type|
207
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
208
+ transformed_hash["#{key}"] = nil
203
209
  elsif type =~ /\AArray<(.*)>/i
204
210
  # check to ensure the input is an array given that the attribute
205
211
  # is documented as an array but the input is not
206
- if attributes[self.class.attribute_map[key]].is_a?(Array)
207
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
212
+ if attributes[attribute_map[key]].is_a?(Array)
213
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
208
214
  end
209
- elsif !attributes[self.class.attribute_map[key]].nil?
210
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
215
+ elsif !attributes[attribute_map[key]].nil?
216
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
211
217
  end
212
218
  end
213
-
214
- self
219
+ new(transformed_hash)
215
220
  end
216
221
 
217
222
  # Deserializes the data based on type
218
223
  # @param string type Data type
219
224
  # @param string value Value to be deserialized
220
225
  # @return [Object] Deserialized data
221
- def _deserialize(type, value)
226
+ def self._deserialize(type, value)
222
227
  case type.to_sym
223
228
  when :Time
224
229
  Time.parse(value)
@@ -253,7 +258,7 @@ module CityPayApiClient
253
258
  else # model
254
259
  # models (e.g. Pet) or oneOf
255
260
  klass = CityPayApiClient.const_get(type)
256
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
261
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
257
262
  end
258
263
  end
259
264
 
@@ -1,11 +1,11 @@
1
1
  =begin
2
2
  #CityPay Payment API
3
3
 
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
4
+ # This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 6.2.1
8
+ OpenAPI Generator version: 7.2.0
9
9
 
10
10
  =end
11
11
 
@@ -68,12 +68,15 @@ module CityPayApiClient
68
68
 
69
69
  if attributes.key?(:'valid')
70
70
  self.valid = attributes[:'valid']
71
+ else
72
+ self.valid = nil
71
73
  end
72
74
  end
73
75
 
74
76
  # Show invalid properties with the reasons. Usually used together with valid?
75
77
  # @return Array for valid properties with the reasons
76
78
  def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
80
  invalid_properties = Array.new
78
81
  if @valid.nil?
79
82
  invalid_properties.push('invalid value for "valid", valid cannot be nil.')
@@ -85,6 +88,7 @@ module CityPayApiClient
85
88
  # Check to see if the all the properties in the model are valid
86
89
  # @return true if the model is valid
87
90
  def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
92
  return false if @valid.nil?
89
93
  true
90
94
  end
@@ -114,37 +118,30 @@ module CityPayApiClient
114
118
  # @param [Hash] attributes Model attributes in the form of hash
115
119
  # @return [Object] Returns the model itself
116
120
  def self.build_from_hash(attributes)
117
- new.build_from_hash(attributes)
118
- end
119
-
120
- # Builds the object from hash
121
- # @param [Hash] attributes Model attributes in the form of hash
122
- # @return [Object] Returns the model itself
123
- def build_from_hash(attributes)
124
121
  return nil unless attributes.is_a?(Hash)
125
122
  attributes = attributes.transform_keys(&:to_sym)
126
- self.class.openapi_types.each_pair do |key, type|
127
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
- self.send("#{key}=", nil)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
129
127
  elsif type =~ /\AArray<(.*)>/i
130
128
  # check to ensure the input is an array given that the attribute
131
129
  # is documented as an array but the input is not
132
- if attributes[self.class.attribute_map[key]].is_a?(Array)
133
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
134
132
  end
135
- elsif !attributes[self.class.attribute_map[key]].nil?
136
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
137
135
  end
138
136
  end
139
-
140
- self
137
+ new(transformed_hash)
141
138
  end
142
139
 
143
140
  # Deserializes the data based on type
144
141
  # @param string type Data type
145
142
  # @param string value Value to be deserialized
146
143
  # @return [Object] Deserialized data
147
- def _deserialize(type, value)
144
+ def self._deserialize(type, value)
148
145
  case type.to_sym
149
146
  when :Time
150
147
  Time.parse(value)
@@ -179,7 +176,7 @@ module CityPayApiClient
179
176
  else # model
180
177
  # models (e.g. Pet) or oneOf
181
178
  klass = CityPayApiClient.const_get(type)
182
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
180
  end
184
181
  end
185
182
 
@@ -1,11 +1,11 @@
1
1
  =begin
2
2
  #CityPay Payment API
3
3
 
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
4
+ # This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 6.2.1
8
+ OpenAPI Generator version: 7.2.0
9
9
 
10
10
  =end
11
11
 
@@ -79,18 +79,26 @@ module CityPayApiClient
79
79
 
80
80
  if attributes.key?(:'amount')
81
81
  self.amount = attributes[:'amount']
82
+ else
83
+ self.amount = nil
82
84
  end
83
85
 
84
86
  if attributes.key?(:'identifier')
85
87
  self.identifier = attributes[:'identifier']
88
+ else
89
+ self.identifier = nil
86
90
  end
87
91
 
88
92
  if attributes.key?(:'merchantid')
89
93
  self.merchantid = attributes[:'merchantid']
94
+ else
95
+ self.merchantid = nil
90
96
  end
91
97
 
92
98
  if attributes.key?(:'refund_ref')
93
99
  self.refund_ref = attributes[:'refund_ref']
100
+ else
101
+ self.refund_ref = nil
94
102
  end
95
103
 
96
104
  if attributes.key?(:'trans_info')
@@ -101,6 +109,7 @@ module CityPayApiClient
101
109
  # Show invalid properties with the reasons. Usually used together with valid?
102
110
  # @return Array for valid properties with the reasons
103
111
  def list_invalid_properties
112
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
113
  invalid_properties = Array.new
105
114
  if @amount.nil?
106
115
  invalid_properties.push('invalid value for "amount", amount cannot be nil.')
@@ -136,6 +145,7 @@ module CityPayApiClient
136
145
  # Check to see if the all the properties in the model are valid
137
146
  # @return true if the model is valid
138
147
  def valid?
148
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
149
  return false if @amount.nil?
140
150
  return false if @identifier.nil?
141
151
  return false if @identifier.to_s.length > 50
@@ -177,7 +187,11 @@ module CityPayApiClient
177
187
  # Custom attribute writer method with validation
178
188
  # @param [Object] trans_info Value to be assigned
179
189
  def trans_info=(trans_info)
180
- if !trans_info.nil? && trans_info.to_s.length > 50
190
+ if trans_info.nil?
191
+ fail ArgumentError, 'trans_info cannot be nil'
192
+ end
193
+
194
+ if trans_info.to_s.length > 50
181
195
  fail ArgumentError, 'invalid value for "trans_info", the character length must be smaller than or equal to 50.'
182
196
  end
183
197
 
@@ -212,37 +226,30 @@ module CityPayApiClient
212
226
  # @param [Hash] attributes Model attributes in the form of hash
213
227
  # @return [Object] Returns the model itself
214
228
  def self.build_from_hash(attributes)
215
- new.build_from_hash(attributes)
216
- end
217
-
218
- # Builds the object from hash
219
- # @param [Hash] attributes Model attributes in the form of hash
220
- # @return [Object] Returns the model itself
221
- def build_from_hash(attributes)
222
229
  return nil unless attributes.is_a?(Hash)
223
230
  attributes = attributes.transform_keys(&:to_sym)
224
- self.class.openapi_types.each_pair do |key, type|
225
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
226
- self.send("#{key}=", nil)
231
+ transformed_hash = {}
232
+ openapi_types.each_pair do |key, type|
233
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
234
+ transformed_hash["#{key}"] = nil
227
235
  elsif type =~ /\AArray<(.*)>/i
228
236
  # check to ensure the input is an array given that the attribute
229
237
  # is documented as an array but the input is not
230
- if attributes[self.class.attribute_map[key]].is_a?(Array)
231
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
238
+ if attributes[attribute_map[key]].is_a?(Array)
239
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
232
240
  end
233
- elsif !attributes[self.class.attribute_map[key]].nil?
234
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
241
+ elsif !attributes[attribute_map[key]].nil?
242
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
235
243
  end
236
244
  end
237
-
238
- self
245
+ new(transformed_hash)
239
246
  end
240
247
 
241
248
  # Deserializes the data based on type
242
249
  # @param string type Data type
243
250
  # @param string value Value to be deserialized
244
251
  # @return [Object] Deserialized data
245
- def _deserialize(type, value)
252
+ def self._deserialize(type, value)
246
253
  case type.to_sym
247
254
  when :Time
248
255
  Time.parse(value)
@@ -277,7 +284,7 @@ module CityPayApiClient
277
284
  else # model
278
285
  # models (e.g. Pet) or oneOf
279
286
  klass = CityPayApiClient.const_get(type)
280
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
287
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
281
288
  end
282
289
  end
283
290
 
@@ -1,11 +1,11 @@
1
1
  =begin
2
2
  #CityPay Payment API
3
3
 
4
- # This CityPay API is a HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokinsed payments using Card Holder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive card holder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
4
+ # This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 6.2.1
8
+ OpenAPI Generator version: 7.2.0
9
9
 
10
10
  =end
11
11
 
@@ -79,6 +79,8 @@ module CityPayApiClient
79
79
 
80
80
  if attributes.key?(:'cardnumber')
81
81
  self.cardnumber = attributes[:'cardnumber']
82
+ else
83
+ self.cardnumber = nil
82
84
  end
83
85
 
84
86
  if attributes.key?(:'default')
@@ -87,10 +89,14 @@ module CityPayApiClient
87
89
 
88
90
  if attributes.key?(:'expmonth')
89
91
  self.expmonth = attributes[:'expmonth']
92
+ else
93
+ self.expmonth = nil
90
94
  end
91
95
 
92
96
  if attributes.key?(:'expyear')
93
97
  self.expyear = attributes[:'expyear']
98
+ else
99
+ self.expyear = nil
94
100
  end
95
101
 
96
102
  if attributes.key?(:'name_on_card')
@@ -101,6 +107,7 @@ module CityPayApiClient
101
107
  # Show invalid properties with the reasons. Usually used together with valid?
102
108
  # @return Array for valid properties with the reasons
103
109
  def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
104
111
  invalid_properties = Array.new
105
112
  if @cardnumber.nil?
106
113
  invalid_properties.push('invalid value for "cardnumber", cardnumber cannot be nil.')
@@ -152,6 +159,7 @@ module CityPayApiClient
152
159
  # Check to see if the all the properties in the model are valid
153
160
  # @return true if the model is valid
154
161
  def valid?
162
+ warn '[DEPRECATED] the `valid?` method is obsolete'
155
163
  return false if @cardnumber.nil?
156
164
  return false if @cardnumber.to_s.length > 22
157
165
  return false if @cardnumber.to_s.length < 12
@@ -223,11 +231,15 @@ module CityPayApiClient
223
231
  # Custom attribute writer method with validation
224
232
  # @param [Object] name_on_card Value to be assigned
225
233
  def name_on_card=(name_on_card)
226
- if !name_on_card.nil? && name_on_card.to_s.length > 45
234
+ if name_on_card.nil?
235
+ fail ArgumentError, 'name_on_card cannot be nil'
236
+ end
237
+
238
+ if name_on_card.to_s.length > 45
227
239
  fail ArgumentError, 'invalid value for "name_on_card", the character length must be smaller than or equal to 45.'
228
240
  end
229
241
 
230
- if !name_on_card.nil? && name_on_card.to_s.length < 2
242
+ if name_on_card.to_s.length < 2
231
243
  fail ArgumentError, 'invalid value for "name_on_card", the character length must be great than or equal to 2.'
232
244
  end
233
245
 
@@ -262,37 +274,30 @@ module CityPayApiClient
262
274
  # @param [Hash] attributes Model attributes in the form of hash
263
275
  # @return [Object] Returns the model itself
264
276
  def self.build_from_hash(attributes)
265
- new.build_from_hash(attributes)
266
- end
267
-
268
- # Builds the object from hash
269
- # @param [Hash] attributes Model attributes in the form of hash
270
- # @return [Object] Returns the model itself
271
- def build_from_hash(attributes)
272
277
  return nil unless attributes.is_a?(Hash)
273
278
  attributes = attributes.transform_keys(&:to_sym)
274
- self.class.openapi_types.each_pair do |key, type|
275
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
276
- self.send("#{key}=", nil)
279
+ transformed_hash = {}
280
+ openapi_types.each_pair do |key, type|
281
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
282
+ transformed_hash["#{key}"] = nil
277
283
  elsif type =~ /\AArray<(.*)>/i
278
284
  # check to ensure the input is an array given that the attribute
279
285
  # is documented as an array but the input is not
280
- if attributes[self.class.attribute_map[key]].is_a?(Array)
281
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
286
+ if attributes[attribute_map[key]].is_a?(Array)
287
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
282
288
  end
283
- elsif !attributes[self.class.attribute_map[key]].nil?
284
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
289
+ elsif !attributes[attribute_map[key]].nil?
290
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
285
291
  end
286
292
  end
287
-
288
- self
293
+ new(transformed_hash)
289
294
  end
290
295
 
291
296
  # Deserializes the data based on type
292
297
  # @param string type Data type
293
298
  # @param string value Value to be deserialized
294
299
  # @return [Object] Deserialized data
295
- def _deserialize(type, value)
300
+ def self._deserialize(type, value)
296
301
  case type.to_sym
297
302
  when :Time
298
303
  Time.parse(value)
@@ -327,7 +332,7 @@ module CityPayApiClient
327
332
  else # model
328
333
  # models (e.g. Pet) or oneOf
329
334
  klass = CityPayApiClient.const_get(type)
330
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
335
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
331
336
  end
332
337
  end
333
338