citypay_api_client 1.1.1 → 1.1.3

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 (212) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +73 -0
  3. data/README.md +65 -37
  4. data/citypay_api_client.gemspec +4 -3
  5. data/docs/Acknowledgement.md +2 -2
  6. data/docs/AclCheckResponseModel.md +3 -3
  7. data/docs/AirlineAdvice.md +1 -1
  8. data/docs/AuthRequest.md +9 -7
  9. data/docs/AuthResponse.md +9 -5
  10. data/docs/AuthorisationAndPaymentApi.md +145 -10
  11. data/docs/Batch.md +1 -1
  12. data/docs/BatchProcessingApi.md +24 -20
  13. data/docs/BatchReportResponseModel.md +2 -2
  14. data/docs/BatchTransaction.md +1 -1
  15. data/docs/BatchTransactionReportRequest.md +22 -0
  16. data/docs/BatchTransactionReportResponse.md +24 -0
  17. data/docs/BatchTransactionResultModel.md +6 -2
  18. data/docs/Bin.md +2 -2
  19. data/docs/CaptureRequest.md +1 -1
  20. data/docs/Card.md +3 -3
  21. data/docs/CardHolderAccountApi.md +73 -14
  22. data/docs/ChargeRequest.md +8 -6
  23. data/docs/ContactDetails.md +11 -11
  24. data/docs/Decision.md +0 -2
  25. data/docs/DirectPostApi.md +26 -16
  26. data/docs/DirectPostRequest.md +9 -7
  27. data/docs/EventDataModel.md +2 -2
  28. data/docs/MerchantBatchReportRequest.md +28 -0
  29. data/docs/MerchantBatchReportResponse.md +24 -0
  30. data/docs/MerchantBatchResponse.md +30 -0
  31. data/docs/NetSummaryResponse.md +32 -0
  32. data/docs/OperationalFunctionsApi.md +28 -8
  33. data/docs/PaylinkAdjustmentRequest.md +1 -1
  34. data/docs/PaylinkApi.md +337 -21
  35. data/docs/PaylinkBillPaymentTokenRequest.md +1 -1
  36. data/docs/PaylinkCustomParam.md +3 -1
  37. data/docs/PaylinkErrorCode.md +2 -2
  38. data/docs/PaylinkFieldGuardModel.md +1 -1
  39. data/docs/PaylinkResendNotificationRequest.md +20 -0
  40. data/docs/PaylinkStateEvent.md +4 -4
  41. data/docs/PaylinkTokenCreated.md +11 -11
  42. data/docs/PaylinkTokenRequestModel.md +4 -0
  43. data/docs/PaylinkTokenStatus.md +7 -7
  44. data/docs/PaylinkTokenStatusChangeRequest.md +7 -7
  45. data/docs/PaylinkTokenStatusChangeResponse.md +6 -2
  46. data/docs/PaymentIntent.md +42 -0
  47. data/docs/PaymentIntentReference.md +18 -0
  48. data/docs/RefundRequest.md +1 -1
  49. data/docs/RegisterCard.md +1 -1
  50. data/docs/RemittanceData.md +28 -0
  51. data/docs/RemittanceReportRequest.md +28 -0
  52. data/docs/RemittanceReportResponse.md +24 -0
  53. data/docs/RemittedClientData.md +44 -0
  54. data/docs/ReportingApi.md +378 -0
  55. data/docs/ThreeDSecure.md +1 -1
  56. data/docs/TokenisationResponseModel.md +3 -3
  57. data/docs/images/3dsv1-challenge.png +0 -0
  58. data/docs/images/3dsv2-challenge.png +0 -0
  59. data/docs/images/3dsv2-frictionless.png +0 -0
  60. data/docs/images/3dsv2-method-challenge.png +0 -0
  61. data/docs/images/3dsv2-method-frictionless.png +0 -0
  62. data/docs/images/3dsv2-no3d.png +0 -0
  63. data/docs/images/citypay-logo.svg +1 -0
  64. data/docs/images/direct-post-flow.png +0 -0
  65. data/docs/images/favicon.ico +0 -0
  66. data/docs/images/header.png +0 -0
  67. data/docs/images/logo.ai +1913 -4
  68. data/docs/images/logo.png +0 -0
  69. data/docs/images/logo.svg +1 -0
  70. data/docs/images/merchant-BPS-workflow.png +0 -0
  71. data/docs/images/paylink-field-guards.png +0 -0
  72. data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +72 -4
  73. data/lib/citypay_api_client/api/batch_processing_api__.rb +15 -15
  74. data/lib/citypay_api_client/api/card_holder_account_api__.rb +5 -2
  75. data/lib/citypay_api_client/api/direct_post_api__.rb +9 -9
  76. data/lib/citypay_api_client/api/operational_functions_api__.rb +3 -3
  77. data/lib/citypay_api_client/api/paylink_api__.rb +163 -26
  78. data/lib/citypay_api_client/api/reporting_api__.rb +381 -0
  79. data/lib/citypay_api_client/api_client.rb +24 -22
  80. data/lib/citypay_api_client/api_error.rb +3 -2
  81. data/lib/citypay_api_client/configuration.rb +28 -9
  82. data/lib/citypay_api_client/models/account_create.rb +17 -20
  83. data/lib/citypay_api_client/models/account_status.rb +15 -20
  84. data/lib/citypay_api_client/models/acknowledgement.rb +21 -46
  85. data/lib/citypay_api_client/models/acl_check_request.rb +17 -20
  86. data/lib/citypay_api_client/models/acl_check_response_model.rb +16 -21
  87. data/lib/citypay_api_client/models/airline_advice.rb +45 -29
  88. data/lib/citypay_api_client/models/airline_segment.rb +35 -22
  89. data/lib/citypay_api_client/models/auth_reference.rb +41 -26
  90. data/lib/citypay_api_client/models/auth_references.rb +15 -20
  91. data/lib/citypay_api_client/models/auth_request.rb +72 -34
  92. data/lib/citypay_api_client/models/auth_response.rb +46 -23
  93. data/lib/citypay_api_client/models/authen_required.rb +15 -20
  94. data/lib/citypay_api_client/models/batch.rb +25 -22
  95. data/lib/citypay_api_client/models/batch_report_request.rb +23 -22
  96. data/lib/citypay_api_client/models/batch_report_response_model.rb +28 -21
  97. data/lib/citypay_api_client/models/batch_transaction.rb +25 -22
  98. data/lib/citypay_api_client/models/batch_transaction_report_request.rb +234 -0
  99. data/lib/citypay_api_client/models/batch_transaction_report_response.rb +252 -0
  100. data/lib/citypay_api_client/models/batch_transaction_result_model.rb +53 -22
  101. data/lib/citypay_api_client/models/bin.rb +15 -20
  102. data/lib/citypay_api_client/models/bin_lookup.rb +17 -20
  103. data/lib/citypay_api_client/models/c_res_auth_request.rb +15 -20
  104. data/lib/citypay_api_client/models/capture_request.rb +27 -22
  105. data/lib/citypay_api_client/models/card.rb +33 -26
  106. data/lib/citypay_api_client/models/card_holder_account.rb +19 -20
  107. data/lib/citypay_api_client/models/card_status.rb +15 -20
  108. data/lib/citypay_api_client/models/charge_request.rb +72 -34
  109. data/lib/citypay_api_client/models/check_batch_status.rb +23 -22
  110. data/lib/citypay_api_client/models/check_batch_status_response.rb +15 -20
  111. data/lib/citypay_api_client/models/contact_details.rb +77 -42
  112. data/lib/citypay_api_client/models/decision.rb +16 -30
  113. data/lib/citypay_api_client/models/direct_post_request.rb +72 -34
  114. data/lib/citypay_api_client/models/direct_token_auth_request.rb +15 -20
  115. data/lib/citypay_api_client/models/domain_key_check_request.rb +17 -20
  116. data/lib/citypay_api_client/models/domain_key_request.rb +19 -20
  117. data/lib/citypay_api_client/models/domain_key_response.rb +25 -22
  118. data/lib/citypay_api_client/models/error.rb +27 -24
  119. data/lib/citypay_api_client/models/event_data_model.rb +15 -20
  120. data/lib/citypay_api_client/models/exists.rb +17 -20
  121. data/lib/citypay_api_client/models/external_mpi.rb +39 -24
  122. data/lib/citypay_api_client/models/list_merchants_response.rb +21 -22
  123. data/lib/citypay_api_client/models/mcc6012.rb +15 -20
  124. data/lib/citypay_api_client/models/merchant.rb +15 -20
  125. data/lib/citypay_api_client/models/merchant_batch_report_request.rb +265 -0
  126. data/lib/citypay_api_client/models/merchant_batch_report_response.rb +252 -0
  127. data/lib/citypay_api_client/models/merchant_batch_response.rb +301 -0
  128. data/lib/citypay_api_client/models/net_summary_response.rb +472 -0
  129. data/lib/citypay_api_client/models/pa_res_auth_request.rb +19 -20
  130. data/lib/citypay_api_client/models/paylink_address.rb +52 -29
  131. data/lib/citypay_api_client/models/paylink_adjustment_request.rb +25 -22
  132. data/lib/citypay_api_client/models/paylink_attachment_request.rb +19 -20
  133. data/lib/citypay_api_client/models/paylink_attachment_result.rb +19 -20
  134. data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +17 -20
  135. data/lib/citypay_api_client/models/paylink_card_holder.rb +30 -23
  136. data/lib/citypay_api_client/models/paylink_cart.rb +15 -20
  137. data/lib/citypay_api_client/models/paylink_cart_item_model.rb +15 -20
  138. data/lib/citypay_api_client/models/paylink_config.rb +15 -20
  139. data/lib/citypay_api_client/models/paylink_custom_param.rb +29 -22
  140. data/lib/citypay_api_client/models/paylink_email_notification_path.rb +17 -20
  141. data/lib/citypay_api_client/models/paylink_error_code.rb +19 -20
  142. data/lib/citypay_api_client/models/paylink_field_guard_model.rb +16 -21
  143. data/lib/citypay_api_client/models/paylink_part_payments.rb +15 -20
  144. data/lib/citypay_api_client/models/paylink_resend_notification_request.rb +224 -0
  145. data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +17 -20
  146. data/lib/citypay_api_client/models/paylink_state_event.rb +16 -21
  147. data/lib/citypay_api_client/models/paylink_token_created.rb +56 -27
  148. data/lib/citypay_api_client/models/paylink_token_request_model.rb +75 -22
  149. data/lib/citypay_api_client/models/paylink_token_status.rb +44 -21
  150. data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +24 -26
  151. data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +39 -22
  152. data/lib/citypay_api_client/models/paylink_ui.rb +15 -20
  153. data/lib/citypay_api_client/models/payment_intent.rb +479 -0
  154. data/lib/citypay_api_client/models/payment_intent_reference.rb +221 -0
  155. data/lib/citypay_api_client/models/ping.rb +21 -22
  156. data/lib/citypay_api_client/models/process_batch_request.rb +27 -22
  157. data/lib/citypay_api_client/models/process_batch_response.rb +17 -20
  158. data/lib/citypay_api_client/models/refund_request.rb +28 -21
  159. data/lib/citypay_api_client/models/register_card.rb +27 -22
  160. data/lib/citypay_api_client/models/remittance_data.rb +404 -0
  161. data/lib/citypay_api_client/models/remittance_report_request.rb +265 -0
  162. data/lib/citypay_api_client/models/remittance_report_response.rb +252 -0
  163. data/lib/citypay_api_client/models/remitted_client_data.rb +612 -0
  164. data/lib/citypay_api_client/models/request_challenged.rb +15 -20
  165. data/lib/citypay_api_client/models/retrieve_request.rb +23 -22
  166. data/lib/citypay_api_client/models/three_d_secure.rb +16 -21
  167. data/lib/citypay_api_client/models/tokenisation_response_model.rb +23 -24
  168. data/lib/citypay_api_client/models/void_request.rb +23 -22
  169. data/lib/citypay_api_client/version.rb +3 -3
  170. data/lib/citypay_api_client.rb +16 -3
  171. data/spec/api/reporting_api___spec.rb +99 -0
  172. data/spec/it_api_sandbox_spec.rb +5 -14
  173. data/spec/models/account_create_spec.rb +1 -2
  174. data/spec/models/account_status_spec.rb +2 -2
  175. data/spec/models/airline_advice_spec.rb +0 -2
  176. data/spec/models/airline_segment_spec.rb +0 -2
  177. data/spec/models/auth_request_spec.rb +0 -2
  178. data/spec/models/auth_response_spec.rb +75 -30
  179. data/spec/models/batch_report_request_spec.rb +0 -2
  180. data/spec/models/batch_report_response_model_spec.rb +0 -2
  181. data/spec/models/batch_spec.rb +0 -2
  182. data/spec/models/batch_transaction_report_request_spec.rb +47 -0
  183. data/spec/models/batch_transaction_report_response_spec.rb +53 -0
  184. data/spec/models/batch_transaction_result_model_spec.rb +0 -2
  185. data/spec/models/batch_transaction_spec.rb +0 -2
  186. data/spec/models/bin_lookup_spec.rb +0 -2
  187. data/spec/models/capture_request_spec.rb +0 -2
  188. data/spec/models/card_holder_account_spec.rb +0 -2
  189. data/spec/models/charge_request_spec.rb +0 -2
  190. data/spec/models/decision_spec.rb +0 -26
  191. data/spec/models/direct_post_request_spec.rb +0 -2
  192. data/spec/models/domain_key_check_request_spec.rb +0 -2
  193. data/spec/models/merchant_batch_report_request_spec.rb +65 -0
  194. data/spec/models/merchant_batch_report_response_spec.rb +53 -0
  195. data/spec/models/merchant_batch_response_spec.rb +71 -0
  196. data/spec/models/net_summary_response_spec.rb +77 -0
  197. data/spec/models/paylink_resend_notification_request_spec.rb +41 -0
  198. data/spec/models/paylink_token_request_model_spec.rb +0 -2
  199. data/spec/models/payment_intent_reference_spec.rb +35 -0
  200. data/spec/models/payment_intent_spec.rb +107 -0
  201. data/spec/models/process_batch_request_spec.rb +0 -2
  202. data/spec/models/refund_request_spec.rb +0 -2
  203. data/spec/models/register_card_spec.rb +0 -2
  204. data/spec/models/remittance_data_spec.rb +65 -0
  205. data/spec/models/remittance_report_request_spec.rb +65 -0
  206. data/spec/models/remittance_report_response_spec.rb +53 -0
  207. data/spec/models/remitted_client_data_spec.rb +113 -0
  208. data/spec/spec_helper.rb +2 -2
  209. metadata +146 -78
  210. data/docs/OperationalApi.md +0 -214
  211. data/docs/PaymentProcessingApi.md +0 -559
  212. data/spec/models/authen_required_spec.rb +0 -52
