citypay_api_client 1.0.3 → 1.1.1

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 (242) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +105 -34
  3. data/citypay_api_client.gemspec +4 -5
  4. data/docs/AccountCreate.md +10 -9
  5. data/docs/AccountStatus.md +8 -7
  6. data/docs/Acknowledgement.md +14 -13
  7. data/docs/AclCheckRequest.md +18 -0
  8. data/docs/AclCheckResponseModel.md +24 -0
  9. data/docs/AirlineAdvice.md +38 -37
  10. data/docs/AirlineSegment.md +22 -21
  11. data/docs/AuthReference.md +34 -33
  12. data/docs/AuthReferences.md +8 -7
  13. data/docs/AuthRequest.md +50 -49
  14. data/docs/AuthResponse.md +60 -59
  15. data/docs/AuthenRequired.md +12 -11
  16. data/docs/AuthorisationAndPaymentApi.md +559 -0
  17. data/docs/Batch.md +22 -0
  18. data/docs/BatchProcessingApi.md +214 -0
  19. data/docs/BatchReportRequest.md +20 -0
  20. data/docs/BatchReportResponseModel.md +28 -0
  21. data/docs/BatchTransaction.md +24 -0
  22. data/docs/BatchTransactionResultModel.md +40 -0
  23. data/docs/Bin.md +34 -0
  24. data/docs/BinLookup.md +18 -0
  25. data/docs/CResAuthRequest.md +8 -7
  26. data/docs/CaptureRequest.md +18 -17
  27. data/docs/Card.md +46 -41
  28. data/docs/CardHolderAccount.md +24 -21
  29. data/docs/CardHolderAccountApi.md +326 -105
  30. data/docs/CardStatus.md +10 -9
  31. data/docs/ChargeRequest.md +36 -31
  32. data/docs/CheckBatchStatus.md +20 -0
  33. data/docs/CheckBatchStatusResponse.md +18 -0
  34. data/docs/ContactDetails.md +32 -31
  35. data/docs/Decision.md +12 -11
  36. data/docs/DirectPostApi.md +365 -0
  37. data/docs/DirectPostRequest.md +58 -0
  38. data/docs/DirectTokenAuthRequest.md +24 -0
  39. data/docs/DomainKeyCheckRequest.md +18 -0
  40. data/docs/DomainKeyRequest.md +22 -0
  41. data/docs/DomainKeyResponse.md +26 -0
  42. data/docs/Error.md +16 -13
  43. data/docs/EventDataModel.md +26 -0
  44. data/docs/Exists.md +22 -0
  45. data/docs/ExternalMPI.md +16 -15
  46. data/docs/ListMerchantsResponse.md +12 -11
  47. data/docs/MCC6012.md +14 -13
  48. data/docs/Merchant.md +16 -15
  49. data/docs/OperationalApi.md +124 -22
  50. data/docs/OperationalFunctionsApi.md +355 -0
  51. data/docs/PaResAuthRequest.md +10 -9
  52. data/docs/PaylinkAddress.md +30 -0
  53. data/docs/PaylinkAdjustmentRequest.md +22 -0
  54. data/docs/PaylinkApi.md +630 -0
  55. data/docs/PaylinkAttachmentRequest.md +26 -0
  56. data/docs/PaylinkAttachmentResult.md +22 -0
  57. data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
  58. data/docs/PaylinkCardHolder.md +36 -0
  59. data/docs/PaylinkCart.md +30 -0
  60. data/docs/PaylinkCartItemModel.md +32 -0
  61. data/docs/PaylinkConfig.md +60 -0
  62. data/docs/PaylinkCustomParam.md +36 -0
  63. data/docs/PaylinkEmailNotificationPath.md +26 -0
  64. data/docs/PaylinkErrorCode.md +20 -0
  65. data/docs/PaylinkFieldGuardModel.md +30 -0
  66. data/docs/PaylinkPartPayments.md +28 -0
  67. data/docs/PaylinkSMSNotificationPath.md +20 -0
  68. data/docs/PaylinkStateEvent.md +22 -0
  69. data/docs/PaylinkTokenCreated.md +44 -0
  70. data/docs/PaylinkTokenRequestModel.md +38 -0
  71. data/docs/PaylinkTokenStatus.md +72 -0
  72. data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
  73. data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
  74. data/docs/PaylinkUI.md +24 -0
  75. data/docs/PaymentProcessingApi.md +307 -68
  76. data/docs/Ping.md +8 -7
  77. data/docs/ProcessBatchRequest.md +24 -0
  78. data/docs/ProcessBatchResponse.md +20 -0
  79. data/docs/RefundRequest.md +26 -0
  80. data/docs/RegisterCard.md +16 -13
  81. data/docs/RequestChallenged.md +16 -15
  82. data/docs/RetrieveRequest.md +12 -11
  83. data/docs/ThreeDSecure.md +32 -15
  84. data/docs/TokenisationResponseModel.md +36 -0
  85. data/docs/VoidRequest.md +12 -13
  86. data/lib/.DS_Store +0 -0
  87. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
  88. data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
  89. data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
  90. data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
  91. data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
  92. data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
  93. data/lib/citypay_api_client/api_client.rb +59 -59
  94. data/lib/citypay_api_client/api_error.rb +2 -2
  95. data/lib/citypay_api_client/configuration.rb +53 -15
  96. data/lib/citypay_api_client/models/account_create.rb +21 -8
  97. data/lib/citypay_api_client/models/account_status.rb +21 -8
  98. data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
  99. data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
  100. data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
  101. data/lib/citypay_api_client/models/airline_advice.rb +23 -10
  102. data/lib/citypay_api_client/models/airline_segment.rb +21 -8
  103. data/lib/citypay_api_client/models/auth_reference.rb +45 -11
  104. data/lib/citypay_api_client/models/auth_references.rb +21 -8
  105. data/lib/citypay_api_client/models/auth_request.rb +79 -35
  106. data/lib/citypay_api_client/models/auth_response.rb +43 -106
  107. data/lib/citypay_api_client/models/authen_required.rb +21 -8
  108. data/lib/citypay_api_client/models/batch.rb +264 -0
  109. data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
  110. data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
  111. data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
  112. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
  113. data/lib/citypay_api_client/models/bin.rb +299 -0
  114. data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
  115. data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
  116. data/lib/citypay_api_client/models/capture_request.rb +38 -22
  117. data/lib/citypay_api_client/models/card.rb +67 -10
  118. data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
  119. data/lib/citypay_api_client/models/card_status.rb +21 -8
  120. data/lib/citypay_api_client/models/charge_request.rb +96 -26
  121. data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
  122. data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
  123. data/lib/citypay_api_client/models/contact_details.rb +87 -44
  124. data/lib/citypay_api_client/models/decision.rb +21 -8
  125. data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
  126. data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
  127. data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
  128. data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
  129. data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
  130. data/lib/citypay_api_client/models/error.rb +35 -12
  131. data/lib/citypay_api_client/models/event_data_model.rb +259 -0
  132. data/lib/citypay_api_client/models/exists.rb +244 -0
  133. data/lib/citypay_api_client/models/external_mpi.rb +27 -8
  134. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
  135. data/lib/citypay_api_client/models/mcc6012.rb +21 -8
  136. data/lib/citypay_api_client/models/merchant.rb +21 -8
  137. data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
  138. data/lib/citypay_api_client/models/paylink_address.rb +402 -0
  139. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
  140. data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
  141. data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
  142. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
  143. data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
  144. data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
  145. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
  146. data/lib/citypay_api_client/models/paylink_config.rb +433 -0
  147. data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
  148. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
  149. data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
  150. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
  151. data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
  152. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
  153. data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
  154. data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
  155. data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
  156. data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
  157. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
  158. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
  159. data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
  160. data/lib/citypay_api_client/models/ping.rb +21 -8
  161. data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
  162. data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
  163. data/lib/citypay_api_client/models/refund_request.rb +332 -0
  164. data/lib/citypay_api_client/models/register_card.rb +59 -12
  165. data/lib/citypay_api_client/models/request_challenged.rb +29 -16
  166. data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
  167. data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
  168. data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
  169. data/lib/citypay_api_client/models/void_request.rb +22 -21
  170. data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
  171. data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
  172. data/lib/citypay_api_client/version.rb +3 -4
  173. data/lib/citypay_api_client.rb +53 -6
  174. data/spec/.DS_Store +0 -0
  175. data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
  176. data/spec/api/batch_processing_api___spec.rb +70 -0
  177. data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
  178. data/spec/api/direct_post_api___spec.rb +98 -0
  179. data/spec/api/operational_functions_api___spec.rb +94 -0
  180. data/spec/api/paylink_api___spec.rb +131 -0
  181. data/spec/api_client_spec.rb +4 -4
  182. data/spec/configuration_spec.rb +5 -5
  183. data/spec/it_api_sandbox_spec.rb +126 -58
  184. data/spec/models/acknowledgement_spec.rb +7 -22
  185. data/spec/models/acl_check_request_spec.rb +33 -0
  186. data/spec/models/acl_check_response_model_spec.rb +51 -0
  187. data/spec/models/auth_references_spec.rb +7 -8
  188. data/spec/models/auth_response_spec.rb +29 -30
  189. data/spec/models/batch_report_request_spec.rb +39 -0
  190. data/spec/models/batch_report_response_model_spec.rb +63 -0
  191. data/spec/models/batch_spec.rb +45 -0
  192. data/spec/models/batch_transaction_result_model_spec.rb +87 -0
  193. data/spec/models/batch_transaction_spec.rb +51 -0
  194. data/spec/models/bin_lookup_spec.rb +33 -0
  195. data/spec/models/bin_spec.rb +81 -0
  196. data/spec/models/card_holder_account_spec.rb +8 -5
  197. data/spec/models/check_batch_status_response_spec.rb +45 -0
  198. data/spec/models/check_batch_status_spec.rb +39 -0
  199. data/spec/models/decision_spec.rb +1 -1
  200. data/spec/models/direct_post_request_spec.rb +153 -0
  201. data/spec/models/direct_token_auth_request_spec.rb +51 -0
  202. data/spec/models/domain_key_check_request_spec.rb +33 -0
  203. data/spec/models/domain_key_request_spec.rb +45 -0
  204. data/spec/models/domain_key_response_spec.rb +57 -0
  205. data/spec/models/event_data_model_spec.rb +57 -0
  206. data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
  207. data/spec/models/list_merchants_response_spec.rb +2 -2
  208. data/spec/models/paylink_address_spec.rb +69 -0
  209. data/spec/models/paylink_adjustment_request_spec.rb +45 -0
  210. data/spec/models/paylink_attachment_request_spec.rb +45 -0
  211. data/spec/models/paylink_attachment_result_spec.rb +45 -0
  212. data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
  213. data/spec/models/paylink_card_holder_spec.rb +87 -0
  214. data/spec/models/paylink_cart_item_model_spec.rb +75 -0
  215. data/spec/models/paylink_cart_spec.rb +69 -0
  216. data/spec/models/paylink_config_spec.rb +159 -0
  217. data/spec/models/paylink_custom_param_spec.rb +87 -0
  218. data/spec/models/paylink_email_notification_path_spec.rb +57 -0
  219. data/spec/models/paylink_error_code_spec.rb +39 -0
  220. data/spec/models/paylink_field_guard_model_spec.rb +45 -0
  221. data/spec/models/paylink_part_payments_spec.rb +63 -0
  222. data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
  223. data/spec/models/paylink_state_event_spec.rb +45 -0
  224. data/spec/models/paylink_token_created_spec.rb +111 -0
  225. data/spec/models/paylink_token_request_model_spec.rb +93 -0
  226. data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
  227. data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
  228. data/spec/models/paylink_token_status_spec.rb +195 -0
  229. data/spec/models/paylink_ui_spec.rb +51 -0
  230. data/spec/models/process_batch_request_spec.rb +51 -0
  231. data/spec/models/process_batch_response_spec.rb +39 -0
  232. data/spec/models/refund_request_spec.rb +64 -0
  233. data/spec/models/tokenisation_response_model_spec.rb +87 -0
  234. data/spec/spec_helper.rb +2 -2
  235. data/spec/utils/direct_post_mac_spec.rb +13 -0
  236. metadata +210 -37
  237. data/Gemfile.lock +0 -70
  238. data/git_push.sh +0 -58
  239. data/lib/citypay_api_client/api/operational_api.rb +0 -147
  240. data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
  241. data/lib/citypay_api_client/test.rb +0 -20
  242. data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -1,15 +1,16 @@
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 <aside class=\"notice\"> Before we begin a reminder that 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 including: </aside> * 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 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.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 5.0.0-SNAPSHOT
8
+ OpenAPI Generator version: 6.2.1
9
9
 
