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
 
@@ -97,6 +97,8 @@ module CityPayApiClient
97
97
 
98
98
  if attributes.key?(:'account_id')
99
99
  self.account_id = attributes[:'account_id']
100
+ else
101
+ self.account_id = nil
100
102
  end
101
103
 
102
104
  if attributes.key?(:'cards')
@@ -107,6 +109,8 @@ module CityPayApiClient
107
109
 
108
110
  if attributes.key?(:'contact')
109
111
  self.contact = attributes[:'contact']
112
+ else
113
+ self.contact = nil
110
114
  end
111
115
 
112
116
  if attributes.key?(:'date_created')
@@ -137,6 +141,7 @@ module CityPayApiClient
137
141
  # Show invalid properties with the reasons. Usually used together with valid?
138
142
  # @return Array for valid properties with the reasons
139
143
  def list_invalid_properties
144
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
140
145
  invalid_properties = Array.new
141
146
  if @account_id.nil?
142
147
  invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
@@ -160,6 +165,7 @@ module CityPayApiClient
160
165
  # Check to see if the all the properties in the model are valid
161
166
  # @return true if the model is valid
162
167
  def valid?
168
+ warn '[DEPRECATED] the `valid?` method is obsolete'
163
169
  return false if @account_id.nil?
164
170
  return false if @account_id.to_s.length > 50
165
171
  return false if @account_id.to_s.length < 5
@@ -217,37 +223,30 @@ module CityPayApiClient
217
223
  # @param [Hash] attributes Model attributes in the form of hash
218
224
  # @return [Object] Returns the model itself
219
225
  def self.build_from_hash(attributes)
220
- new.build_from_hash(attributes)
221
- end
222
-
223
- # Builds the object from hash
224
- # @param [Hash] attributes Model attributes in the form of hash
225
- # @return [Object] Returns the model itself
226
- def build_from_hash(attributes)
227
226
  return nil unless attributes.is_a?(Hash)
228
227
  attributes = attributes.transform_keys(&:to_sym)
229
- self.class.openapi_types.each_pair do |key, type|
230
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
231
- self.send("#{key}=", nil)
228
+ transformed_hash = {}
229
+ openapi_types.each_pair do |key, type|
230
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
231
+ transformed_hash["#{key}"] = nil
232
232
  elsif type =~ /\AArray<(.*)>/i
233
233
  # check to ensure the input is an array given that the attribute
234
234
  # is documented as an array but the input is not
235
- if attributes[self.class.attribute_map[key]].is_a?(Array)
236
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
235
+ if attributes[attribute_map[key]].is_a?(Array)
236
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
237
237
  end
238
- elsif !attributes[self.class.attribute_map[key]].nil?
239
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
238
+ elsif !attributes[attribute_map[key]].nil?
239
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
240
240
  end
241
241
  end
242
-
243
- self
242
+ new(transformed_hash)
244
243
  end
245
244
 
246
245
  # Deserializes the data based on type
247
246
  # @param string type Data type
248
247
  # @param string value Value to be deserialized
249
248
  # @return [Object] Deserialized data
250
- def _deserialize(type, value)
249
+ def self._deserialize(type, value)
251
250
  case type.to_sym
252
251
  when :Time
253
252
  Time.parse(value)
@@ -282,7 +281,7 @@ module CityPayApiClient
282
281
  else # model
283
282
  # models (e.g. Pet) or oneOf
284
283
  klass = CityPayApiClient.const_get(type)
285
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
284
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
286
285
  end
287
286
  end
288
287
 
@@ -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
 
@@ -74,6 +74,7 @@ module CityPayApiClient
74
74
  # Show invalid properties with the reasons. Usually used together with valid?
75
75
  # @return Array for valid properties with the reasons
76
76
  def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
78
  invalid_properties = Array.new
78
79
  invalid_properties
79
80
  end
@@ -81,6 +82,7 @@ module CityPayApiClient
81
82
  # Check to see if the all the properties in the model are valid
82
83
  # @return true if the model is valid
83
84
  def valid?
85
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
86
  true
85
87
  end
86
88
 