@@ -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
+ # Welcome to the CityPay API, a robust HTTP API payment solution designed for seamless server-to-server transactional processing. Our API facilitates a wide array of payment operations, catering to diverse business needs. Whether you're integrating Internet payments, handling Mail Order/Telephone Order (MOTO) transactions, managing Subscriptions with Recurring and Continuous Authority payments, or navigating the complexities of 3-D Secure authentication, our API is equipped to support your requirements. Additionally, we offer functionalities for Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids, and Completion processing, alongside the capability for tokenised payments. ## Compliance and Security Overview <aside class=\"notice\"> Ensuring the security of payment transactions and compliance with industry standards is paramount. Our API is designed with stringent security measures and compliance protocols to safeguard sensitive information and meet the rigorous requirements of Visa, MasterCard, and the PCI Security Standards Council. </aside> ### Key Compliance and Security Measures * **TLS Encryption**: All data transmissions must utilise TLS version 1.2 or higher, employing [strong cryptography](#enabled-tls-ciphers). Our infrastructure strictly enforces this requirement to maintain the integrity and confidentiality of data in transit. We conduct regular scans and assessments of our TLS endpoints to identify and mitigate vulnerabilities. * **Data Storage Prohibitions**: Storing sensitive cardholder data (CHD), such as the card security code (CSC) or primary account number (PAN), is strictly prohibited. Our API is designed to minimize your exposure to sensitive data, thereby reducing your compliance burden. * **Data Masking**: For consumer protection and compliance, full card numbers must not be displayed on receipts or any customer-facing materials. Our API automatically masks PANs, displaying only the last four digits to facilitate safe receipt generation. * **Network Scans**: If your application is web-based, regular scans of your hosting environment are mandatory to identify and rectify potential vulnerabilities. This proactive measure is crucial for maintaining a secure and compliant online presence. * **PCI Compliance**: Adherence to PCI DSS standards is not optional; it's a requirement for operating securely and legally in the payments ecosystem. For detailed information on compliance requirements and resources, please visit the PCI Security Standards Council website [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/). * **Request Validation**: Our API includes mechanisms to verify the legitimacy of each request, ensuring it pertains to a valid account and originates from a trusted source. We leverage remote IP address verification alongside sophisticated application firewall technologies to thwart a wide array of common security threats. ## Getting Started Before integrating with the CityPay API, ensure your application and development practices align with the outlined compliance and security measures. This preparatory step is crucial for a smooth integration process and the long-term success of your payment processing operations. For further details on API endpoints, request/response formats, and code examples, proceed to the subsequent sections of our documentation. Our aim is to provide you with all the necessary tools and information to integrate our payment processing capabilities seamlessly into your application. Thank you for choosing CityPay API. We look forward to supporting your payment processing needs with our secure, compliant, and versatile API solution.
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
 