10
10
  =end
11
11
 
12
12
  require 'date'
13
+ require 'time'
13
14
 
14
15
  module CityPayApiClient
15
16
  class Acknowledgement
@@ -35,6 +36,11 @@ module CityPayApiClient
35
36
  }
36
37
  end
37
38
 
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
38
44
  # Attribute type mapping.
39
45
  def self.openapi_types
40
46
  {
@@ -179,8 +185,11 @@ module CityPayApiClient
179
185
  # @return [Object] Returns the model itself
180
186
  def build_from_hash(attributes)
181
187
  return nil unless attributes.is_a?(Hash)
188
+ attributes = attributes.transform_keys(&:to_sym)
182
189
  self.class.openapi_types.each_pair do |key, type|
183
- if type =~ /\AArray<(.*)>/i
190
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
191
+ self.send("#{key}=", nil)
192
+ elsif type =~ /\AArray<(.*)>/i
184
193
  # check to ensure the input is an array given that the attribute
185
194
  # is documented as an array but the input is not
186
195
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -188,7 +197,7 @@ module CityPayApiClient
188
197
  end
189
198
  elsif !attributes[self.class.attribute_map[key]].nil?
190
199
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
191
- end # or else data not found in attributes(hash), not an issue as the data can be optional
200
+ end
192
201
  end
193
202
 
194
203
  self
@@ -200,8 +209,8 @@ module CityPayApiClient
200
209
  # @return [Object] Deserialized data
201
210
  def _deserialize(type, value)
202
211
  case type.to_sym
203
- when :DateTime
204
- DateTime.parse(value)
212
+ when :Time
213
+ Time.parse(value)
205
214
  when :Date
206
215
  Date.parse(value)
207
216
  when :String
@@ -231,7 +240,9 @@ module CityPayApiClient
231
240
  end
232
241
  end
233
242
  else # model
234
- CityPayApiClient.const_get(type).build_from_hash(value)
243
+ # models (e.g. Pet) or oneOf
244
+ klass = CityPayApiClient.const_get(type)
245
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
235
246
  end
236
247
  end
237
248
 
@@ -257,7 +268,7 @@ module CityPayApiClient
257
268
  is_nullable = self.class.openapi_nullable.include?(attr)
258
269
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
259
270
  end
260
-
271
+
261
272
  hash[param] = _to_hash(value)
262
273
  end
263
274
  hash
@@ -280,5 +291,7 @@ module CityPayApiClient
280
291
  value
281
292
  end
282
293
  end
294
+
283
295
  end
296
+
284
297
  end
@@ -0,0 +1,224 @@
1
+ =begin
2
+ #CityPay Payment API
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.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 6.2.1
9
+
10
+ =end
11
+
12
+ require 'date'
13
+ require 'time'
14
+
15
+ module CityPayApiClient
16
+ class AclCheckRequest
17
+ # An ip address to check for an ACL against. The address should be a publicly routable IPv4 address.
18
+ attr_accessor :ip
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'ip' => :'ip'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'ip' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::AclCheckRequest` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::AclCheckRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'ip')
61
+ self.ip = attributes[:'ip']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ if @ip.nil?
70
+ invalid_properties.push('invalid value for "ip", ip cannot be nil.')
71
+ end
72
+
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @ip.nil?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ ip == o.ip
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [ip].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ 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
+ return nil unless attributes.is_a?(Hash)
115
+ 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)
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # 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) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :Time
140
+ Time.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ # models (e.g. Pet) or oneOf
171
+ klass = CityPayApiClient.const_get(type)
172
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end
@@ -0,0 +1,249 @@
1
+ =begin
2
+ #CityPay Payment API
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.
5
+
6
+ Contact: support@citypay.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 6.2.1
9
+
10
+ =end
11
+
12
+ require 'date'
13
+ require 'time'
14
+
15
+ module CityPayApiClient
16
+ class AclCheckResponseModel
17
+ # The name or value of the acl which was found to match the ip address.
18
+ attr_accessor :acl
19
+
20
+ # Whether the ACL was returned via a cached instance.
21
+ attr_accessor :cache
22
+
23
+ # The IP address used in the lookup.
24
+ attr_accessor :ip
25
+
26
+ # The source provider of the ACL.
27
+ attr_accessor :provider
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'acl' => :'acl',
33
+ :'cache' => :'cache',
34
+ :'ip' => :'ip',
35
+ :'provider' => :'provider'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'acl' => :'String',
48
+ :'cache' => :'Boolean',
49
+ :'ip' => :'String',
50
+ :'provider' => :'String'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::AclCheckResponseModel` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::AclCheckResponseModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'acl')
76
+ self.acl = attributes[:'acl']
77
+ end
78
+
79
+ if attributes.key?(:'cache')
80
+ self.cache = attributes[:'cache']
81
+ end
82
+
83
+ if attributes.key?(:'ip')
84
+ self.ip = attributes[:'ip']
85
+ end
86
+
87
+ if attributes.key?(:'provider')
88
+ self.provider = attributes[:'provider']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ acl == o.acl &&
111
+ cache == o.cache &&
112
+ ip == o.ip &&
113
+ provider == o.provider
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [acl, cache, ip, provider].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ 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
+ return nil unless attributes.is_a?(Hash)
140
+ 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)
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # 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) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :Time
165
+ Time.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :Boolean
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ # models (e.g. Pet) or oneOf
196
+ klass = CityPayApiClient.const_get(type)
197
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+
247
+ end
248
+
249
+ end
@@ -1,15 +1,16 @@
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 <aside class=\"notice\"> Before we begin a reminder that 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 including: </aside> * 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 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.
5
5
 