@@ -109,37 +111,30 @@ module CityPayApiClient
109
111
  # @param [Hash] attributes Model attributes in the form of hash
110
112
  # @return [Object] Returns the model itself
111
113
  def self.build_from_hash(attributes)
112
- new.build_from_hash(attributes)
113
- end
114
-
115
- # Builds the object from hash
116
- # @param [Hash] attributes Model attributes in the form of hash
117
- # @return [Object] Returns the model itself
118
- def build_from_hash(attributes)
119
114
  return nil unless attributes.is_a?(Hash)
120
115
  attributes = attributes.transform_keys(&:to_sym)
121
- self.class.openapi_types.each_pair do |key, type|
122
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
123
- self.send("#{key}=", nil)
116
+ transformed_hash = {}
117
+ openapi_types.each_pair do |key, type|
118
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
119
+ transformed_hash["#{key}"] = nil
124
120
  elsif type =~ /\AArray<(.*)>/i
125
121
  # check to ensure the input is an array given that the attribute
126
122
  # is documented as an array but the input is not
127
- if attributes[self.class.attribute_map[key]].is_a?(Array)
128
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ if attributes[attribute_map[key]].is_a?(Array)
124
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
129
125
  end
130
- elsif !attributes[self.class.attribute_map[key]].nil?
131
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ elsif !attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
132
128
  end
133
129
  end
134
-
135
- self
130
+ new(transformed_hash)
136
131
  end
137
132
 
138
133
  # Deserializes the data based on type
139
134
  # @param string type Data type
140
135
  # @param string value Value to be deserialized
141
136
  # @return [Object] Deserialized data
142
- def _deserialize(type, value)
137
+ def self._deserialize(type, value)
143
138
  case type.to_sym
144
139
  when :Time
145
140
  Time.parse(value)
@@ -174,7 +169,7 @@ module CityPayApiClient
174
169
  else # model
175
170
  # models (e.g. Pet) or oneOf
176
171
  klass = CityPayApiClient.const_get(type)
177
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
173
  end
179
174
  end
180
175
 
@@ -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
 
@@ -17,22 +17,22 @@ module CityPayApiClient
17
17
  # The amount to authorise in the lowest unit of currency with a variable length to a maximum of 12 digits. No decimal points are to be included and no divisional characters such as 1,024. The amount should be the total amount required for the transaction. For example with GBP £1,021.95 the amount value is 102195.
18
18
  attr_accessor :amount
19
19
 
20
- # A policy value which determines whether an AVS postcode policy is enforced or bypassed. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS postcode numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the postcode did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send postcode details for authorisation.
20
+ # A policy value which determines whether an AVS postcode policy is enforced or bypassed. Values are: `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS postcode numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the postcode did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send postcode details for authorisation.
21
21
  attr_accessor :avs_postcode_policy
22
22
 
23
23
  # Merchant-initiated transactions (MITs) are payments you trigger, where the cardholder has previously consented to you carrying out such payments. These may be scheduled (such as recurring payments and installments) or unscheduled (like account top-ups triggered by balance thresholds and no-show charges). Scheduled --- These are regular payments using stored card details, like installments or a monthly subscription fee. - `I` Instalment - A single purchase of goods or services billed to a cardholder in multiple transactions, over a period of time agreed by the cardholder and you. - `R` Recurring - Transactions processed at fixed, regular intervals not to exceed one year between transactions, representing an agreement between a cardholder and you to purchase goods or services provided over a period of time. Unscheduled --- These are payments using stored card details that do not occur on a regular schedule, like top-ups for a digital wallet triggered by the balance falling below a certain threshold. - `A` Reauthorisation - a purchase made after the original purchase. A common scenario is delayed/split shipments. - `C` Unscheduled Payment - A transaction using a stored credential for a fixed or variable amount that does not occur on a scheduled or regularly occurring transaction date. This includes account top-ups triggered by balance thresholds. - `D` Delayed Charge - A delayed charge is typically used in hotel, cruise lines and vehicle rental environments to perform a supplemental account charge after original services are rendered. - `L` Incremental - An incremental authorisation is typically found in hotel and car rental environments, where the cardholder has agreed to pay for any service incurred during the duration of the contract. An incremental authorisation is where you need to seek authorisation of further funds in addition to what you have originally requested. A common scenario is additional services charged to the contract, such as extending a stay in a hotel. - `S` Resubmission - When the original purchase occurred, but you were not able to get authorisation at the time the goods or services were provided. It should be only used where the goods or services have already been provided, but the authorisation request is declined for insufficient funds. - `X` No-show - A no-show is a transaction where you are enabled to charge for services which the cardholder entered into an agreement to purchase, but the cardholder did not meet the terms of the agreement.