@@ -34,7 +34,7 @@ module CityPayApiClient
34
34
  attr_accessor :mode
35
35
 
36
36
  # A URL of a qrcode which can be used to refer to the token URL.
37
- attr_accessor :qr_code
37
+ attr_accessor :qrcode
38
38
 
39
39
  # The result field contains the result for the Paylink Token Request. 0 - indicates that an error was encountered while creating the token. 1 - which indicates that a Token was successfully created.
40
40
  attr_accessor :result
@@ -64,7 +64,7 @@ module CityPayApiClient
64
64
  :'id' => :'id',
65
65
  :'identifier' => :'identifier',
66
66
  :'mode' => :'mode',
67
- :'qr_code' => :'qr_code',
67
+ :'qrcode' => :'qrcode',
68
68
  :'result' => :'result',
69
69
  :'server_version' => :'server_version',
70
70
  :'source' => :'source',
@@ -89,7 +89,7 @@ module CityPayApiClient
89
89
  :'id' => :'String',
90
90
  :'identifier' => :'String',
91
91
  :'mode' => :'String',
92
- :'qr_code' => :'String',
92
+ :'qrcode' => :'String',
93
93
  :'result' => :'Integer',
94
94
  :'server_version' => :'String',
95
95
  :'source' => :'String',
@@ -140,6 +140,8 @@ module CityPayApiClient
140
140
 
