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