24
24
  attr_accessor :cardholder_agreement
25
25
 
26
- # The Card Security Code (CSC) (also known as CV2/CVV2) is normally found on the back of the card (American Express has it on the front). The value helps to identify posession of the card as it is not available within the chip or magnetic swipe. When forwarding the CSC, please ensure the value is a string as some values start with 0 and this will be stripped out by any integer parsing. The CSC number aids fraud prevention in Mail Order and Internet payments. Business rules are available on your account to identify whether to accept or decline transactions based on mismatched results of the CSC. The Payment Card Industry (PCI) requires that at no stage of a transaction should the CSC be stored. This applies to all entities handling card data. It should also not be used in any hashing process. CityPay do not store the value and have no method of retrieving the value once the transaction has been processed. For this reason, duplicate checking is unable to determine the CSC in its duplication check algorithm.
26
+ # The Card Security Code (CSC) (also known as CV2/CVV2) is normally found on the back of the card (American Express has it on the front). The value helps to identify possession of the card as it is not available within the chip or magnetic swipe. When forwarding the CSC, please ensure the value is a string as some values start with 0 and this will be stripped out by any integer parsing. The CSC number aids fraud prevention in Mail Order and Internet payments. Business rules are available on your account to identify whether to accept or decline transactions based on mismatched results of the CSC. The Payment Card Industry (PCI) requires that at no stage of a transaction should the CSC be stored. This applies to all entities handling card data. It should also not be used in any hashing process. CityPay do not store the value and have no method of retrieving the value once the transaction has been processed. For this reason, duplicate checking is unable to determine the CSC in its duplication check algorithm.
27
27
  attr_accessor :csc
28
28
 
29
- # A policy value which determines whether a CSC policy is enforced or bypassed. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the CSC value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the CSC did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send the CSC details for authorisation.
29
+ # A policy value which determines whether a CSC policy is enforced or bypassed. Values are: `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the CSC value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the CSC did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send the CSC details for authorisation.
30
30
  attr_accessor :csc_policy
31
31
 
32
32
  # The processing currency for the transaction. Will default to the merchant account currency.
33
33
  attr_accessor :currency
34
34
 
35
- # A policy value which determines whether a duplication policy is enforced or bypassed. A duplication check has a window of time set against your account within which it can action. If a previous transaction with matching values occurred within the window, any subsequent transaction will result in a T001 result. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be checked for duplication within the duplication window. `2` to bypass. Transactions that are bypassed will not be checked for duplication within the duplication window. `3` to ignore. Transactions that are ignored will have the same affect as bypass.
35
+ # A policy value which determines whether a duplication policy is enforced or bypassed. A duplication check has a window of time set against your account within which it can action. If a previous transaction with matching values occurred within the window, any subsequent transaction will result in a T001 result. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be checked for duplication within the duplication window. `2` to bypass. Transactions that are bypassed will not be checked for duplication within the duplication window. `3` to ignore. Transactions that are ignored will have the same affect as bypass.
36
36
  attr_accessor :duplicate_policy
37
37
 
38
38
  # The identifier of the transaction to process. The value should be a valid reference and may be used to perform post processing actions and to aid in reconciliation of transactions. The value should be a valid printable string with ASCII character ranges from 0x32 to 0x127. The identifier is recommended to be distinct for each transaction such as a [random unique identifier](https://en.wikipedia.org/wiki/Universally_unique_identifier) this will aid in ensuring each transaction is identifiable. When transactions are processed they are also checked for duplicate requests. Changing the identifier on a subsequent request will ensure that a transaction is considered as different.
