citypay_api_client 1.1.1 → 1.1.2

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