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
  invalid_properties
70
71
  end
@@ -72,6 +73,7 @@ module CityPayApiClient
72
73
  # Check to see if the all the properties in the model are valid
73
74
  # @return true if the model is valid
74
75
  def valid?
76
+ warn '[DEPRECATED] the `valid?` method is obsolete'
75
77
  true
76
78
  end
77
79
 
@@ -99,37 +101,30 @@ module CityPayApiClient
99
101
  # @param [Hash] attributes Model attributes in the form of hash
100
102
  # @return [Object] Returns the model itself
101
103
  def self.build_from_hash(attributes)
102
- new.build_from_hash(attributes)
103
- end
104
-
105
- # Builds the object from hash
106
- # @param [Hash] attributes Model attributes in the form of hash
107
- # @return [Object] Returns the model itself
108
- def build_from_hash(attributes)
109
104
  return nil unless attributes.is_a?(Hash)
110
105
  attributes = attributes.transform_keys(&:to_sym)
111
- self.class.openapi_types.each_pair do |key, type|
112
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
- self.send("#{key}=", nil)
106
+ transformed_hash = {}
107
+ openapi_types.each_pair do |key, type|
108
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
109
+ transformed_hash["#{key}"] = nil
114
110
  elsif type =~ /\AArray<(.*)>/i
115
111
  # check to ensure the input is an array given that the attribute
116
112
  # is documented as an array but the input is not
117
- if attributes[self.class.attribute_map[key]].is_a?(Array)
118
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
119
115
  end
120
- elsif !attributes[self.class.attribute_map[key]].nil?
121
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif !attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
122
118
  end
123
119
  end
124
-
125
- self
120
+ new(transformed_hash)
126
121
  end
127
122
 
128
123
  # Deserializes the data based on type
129
124
  # @param string type Data type
130
125
  # @param string value Value to be deserialized
131
126
  # @return [Object] Deserialized data
132
- def _deserialize(type, value)
127
+ def self._deserialize(type, value)
133
128
  case type.to_sym
134
129
  when :Time
135
130
  Time.parse(value)
@@ -164,7 +159,7 @@ module CityPayApiClient
164
159
  else # model
165
160
  # models (e.g. Pet) or oneOf
166
161
  klass = CityPayApiClient.const_get(type)
167
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
162
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
163
  end
169
164
  end
170
165
 
@@ -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
 
@@ -92,6 +92,7 @@ module CityPayApiClient
92
92
  # Show invalid properties with the reasons. Usually used together with valid?
93
93
  # @return Array for valid properties with the reasons
94
94
  def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
96
  invalid_properties = Array.new
96
97
  if !@code.nil? && @code.to_s.length > 4
97
98
  invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 4.')
@@ -115,6 +116,7 @@ module CityPayApiClient
115
116
  # Check to see if the all the properties in the model are valid
116
117
  # @return true if the model is valid
117
118
  def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
118
120
  return false if !@code.nil? && @code.to_s.length > 4
119
121
  return false if !@code.nil? && @code.to_s.length < 3
120
122
  return false if !@identifier.nil? && @identifier.to_s.length > 50
@@ -125,11 +127,15 @@ module CityPayApiClient
125
127
  # Custom attribute writer method with validation
126
128
  # @param [Object] code Value to be assigned
127
129
  def code=(code)
128
- if !code.nil? && code.to_s.length > 4
130
+ if code.nil?
131
+ fail ArgumentError, 'code cannot be nil'
132
+ end
133
+
134
+ if code.to_s.length > 4
129
135
  fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 4.'
130
136
  end
131
137
 
132
- if !code.nil? && code.to_s.length < 3
138
+ if code.to_s.length < 3
133
139
  fail ArgumentError, 'invalid value for "code", the character length must be great than or equal to 3.'
134
140
  end
135
141
 
@@ -139,11 +145,15 @@ module CityPayApiClient
139
145
  # Custom attribute writer method with validation
140
146
  # @param [Object] identifier Value to be assigned