@@ -41,12 +41,14 @@ module CityPayApiClient
41
41
  # Transactions charged using the API are defined as: **Cardholder Initiated**: A _cardholder initiated transaction_ (CIT) is where the cardholder selects the card for use for a purchase using previously stored details. An example would be a customer buying an item from your website after being present with their saved card details at checkout. **Merchant Intiated**: A _merchant initiated transaction_ (MIT) is an authorisation initiated where you as the merchant submit a cardholders previously stored details without the cardholder's participation. An example would be a subscription to a membership scheme to debit their card monthly. MITs have different reasons such as reauthorisation, delayed, unscheduled, incremental, recurring, instalment, no-show or resubmission. The following values apply - `M` - specifies that the transaction is initiated by the merchant - `C` - specifies that the transaction is initiated by the cardholder Where transactions are merchant initiated, a valid cardholder agreement must be defined.
42
42
  attr_accessor :initiation
43
43
 
44
- # A policy value which determines whether an AVS address policy is enforced, bypassed or ignored. Values are `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS address numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the address did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send address numeric details for authorisation.
44
+ # A policy value which determines whether an AVS address policy is enforced, bypassed or ignored. Values are: `0` for the default policy (default value if not supplied). Your default values are determined by your account manager on setup of the account. `1` for an enforced policy. Transactions that are enforced will be rejected if the AVS address numeric value does not match. `2` to bypass. Transactions that are bypassed will be allowed through even if the address did not match. `3` to ignore. Transactions that are ignored will bypass the result and not send address numeric details for authorisation.
45
45
  attr_accessor :match_avsa
46
46
 
47
47
  # Identifies the merchant account to perform processing for.
48
48
  attr_accessor :merchantid
49
49
 
50
+ attr_accessor :tag
51
+
50
52
  attr_accessor :threedsecure
51
53
 
52
54
  # A tokenised form of a card that belongs to a card holder's account and that has been previously registered. The token is time based and will only be active for a short duration. The value is therefore designed not to be stored remotely for future use. Tokens will start with ct and are resiliently tamper proof using HMacSHA-256. No sensitive card data is stored internally within the token. Each card will contain a different token and the value may be different on any retrieval call. The value can be presented for payment as a selection value to an end user in a web application.
@@ -72,6 +74,7 @@ module CityPayApiClient
72
74
  :'initiation' => :'initiation',
73
75
  :'match_avsa' => :'match_avsa',
74
76
  :'merchantid' => :'merchantid',
77
+ :'tag' => :'tag',
75
78
  :'threedsecure' => :'threedsecure',
76
79
  :'token' => :'token',
77
80
  :'trans_info' => :'trans_info',
@@ -98,6 +101,7 @@ module CityPayApiClient
98
101
  :'initiation' => :'String',
99
102
  :'match_avsa' => :'String',
100
103
  :'merchantid' => :'Integer',
104
+ :'tag' => :'Array<String>',
101
105
  :'threedsecure' => :'ThreeDSecure',
102
106
  :'token' => :'String',
103
107
  :'trans_info' => :'String',
@@ -128,6 +132,8 @@ module CityPayApiClient
128
132
 
129
133
  if attributes.key?(:'amount')
130
134
  self.amount = attributes[:'amount']
135
+ else
136
+ self.amount = nil
131
137
  end
132
138
 
133
139
  if attributes.key?(:'avs_postcode_policy')
@@ -156,6 +162,8 @@ module CityPayApiClient
156
162
 
157
163
  if attributes.key?(:'identifier')
158
164
  self.identifier = attributes[:'identifier']
165
+ else
166
+ self.identifier = nil
159
167
  end
160
168
 
161
169
  if attributes.key?(:'initiation')
@@ -168,6 +176,14 @@ module CityPayApiClient
168
176
 
169
177
  if attributes.key?(:'merchantid')
170
178
  self.merchantid = attributes[:'merchantid']
179
+ else
180
+ self.merchantid = nil
181
+ end
182
+
183
+ if attributes.key?(:'tag')
184
+ if (value = attributes[:'tag']).is_a?(Array)
185
+ self.tag = value
186
+ end
171
187
  end
172
188
 
173
189
  if attributes.key?(:'threedsecure')