6
6
  Contact: support@citypay.com
7
7
  Generated by: https://openapi-generator.tech
8
- OpenAPI Generator version: 5.0.0-SNAPSHOT
8
+ OpenAPI Generator version: 6.2.1
9
9
 
10
10
  =end
11
11
 
12
12
  require 'date'
13
+ require 'time'
13
14
 
14
15
  module CityPayApiClient
15
16
  class AirlineAdvice
@@ -22,7 +23,7 @@ module CityPayApiClient
22
23
  # The Electronic Ticket Indicator, a code that indicates if an electronic ticket was issued. Defaults to true.
23
24
  attr_accessor :eticket_indicator
24
25
 
25
- # A value that indicates the number of air travel segments included on this ticket. Valid entries include the numerals “0” through “4”. Required only if the transaction type is TKT or EXC.
26
+ # A value that indicates the number of air travel segments included on this ticket. Valid entries include the numerals “0” through “4”. Required only if the transaction type is TKT or EXC.
26
27
  attr_accessor :no_air_segments
27
28
 
28
29
  # The number of people in the party.
@@ -54,7 +55,7 @@ module CityPayApiClient
54
55
  # This must be a valid ticket number, i.e. numeric (the first 3 digits must represent the valid IATA plate carrier code). The final check digit should be validated prior to submission. On credit charges, this field should contain the number of the original ticket, and not of a replacement.