141
147
  def identifier=(identifier)
142
- if !identifier.nil? && identifier.to_s.length > 50
148
+ if identifier.nil?
149
+ fail ArgumentError, 'identifier cannot be nil'
150
+ end
151
+
152
+ if identifier.to_s.length > 50
143
153
  fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
144
154
  end
145
155
 
146
- if !identifier.nil? && identifier.to_s.length < 4
156
+ if identifier.to_s.length < 4
147
157
  fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
148
158
  end
149
159
 
@@ -177,37 +187,30 @@ module CityPayApiClient
177
187
  # @param [Hash] attributes Model attributes in the form of hash
178
188
  # @return [Object] Returns the model itself
179
189
  def self.build_from_hash(attributes)
180
- new.build_from_hash(attributes)
181
- end
182
-
183
- # Builds the object from hash
184
- # @param [Hash] attributes Model attributes in the form of hash
185
- # @return [Object] Returns the model itself
186
- def build_from_hash(attributes)
187
190
  return nil unless attributes.is_a?(Hash)
188
191
  attributes = attributes.transform_keys(&:to_sym)
189
- self.class.openapi_types.each_pair do |key, type|
190
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
191
- self.send("#{key}=", nil)
192
+ transformed_hash = {}
193
+ openapi_types.each_pair do |key, type|
194
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = nil
192
196
  elsif type =~ /\AArray<(.*)>/i
193
197
  # check to ensure the input is an array given that the attribute
194
198
  # is documented as an array but the input is not
195
- if attributes[self.class.attribute_map[key]].is_a?(Array)
196
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
+ if attributes[attribute_map[key]].is_a?(Array)
200
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
197
201
  end
198
- elsif !attributes[self.class.attribute_map[key]].nil?
199
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
202
+ elsif !attributes[attribute_map[key]].nil?
203
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
200
204
  end
201
205
  end
202
-
203
- self
206
+ new(transformed_hash)
204
207
  end
205
208
 
206
209
  # Deserializes the data based on type
207
210
  # @param string type Data type
208
211
  # @param string value Value to be deserialized
209
212
  # @return [Object] Deserialized data
210
- def _deserialize(type, value)
213
+ def self._deserialize(type, value)
211
214
  case type.to_sym
212
215
  when :Time
213
216
  Time.parse(value)
@@ -242,7 +245,7 @@ module CityPayApiClient
242
245
  else # model
243
246
  # models (e.g. Pet) or oneOf
244
247
  klass = CityPayApiClient.const_get(type)
245
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
248
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
246
249
  end
247
250
  end
248
251
 
@@ -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
 
@@ -59,12 +59,15 @@ module CityPayApiClient
59
59
 
60
60
  if attributes.key?(:'ip')
61
61
  self.ip = attributes[:'ip']
62
+ else
63
+ self.ip = nil
62
64
  end
63
65
  end
64
66
 
65
67
  # Show invalid properties with the reasons. Usually used together with valid?
66
68
  # @return Array for valid properties with the reasons
67
69
  def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
68
71
  invalid_properties = Array.new
69
72
  if @ip.nil?
70
73
  invalid_properties.push('invalid value for "ip", ip cannot be nil.')
@@ -76,6 +79,7 @@ module CityPayApiClient
76
79
  # Check to see if the all the properties in the model are valid
77
80
  # @return true if the model is valid
78
81
  def valid?
82
+ warn '[DEPRECATED] the `valid?` method is obsolete'
79
83
  return false if @ip.nil?
80
84
  true
81
85
  end
@@ -104,37 +108,30 @@ module CityPayApiClient
104
108
  # @param [Hash] attributes Model attributes in the form of hash
105
109
  # @return [Object] Returns the model itself
106
110
  def self.build_from_hash(attributes)
107
- new.build_from_hash(attributes)
108
- end
109
-
110
- # Builds the object from hash
111
- # @param [Hash] attributes Model attributes in the form of hash
112
- # @return [Object] Returns the model itself
113
- def build_from_hash(attributes)
114
111
  return nil unless attributes.is_a?(Hash)
