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.
- checksums.yaml +4 -4
- data/Gemfile.lock +73 -0
- data/README.md +65 -37
- data/citypay_api_client.gemspec +4 -3
- data/docs/Acknowledgement.md +2 -2
- data/docs/AclCheckResponseModel.md +3 -3
- data/docs/AirlineAdvice.md +1 -1
- data/docs/AuthRequest.md +9 -7
- data/docs/AuthResponse.md +9 -5
- data/docs/AuthorisationAndPaymentApi.md +145 -10
- data/docs/Batch.md +1 -1
- data/docs/BatchProcessingApi.md +24 -20
- data/docs/BatchReportResponseModel.md +2 -2
- data/docs/BatchTransaction.md +1 -1
- data/docs/BatchTransactionReportRequest.md +22 -0
- data/docs/BatchTransactionReportResponse.md +24 -0
- data/docs/BatchTransactionResultModel.md +6 -2
- data/docs/Bin.md +2 -2
- data/docs/CaptureRequest.md +1 -1
- data/docs/Card.md +3 -3
- data/docs/CardHolderAccountApi.md +73 -14
- data/docs/ChargeRequest.md +8 -6
- data/docs/ContactDetails.md +11 -11
- data/docs/Decision.md +0 -2
- data/docs/DirectPostApi.md +26 -16
- data/docs/DirectPostRequest.md +9 -7
- data/docs/EventDataModel.md +2 -2
- data/docs/MerchantBatchReportRequest.md +28 -0
- data/docs/MerchantBatchReportResponse.md +24 -0
- data/docs/MerchantBatchResponse.md +30 -0
- data/docs/NetSummaryResponse.md +32 -0
- data/docs/OperationalFunctionsApi.md +28 -8
- data/docs/PaylinkAdjustmentRequest.md +1 -1
- data/docs/PaylinkApi.md +337 -21
- data/docs/PaylinkBillPaymentTokenRequest.md +1 -1
- data/docs/PaylinkCustomParam.md +3 -1
- data/docs/PaylinkErrorCode.md +2 -2
- data/docs/PaylinkFieldGuardModel.md +1 -1
- data/docs/PaylinkResendNotificationRequest.md +20 -0
- data/docs/PaylinkStateEvent.md +4 -4
- data/docs/PaylinkTokenCreated.md +11 -11
- data/docs/PaylinkTokenRequestModel.md +4 -0
- data/docs/PaylinkTokenStatus.md +7 -7
- data/docs/PaylinkTokenStatusChangeRequest.md +7 -7
- data/docs/PaylinkTokenStatusChangeResponse.md +6 -2
- data/docs/PaymentIntent.md +42 -0
- data/docs/PaymentIntentReference.md +18 -0
- data/docs/RefundRequest.md +1 -1
- data/docs/RegisterCard.md +1 -1
- data/docs/RemittanceData.md +28 -0
- data/docs/RemittanceReportRequest.md +28 -0
- data/docs/RemittanceReportResponse.md +24 -0
- data/docs/RemittedClientData.md +44 -0
- data/docs/ReportingApi.md +378 -0
- data/docs/ThreeDSecure.md +1 -1
- data/docs/TokenisationResponseModel.md +3 -3
- data/docs/images/3dsv1-challenge.png +0 -0
- data/docs/images/3dsv2-challenge.png +0 -0
- data/docs/images/3dsv2-frictionless.png +0 -0
- data/docs/images/3dsv2-method-challenge.png +0 -0
- data/docs/images/3dsv2-method-frictionless.png +0 -0
- data/docs/images/3dsv2-no3d.png +0 -0
- data/docs/images/citypay-logo.svg +1 -0
- data/docs/images/direct-post-flow.png +0 -0
- data/docs/images/favicon.ico +0 -0
- data/docs/images/header.png +0 -0
- data/docs/images/logo.ai +1913 -4
- data/docs/images/logo.png +0 -0
- data/docs/images/logo.svg +1 -0
- data/docs/images/merchant-BPS-workflow.png +0 -0
- data/docs/images/paylink-field-guards.png +0 -0
- data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +72 -4
- data/lib/citypay_api_client/api/batch_processing_api__.rb +15 -15
- data/lib/citypay_api_client/api/card_holder_account_api__.rb +5 -2
- data/lib/citypay_api_client/api/direct_post_api__.rb +9 -9
- data/lib/citypay_api_client/api/operational_functions_api__.rb +3 -3
- data/lib/citypay_api_client/api/paylink_api__.rb +163 -26
- data/lib/citypay_api_client/api/reporting_api__.rb +381 -0
- data/lib/citypay_api_client/api_client.rb +24 -22
- data/lib/citypay_api_client/api_error.rb +3 -2
- data/lib/citypay_api_client/configuration.rb +28 -9
- data/lib/citypay_api_client/models/account_create.rb +17 -20
- data/lib/citypay_api_client/models/account_status.rb +15 -20
- data/lib/citypay_api_client/models/acknowledgement.rb +21 -46
- data/lib/citypay_api_client/models/acl_check_request.rb +17 -20
- data/lib/citypay_api_client/models/acl_check_response_model.rb +16 -21
- data/lib/citypay_api_client/models/airline_advice.rb +45 -29
- data/lib/citypay_api_client/models/airline_segment.rb +35 -22
- data/lib/citypay_api_client/models/auth_reference.rb +41 -26
- data/lib/citypay_api_client/models/auth_references.rb +15 -20
- data/lib/citypay_api_client/models/auth_request.rb +72 -34
- data/lib/citypay_api_client/models/auth_response.rb +46 -23
- data/lib/citypay_api_client/models/authen_required.rb +15 -20
- data/lib/citypay_api_client/models/batch.rb +25 -22
- data/lib/citypay_api_client/models/batch_report_request.rb +23 -22
- data/lib/citypay_api_client/models/batch_report_response_model.rb +28 -21
- data/lib/citypay_api_client/models/batch_transaction.rb +25 -22
- data/lib/citypay_api_client/models/batch_transaction_report_request.rb +234 -0
- data/lib/citypay_api_client/models/batch_transaction_report_response.rb +252 -0
- data/lib/citypay_api_client/models/batch_transaction_result_model.rb +53 -22
- data/lib/citypay_api_client/models/bin.rb +15 -20
- data/lib/citypay_api_client/models/bin_lookup.rb +17 -20
- data/lib/citypay_api_client/models/c_res_auth_request.rb +15 -20
- data/lib/citypay_api_client/models/capture_request.rb +27 -22
- data/lib/citypay_api_client/models/card.rb +33 -26
- data/lib/citypay_api_client/models/card_holder_account.rb +19 -20
- data/lib/citypay_api_client/models/card_status.rb +15 -20
- data/lib/citypay_api_client/models/charge_request.rb +72 -34
- data/lib/citypay_api_client/models/check_batch_status.rb +23 -22
- data/lib/citypay_api_client/models/check_batch_status_response.rb +15 -20
- data/lib/citypay_api_client/models/contact_details.rb +77 -42
- data/lib/citypay_api_client/models/decision.rb +16 -30
- data/lib/citypay_api_client/models/direct_post_request.rb +72 -34
- data/lib/citypay_api_client/models/direct_token_auth_request.rb +15 -20
- data/lib/citypay_api_client/models/domain_key_check_request.rb +17 -20
- data/lib/citypay_api_client/models/domain_key_request.rb +19 -20
- data/lib/citypay_api_client/models/domain_key_response.rb +25 -22
- data/lib/citypay_api_client/models/error.rb +27 -24
- data/lib/citypay_api_client/models/event_data_model.rb +15 -20
- data/lib/citypay_api_client/models/exists.rb +17 -20
- data/lib/citypay_api_client/models/external_mpi.rb +39 -24
- data/lib/citypay_api_client/models/list_merchants_response.rb +21 -22
- data/lib/citypay_api_client/models/mcc6012.rb +15 -20
- data/lib/citypay_api_client/models/merchant.rb +15 -20
- data/lib/citypay_api_client/models/merchant_batch_report_request.rb +265 -0
- data/lib/citypay_api_client/models/merchant_batch_report_response.rb +252 -0
- data/lib/citypay_api_client/models/merchant_batch_response.rb +301 -0
- data/lib/citypay_api_client/models/net_summary_response.rb +472 -0
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +19 -20
- data/lib/citypay_api_client/models/paylink_address.rb +52 -29
- data/lib/citypay_api_client/models/paylink_adjustment_request.rb +25 -22
- data/lib/citypay_api_client/models/paylink_attachment_request.rb +19 -20
- data/lib/citypay_api_client/models/paylink_attachment_result.rb +19 -20
- data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +17 -20
- data/lib/citypay_api_client/models/paylink_card_holder.rb +30 -23
- data/lib/citypay_api_client/models/paylink_cart.rb +15 -20
- data/lib/citypay_api_client/models/paylink_cart_item_model.rb +15 -20
- data/lib/citypay_api_client/models/paylink_config.rb +15 -20
- data/lib/citypay_api_client/models/paylink_custom_param.rb +29 -22
- data/lib/citypay_api_client/models/paylink_email_notification_path.rb +17 -20
- data/lib/citypay_api_client/models/paylink_error_code.rb +19 -20
- data/lib/citypay_api_client/models/paylink_field_guard_model.rb +16 -21
- data/lib/citypay_api_client/models/paylink_part_payments.rb +15 -20
- data/lib/citypay_api_client/models/paylink_resend_notification_request.rb +224 -0
- data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +17 -20
- data/lib/citypay_api_client/models/paylink_state_event.rb +16 -21
- data/lib/citypay_api_client/models/paylink_token_created.rb +56 -27
- data/lib/citypay_api_client/models/paylink_token_request_model.rb +75 -22
- data/lib/citypay_api_client/models/paylink_token_status.rb +44 -21
- data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +24 -26
- data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +39 -22
- data/lib/citypay_api_client/models/paylink_ui.rb +15 -20
- data/lib/citypay_api_client/models/payment_intent.rb +479 -0
- data/lib/citypay_api_client/models/payment_intent_reference.rb +221 -0
- data/lib/citypay_api_client/models/ping.rb +21 -22
- data/lib/citypay_api_client/models/process_batch_request.rb +27 -22
- data/lib/citypay_api_client/models/process_batch_response.rb +17 -20
- data/lib/citypay_api_client/models/refund_request.rb +28 -21
- data/lib/citypay_api_client/models/register_card.rb +27 -22
- data/lib/citypay_api_client/models/remittance_data.rb +404 -0
- data/lib/citypay_api_client/models/remittance_report_request.rb +265 -0
- data/lib/citypay_api_client/models/remittance_report_response.rb +252 -0
- data/lib/citypay_api_client/models/remitted_client_data.rb +612 -0
- data/lib/citypay_api_client/models/request_challenged.rb +15 -20
- data/lib/citypay_api_client/models/retrieve_request.rb +23 -22
- data/lib/citypay_api_client/models/three_d_secure.rb +16 -21
- data/lib/citypay_api_client/models/tokenisation_response_model.rb +23 -24
- data/lib/citypay_api_client/models/void_request.rb +23 -22
- data/lib/citypay_api_client/version.rb +3 -3
- data/lib/citypay_api_client.rb +16 -3
- data/spec/api/reporting_api___spec.rb +99 -0
- data/spec/it_api_sandbox_spec.rb +5 -14
- data/spec/models/account_create_spec.rb +1 -2
- data/spec/models/account_status_spec.rb +2 -2
- data/spec/models/airline_advice_spec.rb +0 -2
- data/spec/models/airline_segment_spec.rb +0 -2
- data/spec/models/auth_request_spec.rb +0 -2
- data/spec/models/auth_response_spec.rb +75 -30
- data/spec/models/batch_report_request_spec.rb +0 -2
- data/spec/models/batch_report_response_model_spec.rb +0 -2
- data/spec/models/batch_spec.rb +0 -2
- data/spec/models/batch_transaction_report_request_spec.rb +47 -0
- data/spec/models/batch_transaction_report_response_spec.rb +53 -0
- data/spec/models/batch_transaction_result_model_spec.rb +0 -2
- data/spec/models/batch_transaction_spec.rb +0 -2
- data/spec/models/bin_lookup_spec.rb +0 -2
- data/spec/models/capture_request_spec.rb +0 -2
- data/spec/models/card_holder_account_spec.rb +0 -2
- data/spec/models/charge_request_spec.rb +0 -2
- data/spec/models/decision_spec.rb +0 -26
- data/spec/models/direct_post_request_spec.rb +0 -2
- data/spec/models/domain_key_check_request_spec.rb +0 -2
- data/spec/models/merchant_batch_report_request_spec.rb +65 -0
- data/spec/models/merchant_batch_report_response_spec.rb +53 -0
- data/spec/models/merchant_batch_response_spec.rb +71 -0
- data/spec/models/net_summary_response_spec.rb +77 -0
- data/spec/models/paylink_resend_notification_request_spec.rb +41 -0
- data/spec/models/paylink_token_request_model_spec.rb +0 -2
- data/spec/models/payment_intent_reference_spec.rb +35 -0
- data/spec/models/payment_intent_spec.rb +107 -0
- data/spec/models/process_batch_request_spec.rb +0 -2
- data/spec/models/refund_request_spec.rb +0 -2
- data/spec/models/register_card_spec.rb +0 -2
- data/spec/models/remittance_data_spec.rb +65 -0
- data/spec/models/remittance_report_request_spec.rb +65 -0
- data/spec/models/remittance_report_response_spec.rb +53 -0
- data/spec/models/remitted_client_data_spec.rb +113 -0
- data/spec/spec_helper.rb +2 -2
- metadata +146 -78
- data/docs/OperationalApi.md +0 -214
- data/docs/PaymentProcessingApi.md +0 -559
- data/spec/models/authen_required_spec.rb +0 -52
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
#
|
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:
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
|
326
|
-
|
327
|
-
|
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[
|
332
|
-
|
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[
|
335
|
-
|
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
|
-
#
|
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:
|
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
|
-
|
113
|
-
|
114
|
-
|
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[
|
119
|
-
|
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[
|
122
|
-
|
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
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
#
|
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:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
@@ -19,7 +19,7 @@ module CityPayApiClient
|
|
19
19
|
# 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.
|
20
20
|
attr_accessor :amount
|
21
21
|
|
22
|
-
# A policy value which determines whether an AVS postcode policy is enforced or bypassed. Values are
|
22
|
+
# 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.
|
23
23
|
attr_accessor :avs_postcode_policy
|
24
24
|
|
25
25
|
attr_accessor :bill_to
|
@@ -27,16 +27,16 @@ module CityPayApiClient
|
|
27
27
|
# The card number (PAN) with a variable length to a maximum of 21 digits in numerical form. Any non numeric characters will be stripped out of the card number, this includes whitespace or separators internal of the provided value. The card number must be treated as sensitive data. We only provide an obfuscated value in logging and reporting. The plaintext value is encrypted in our database using AES 256 GMC bit encryption for settlement or refund purposes. When providing the card number to our gateway through the authorisation API you will be handling the card data on your application. This will require further PCI controls to be in place and this value must never be stored.
|
28
28
|
attr_accessor :cardnumber
|
29
29
|
|
30
|
-
# 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
|
30
|
+
# 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.
|
31
31
|
attr_accessor :csc
|
32
32
|
|
33
|
-
# A policy value which determines whether a CSC policy is enforced or bypassed. Values are
|
33
|
+
# 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.
|
34
34
|
attr_accessor :csc_policy
|
35
35
|
|
36
36
|
# The processing currency for the transaction. Will default to the merchant account currency.
|
37
37
|
attr_accessor :currency
|
38
38
|
|
39
|
-
# 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
|
39
|
+
# 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.
|
40
40
|
attr_accessor :duplicate_policy
|
41
41
|
|
42
42
|
attr_accessor :event_management
|
@@ -52,7 +52,7 @@ module CityPayApiClient
|
|
52
52
|
# 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.
|
53
53
|
attr_accessor :identifier
|
54
54
|
|
55
|
-
# A policy value which determines whether an AVS address policy is enforced, bypassed or ignored. Values are
|
55
|
+
# 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.
|
56
56
|
attr_accessor :match_avsa
|
57
57
|
|
58
58
|
attr_accessor :mcc6012
|
@@ -65,6 +65,8 @@ module CityPayApiClient
|
|
65
65
|
|
66
66
|
attr_accessor :ship_to
|
67
67
|
|
68
|
+
attr_accessor :tag
|
69
|
+
|
68
70
|
attr_accessor :threedsecure
|
69
71
|
|
70
72
|
# Further information that can be added to the transaction will display in reporting. Can be used for flexible values such as operator id.
|
@@ -95,6 +97,7 @@ module CityPayApiClient
|
|
95
97
|
:'merchantid' => :'merchantid',
|
96
98
|
:'name_on_card' => :'name_on_card',
|
97
99
|
:'ship_to' => :'ship_to',
|
100
|
+
:'tag' => :'tag',
|
98
101
|
:'threedsecure' => :'threedsecure',
|
99
102
|
:'trans_info' => :'trans_info',
|
100
103
|
:'trans_type' => :'trans_type'
|
@@ -128,6 +131,7 @@ module CityPayApiClient
|
|
128
131
|
:'merchantid' => :'Integer',
|
129
132
|
:'name_on_card' => :'String',
|
130
133
|
:'ship_to' => :'ContactDetails',
|
134
|
+
:'tag' => :'Array<String>',
|
131
135
|
:'threedsecure' => :'ThreeDSecure',
|
132
136
|
:'trans_info' => :'String',
|
133
137
|
:'trans_type' => :'String'
|
@@ -161,6 +165,8 @@ module CityPayApiClient
|
|
161
165
|
|
162
166
|
if attributes.key?(:'amount')
|
163
167
|
self.amount = attributes[:'amount']
|
168
|
+
else
|
169
|
+
self.amount = nil
|
164
170
|
end
|
165
171
|
|
166
172
|
if attributes.key?(:'avs_postcode_policy')
|
@@ -173,6 +179,8 @@ module CityPayApiClient
|
|
173
179
|
|
174
180
|
if attributes.key?(:'cardnumber')
|
175
181
|
self.cardnumber = attributes[:'cardnumber']
|
182
|
+
else
|
183
|
+
self.cardnumber = nil
|
176
184
|
end
|
177
185
|
|
178
186
|
if attributes.key?(:'csc')
|
@@ -197,10 +205,14 @@ module CityPayApiClient
|
|
197
205
|
|
198
206
|
if attributes.key?(:'expmonth')
|
199
207
|
self.expmonth = attributes[:'expmonth']
|
208
|
+
else
|
209
|
+
self.expmonth = nil
|
200
210
|
end
|
201
211
|
|
202
212
|
if attributes.key?(:'expyear')
|
203
213
|
self.expyear = attributes[:'expyear']
|
214
|
+
else
|
215
|
+
self.expyear = nil
|
204
216
|
end
|
205
217
|
|
206
218
|
if attributes.key?(:'external_mpi')
|
@@ -209,6 +221,8 @@ module CityPayApiClient
|
|
209
221
|
|
210
222
|
if attributes.key?(:'identifier')
|
211
223
|
self.identifier = attributes[:'identifier']
|
224
|
+
else
|
225
|
+
self.identifier = nil
|
212
226
|
end
|
213
227
|
|
214
228
|
if attributes.key?(:'match_avsa')
|
@@ -221,6 +235,8 @@ module CityPayApiClient
|
|
221
235
|
|
222
236
|
if attributes.key?(:'merchantid')
|
223
237
|
self.merchantid = attributes[:'merchantid']
|
238
|
+
else
|
239
|
+
self.merchantid = nil
|
224
240
|
end
|
225
241
|
|
226
242
|
if attributes.key?(:'name_on_card')
|
@@ -231,6 +247,12 @@ module CityPayApiClient
|
|
231
247
|
self.ship_to = attributes[:'ship_to']
|
232
248
|
end
|
233
249
|
|
250
|
+
if attributes.key?(:'tag')
|
251
|
+
if (value = attributes[:'tag']).is_a?(Array)
|
252
|
+
self.tag = value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
234
256
|
if attributes.key?(:'threedsecure')
|
235
257
|
self.threedsecure = attributes[:'threedsecure']
|
236
258
|
end
|
@@ -247,6 +269,7 @@ module CityPayApiClient
|
|
247
269
|
# Show invalid properties with the reasons. Usually used together with valid?
|
248
270
|
# @return Array for valid properties with the reasons
|
249
271
|
def list_invalid_properties
|
272
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
250
273
|
invalid_properties = Array.new
|
251
274
|
if @amount.nil?
|
252
275
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
@@ -342,6 +365,7 @@ module CityPayApiClient
|
|
342
365
|
# Check to see if the all the properties in the model are valid
|
343
366
|
# @return true if the model is valid
|
344
367
|
def valid?
|
368
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
345
369
|
return false if @amount.nil?
|
346
370
|
return false if @cardnumber.nil?
|
347
371
|
return false if @cardnumber.to_s.length > 22
|
@@ -398,11 +422,15 @@ module CityPayApiClient
|
|
398
422
|
# Custom attribute writer method with validation
|
399
423
|
# @param [Object] csc Value to be assigned
|
400
424
|
def csc=(csc)
|
401
|
-
if
|
425
|
+
if csc.nil?
|
426
|
+
fail ArgumentError, 'csc cannot be nil'
|
427
|
+
end
|
428
|
+
|
429
|
+
if csc.to_s.length > 4
|
402
430
|
fail ArgumentError, 'invalid value for "csc", the character length must be smaller than or equal to 4.'
|
403
431
|
end
|
404
432
|
|
405
|
-
if
|
433
|
+
if csc.to_s.length < 3
|
406
434
|
fail ArgumentError, 'invalid value for "csc", the character length must be great than or equal to 3.'
|
407
435
|
end
|
408
436
|
|
@@ -412,11 +440,15 @@ module CityPayApiClient
|
|
412
440
|
# Custom attribute writer method with validation
|
413
441
|
# @param [Object] currency Value to be assigned
|
414
442
|
def currency=(currency)
|
415
|
-
if
|
443
|
+
if currency.nil?
|
444
|
+
fail ArgumentError, 'currency cannot be nil'
|
445
|
+
end
|
446
|
+
|
447
|
+
if currency.to_s.length > 3
|
416
448
|
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
417
449
|
end
|
418
450
|
|
419
|
-
if
|
451
|
+
if currency.to_s.length < 3
|
420
452
|
fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 3.'
|
421
453
|
end
|
422
454
|
|
@@ -480,11 +512,15 @@ module CityPayApiClient
|
|
480
512
|
# Custom attribute writer method with validation
|
481
513
|
# @param [Object] name_on_card Value to be assigned
|
482
514
|
def name_on_card=(name_on_card)
|
483
|
-
if
|
515
|
+
if name_on_card.nil?
|
516
|
+
fail ArgumentError, 'name_on_card cannot be nil'
|
517
|
+
end
|
518
|
+
|
519
|
+
if name_on_card.to_s.length > 45
|
484
520
|
fail ArgumentError, 'invalid value for "name_on_card", the character length must be smaller than or equal to 45.'
|
485
521
|
end
|
486
522
|
|
487
|
-
if
|
523
|
+
if name_on_card.to_s.length < 2
|
488
524
|
fail ArgumentError, 'invalid value for "name_on_card", the character length must be great than or equal to 2.'
|
489
525
|
end
|
490
526
|
|
@@ -494,7 +530,11 @@ module CityPayApiClient
|
|
494
530
|
# Custom attribute writer method with validation
|
495
531
|
# @param [Object] trans_info Value to be assigned
|
496
532
|
def trans_info=(trans_info)
|
497
|
-
if
|
533
|
+
if trans_info.nil?
|
534
|
+
fail ArgumentError, 'trans_info cannot be nil'
|
535
|
+
end
|
536
|
+
|
537
|
+
if trans_info.to_s.length > 50
|
498
538
|
fail ArgumentError, 'invalid value for "trans_info", the character length must be smaller than or equal to 50.'
|
499
539
|
end
|
500
540
|
|
@@ -504,7 +544,11 @@ module CityPayApiClient
|
|
504
544
|
# Custom attribute writer method with validation
|
505
545
|
# @param [Object] trans_type Value to be assigned
|
506
546
|
def trans_type=(trans_type)
|
507
|
-
if
|
547
|
+
if trans_type.nil?
|
548
|
+
fail ArgumentError, 'trans_type cannot be nil'
|
549
|
+
end
|
550
|
+
|
551
|
+
if trans_type.to_s.length > 1
|
508
552
|
fail ArgumentError, 'invalid value for "trans_type", the character length must be smaller than or equal to 1.'
|
509
553
|
end
|
510
554
|
|
@@ -535,6 +579,7 @@ module CityPayApiClient
|
|
535
579
|
merchantid == o.merchantid &&
|
536
580
|
name_on_card == o.name_on_card &&
|
537
581
|
ship_to == o.ship_to &&
|
582
|
+
tag == o.tag &&
|
538
583
|
threedsecure == o.threedsecure &&
|
539
584
|
trans_info == o.trans_info &&
|
540
585
|
trans_type == o.trans_type
|
@@ -549,44 +594,37 @@ module CityPayApiClient
|
|
549
594
|
# Calculates hash code according to all attributes.
|
550
595
|
# @return [Integer] Hash code
|
551
596
|
def hash
|
552
|
-
[airline_data, amount, avs_postcode_policy, bill_to, cardnumber, csc, csc_policy, currency, duplicate_policy, event_management, expmonth, expyear, external_mpi, identifier, match_avsa, mcc6012, merchantid, name_on_card, ship_to, threedsecure, trans_info, trans_type].hash
|
597
|
+
[airline_data, amount, avs_postcode_policy, bill_to, cardnumber, csc, csc_policy, currency, duplicate_policy, event_management, expmonth, expyear, external_mpi, identifier, match_avsa, mcc6012, merchantid, name_on_card, ship_to, tag, threedsecure, trans_info, trans_type].hash
|
553
598
|
end
|
554
599
|
|
555
600
|
# Builds the object from hash
|
556
601
|
# @param [Hash] attributes Model attributes in the form of hash
|
557
602
|
# @return [Object] Returns the model itself
|
558
603
|
def self.build_from_hash(attributes)
|
559
|
-
new.build_from_hash(attributes)
|
560
|
-
end
|
561
|
-
|
562
|
-
# Builds the object from hash
|
563
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
564
|
-
# @return [Object] Returns the model itself
|
565
|
-
def build_from_hash(attributes)
|
566
604
|
return nil unless attributes.is_a?(Hash)
|
567
605
|
attributes = attributes.transform_keys(&:to_sym)
|
568
|
-
|
569
|
-
|
570
|
-
|
606
|
+
transformed_hash = {}
|
607
|
+
openapi_types.each_pair do |key, type|
|
608
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
609
|
+
transformed_hash["#{key}"] = nil
|
571
610
|
elsif type =~ /\AArray<(.*)>/i
|
572
611
|
# check to ensure the input is an array given that the attribute
|
573
612
|
# is documented as an array but the input is not
|
574
|
-
if attributes[
|
575
|
-
|
613
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
614
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
576
615
|
end
|
577
|
-
elsif !attributes[
|
578
|
-
|
616
|
+
elsif !attributes[attribute_map[key]].nil?
|
617
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
579
618
|
end
|
580
619
|
end
|
581
|
-
|
582
|
-
self
|
620
|
+
new(transformed_hash)
|
583
621
|
end
|
584
622
|
|
585
623
|
# Deserializes the data based on type
|
586
624
|
# @param string type Data type
|
587
625
|
# @param string value Value to be deserialized
|
588
626
|
# @return [Object] Deserialized data
|
589
|
-
def _deserialize(type, value)
|
627
|
+
def self._deserialize(type, value)
|
590
628
|
case type.to_sym
|
591
629
|
when :Time
|
592
630
|
Time.parse(value)
|
@@ -621,7 +659,7 @@ module CityPayApiClient
|
|
621
659
|
else # model
|
622
660
|
# models (e.g. Pet) or oneOf
|
623
661
|
klass = CityPayApiClient.const_get(type)
|
624
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
662
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
625
663
|
end
|
626
664
|
end
|
627
665
|
|