55
56
  attr_accessor :ticket_no
56
57
 
57
- # This field contains the Transaction Type code assigned to this transaction. Valid codes include: - `TKT` = Ticket Purchase - `REF` = Refund - `EXC` = Exchange Ticket - `MSC` = Miscellaneous (non-Ticket Purchase- and non-Exchange Ticket-related transactions only).
58
+ # This field contains the Transaction Type code assigned to this transaction. Valid codes include: - `TKT` = Ticket Purchase - `REF` = Refund - `EXC` = Exchange Ticket - `MSC` = Miscellaneous (non-Ticket Purchase- and non-Exchange Ticket-related transactions only).
58
59
  attr_accessor :transaction_type
59
60
 
60
61
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -79,6 +80,11 @@ module CityPayApiClient
79
80
  }
80
81
  end
81
82
 
83
+ # Returns all the JSON keys this model knows about
84
+ def self.acceptable_attributes
85
+ attribute_map.values
86
+ end
87
+
82
88
  # Attribute type mapping.
83
89
  def self.openapi_types
84
90
  {
@@ -445,8 +451,11 @@ module CityPayApiClient
445
451
  # @return [Object] Returns the model itself
446
452
  def build_from_hash(attributes)
447
453
  return nil unless attributes.is_a?(Hash)
454
+ attributes = attributes.transform_keys(&:to_sym)
448
455
  self.class.openapi_types.each_pair do |key, type|
449
- if type =~ /\AArray<(.*)>/i
456
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
457
+ self.send("#{key}=", nil)
458
+ elsif type =~ /\AArray<(.*)>/i
450
459
  # check to ensure the input is an array given that the attribute
451
460
  # is documented as an array but the input is not
452
461
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -454,7 +463,7 @@ module CityPayApiClient
454
463
  end
455
464
  elsif !attributes[self.class.attribute_map[key]].nil?
456
465
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
457
- end # or else data not found in attributes(hash), not an issue as the data can be optional
466
+ end
458
467
  end
459
468
 
460
469
  self
@@ -466,8 +475,8 @@ module CityPayApiClient
466
475
  # @return [Object] Deserialized data
467
476
  def _deserialize(type, value)
468
477
  case type.to_sym
469
- when :DateTime
470
- DateTime.parse(value)
478
+ when :Time
479
+ Time.parse(value)
471
480
  when :Date
472
481
  Date.parse(value)
473
482
  when :String
@@ -497,7 +506,9 @@ module CityPayApiClient
497
506
  end
498
507
  end
499
508
  else # model
500
- CityPayApiClient.const_get(type).build_from_hash(value)
509
+ # models (e.g. Pet) or oneOf
510
+ klass = CityPayApiClient.const_get(type)
511
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
501
512
  end
502
513
  end
503
514
 
@@ -523,7 +534,7 @@ module CityPayApiClient
523
534
  is_nullable = self.class.openapi_nullable.include?(attr)
524
535
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
525
536
  end
526
-
537
+
527
538
  hash[param] = _to_hash(value)
528
539
  end
529
540
  hash
@@ -546,5 +557,7 @@ module CityPayApiClient
546
557
  value
547
558
  end
548
559
  end
560
+
549
561
  end
562
+
550
563
  end