115
112
  attributes = attributes.transform_keys(&:to_sym)
116
- self.class.openapi_types.each_pair do |key, type|
117
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
- self.send("#{key}=", nil)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
119
117
  elsif type =~ /\AArray<(.*)>/i
120
118
  # check to ensure the input is an array given that the attribute
121
119
  # is documented as an array but the input is not
122
- if attributes[self.class.attribute_map[key]].is_a?(Array)
123
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
122
  end
125
- elsif !attributes[self.class.attribute_map[key]].nil?
126
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
127
125
  end
128
126
  end
129
-
130
- self
127
+ new(transformed_hash)
131
128
  end
132
129
 
133
130
  # Deserializes the data based on type
134
131
  # @param string type Data type
135
132
  # @param string value Value to be deserialized
136
133
  # @return [Object] Deserialized data
137
- def _deserialize(type, value)
134
+ def self._deserialize(type, value)
138
135
  case type.to_sym
139
136
  when :Time
140
137
  Time.parse(value)
@@ -169,7 +166,7 @@ module CityPayApiClient
169
166
  else # model
170
167
  # models (e.g. Pet) or oneOf
171
168
  klass = CityPayApiClient.const_get(type)
172
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
169
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
170
  end
174
171
  end
175
172
 
@@ -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
 
@@ -92,6 +92,7 @@ module CityPayApiClient
92
92
  # Show invalid properties with the reasons. Usually used together with valid?
93
93
  # @return Array for valid properties with the reasons
94
94
  def list_invalid_properties
95
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
96
  invalid_properties = Array.new
96
97
  invalid_properties
97
98
  end
@@ -99,6 +100,7 @@ module CityPayApiClient
99
100
  # Check to see if the all the properties in the model are valid
100
101
  # @return true if the model is valid
101
102
  def valid?
103
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
104
  true
103
105
  end
104
106
 
@@ -129,37 +131,30 @@ module CityPayApiClient
129
131
  # @param [Hash] attributes Model attributes in the form of hash
130
132
  # @return [Object] Returns the model itself
131
133
  def self.build_from_hash(attributes)
132
- new.build_from_hash(attributes)
133
- end
134
-
135
- # Builds the object from hash
136
- # @param [Hash] attributes Model attributes in the form of hash
137
- # @return [Object] Returns the model itself
138
- def build_from_hash(attributes)
139
134
  return nil unless attributes.is_a?(Hash)
140
135
  attributes = attributes.transform_keys(&:to_sym)
141
- self.class.openapi_types.each_pair do |key, type|
142
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
143
- self.send("#{key}=", nil)
136
+ transformed_hash = {}
137
+ openapi_types.each_pair do |key, type|
138
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
139
+ transformed_hash["#{key}"] = nil
144
140
  elsif type =~ /\AArray<(.*)>/i
145
141
  # check to ensure the input is an array given that the attribute
146
142
  # is documented as an array but the input is not
147
- if attributes[self.class.attribute_map[key]].is_a?(Array)
148
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ if attributes[attribute_map[key]].is_a?(Array)
144
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
145
  end
150
- elsif !attributes[self.class.attribute_map[key]].nil?
151
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ elsif !attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
148
  end
153
149
  end
154
-
155
- self
150
+ new(transformed_hash)
156
151
  end
157
152
 
158
153
  # Deserializes the data based on type
159
154
  # @param string type Data type
160
155
  # @param string value Value to be deserialized
161
156
  # @return [Object] Deserialized data
162
- def _deserialize(type, value)
157
+ def self._deserialize(type, value)
163
158
  case type.to_sym
164
159
  when :Time
165
160
  Time.parse(value)
@@ -194,7 +189,7 @@ module CityPayApiClient
194
189
  else # model
195
190
  # models (e.g. Pet) or oneOf
196
191
  klass = CityPayApiClient.const_get(type)
197
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
192
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
193
  end
199
194
  end
200
195
 