@@ -176,6 +192,8 @@ module CityPayApiClient
176
192
 
177
193
  if attributes.key?(:'token')
178
194
  self.token = attributes[:'token']
195
+ else
196
+ self.token = nil
179
197
  end
180
198
 
181
199
  if attributes.key?(:'trans_info')
@@ -190,6 +208,7 @@ module CityPayApiClient
190
208
  # Show invalid properties with the reasons. Usually used together with valid?
191
209
  # @return Array for valid properties with the reasons
192
210
  def list_invalid_properties
211
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
193
212
  invalid_properties = Array.new
194
213
  if @amount.nil?
195
214
  invalid_properties.push('invalid value for "amount", amount cannot be nil.')
@@ -253,6 +272,7 @@ module CityPayApiClient
253
272
  # Check to see if the all the properties in the model are valid
254
273
  # @return true if the model is valid
255
274
  def valid?
275
+ warn '[DEPRECATED] the `valid?` method is obsolete'
256
276
  return false if @amount.nil?
257
277
  return false if !@cardholder_agreement.nil? && @cardholder_agreement.to_s.length > 1
258
278
  return false if !@csc.nil? && @csc.to_s.length > 4
@@ -283,7 +303,11 @@ module CityPayApiClient
283
303
  # Custom attribute writer method with validation
284
304
  # @param [Object] cardholder_agreement Value to be assigned
285
305
  def cardholder_agreement=(cardholder_agreement)
286
- if !cardholder_agreement.nil? && cardholder_agreement.to_s.length > 1
306
+ if cardholder_agreement.nil?
307
+ fail ArgumentError, 'cardholder_agreement cannot be nil'
308
+ end
309
+
310
+ if cardholder_agreement.to_s.length > 1
287
311
  fail ArgumentError, 'invalid value for "cardholder_agreement", the character length must be smaller than or equal to 1.'
288
312
  end
289
313
 
@@ -293,11 +317,15 @@ module CityPayApiClient
293
317
  # Custom attribute writer method with validation
294
318
  # @param [Object] csc Value to be assigned
295
319
  def csc=(csc)
296
- if !csc.nil? && csc.to_s.length > 4
320
+ if csc.nil?
321
+ fail ArgumentError, 'csc cannot be nil'
322
+ end
323
+
324
+ if csc.to_s.length > 4
297
325
  fail ArgumentError, 'invalid value for "csc", the character length must be smaller than or equal to 4.'
298
326
  end
299
327
 
300
- if !csc.nil? && csc.to_s.length < 3
328
+ if csc.to_s.length < 3
301
329
  fail ArgumentError, 'invalid value for "csc", the character length must be great than or equal to 3.'
302
330
  end
303
331
 
@@ -307,11 +335,15 @@ module CityPayApiClient
307
335
  # Custom attribute writer method with validation
308
336
  # @param [Object] currency Value to be assigned
309
337
  def currency=(currency)
310
- if !currency.nil? && currency.to_s.length > 3
338
+ if currency.nil?
339
+ fail ArgumentError, 'currency cannot be nil'
340
+ end
341
+
342
+ if currency.to_s.length > 3
311
343
  fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
312
344
  end
313
345
 
314
- if !currency.nil? && currency.to_s.length < 3
346
+ if currency.to_s.length < 3
315
347
  fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 3.'
316
348
  end
317
349
 
@@ -339,7 +371,11 @@ module CityPayApiClient
339
371
  # Custom attribute writer method with validation
340
372
  # @param [Object] initiation Value to be assigned
341
373
  def initiation=(initiation)
342
- if !initiation.nil? && initiation.to_s.length > 1
374
+ if initiation.nil?
375
+ fail ArgumentError, 'initiation cannot be nil'
376
+ end
377
+
378
+ if initiation.to_s.length > 1
343
379
  fail ArgumentError, 'invalid value for "initiation", the character length must be smaller than or equal to 1.'
344
380
  end
345
381
 
@@ -349,7 +385,11 @@ module CityPayApiClient
349
385
  # Custom attribute writer method with validation
350
386
  # @param [Object] trans_info Value to be assigned
351
387
  def trans_info=(trans_info)