141
141
  if attributes.key?(:'id')
142
142
  self.id = attributes[:'id']
143
+ else
144
+ self.id = nil
143
145
  end
144
146
 
145
147
  if attributes.key?(:'identifier')
@@ -150,12 +152,14 @@ module CityPayApiClient
150
152
  self.mode = attributes[:'mode']
151
153
  end
152
154
 
153
- if attributes.key?(:'qr_code')
154
- self.qr_code = attributes[:'qr_code']
155
+ if attributes.key?(:'qrcode')
156
+ self.qrcode = attributes[:'qrcode']
155
157
  end
156
158
 
157
159
  if attributes.key?(:'result')
158
160
  self.result = attributes[:'result']
161
+ else
162
+ self.result = nil
159
163
  end
160
164
 
161
165
  if attributes.key?(:'server_version')
@@ -168,6 +172,8 @@ module CityPayApiClient
168
172
 
169
173
  if attributes.key?(:'token')
170
174
  self.token = attributes[:'token']
175
+ else
176
+ self.token = nil
171
177
  end
172
178
 
173
179
  if attributes.key?(:'url')
@@ -182,11 +188,20 @@ module CityPayApiClient
182
188
  # Show invalid properties with the reasons. Usually used together with valid?
183
189
  # @return Array for valid properties with the reasons
184
190
  def list_invalid_properties
191
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
185
192
  invalid_properties = Array.new
186
193
  if @id.nil?
187
194
  invalid_properties.push('invalid value for "id", id cannot be nil.')
188
195
  end
189
196
 
197
+ if !@identifier.nil? && @identifier.to_s.length > 50
198
+ invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
199
+ end
200
+
201
+ if !@identifier.nil? && @identifier.to_s.length < 4
202
+ invalid_properties.push('invalid value for "identifier", the character length must be great than or equal to 4.')
203
+ end
204
+
190
205
  if @result.nil?
191
206
  invalid_properties.push('invalid value for "result", result cannot be nil.')
192
207
  end
@@ -201,12 +216,33 @@ module CityPayApiClient
201
216
  # Check to see if the all the properties in the model are valid
202
217
  # @return true if the model is valid
203
218
  def valid?
219
+ warn '[DEPRECATED] the `valid?` method is obsolete'
204
220
  return false if @id.nil?
221
+ return false if !@identifier.nil? && @identifier.to_s.length > 50
222
+ return false if !@identifier.nil? && @identifier.to_s.length < 4
205
223
  return false if @result.nil?
206
224
  return false if @token.nil?
207
225
  true
208
226
  end
209
227
 