@@ -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
 
@@ -130,6 +130,8 @@ module CityPayApiClient
130
130
 
131
131
  if attributes.key?(:'carrier_name')
132
132
  self.carrier_name = attributes[:'carrier_name']
133
+ else
134
+ self.carrier_name = nil
133
135
  end
134
136
 
135
137
  if attributes.key?(:'conjunction_ticket_indicator')
@@ -158,6 +160,8 @@ module CityPayApiClient
158
160
 
159
161
  if attributes.key?(:'segment1')
160
162
  self.segment1 = attributes[:'segment1']
163
+ else
164
+ self.segment1 = nil
161
165
  end
162
166
 
163
167
  if attributes.key?(:'segment2')
@@ -174,28 +178,39 @@ module CityPayApiClient
174
178
 
175
179
  if attributes.key?(:'ticket_issue_city')
176
180
  self.ticket_issue_city = attributes[:'ticket_issue_city']
181
+ else
182
+ self.ticket_issue_city = nil
177
183
  end
178
184
 
179
185
  if attributes.key?(:'ticket_issue_date')
180
186
  self.ticket_issue_date = attributes[:'ticket_issue_date']
187
+ else
188
+ self.ticket_issue_date = nil
181
189
  end
182
190
 
183
191
  if attributes.key?(:'ticket_issue_name')
184
192
  self.ticket_issue_name = attributes[:'ticket_issue_name']
193
+ else
194
+ self.ticket_issue_name = nil
185
195
  end
186
196
 
187
197
  if attributes.key?(:'ticket_no')
188
198
  self.ticket_no = attributes[:'ticket_no']
199
+ else
200
+ self.ticket_no = nil
189
201
  end
190
202
 
191
203
  if attributes.key?(:'transaction_type')
192
204
  self.transaction_type = attributes[:'transaction_type']
205
+ else
206
+ self.transaction_type = nil
193
207
  end
194
208
  end
195
209
 
196
210
  # Show invalid properties with the reasons. Usually used together with valid?
197
211
  # @return Array for valid properties with the reasons
198
212
  def list_invalid_properties
213
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
199
214
  invalid_properties = Array.new
200
215
  if @carrier_name.nil?
201
216
  invalid_properties.push('invalid value for "carrier_name", carrier_name cannot be nil.')
@@ -213,10 +228,6 @@ module CityPayApiClient
213
228
  invalid_properties.push('invalid value for "no_air_segments", must be greater than or equal to 0.')
214
229
  end
215
230
 
216
- if @number_in_party.nil?
217
- invalid_properties.push('invalid value for "number_in_party", number_in_party cannot be nil.')
218
- end
219
-
220
231
  if !@original_ticket_no.nil? && @original_ticket_no.to_s.length > 14
221
232
  invalid_properties.push('invalid value for "original_ticket_no", the character length must be smaller than or equal to 14.')
222
233
  end
@@ -275,11 +286,11 @@ module CityPayApiClient
275
286
  # Check to see if the all the properties in the model are valid
276
287
  # @return true if the model is valid
277
288
  def valid?
289
+ warn '[DEPRECATED] the `valid?` method is obsolete'
278
290
  return false if @carrier_name.nil?
279
291
  return false if @carrier_name.to_s.length > 25
280
292
  return false if !@no_air_segments.nil? && @no_air_segments > 4
281
293
  return false if !@no_air_segments.nil? && @no_air_segments < 0
282
- return false if @number_in_party.nil?
283
294
  return false if !@original_ticket_no.nil? && @original_ticket_no.to_s.length > 14
284
295
  return false if !@passenger_name.nil? && @passenger_name.to_s.length > 25
285
296
  return false if @segment1.nil?
@@ -313,11 +324,15 @@ module CityPayApiClient
313
324
  # Custom attribute writer method with validation
314
325
  # @param [Object] no_air_segments Value to be assigned
315
326
  def no_air_segments=(no_air_segments)