352
- if !trans_info.nil? && trans_info.to_s.length > 50
388
+ if trans_info.nil?
389
+ fail ArgumentError, 'trans_info cannot be nil'
390
+ end
391
+
392
+ if trans_info.to_s.length > 50
353
393
  fail ArgumentError, 'invalid value for "trans_info", the character length must be smaller than or equal to 50.'
354
394
  end
355
395
 
@@ -359,7 +399,11 @@ module CityPayApiClient
359
399
  # Custom attribute writer method with validation
360
400
  # @param [Object] trans_type Value to be assigned
361
401
  def trans_type=(trans_type)
362
- if !trans_type.nil? && trans_type.to_s.length > 1
402
+ if trans_type.nil?
403
+ fail ArgumentError, 'trans_type cannot be nil'
404
+ end
405
+
406
+ if trans_type.to_s.length > 1
363
407
  fail ArgumentError, 'invalid value for "trans_type", the character length must be smaller than or equal to 1.'
364
408
  end
365
409
 
@@ -382,6 +426,7 @@ module CityPayApiClient
382
426
  initiation == o.initiation &&
383
427
  match_avsa == o.match_avsa &&
384
428
  merchantid == o.merchantid &&
429
+ tag == o.tag &&
385
430
  threedsecure == o.threedsecure &&
386
431
  token == o.token &&
387
432
  trans_info == o.trans_info &&
@@ -397,44 +442,37 @@ module CityPayApiClient
397
442
  # Calculates hash code according to all attributes.
398
443
  # @return [Integer] Hash code
399
444
  def hash
400
- [amount, avs_postcode_policy, cardholder_agreement, csc, csc_policy, currency, duplicate_policy, identifier, initiation, match_avsa, merchantid, threedsecure, token, trans_info, trans_type].hash
445
+ [amount, avs_postcode_policy, cardholder_agreement, csc, csc_policy, currency, duplicate_policy, identifier, initiation, match_avsa, merchantid, tag, threedsecure, token, trans_info, trans_type].hash
401
446
  end
402
447
 
403
448
  # Builds the object from hash
404
449
  # @param [Hash] attributes Model attributes in the form of hash
405
450
  # @return [Object] Returns the model itself
406
451
  def self.build_from_hash(attributes)
407
- new.build_from_hash(attributes)
408
- end
409
-
410
- # Builds the object from hash
411
- # @param [Hash] attributes Model attributes in the form of hash
412
- # @return [Object] Returns the model itself
413
- def build_from_hash(attributes)
414
452
  return nil unless attributes.is_a?(Hash)
415
453
  attributes = attributes.transform_keys(&:to_sym)
416
- self.class.openapi_types.each_pair do |key, type|
417
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
418
- self.send("#{key}=", nil)
454
+ transformed_hash = {}
455
+ openapi_types.each_pair do |key, type|
456
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
457
+ transformed_hash["#{key}"] = nil
419
458
  elsif type =~ /\AArray<(.*)>/i
420
459
  # check to ensure the input is an array given that the attribute
421
460
  # is documented as an array but the input is not
422
- if attributes[self.class.attribute_map[key]].is_a?(Array)
423
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
461
+ if attributes[attribute_map[key]].is_a?(Array)
462
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
424
463
  end
425
- elsif !attributes[self.class.attribute_map[key]].nil?
426
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
464
+ elsif !attributes[attribute_map[key]].nil?
465
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
427
466
  end
428
467
  end
429
-
430
- self
468
+ new(transformed_hash)
431
469
  end
432
470
 
433
471
  # Deserializes the data based on type
434
472
  # @param string type Data type
435
473
  # @param string value Value to be deserialized
436
474
  # @return [Object] Deserialized data
437
- def _deserialize(type, value)
475
+ def self._deserialize(type, value)
438
476
  case type.to_sym
439
477
  when :Time
440
478
  Time.parse(value)
@@ -469,7 +507,7 @@ module CityPayApiClient
469
507
  else # model
470
508
  # models (e.g. Pet) or oneOf
471
509
  klass = CityPayApiClient.const_get(type)
472
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
510
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
473
511
  end
474
512
  end
475
513