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
|
|
@@ -116,6 +116,8 @@ module CityPayApiClient
|
|
116
116
|
|
117
117
|
if attributes.key?(:'request')
|
118
118
|
self.request = attributes[:'request']
|
119
|
+
else
|
120
|
+
self.request = nil
|
119
121
|
end
|
120
122
|
|
121
123
|
if attributes.key?(:'sms_notification_path')
|
@@ -126,6 +128,7 @@ module CityPayApiClient
|
|
126
128
|
# Show invalid properties with the reasons. Usually used together with valid?
|
127
129
|
# @return Array for valid properties with the reasons
|
128
130
|
def list_invalid_properties
|
131
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
129
132
|
invalid_properties = Array.new
|
130
133
|
if @request.nil?
|
131
134
|
invalid_properties.push('invalid value for "request", request cannot be nil.')
|
@@ -137,6 +140,7 @@ module CityPayApiClient
|
|
137
140
|
# Check to see if the all the properties in the model are valid
|
138
141
|
# @return true if the model is valid
|
139
142
|
def valid?
|
143
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
140
144
|
return false if @request.nil?
|
141
145
|
true
|
142
146
|
end
|
@@ -172,37 +176,30 @@ module CityPayApiClient
|
|
172
176
|
# @param [Hash] attributes Model attributes in the form of hash
|
173
177
|
# @return [Object] Returns the model itself
|
174
178
|
def self.build_from_hash(attributes)
|
175
|
-
new.build_from_hash(attributes)
|
176
|
-
end
|
177
|
-
|
178
|
-
# Builds the object from hash
|
179
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
180
|
-
# @return [Object] Returns the model itself
|
181
|
-
def build_from_hash(attributes)
|
182
179
|
return nil unless attributes.is_a?(Hash)
|
183
180
|
attributes = attributes.transform_keys(&:to_sym)
|
184
|
-
|
185
|
-
|
186
|
-
|
181
|
+
transformed_hash = {}
|
182
|
+
openapi_types.each_pair do |key, type|
|
183
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
184
|
+
transformed_hash["#{key}"] = nil
|
187
185
|
elsif type =~ /\AArray<(.*)>/i
|
188
186
|
# check to ensure the input is an array given that the attribute
|
189
187
|
# is documented as an array but the input is not
|
190
|
-
if attributes[
|
191
|
-
|
188
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
189
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
192
190
|
end
|
193
|
-
elsif !attributes[
|
194
|
-
|
191
|
+
elsif !attributes[attribute_map[key]].nil?
|
192
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
195
193
|
end
|
196
194
|
end
|
197
|
-
|
198
|
-
self
|
195
|
+
new(transformed_hash)
|
199
196
|
end
|
200
197
|
|
201
198
|
# Deserializes the data based on type
|
202
199
|
# @param string type Data type
|
203
200
|
# @param string value Value to be deserialized
|
204
201
|
# @return [Object] Deserialized data
|
205
|
-
def _deserialize(type, value)
|
202
|
+
def self._deserialize(type, value)
|
206
203
|
case type.to_sym
|
207
204
|
when :Time
|
208
205
|
Time.parse(value)
|
@@ -237,7 +234,7 @@ module CityPayApiClient
|
|
237
234
|
else # model
|
238
235
|
# models (e.g. Pet) or oneOf
|
239
236
|
klass = CityPayApiClient.const_get(type)
|
240
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
237
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
241
238
|
end
|
242
239
|
end
|
243
240
|
|
@@ -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
|
|
@@ -145,6 +145,7 @@ module CityPayApiClient
|
|
145
145
|
# Show invalid properties with the reasons. Usually used together with valid?
|
146
146
|
# @return Array for valid properties with the reasons
|
147
147
|
def list_invalid_properties
|
148
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
148
149
|
invalid_properties = Array.new
|
149
150
|
if !@company.nil? && @company.to_s.length > 50
|
150
151
|
invalid_properties.push('invalid value for "company", the character length must be smaller than or equal to 50.')
|
@@ -164,6 +165,7 @@ module CityPayApiClient
|
|
164
165
|
# Check to see if the all the properties in the model are valid
|
165
166
|
# @return true if the model is valid
|
166
167
|
def valid?
|
168
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
167
169
|
return false if !@company.nil? && @company.to_s.length > 50
|
168
170
|
return false if !@email.nil? && @email.to_s.length > 254
|
169
171
|
return false if !@mobile_no.nil? && @mobile_no.to_s.length > 20
|
@@ -173,7 +175,11 @@ module CityPayApiClient
|
|
173
175
|
# Custom attribute writer method with validation
|
174
176
|
# @param [Object] company Value to be assigned
|
175
177
|
def company=(company)
|
176
|
-
if
|
178
|
+
if company.nil?
|
179
|
+
fail ArgumentError, 'company cannot be nil'
|
180
|
+
end
|
181
|
+
|
182
|
+
if company.to_s.length > 50
|
177
183
|
fail ArgumentError, 'invalid value for "company", the character length must be smaller than or equal to 50.'
|
178
184
|
end
|
179
185
|
|
@@ -183,7 +189,11 @@ module CityPayApiClient
|
|
183
189
|
# Custom attribute writer method with validation
|
184
190
|
# @param [Object] email Value to be assigned
|
185
191
|
def email=(email)
|
186
|
-
if
|
192
|
+
if email.nil?
|
193
|
+
fail ArgumentError, 'email cannot be nil'
|
194
|
+
end
|
195
|
+
|
196
|
+
if email.to_s.length > 254
|
187
197
|
fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 254.'
|
188
198
|
end
|
189
199
|
|
@@ -193,7 +203,11 @@ module CityPayApiClient
|
|
193
203
|
# Custom attribute writer method with validation
|
194
204
|
# @param [Object] mobile_no Value to be assigned
|
195
205
|
def mobile_no=(mobile_no)
|
196
|
-
if
|
206
|
+
if mobile_no.nil?
|
207
|
+
fail ArgumentError, 'mobile_no cannot be nil'
|
208
|
+
end
|
209
|
+
|
210
|
+
if mobile_no.to_s.length > 20
|
197
211
|
fail ArgumentError, 'invalid value for "mobile_no", the character length must be smaller than or equal to 20.'
|
198
212
|
end
|
199
213
|
|
@@ -233,37 +247,30 @@ module CityPayApiClient
|
|
233
247
|
# @param [Hash] attributes Model attributes in the form of hash
|
234
248
|
# @return [Object] Returns the model itself
|
235
249
|
def self.build_from_hash(attributes)
|
236
|
-
new.build_from_hash(attributes)
|
237
|
-
end
|
238
|
-
|
239
|
-
# Builds the object from hash
|
240
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
241
|
-
# @return [Object] Returns the model itself
|
242
|
-
def build_from_hash(attributes)
|
243
250
|
return nil unless attributes.is_a?(Hash)
|
244
251
|
attributes = attributes.transform_keys(&:to_sym)
|
245
|
-
|
246
|
-
|
247
|
-
|
252
|
+
transformed_hash = {}
|
253
|
+
openapi_types.each_pair do |key, type|
|
254
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
255
|
+
transformed_hash["#{key}"] = nil
|
248
256
|
elsif type =~ /\AArray<(.*)>/i
|
249
257
|
# check to ensure the input is an array given that the attribute
|
250
258
|
# is documented as an array but the input is not
|
251
|
-
if attributes[
|
252
|
-
|
259
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
260
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
253
261
|
end
|
254
|
-
elsif !attributes[
|
255
|
-
|
262
|
+
elsif !attributes[attribute_map[key]].nil?
|
263
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
256
264
|
end
|
257
265
|
end
|
258
|
-
|
259
|
-
self
|
266
|
+
new(transformed_hash)
|
260
267
|
end
|
261
268
|
|
262
269
|
# Deserializes the data based on type
|
263
270
|
# @param string type Data type
|
264
271
|
# @param string value Value to be deserialized
|
265
272
|
# @return [Object] Deserialized data
|
266
|
-
def _deserialize(type, value)
|
273
|
+
def self._deserialize(type, value)
|
267
274
|
case type.to_sym
|
268
275
|
when :Time
|
269
276
|
Time.parse(value)
|
@@ -298,7 +305,7 @@ module CityPayApiClient
|
|
298
305
|
else # model
|
299
306
|
# models (e.g. Pet) or oneOf
|
300
307
|
klass = CityPayApiClient.const_get(type)
|
301
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
308
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
302
309
|
end
|
303
310
|
end
|
304
311
|
|
@@ -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
|
|
@@ -120,6 +120,7 @@ module CityPayApiClient
|
|
120
120
|
# Show invalid properties with the reasons. Usually used together with valid?
|
121
121
|
# @return Array for valid properties with the reasons
|
122
122
|
def list_invalid_properties
|
123
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
123
124
|
invalid_properties = Array.new
|
124
125
|
invalid_properties
|
125
126
|
end
|
@@ -127,6 +128,7 @@ module CityPayApiClient
|
|
127
128
|
# Check to see if the all the properties in the model are valid
|
128
129
|
# @return true if the model is valid
|
129
130
|
def valid?
|
131
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
130
132
|
true
|
131
133
|
end
|
132
134
|
|
@@ -160,37 +162,30 @@ module CityPayApiClient
|
|
160
162
|
# @param [Hash] attributes Model attributes in the form of hash
|
161
163
|
# @return [Object] Returns the model itself
|
162
164
|
def self.build_from_hash(attributes)
|
163
|
-
new.build_from_hash(attributes)
|
164
|
-
end
|
165
|
-
|
166
|
-
# Builds the object from hash
|
167
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
168
|
-
# @return [Object] Returns the model itself
|
169
|
-
def build_from_hash(attributes)
|
170
165
|
return nil unless attributes.is_a?(Hash)
|
171
166
|
attributes = attributes.transform_keys(&:to_sym)
|
172
|
-
|
173
|
-
|
174
|
-
|
167
|
+
transformed_hash = {}
|
168
|
+
openapi_types.each_pair do |key, type|
|
169
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
170
|
+
transformed_hash["#{key}"] = nil
|
175
171
|
elsif type =~ /\AArray<(.*)>/i
|
176
172
|
# check to ensure the input is an array given that the attribute
|
177
173
|
# is documented as an array but the input is not
|
178
|
-
if attributes[
|
179
|
-
|
174
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
175
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
180
176
|
end
|
181
|
-
elsif !attributes[
|
182
|
-
|
177
|
+
elsif !attributes[attribute_map[key]].nil?
|
178
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
183
179
|
end
|
184
180
|
end
|
185
|
-
|
186
|
-
self
|
181
|
+
new(transformed_hash)
|
187
182
|
end
|
188
183
|
|
189
184
|
# Deserializes the data based on type
|
190
185
|
# @param string type Data type
|
191
186
|
# @param string value Value to be deserialized
|
192
187
|
# @return [Object] Deserialized data
|
193
|
-
def _deserialize(type, value)
|
188
|
+
def self._deserialize(type, value)
|
194
189
|
case type.to_sym
|
195
190
|
when :Time
|
196
191
|
Time.parse(value)
|
@@ -225,7 +220,7 @@ module CityPayApiClient
|
|
225
220
|
else # model
|
226
221
|
# models (e.g. Pet) or oneOf
|
227
222
|
klass = CityPayApiClient.const_get(type)
|
228
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
223
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
229
224
|
end
|
230
225
|
end
|
231
226
|
|
@@ -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
|
|
@@ -128,6 +128,7 @@ module CityPayApiClient
|
|
128
128
|
# Show invalid properties with the reasons. Usually used together with valid?
|
129
129
|
# @return Array for valid properties with the reasons
|
130
130
|
def list_invalid_properties
|
131
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
131
132
|
invalid_properties = Array.new
|
132
133
|
invalid_properties
|
133
134
|
end
|
@@ -135,6 +136,7 @@ module CityPayApiClient
|
|
135
136
|
# Check to see if the all the properties in the model are valid
|
136
137
|
# @return true if the model is valid
|
137
138
|
def valid?
|
139
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
138
140
|
true
|
139
141
|
end
|
140
142
|
|
@@ -169,37 +171,30 @@ module CityPayApiClient
|
|
169
171
|
# @param [Hash] attributes Model attributes in the form of hash
|
170
172
|
# @return [Object] Returns the model itself
|
171
173
|
def self.build_from_hash(attributes)
|
172
|
-
new.build_from_hash(attributes)
|
173
|
-
end
|
174
|
-
|
175
|
-
# Builds the object from hash
|
176
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
177
|
-
# @return [Object] Returns the model itself
|
178
|
-
def build_from_hash(attributes)
|
179
174
|
return nil unless attributes.is_a?(Hash)
|
180
175
|
attributes = attributes.transform_keys(&:to_sym)
|
181
|
-
|
182
|
-
|
183
|
-
|
176
|
+
transformed_hash = {}
|
177
|
+
openapi_types.each_pair do |key, type|
|
178
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
179
|
+
transformed_hash["#{key}"] = nil
|
184
180
|
elsif type =~ /\AArray<(.*)>/i
|
185
181
|
# check to ensure the input is an array given that the attribute
|
186
182
|
# is documented as an array but the input is not
|
187
|
-
if attributes[
|
188
|
-
|
183
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
184
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
189
185
|
end
|
190
|
-
elsif !attributes[
|
191
|
-
|
186
|
+
elsif !attributes[attribute_map[key]].nil?
|
187
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
192
188
|
end
|
193
189
|
end
|
194
|
-
|
195
|
-
self
|
190
|
+
new(transformed_hash)
|
196
191
|
end
|
197
192
|
|
198
193
|
# Deserializes the data based on type
|
199
194
|
# @param string type Data type
|
200
195
|
# @param string value Value to be deserialized
|
201
196
|
# @return [Object] Deserialized data
|
202
|
-
def _deserialize(type, value)
|
197
|
+
def self._deserialize(type, value)
|
203
198
|
case type.to_sym
|
204
199
|
when :Time
|
205
200
|
Time.parse(value)
|
@@ -234,7 +229,7 @@ module CityPayApiClient
|
|
234
229
|
else # model
|
235
230
|
# models (e.g. Pet) or oneOf
|
236
231
|
klass = CityPayApiClient.const_get(type)
|
237
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
232
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
238
233
|
end
|
239
234
|
end
|
240
235
|
|
@@ -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
|
|
@@ -258,6 +258,7 @@ module CityPayApiClient
|
|
258
258
|
# Show invalid properties with the reasons. Usually used together with valid?
|
259
259
|
# @return Array for valid properties with the reasons
|
260
260
|
def list_invalid_properties
|
261
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
261
262
|
invalid_properties = Array.new
|
262
263
|
invalid_properties
|
263
264
|
end
|
@@ -265,6 +266,7 @@ module CityPayApiClient
|
|
265
266
|
# Check to see if the all the properties in the model are valid
|
266
267
|
# @return true if the model is valid
|
267
268
|
def valid?
|
269
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
268
270
|
true
|
269
271
|
end
|
270
272
|
|
@@ -313,37 +315,30 @@ module CityPayApiClient
|
|
313
315
|
# @param [Hash] attributes Model attributes in the form of hash
|
314
316
|
# @return [Object] Returns the model itself
|
315
317
|
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
318
|
return nil unless attributes.is_a?(Hash)
|
324
319
|
attributes = attributes.transform_keys(&:to_sym)
|
325
|
-
|
326
|
-
|
327
|
-
|
320
|
+
transformed_hash = {}
|
321
|
+
openapi_types.each_pair do |key, type|
|
322
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
323
|
+
transformed_hash["#{key}"] = nil
|
328
324
|
elsif type =~ /\AArray<(.*)>/i
|
329
325
|
# check to ensure the input is an array given that the attribute
|
330
326
|
# is documented as an array but the input is not
|
331
|
-
if attributes[
|
332
|
-
|
327
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
328
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
333
329
|
end
|
334
|
-
elsif !attributes[
|
335
|
-
|
330
|
+
elsif !attributes[attribute_map[key]].nil?
|
331
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
336
332
|
end
|
337
333
|
end
|
338
|
-
|
339
|
-
self
|
334
|
+
new(transformed_hash)
|
340
335
|
end
|
341
336
|
|
342
337
|
# Deserializes the data based on type
|
343
338
|
# @param string type Data type
|
344
339
|
# @param string value Value to be deserialized
|
345
340
|
# @return [Object] Deserialized data
|
346
|
-
def _deserialize(type, value)
|
341
|
+
def self._deserialize(type, value)
|
347
342
|
case type.to_sym
|
348
343
|
when :Time
|
349
344
|
Time.parse(value)
|
@@ -378,7 +373,7 @@ module CityPayApiClient
|
|
378
373
|
else # model
|
379
374
|
# models (e.g. Pet) or oneOf
|
380
375
|
klass = CityPayApiClient.const_get(type)
|
381
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
376
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
382
377
|
end
|
383
378
|
end
|
384
379
|
|