316
- if !no_air_segments.nil? && no_air_segments > 4
327
+ if no_air_segments.nil?
328
+ fail ArgumentError, 'no_air_segments cannot be nil'
329
+ end
330
+
331
+ if no_air_segments > 4
317
332
  fail ArgumentError, 'invalid value for "no_air_segments", must be smaller than or equal to 4.'
318
333
  end
319
334
 
320
- if !no_air_segments.nil? && no_air_segments < 0
335
+ if no_air_segments < 0
321
336
  fail ArgumentError, 'invalid value for "no_air_segments", must be greater than or equal to 0.'
322
337
  end
323
338
 
@@ -327,7 +342,11 @@ module CityPayApiClient
327
342
  # Custom attribute writer method with validation
328
343
  # @param [Object] original_ticket_no Value to be assigned
329
344
  def original_ticket_no=(original_ticket_no)
330
- if !original_ticket_no.nil? && original_ticket_no.to_s.length > 14
345
+ if original_ticket_no.nil?
346
+ fail ArgumentError, 'original_ticket_no cannot be nil'
347
+ end
348
+
349
+ if original_ticket_no.to_s.length > 14
331
350
  fail ArgumentError, 'invalid value for "original_ticket_no", the character length must be smaller than or equal to 14.'
332
351
  end
333
352
 
@@ -337,7 +356,11 @@ module CityPayApiClient
337
356
  # Custom attribute writer method with validation
338
357
  # @param [Object] passenger_name Value to be assigned
339
358
  def passenger_name=(passenger_name)
340
- if !passenger_name.nil? && passenger_name.to_s.length > 25
359
+ if passenger_name.nil?
360
+ fail ArgumentError, 'passenger_name cannot be nil'
361
+ end
362
+
363
+ if passenger_name.to_s.length > 25
341
364
  fail ArgumentError, 'invalid value for "passenger_name", the character length must be smaller than or equal to 25.'
342
365
  end
343
366
 
@@ -443,37 +466,30 @@ module CityPayApiClient
443
466
  # @param [Hash] attributes Model attributes in the form of hash
444
467
  # @return [Object] Returns the model itself
445
468
  def self.build_from_hash(attributes)
446
- new.build_from_hash(attributes)
447
- end
448
-
449
- # Builds the object from hash
450
- # @param [Hash] attributes Model attributes in the form of hash
451
- # @return [Object] Returns the model itself
452
- def build_from_hash(attributes)
453
469
  return nil unless attributes.is_a?(Hash)
454
470
  attributes = attributes.transform_keys(&:to_sym)
455
- self.class.openapi_types.each_pair do |key, type|
456
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
457
- self.send("#{key}=", nil)
471
+ transformed_hash = {}
472
+ openapi_types.each_pair do |key, type|
473
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
474
+ transformed_hash["#{key}"] = nil
458
475
  elsif type =~ /\AArray<(.*)>/i
459
476
  # check to ensure the input is an array given that the attribute
460
477
  # is documented as an array but the input is not
461
- if attributes[self.class.attribute_map[key]].is_a?(Array)
462
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
478
+ if attributes[attribute_map[key]].is_a?(Array)
479
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
463
480
  end
464
- elsif !attributes[self.class.attribute_map[key]].nil?
465
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
481
+ elsif !attributes[attribute_map[key]].nil?
482
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
466
483
  end
467
484
  end
468
-
469
- self
485
+ new(transformed_hash)
470
486
  end
471
487
 
472
488
  # Deserializes the data based on type
473
489
  # @param string type Data type
474
490
  # @param string value Value to be deserialized
475
491
  # @return [Object] Deserialized data
476
- def _deserialize(type, value)
492
+ def self._deserialize(type, value)
477
493
  case type.to_sym
478
494
  when :Time
479
495
  Time.parse(value)
@@ -508,7 +524,7 @@ module CityPayApiClient
508
524
  else # model
509
525
  # models (e.g. Pet) or oneOf
510
526
  klass = CityPayApiClient.const_get(type)
511
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
527
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
512
528
  end
513
529
  end
514
530