228
+ # Custom attribute writer method with validation
229
+ # @param [Object] identifier Value to be assigned
230
+ def identifier=(identifier)
231
+ if identifier.nil?
232
+ fail ArgumentError, 'identifier cannot be nil'
233
+ end
234
+
235
+ if identifier.to_s.length > 50
236
+ fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
237
+ end
238
+
239
+ if identifier.to_s.length < 4
240
+ fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
241
+ end
242
+
243
+ @identifier = identifier
244
+ end
245
+
210
246
  # Checks equality by comparing each attribute.
211
247
  # @param [Object] Object to be compared
212
248
  def ==(o)
@@ -219,7 +255,7 @@ module CityPayApiClient
219
255
  id == o.id &&
220
256
  identifier == o.identifier &&
221
257
  mode == o.mode &&
222
- qr_code == o.qr_code &&
258
+ qrcode == o.qrcode &&
223
259
  result == o.result &&
224
260
  server_version == o.server_version &&
225
261
  source == o.source &&
@@ -237,44 +273,37 @@ module CityPayApiClient
237
273
  # Calculates hash code according to all attributes.
238
274
  # @return [Integer] Hash code
239
275
  def hash
240
- [attachments, bps, date_created, errors, id, identifier, mode, qr_code, result, server_version, source, token, url, usc].hash
276
+ [attachments, bps, date_created, errors, id, identifier, mode, qrcode, result, server_version, source, token, url, usc].hash
241
277
  end
242
278
 
243
279
  # Builds the object from hash
244
280
  # @param [Hash] attributes Model attributes in the form of hash
245
281
  # @return [Object] Returns the model itself
246
282
  def self.build_from_hash(attributes)
247
- new.build_from_hash(attributes)
248
- end
249
-
250
- # Builds the object from hash
251
- # @param [Hash] attributes Model attributes in the form of hash
252
- # @return [Object] Returns the model itself
253
- def build_from_hash(attributes)
254
283
  return nil unless attributes.is_a?(Hash)
255
284
  attributes = attributes.transform_keys(&:to_sym)
256
- self.class.openapi_types.each_pair do |key, type|
257
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
258
- self.send("#{key}=", nil)
285
+ transformed_hash = {}
286
+ openapi_types.each_pair do |key, type|
287
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
288
+ transformed_hash["#{key}"] = nil
259
289
  elsif type =~ /\AArray<(.*)>/i
260
290
  # check to ensure the input is an array given that the attribute
261
291
  # is documented as an array but the input is not
262
- if attributes[self.class.attribute_map[key]].is_a?(Array)
263
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
292
+ if attributes[attribute_map[key]].is_a?(Array)
293
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
264
294
  end
265
- elsif !attributes[self.class.attribute_map[key]].nil?
266
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
295
+ elsif !attributes[attribute_map[key]].nil?
296
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
267
297
  end
268
298
  end
269
-
270
- self
299
+ new(transformed_hash)
271
300
  end
272
301
 
273
302
  # Deserializes the data based on type
274
303
  # @param string type Data type
275
304
  # @param string value Value to be deserialized
276
305
  # @return [Object] Deserialized data
277
- def _deserialize(type, value)
306
+ def self._deserialize(type, value)
278
307
  case type.to_sym
279
308
  when :Time
280
309
  Time.parse(value)
@@ -309,7 +338,7 @@ module CityPayApiClient
309
338
  else # model
310
339
  # models (e.g. Pet) or oneOf
311
340
  klass = CityPayApiClient.const_get(type)
312
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
341
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
313
342
  end
314
343
  end
315
344
 
@@ -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
+ # Welcome to the CityPay API, a robust HTTP API payment solution designed for seamless server-to-server transactional processing. Our API facilitates a wide array of payment operations, catering to diverse business needs. Whether you're integrating Internet payments, handling Mail Order/Telephone Order (MOTO) transactions, managing Subscriptions with Recurring and Continuous Authority payments, or navigating the complexities of 3-D Secure authentication, our API is equipped to support your requirements. Additionally, we offer functionalities for Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids, and Completion processing, alongside the capability for tokenised payments. ## Compliance and Security Overview <aside class=\"notice\"> Ensuring the security of payment transactions and compliance with industry standards is paramount. Our API is designed with stringent security measures and compliance protocols to safeguard sensitive information and meet the rigorous requirements of Visa, MasterCard, and the PCI Security Standards Council. </aside> ### Key Compliance and Security Measures * **TLS Encryption**: All data transmissions must utilise TLS version 1.2 or higher, employing [strong cryptography](#enabled-tls-ciphers). Our infrastructure strictly enforces this requirement to maintain the integrity and confidentiality of data in transit. We conduct regular scans and assessments of our TLS endpoints to identify and mitigate vulnerabilities. * **Data Storage Prohibitions**: Storing sensitive cardholder data (CHD), such as the card security code (CSC) or primary account number (PAN), is strictly prohibited. Our API is designed to minimize your exposure to sensitive data, thereby reducing your compliance burden. * **Data Masking**: For consumer protection and compliance, full card numbers must not be displayed on receipts or any customer-facing materials. Our API automatically masks PANs, displaying only the last four digits to facilitate safe receipt generation. * **Network Scans**: If your application is web-based, regular scans of your hosting environment are mandatory to identify and rectify potential vulnerabilities. This proactive measure is crucial for maintaining a secure and compliant online presence. * **PCI Compliance**: Adherence to PCI DSS standards is not optional; it's a requirement for operating securely and legally in the payments ecosystem. For detailed information on compliance requirements and resources, please visit the PCI Security Standards Council website [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/). * **Request Validation**: Our API includes mechanisms to verify the legitimacy of each request, ensuring it pertains to a valid account and originates from a trusted source. We leverage remote IP address verification alongside sophisticated application firewall technologies to thwart a wide array of common security threats. ## Getting Started Before integrating with the CityPay API, ensure your application and development practices align with the outlined compliance and security measures. This preparatory step is crucial for a smooth integration process and the long-term success of your payment processing operations. For further details on API endpoints, request/response formats, and code examples, proceed to the subsequent sections of our documentation. Our aim is to provide you with all the necessary tools and information to integrate our payment processing capabilities seamlessly into your application. Thank you for choosing CityPay API. We look forward to supporting your payment processing needs with our secure, compliant, and versatile API solution.
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
 
