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
|
|
@@ -14,8 +14,6 @@ require 'time'
|
|
14
14
|
|
15
15
|
module CityPayApiClient
|
16
16
|
class Decision
|
17
|
-
attr_accessor :authen_required
|
18
|
-
|
19
17
|
attr_accessor :auth_response
|
20
18
|
|
21
19
|
attr_accessor :request_challenged
|
@@ -23,7 +21,6 @@ module CityPayApiClient
|
|
23
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
24
22
|
def self.attribute_map
|
25
23
|
{
|
26
|
-
:'authen_required' => :'AuthenRequired',
|
27
24
|
:'auth_response' => :'AuthResponse',
|
28
25
|
:'request_challenged' => :'RequestChallenged'
|
29
26
|
}
|
@@ -37,7 +34,6 @@ module CityPayApiClient
|
|
37
34
|
# Attribute type mapping.
|
38
35
|
def self.openapi_types
|
39
36
|
{
|
40
|
-
:'authen_required' => :'AuthenRequired',
|
41
37
|
:'auth_response' => :'AuthResponse',
|
42
38
|
:'request_challenged' => :'RequestChallenged'
|
43
39
|
}
|
@@ -64,10 +60,6 @@ module CityPayApiClient
|
|
64
60
|
h[k.to_sym] = v
|
65
61
|
}
|
66
62
|
|
67
|
-
if attributes.key?(:'authen_required')
|
68
|
-
self.authen_required = attributes[:'authen_required']
|
69
|
-
end
|
70
|
-
|
71
63
|
if attributes.key?(:'auth_response')
|
72
64
|
self.auth_response = attributes[:'auth_response']
|
73
65
|
end
|
@@ -80,6 +72,7 @@ module CityPayApiClient
|
|
80
72
|
# Show invalid properties with the reasons. Usually used together with valid?
|
81
73
|
# @return Array for valid properties with the reasons
|
82
74
|
def list_invalid_properties
|
75
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
83
76
|
invalid_properties = Array.new
|
84
77
|
invalid_properties
|
85
78
|
end
|
@@ -87,6 +80,7 @@ module CityPayApiClient
|
|
87
80
|
# Check to see if the all the properties in the model are valid
|
88
81
|
# @return true if the model is valid
|
89
82
|
def valid?
|
83
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
90
84
|
true
|
91
85
|
end
|
92
86
|
|
@@ -95,7 +89,6 @@ module CityPayApiClient
|
|
95
89
|
def ==(o)
|
96
90
|
return true if self.equal?(o)
|
97
91
|
self.class == o.class &&
|
98
|
-
authen_required == o.authen_required &&
|
99
92
|
auth_response == o.auth_response &&
|
100
93
|
request_challenged == o.request_challenged
|
101
94
|
end
|
@@ -109,44 +102,37 @@ module CityPayApiClient
|
|
109
102
|
# Calculates hash code according to all attributes.
|
110
103
|
# @return [Integer] Hash code
|
111
104
|
def hash
|
112
|
-
[
|
105
|
+
[auth_response, request_challenged].hash
|
113
106
|
end
|
114
107
|
|
115
108
|
# Builds the object from hash
|
116
109
|
# @param [Hash] attributes Model attributes in the form of hash
|
117
110
|
# @return [Object] Returns the model itself
|
118
111
|
def self.build_from_hash(attributes)
|
119
|
-
new.build_from_hash(attributes)
|
120
|
-
end
|
121
|
-
|
122
|
-
# Builds the object from hash
|
123
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
-
# @return [Object] Returns the model itself
|
125
|
-
def build_from_hash(attributes)
|
126
112
|
return nil unless attributes.is_a?(Hash)
|
127
113
|
attributes = attributes.transform_keys(&:to_sym)
|
128
|
-
|
129
|
-
|
130
|
-
|
114
|
+
transformed_hash = {}
|
115
|
+
openapi_types.each_pair do |key, type|
|
116
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
117
|
+
transformed_hash["#{key}"] = nil
|
131
118
|
elsif type =~ /\AArray<(.*)>/i
|
132
119
|
# check to ensure the input is an array given that the attribute
|
133
120
|
# is documented as an array but the input is not
|
134
|
-
if attributes[
|
135
|
-
|
121
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
122
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
136
123
|
end
|
137
|
-
elsif !attributes[
|
138
|
-
|
124
|
+
elsif !attributes[attribute_map[key]].nil?
|
125
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
139
126
|
end
|
140
127
|
end
|
141
|
-
|
142
|
-
self
|
128
|
+
new(transformed_hash)
|
143
129
|
end
|
144
130
|
|
145
131
|
# Deserializes the data based on type
|
146
132
|
# @param string type Data type
|
147
133
|
# @param string value Value to be deserialized
|
148
134
|
# @return [Object] Deserialized data
|
149
|
-
def _deserialize(type, value)
|
135
|
+
def self._deserialize(type, value)
|
150
136
|
case type.to_sym
|
151
137
|
when :Time
|
152
138
|
Time.parse(value)
|
@@ -181,7 +167,7 @@ module CityPayApiClient
|
|
181
167
|
else # model
|
182
168
|
# models (e.g. Pet) or oneOf
|
183
169
|
klass = CityPayApiClient.const_get(type)
|
184
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
170
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
185
171
|
end
|
186
172
|
end
|
187
173
|
|
@@ -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,7 +17,7 @@ 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
|
attr_accessor :bill_to
|
@@ -25,16 +25,16 @@ module CityPayApiClient
|
|
25
25
|
# The card number (PAN) with a variable length to a maximum of 21 digits in numerical form. Any non numeric characters will be stripped out of the card number, this includes whitespace or separators internal of the provided value. The card number must be treated as sensitive data. We only provide an obfuscated value in logging and reporting. The plaintext value is encrypted in our database using AES 256 GMC bit encryption for settlement or refund purposes. When providing the card number to our gateway through the authorisation API you will be handling the card data on your application. This will require further PCI controls to be in place and this value must never be stored.
|
26
26
|
attr_accessor :cardnumber
|
27
27
|
|
28
|
-
# 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
|
28
|
+
# 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.
|
29
29
|
attr_accessor :csc
|
30
30
|
|
31
|
-
# A policy value which determines whether a CSC policy is enforced or bypassed. Values are
|
31
|
+
# 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.
|
32
32
|
attr_accessor :csc_policy
|
33
33
|
|
34
34
|
# The processing currency for the transaction. Will default to the merchant account currency.
|
35
35
|
attr_accessor :currency
|
36
36
|
|
37
|
-
# 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
|
37
|
+
# 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.
|
38
38
|
attr_accessor :duplicate_policy
|
39
39
|
|
40
40
|
# The month of expiry of the card. The month value should be a numerical value between 1 and 12.
|
@@ -49,7 +49,7 @@ module CityPayApiClient
|
|
49
49
|
# A message authentication code ensures the data is authentic and that the intended amount has not been tampered with. The mac value is generated using a hash-based mac value. The following algorithm is used. - A key (k) is derived from your licence key - A value (v) is produced by concatenating the nonce, amount value and identifier, such as a purchase with nonce `0123456789ABCDEF` an amount of £275.95 and an identifier of OD-12345678 would become `0123456789ABCDEF27595OD-12345678` and extracting the UTF-8 byte values - The result from HMAC_SHA256(k, v) is hex-encoded (upper-case) - For instance, a licence key of `LK123456789`, a nonce of `0123456789ABCDEF`, an amount of `27595` and an identifier of `OD-12345678` would generate a MAC of `163DBAB194D743866A9BCC7FC9C8A88FCD99C6BBBF08D619291212D1B91EE12E`.
|
50
50
|
attr_accessor :mac
|
51
51
|
|
52
|
-
# A policy value which determines whether an AVS address policy is enforced, bypassed or ignored. Values are
|
52
|
+
# 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.
|
53
53
|
attr_accessor :match_avsa
|
54
54
|
|
55
55
|
# The card holder name as appears on the card such as MR N E BODY. Required for some acquirers.
|
@@ -66,6 +66,8 @@ module CityPayApiClient
|
|
66
66
|
|
67
67
|
attr_accessor :ship_to
|
68
68
|
|
69
|
+
attr_accessor :tag
|
70
|
+
|
69
71
|
attr_accessor :threedsecure
|
70
72
|
|
71
73
|
# Further information that can be added to the transaction will display in reporting. Can be used for flexible values such as operator id.
|
@@ -95,6 +97,7 @@ module CityPayApiClient
|
|
95
97
|
:'redirect_failure' => :'redirect_failure',
|
96
98
|
:'redirect_success' => :'redirect_success',
|
97
99
|
:'ship_to' => :'ship_to',
|
100
|
+
:'tag' => :'tag',
|
98
101
|
:'threedsecure' => :'threedsecure',
|
99
102
|
:'trans_info' => :'trans_info',
|
100
103
|
:'trans_type' => :'trans_type'
|
@@ -127,6 +130,7 @@ module CityPayApiClient
|
|
127
130
|
:'redirect_failure' => :'String',
|
128
131
|
:'redirect_success' => :'String',
|
129
132
|
:'ship_to' => :'ContactDetails',
|
133
|
+
:'tag' => :'Array<String>',
|
130
134
|
:'threedsecure' => :'ThreeDSecure',
|
131
135
|
:'trans_info' => :'String',
|
132
136
|
:'trans_type' => :'String'
|
@@ -156,6 +160,8 @@ module CityPayApiClient
|
|
156
160
|
|
157
161
|
if attributes.key?(:'amount')
|
158
162
|
self.amount = attributes[:'amount']
|
163
|
+
else
|
164
|
+
self.amount = nil
|
159
165
|
end
|
160
166
|
|
161
167
|
if attributes.key?(:'avs_postcode_policy')
|
@@ -168,6 +174,8 @@ module CityPayApiClient
|
|
168
174
|
|
169
175
|
if attributes.key?(:'cardnumber')
|
170
176
|
self.cardnumber = attributes[:'cardnumber']
|
177
|
+
else
|
178
|
+
self.cardnumber = nil
|
171
179
|
end
|
172
180
|
|
173
181
|
if attributes.key?(:'csc')
|
@@ -188,18 +196,26 @@ module CityPayApiClient
|
|
188
196
|
|
189
197
|
if attributes.key?(:'expmonth')
|
190
198
|
self.expmonth = attributes[:'expmonth']
|
199
|
+
else
|
200
|
+
self.expmonth = nil
|
191
201
|
end
|
192
202
|
|
193
203
|
if attributes.key?(:'expyear')
|
194
204
|
self.expyear = attributes[:'expyear']
|
205
|
+
else
|
206
|
+
self.expyear = nil
|
195
207
|
end
|
196
208
|
|
197
209
|
if attributes.key?(:'identifier')
|
198
210
|
self.identifier = attributes[:'identifier']
|
211
|
+
else
|
212
|
+
self.identifier = nil
|
199
213
|
end
|
200
214
|
|
201
215
|
if attributes.key?(:'mac')
|
202
216
|
self.mac = attributes[:'mac']
|
217
|
+
else
|
218
|
+
self.mac = nil
|
203
219
|
end
|
204
220
|
|
205
221
|
if attributes.key?(:'match_avsa')
|
@@ -226,6 +242,12 @@ module CityPayApiClient
|
|
226
242
|
self.ship_to = attributes[:'ship_to']
|
227
243
|
end
|
228
244
|
|
245
|
+
if attributes.key?(:'tag')
|
246
|
+
if (value = attributes[:'tag']).is_a?(Array)
|
247
|
+
self.tag = value
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
229
251
|
if attributes.key?(:'threedsecure')
|
230
252
|
self.threedsecure = attributes[:'threedsecure']
|
231
253
|
end
|
@@ -242,6 +264,7 @@ module CityPayApiClient
|
|
242
264
|
# Show invalid properties with the reasons. Usually used together with valid?
|
243
265
|
# @return Array for valid properties with the reasons
|
244
266
|
def list_invalid_properties
|
267
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
245
268
|
invalid_properties = Array.new
|
246
269
|
if @amount.nil?
|
247
270
|
invalid_properties.push('invalid value for "amount", amount cannot be nil.')
|
@@ -337,6 +360,7 @@ module CityPayApiClient
|
|
337
360
|
# Check to see if the all the properties in the model are valid
|
338
361
|
# @return true if the model is valid
|
339
362
|
def valid?
|
363
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
340
364
|
return false if @amount.nil?
|
341
365
|
return false if @cardnumber.nil?
|
342
366
|
return false if @cardnumber.to_s.length > 22
|
@@ -393,11 +417,15 @@ module CityPayApiClient
|
|
393
417
|
# Custom attribute writer method with validation
|
394
418
|
# @param [Object] csc Value to be assigned
|
395
419
|
def csc=(csc)
|
396
|
-
if
|
420
|
+
if csc.nil?
|
421
|
+
fail ArgumentError, 'csc cannot be nil'
|
422
|
+
end
|
423
|
+
|
424
|
+
if csc.to_s.length > 4
|
397
425
|
fail ArgumentError, 'invalid value for "csc", the character length must be smaller than or equal to 4.'
|
398
426
|
end
|
399
427
|
|
400
|
-
if
|
428
|
+
if csc.to_s.length < 3
|
401
429
|
fail ArgumentError, 'invalid value for "csc", the character length must be great than or equal to 3.'
|
402
430
|
end
|
403
431
|
|
@@ -407,11 +435,15 @@ module CityPayApiClient
|
|
407
435
|
# Custom attribute writer method with validation
|
408
436
|
# @param [Object] currency Value to be assigned
|
409
437
|
def currency=(currency)
|
410
|
-
if
|
438
|
+
if currency.nil?
|
439
|
+
fail ArgumentError, 'currency cannot be nil'
|
440
|
+
end
|
441
|
+
|
442
|
+
if currency.to_s.length > 3
|
411
443
|
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
412
444
|
end
|
413
445
|
|
414
|
-
if
|
446
|
+
if currency.to_s.length < 3
|
415
447
|
fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 3.'
|
416
448
|
end
|
417
449
|
|
@@ -475,11 +507,15 @@ module CityPayApiClient
|
|
475
507
|
# Custom attribute writer method with validation
|
476
508
|
# @param [Object] name_on_card Value to be assigned
|
477
509
|
def name_on_card=(name_on_card)
|
478
|
-
if
|
510
|
+
if name_on_card.nil?
|
511
|
+
fail ArgumentError, 'name_on_card cannot be nil'
|
512
|
+
end
|
513
|
+
|
514
|
+
if name_on_card.to_s.length > 45
|
479
515
|
fail ArgumentError, 'invalid value for "name_on_card", the character length must be smaller than or equal to 45.'
|
480
516
|
end
|
481
517
|
|
482
|
-
if
|
518
|
+
if name_on_card.to_s.length < 2
|
483
519
|
fail ArgumentError, 'invalid value for "name_on_card", the character length must be great than or equal to 2.'
|
484
520
|
end
|
485
521
|
|
@@ -489,7 +525,11 @@ module CityPayApiClient
|
|
489
525
|
# Custom attribute writer method with validation
|
490
526
|
# @param [Object] trans_info Value to be assigned
|
491
527
|
def trans_info=(trans_info)
|
492
|
-
if
|
528
|
+
if trans_info.nil?
|
529
|
+
fail ArgumentError, 'trans_info cannot be nil'
|
530
|
+
end
|
531
|
+
|
532
|
+
if trans_info.to_s.length > 50
|
493
533
|
fail ArgumentError, 'invalid value for "trans_info", the character length must be smaller than or equal to 50.'
|
494
534
|
end
|
495
535
|
|
@@ -499,7 +539,11 @@ module CityPayApiClient
|
|
499
539
|
# Custom attribute writer method with validation
|
500
540
|
# @param [Object] trans_type Value to be assigned
|
501
541
|
def trans_type=(trans_type)
|
502
|
-
if
|
542
|
+
if trans_type.nil?
|
543
|
+
fail ArgumentError, 'trans_type cannot be nil'
|
544
|
+
end
|
545
|
+
|
546
|
+
if trans_type.to_s.length > 1
|
503
547
|
fail ArgumentError, 'invalid value for "trans_type", the character length must be smaller than or equal to 1.'
|
504
548
|
end
|
505
549
|
|
@@ -529,6 +573,7 @@ module CityPayApiClient
|
|
529
573
|
redirect_failure == o.redirect_failure &&
|
530
574
|
redirect_success == o.redirect_success &&
|
531
575
|
ship_to == o.ship_to &&
|
576
|
+
tag == o.tag &&
|
532
577
|
threedsecure == o.threedsecure &&
|
533
578
|
trans_info == o.trans_info &&
|
534
579
|
trans_type == o.trans_type
|
@@ -543,44 +588,37 @@ module CityPayApiClient
|
|
543
588
|
# Calculates hash code according to all attributes.
|
544
589
|
# @return [Integer] Hash code
|
545
590
|
def hash
|
546
|
-
[amount, avs_postcode_policy, bill_to, cardnumber, csc, csc_policy, currency, duplicate_policy, expmonth, expyear, identifier, mac, match_avsa, name_on_card, nonce, redirect_failure, redirect_success, ship_to, threedsecure, trans_info, trans_type].hash
|
591
|
+
[amount, avs_postcode_policy, bill_to, cardnumber, csc, csc_policy, currency, duplicate_policy, expmonth, expyear, identifier, mac, match_avsa, name_on_card, nonce, redirect_failure, redirect_success, ship_to, tag, threedsecure, trans_info, trans_type].hash
|
547
592
|
end
|
548
593
|
|
549
594
|
# Builds the object from hash
|
550
595
|
# @param [Hash] attributes Model attributes in the form of hash
|
551
596
|
# @return [Object] Returns the model itself
|
552
597
|
def self.build_from_hash(attributes)
|
553
|
-
new.build_from_hash(attributes)
|
554
|
-
end
|
555
|
-
|
556
|
-
# Builds the object from hash
|
557
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
558
|
-
# @return [Object] Returns the model itself
|
559
|
-
def build_from_hash(attributes)
|
560
598
|
return nil unless attributes.is_a?(Hash)
|
561
599
|
attributes = attributes.transform_keys(&:to_sym)
|
562
|
-
|
563
|
-
|
564
|
-
|
600
|
+
transformed_hash = {}
|
601
|
+
openapi_types.each_pair do |key, type|
|
602
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
603
|
+
transformed_hash["#{key}"] = nil
|
565
604
|
elsif type =~ /\AArray<(.*)>/i
|
566
605
|
# check to ensure the input is an array given that the attribute
|
567
606
|
# is documented as an array but the input is not
|
568
|
-
if attributes[
|
569
|
-
|
607
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
608
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
570
609
|
end
|
571
|
-
elsif !attributes[
|
572
|
-
|
610
|
+
elsif !attributes[attribute_map[key]].nil?
|
611
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
573
612
|
end
|
574
613
|
end
|
575
|
-
|
576
|
-
self
|
614
|
+
new(transformed_hash)
|
577
615
|
end
|
578
616
|
|
579
617
|
# Deserializes the data based on type
|
580
618
|
# @param string type Data type
|
581
619
|
# @param string value Value to be deserialized
|
582
620
|
# @return [Object] Deserialized data
|
583
|
-
def _deserialize(type, value)
|
621
|
+
def self._deserialize(type, value)
|
584
622
|
case type.to_sym
|
585
623
|
when :Time
|
586
624
|
Time.parse(value)
|
@@ -615,7 +653,7 @@ module CityPayApiClient
|
|
615
653
|
else # model
|
616
654
|
# models (e.g. Pet) or oneOf
|
617
655
|
klass = CityPayApiClient.const_get(type)
|
618
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
656
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
619
657
|
end
|
620
658
|
end
|
621
659
|
|
@@ -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
|
|
@@ -92,6 +92,7 @@ module CityPayApiClient
|
|
92
92
|
# Show invalid properties with the reasons. Usually used together with valid?
|
93
93
|
# @return Array for valid properties with the reasons
|
94
94
|
def list_invalid_properties
|
95
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
95
96
|
invalid_properties = Array.new
|
96
97
|
invalid_properties
|
97
98
|
end
|
@@ -99,6 +100,7 @@ module CityPayApiClient
|
|
99
100
|
# Check to see if the all the properties in the model are valid
|
100
101
|
# @return true if the model is valid
|
101
102
|
def valid?
|
103
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
102
104
|
true
|
103
105
|
end
|
104
106
|
|
@@ -129,37 +131,30 @@ module CityPayApiClient
|
|
129
131
|
# @param [Hash] attributes Model attributes in the form of hash
|
130
132
|
# @return [Object] Returns the model itself
|
131
133
|
def self.build_from_hash(attributes)
|
132
|
-
new.build_from_hash(attributes)
|
133
|
-
end
|
134
|
-
|
135
|
-
# Builds the object from hash
|
136
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
-
# @return [Object] Returns the model itself
|
138
|
-
def build_from_hash(attributes)
|
139
134
|
return nil unless attributes.is_a?(Hash)
|
140
135
|
attributes = attributes.transform_keys(&:to_sym)
|
141
|
-
|
142
|
-
|
143
|
-
|
136
|
+
transformed_hash = {}
|
137
|
+
openapi_types.each_pair do |key, type|
|
138
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
139
|
+
transformed_hash["#{key}"] = nil
|
144
140
|
elsif type =~ /\AArray<(.*)>/i
|
145
141
|
# check to ensure the input is an array given that the attribute
|
146
142
|
# is documented as an array but the input is not
|
147
|
-
if attributes[
|
148
|
-
|
143
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
144
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
149
145
|
end
|
150
|
-
elsif !attributes[
|
151
|
-
|
146
|
+
elsif !attributes[attribute_map[key]].nil?
|
147
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
152
148
|
end
|
153
149
|
end
|
154
|
-
|
155
|
-
self
|
150
|
+
new(transformed_hash)
|
156
151
|
end
|
157
152
|
|
158
153
|
# Deserializes the data based on type
|
159
154
|
# @param string type Data type
|
160
155
|
# @param string value Value to be deserialized
|
161
156
|
# @return [Object] Deserialized data
|
162
|
-
def _deserialize(type, value)
|
157
|
+
def self._deserialize(type, value)
|
163
158
|
case type.to_sym
|
164
159
|
when :Time
|
165
160
|
Time.parse(value)
|
@@ -194,7 +189,7 @@ module CityPayApiClient
|
|
194
189
|
else # model
|
195
190
|
# models (e.g. Pet) or oneOf
|
196
191
|
klass = CityPayApiClient.const_get(type)
|
197
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
192
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
198
193
|
end
|
199
194
|
end
|
200
195
|
|