@@ -29,6 +29,9 @@ module CityPayApiClient
29
29
 
30
30
  attr_accessor :config
31
31
 
32
+ # A currency for the token. This value should be only used on multi-currency accounts and be an appropriate currency which the account is configured for.
33
+ attr_accessor :currency
34
+
32
35
  # The email field is used for the Merchant to be notified on completion of the transaction . The value may be supplied to override the default stored value. Emails sent to this address by the Paylink service should not be forwarded on to the cardholder as it may contain certain information that is used by the Paylink service to validate and authenticate Paylink Token Requests: for example, the Merchant ID and the licence key.
33
36
  attr_accessor :email
34
37
 
@@ -38,6 +41,9 @@ module CityPayApiClient
38
41
  # The merchant id you wish to process this transaction with.
39
42
  attr_accessor :merchantid
40
43
 
44
+ # True if the intent of this cardholder initiated transaction is to establish a recurring payment model, processable as merchant initiated transactions.
45
+ attr_accessor :recurring
46
+
41
47
  # an id associated with a subscription to link the token request against.
42
48
  attr_accessor :subscription_id
43
49
 
@@ -53,9 +59,11 @@ module CityPayApiClient
53
59
  :'cart' => :'cart',
54
60
  :'client_version' => :'client_version',
55
61
  :'config' => :'config',
62
+ :'currency' => :'currency',
56
63
  :'email' => :'email',
57
64
  :'identifier' => :'identifier',
58
65
  :'merchantid' => :'merchantid',
66
+ :'recurring' => :'recurring',
59
67
  :'subscription_id' => :'subscription_id',
60
68
  :'tx_type' => :'tx_type'
61
69
  }
@@ -75,9 +83,11 @@ module CityPayApiClient
75
83
  :'cart' => :'PaylinkCart',
76
84
  :'client_version' => :'String',
77
85
  :'config' => :'PaylinkConfig',
86
+ :'currency' => :'String',
78
87
  :'email' => :'String',
79
88
  :'identifier' => :'String',
80
89
  :'merchantid' => :'Integer',
90
+ :'recurring' => :'Boolean',
81
91
  :'subscription_id' => :'String',
82
92
  :'tx_type' => :'String'
83
93
  }
@@ -110,6 +120,8 @@ module CityPayApiClient
110
120
 
111
121
  if attributes.key?(:'amount')
112
122
  self.amount = attributes[:'amount']
123
+ else
124
+ self.amount = nil
113
125
  end
114
126
 
115
127
  if attributes.key?(:'cardholder')
@@ -128,16 +140,28 @@ module CityPayApiClient
128
140
  self.config = attributes[:'config']
129
141
  end
130
142
 
143
+ if attributes.key?(:'currency')
144
+ self.currency = attributes[:'currency']
145
+ end
146
+
131
147
  if attributes.key?(:'email')
132
148
  self.email = attributes[:'email']
133
149
  end
134
150
 
135
151
  if attributes.key?(:'identifier')
136
152
  self.identifier = attributes[:'identifier']
153
+ else
154
+ self.identifier = nil
137
155
  end
138
156
 
139
157
  if attributes.key?(:'merchantid')
140
158
  self.merchantid = attributes[:'merchantid']
159
+ else
160
+ self.merchantid = nil
161
+ end
162
+
163
+ if attributes.key?(:'recurring')
164
+ self.recurring = attributes[:'recurring']
141
165
  end
142
166
 
143
167
  if attributes.key?(:'subscription_id')
@@ -152,11 +176,20 @@ module CityPayApiClient
152
176
  # Show invalid properties with the reasons. Usually used together with valid?
153
177
  # @return Array for valid properties with the reasons
154
178
  def list_invalid_properties
179
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
155
180
  invalid_properties = Array.new
156
181
  if @amount.nil?
157
182
  invalid_properties.push('invalid value for "amount", amount cannot be nil.')
158
183
  end
159
184
 
185
+ if !@currency.nil? && @currency.to_s.length > 3
186
+ invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
187
+ end
188
+
189
+ if !@currency.nil? && @currency.to_s.length < 3
190
+ invalid_properties.push('invalid value for "currency", the character length must be great than or equal to 3.')
191
+ end
192
+
160
193
  if !@email.nil? && @email.to_s.length > 254
161
194
  invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 254.')
162
195
  end
@@ -183,7 +216,10 @@ module CityPayApiClient
183
216
  # Check to see if the all the properties in the model are valid
184
217
  # @return true if the model is valid
185
218
  def valid?
219
+ warn '[DEPRECATED] the `valid?` method is obsolete'
186
220
  return false if @amount.nil?
221
+ return false if !@currency.nil? && @currency.to_s.length > 3
222
+ return false if !@currency.nil? && @currency.to_s.length < 3
187
223
  return false if !@email.nil? && @email.to_s.length > 254
188
224
  return false if @identifier.nil?
189
225
  return false if @identifier.to_s.length > 50
@@ -192,10 +228,32 @@ module CityPayApiClient
192
228
  true
193
229
  end
194
230
 
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] currency Value to be assigned
233
+ def currency=(currency)
234
+ if currency.nil?
235
+ fail ArgumentError, 'currency cannot be nil'
236
+ end
237
+
238
+ if currency.to_s.length > 3
239
+ fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
240
+ end
241
+
242
+ if currency.to_s.length < 3
243
+ fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 3.'
244
+ end
245
+
246
+ @currency = currency
247
+ end
248
+
195
249
  # Custom attribute writer method with validation
196
250
  # @param [Object] email Value to be assigned
197
251
  def email=(email)
198
- if !email.nil? && email.to_s.length > 254
252
+ if email.nil?
253
+ fail ArgumentError, 'email cannot be nil'
254
+ end
255
+
256
+ if email.to_s.length > 254
199
257
  fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 254.'
200
258
  end
201
259
 
@@ -231,9 +289,11 @@ module CityPayApiClient
231
289
  cart == o.cart &&
232
290
  client_version == o.client_version &&
233
291
  config == o.config &&
292
+ currency == o.currency &&
234
293
  email == o.email &&
235
294
  identifier == o.identifier &&
236
295
  merchantid == o.merchantid &&
296
+ recurring == o.recurring &&
237
297
  subscription_id == o.subscription_id &&
238
298
  tx_type == o.tx_type
239
299
  end
@@ -247,44 +307,37 @@ module CityPayApiClient
247
307
  # Calculates hash code according to all attributes.
248
308
  # @return [Integer] Hash code
249
309
  def hash
250
- [accountno, amount, cardholder, cart, client_version, config, email, identifier, merchantid, subscription_id, tx_type].hash
310
+ [accountno, amount, cardholder, cart, client_version, config, currency, email, identifier, merchantid, recurring, subscription_id, tx_type].hash
251
311
  end
252
312
 
253
313
  # Builds the object from hash
254
314
  # @param [Hash] attributes Model attributes in the form of hash
255
315
  # @return [Object] Returns the model itself
256
316
  def self.build_from_hash(attributes)
257
- new.build_from_hash(attributes)
258
- end
259
-
260
- # Builds the object from hash
261
- # @param [Hash] attributes Model attributes in the form of hash
262
- # @return [Object] Returns the model itself
263
- def build_from_hash(attributes)
264
317
  return nil unless attributes.is_a?(Hash)
265
318
  attributes = attributes.transform_keys(&:to_sym)
266
- self.class.openapi_types.each_pair do |key, type|
267
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
268
- self.send("#{key}=", nil)
319
+ transformed_hash = {}
320
+ openapi_types.each_pair do |key, type|
321
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
322
+ transformed_hash["#{key}"] = nil
269
323
  elsif type =~ /\AArray<(.*)>/i
270
324
  # check to ensure the input is an array given that the attribute
271
325
  # is documented as an array but the input is not
272
- if attributes[self.class.attribute_map[key]].is_a?(Array)
273
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
326
+ if attributes[attribute_map[key]].is_a?(Array)
327
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
274
328
  end
275
- elsif !attributes[self.class.attribute_map[key]].nil?
276
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
329
+ elsif !attributes[attribute_map[key]].nil?
330
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
277
331
  end
278
332
  end
279
-
280
- self
333
+ new(transformed_hash)
281
334
  end
282
335
 
283
336
  # Deserializes the data based on type
284
337
  # @param string type Data type
285
338
  # @param string value Value to be deserialized
286
339
  # @return [Object] Deserialized data
287
- def _deserialize(type, value)
340
+ def self._deserialize(type, value)
288
341
  case type.to_sym
289
342
  when :Time
290
343
  Time.parse(value)
@@ -319,7 +372,7 @@ module CityPayApiClient
319
372
  else # model
320
373
  # models (e.g. Pet) or oneOf
321
374
  klass = CityPayApiClient.const_get(type)
322
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
375
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
323
376
  end
324
377
  end
325
378
 
@@ -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
+ # Welcome to the CityPay API, a robust HTTP API payment solution designed for seamless server-to-server transactional processing. Our API facilitates a wide array of payment operations, catering to diverse business needs. Whether you're integrating Internet payments, handling Mail Order/Telephone Order (MOTO) transactions, managing Subscriptions with Recurring and Continuous Authority payments, or navigating the complexities of 3-D Secure authentication, our API is equipped to support your requirements. Additionally, we offer functionalities for Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids, and Completion processing, alongside the capability for tokenised payments. ## Compliance and Security Overview <aside class=\"notice\"> Ensuring the security of payment transactions and compliance with industry standards is paramount. Our API is designed with stringent security measures and compliance protocols to safeguard sensitive information and meet the rigorous requirements of Visa, MasterCard, and the PCI Security Standards Council. </aside> ### Key Compliance and Security Measures * **TLS Encryption**: All data transmissions must utilise TLS version 1.2 or higher, employing [strong cryptography](#enabled-tls-ciphers). Our infrastructure strictly enforces this requirement to maintain the integrity and confidentiality of data in transit. We conduct regular scans and assessments of our TLS endpoints to identify and mitigate vulnerabilities. * **Data Storage Prohibitions**: Storing sensitive cardholder data (CHD), such as the card security code (CSC) or primary account number (PAN), is strictly prohibited. Our API is designed to minimize your exposure to sensitive data, thereby reducing your compliance burden. * **Data Masking**: For consumer protection and compliance, full card numbers must not be displayed on receipts or any customer-facing materials. Our API automatically masks PANs, displaying only the last four digits to facilitate safe receipt generation. * **Network Scans**: If your application is web-based, regular scans of your hosting environment are mandatory to identify and rectify potential vulnerabilities. This proactive measure is crucial for maintaining a secure and compliant online presence. * **PCI Compliance**: Adherence to PCI DSS standards is not optional; it's a requirement for operating securely and legally in the payments ecosystem. For detailed information on compliance requirements and resources, please visit the PCI Security Standards Council website [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/). * **Request Validation**: Our API includes mechanisms to verify the legitimacy of each request, ensuring it pertains to a valid account and originates from a trusted source. We leverage remote IP address verification alongside sophisticated application firewall technologies to thwart a wide array of common security threats. ## Getting Started Before integrating with the CityPay API, ensure your application and development practices align with the outlined compliance and security measures. This preparatory step is crucial for a smooth integration process and the long-term success of your payment processing operations. For further details on API endpoints, request/response formats, and code examples, proceed to the subsequent sections of our documentation. Our aim is to provide you with all the necessary tools and information to integrate our payment processing capabilities seamlessly into your application. Thank you for choosing CityPay API. We look forward to supporting your payment processing needs with our secure, compliant, and versatile API solution.
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
 
@@ -162,7 +162,7 @@ module CityPayApiClient
162
162
  :'is_validated' => :'Boolean',
163
163
  :'last_event_date_time' => :'Time',
164
164
  :'last_payment_result' => :'String',
165
- :'mid' => :'String',
165
+ :'mid' => :'Integer',
166
166
  :'payment_attempts_count' => :'Integer',
167
167
  :'state_history' => :'Array<PaylinkStateEvent>',
168
168
  :'token' => :'String',
@@ -309,16 +309,46 @@ module CityPayApiClient
309
309
  # Show invalid properties with the reasons. Usually used together with valid?
310
310
  # @return Array for valid properties with the reasons
311
311
  def list_invalid_properties
312
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
312
313
  invalid_properties = Array.new
314
+ if !@identifier.nil? && @identifier.to_s.length > 50
315
+ invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
316
+ end
317
+
318
+ if !@identifier.nil? && @identifier.to_s.length < 4
319
+ invalid_properties.push('invalid value for "identifier", the character length must be great than or equal to 4.')
320
+ end
321
+
313
322
  invalid_properties
314
323
  end
315
324
 
316
325
  # Check to see if the all the properties in the model are valid
317
326
  # @return true if the model is valid
318
327
  def valid?
328
+ warn '[DEPRECATED] the `valid?` method is obsolete'
329
+ return false if !@identifier.nil? && @identifier.to_s.length > 50
330
+ return false if !@identifier.nil? && @identifier.to_s.length < 4
319
331
  true
320
332
  end
321
333
 
334
+ # Custom attribute writer method with validation
335
+ # @param [Object] identifier Value to be assigned
336
+ def identifier=(identifier)
337
+ if identifier.nil?
338
+ fail ArgumentError, 'identifier cannot be nil'
339
+ end
340
+
341
+ if identifier.to_s.length > 50
342
+ fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
343
+ end
344
+
345
+ if identifier.to_s.length < 4
346
+ fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
347
+ end
348
+
349
+ @identifier = identifier
350
+ end
351
+
322
352
  # Checks equality by comparing each attribute.
323
353
  # @param [Object] Object to be compared
324
354
  def ==(o)
@@ -370,37 +400,30 @@ module CityPayApiClient
370
400
  # @param [Hash] attributes Model attributes in the form of hash
371
401
  # @return [Object] Returns the model itself
372
402
  def self.build_from_hash(attributes)
373
- new.build_from_hash(attributes)
374
- end
375
-
376
- # Builds the object from hash
377
- # @param [Hash] attributes Model attributes in the form of hash
378
- # @return [Object] Returns the model itself
379
- def build_from_hash(attributes)
380
403
  return nil unless attributes.is_a?(Hash)
381
404
  attributes = attributes.transform_keys(&:to_sym)
382
- self.class.openapi_types.each_pair do |key, type|
383
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
384
- self.send("#{key}=", nil)
405
+ transformed_hash = {}
406
+ openapi_types.each_pair do |key, type|
407
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
408
+ transformed_hash["#{key}"] = nil
385
409
  elsif type =~ /\AArray<(.*)>/i
386
410
  # check to ensure the input is an array given that the attribute
387
411
  # is documented as an array but the input is not
388
- if attributes[self.class.attribute_map[key]].is_a?(Array)
389
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
412
+ if attributes[attribute_map[key]].is_a?(Array)
413
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
390
414
  end
391
- elsif !attributes[self.class.attribute_map[key]].nil?
392
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
415
+ elsif !attributes[attribute_map[key]].nil?
416
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
393
417
  end
394
418
  end
395
-
396
- self
419
+ new(transformed_hash)
397
420
  end
398
421
 
399
422
  # Deserializes the data based on type
400
423
  # @param string type Data type
401
424
  # @param string value Value to be deserialized
402
425
  # @return [Object] Deserialized data
403
- def _deserialize(type, value)
426
+ def self._deserialize(type, value)
404
427
  case type.to_sym
405
428
  when :Time
406
429
  Time.parse(value)
@@ -435,7 +458,7 @@ module CityPayApiClient
435
458
  else # model
436
459
  # models (e.g. Pet) or oneOf
437
460
  klass = CityPayApiClient.const_get(type)
438
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
461
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
439
462
  end
440
463
  end
441
464