citypay_api_client 1.0.3 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +111 -39
- data/citypay_api_client.gemspec +5 -5
- data/docs/AccountCreate.md +10 -9
- data/docs/AccountStatus.md +8 -7
- data/docs/Acknowledgement.md +14 -13
- data/docs/AclCheckRequest.md +18 -0
- data/docs/AclCheckResponseModel.md +24 -0
- data/docs/AirlineAdvice.md +38 -37
- data/docs/AirlineSegment.md +22 -21
- data/docs/AuthReference.md +34 -33
- data/docs/AuthReferences.md +8 -7
- data/docs/AuthRequest.md +52 -49
- data/docs/AuthResponse.md +64 -59
- data/docs/AuthenRequired.md +12 -11
- data/docs/AuthorisationAndPaymentApi.md +850 -0
- data/docs/Batch.md +22 -0
- data/docs/BatchProcessingApi.md +218 -0
- data/docs/BatchReportRequest.md +20 -0
- data/docs/BatchReportResponseModel.md +28 -0
- data/docs/BatchTransaction.md +24 -0
- data/docs/BatchTransactionResultModel.md +44 -0
- data/docs/Bin.md +34 -0
- data/docs/BinLookup.md +18 -0
- data/docs/CResAuthRequest.md +8 -7
- data/docs/CaptureRequest.md +18 -17
- data/docs/Card.md +46 -41
- data/docs/CardHolderAccount.md +24 -21
- data/docs/CardHolderAccountApi.md +387 -111
- data/docs/CardStatus.md +10 -9
- data/docs/ChargeRequest.md +38 -31
- data/docs/CheckBatchStatus.md +20 -0
- data/docs/CheckBatchStatusResponse.md +18 -0
- data/docs/ContactDetails.md +32 -31
- data/docs/Decision.md +12 -11
- data/docs/DirectPostApi.md +389 -0
- data/docs/DirectPostRequest.md +60 -0
- data/docs/DirectTokenAuthRequest.md +24 -0
- data/docs/DomainKeyCheckRequest.md +18 -0
- data/docs/DomainKeyRequest.md +22 -0
- data/docs/DomainKeyResponse.md +26 -0
- data/docs/Error.md +16 -13
- data/docs/EventDataModel.md +26 -0
- data/docs/Exists.md +22 -0
- data/docs/ExternalMPI.md +16 -15
- data/docs/ListMerchantsResponse.md +12 -11
- data/docs/MCC6012.md +14 -13
- data/docs/Merchant.md +16 -15
- data/docs/OperationalFunctionsApi.md +375 -0
- data/docs/PaResAuthRequest.md +10 -9
- data/docs/PaylinkAddress.md +30 -0
- data/docs/PaylinkAdjustmentRequest.md +22 -0
- data/docs/PaylinkApi.md +806 -0
- data/docs/PaylinkAttachmentRequest.md +26 -0
- data/docs/PaylinkAttachmentResult.md +22 -0
- data/docs/PaylinkBillPaymentTokenRequest.md +32 -0
- data/docs/PaylinkCardHolder.md +36 -0
- data/docs/PaylinkCart.md +30 -0
- data/docs/PaylinkCartItemModel.md +32 -0
- data/docs/PaylinkConfig.md +60 -0
- data/docs/PaylinkCustomParam.md +38 -0
- data/docs/PaylinkEmailNotificationPath.md +26 -0
- data/docs/PaylinkErrorCode.md +20 -0
- data/docs/PaylinkFieldGuardModel.md +30 -0
- data/docs/PaylinkPartPayments.md +28 -0
- data/docs/PaylinkSMSNotificationPath.md +20 -0
- data/docs/PaylinkStateEvent.md +22 -0
- data/docs/PaylinkTokenCreated.md +44 -0
- data/docs/PaylinkTokenRequestModel.md +42 -0
- data/docs/PaylinkTokenStatus.md +72 -0
- data/docs/PaylinkTokenStatusChangeRequest.md +26 -0
- data/docs/PaylinkTokenStatusChangeResponse.md +20 -0
- data/docs/PaylinkUI.md +24 -0
- data/docs/Ping.md +8 -7
- data/docs/ProcessBatchRequest.md +24 -0
- data/docs/ProcessBatchResponse.md +20 -0
- data/docs/RefundRequest.md +26 -0
- data/docs/RegisterCard.md +16 -13
- data/docs/RequestChallenged.md +16 -15
- data/docs/RetrieveRequest.md +12 -11
- data/docs/ThreeDSecure.md +32 -15
- data/docs/TokenisationResponseModel.md +36 -0
- data/docs/VoidRequest.md +12 -13
- 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/.DS_Store +0 -0
- data/lib/citypay_api_client/api/authorisation_and_payment_api__.rb +565 -0
- data/lib/citypay_api_client/api/batch_processing_api__.rb +225 -0
- data/lib/citypay_api_client/api/{card_holder_account_api.rb → card_holder_account_api__.rb} +136 -46
- data/lib/citypay_api_client/api/direct_post_api__.rb +373 -0
- data/lib/citypay_api_client/api/operational_functions_api__.rb +356 -0
- data/lib/citypay_api_client/api/paylink_api__.rb +614 -0
- data/lib/citypay_api_client/api_client.rb +72 -70
- data/lib/citypay_api_client/api_error.rb +3 -2
- data/lib/citypay_api_client/configuration.rb +74 -17
- data/lib/citypay_api_client/models/account_create.rb +33 -23
- data/lib/citypay_api_client/models/account_status.rb +31 -23
- data/lib/citypay_api_client/models/acknowledgement.rb +43 -27
- data/lib/citypay_api_client/models/acl_check_request.rb +221 -0
- data/lib/citypay_api_client/models/acl_check_response_model.rb +244 -0
- data/lib/citypay_api_client/models/airline_advice.rb +63 -34
- data/lib/citypay_api_client/models/airline_segment.rb +51 -25
- data/lib/citypay_api_client/models/auth_reference.rb +80 -31
- data/lib/citypay_api_client/models/auth_references.rb +31 -23
- data/lib/citypay_api_client/models/auth_request.rb +137 -56
- data/lib/citypay_api_client/models/auth_response.rb +83 -123
- data/lib/citypay_api_client/models/authen_required.rb +31 -23
- data/lib/citypay_api_client/models/batch.rb +267 -0
- data/lib/citypay_api_client/models/batch_report_request.rb +278 -0
- data/lib/citypay_api_client/models/batch_report_response_model.rb +364 -0
- data/lib/citypay_api_client/models/batch_transaction.rb +324 -0
- data/lib/citypay_api_client/models/batch_transaction_result_model.rb +452 -0
- data/lib/citypay_api_client/models/bin.rb +294 -0
- data/lib/citypay_api_client/models/bin_lookup.rb +231 -0
- data/lib/citypay_api_client/models/c_res_auth_request.rb +31 -23
- data/lib/citypay_api_client/models/capture_request.rb +59 -38
- data/lib/citypay_api_client/models/card.rb +93 -29
- data/lib/citypay_api_client/models/card_holder_account.rb +49 -27
- data/lib/citypay_api_client/models/card_status.rb +31 -23
- data/lib/citypay_api_client/models/charge_request.rb +154 -47
- data/lib/citypay_api_client/models/check_batch_status.rb +260 -0
- data/lib/citypay_api_client/models/check_batch_status_response.rb +215 -0
- data/lib/citypay_api_client/models/contact_details.rb +130 -52
- data/lib/citypay_api_client/models/decision.rb +31 -23
- data/lib/citypay_api_client/models/direct_post_request.rb +707 -0
- data/lib/citypay_api_client/models/direct_token_auth_request.rb +244 -0
- data/lib/citypay_api_client/models/domain_key_check_request.rb +249 -0
- data/lib/citypay_api_client/models/domain_key_request.rb +249 -0
- data/lib/citypay_api_client/models/domain_key_response.rb +297 -0
- data/lib/citypay_api_client/models/error.rb +57 -31
- data/lib/citypay_api_client/models/event_data_model.rb +254 -0
- data/lib/citypay_api_client/models/exists.rb +241 -0
- data/lib/citypay_api_client/models/external_mpi.rb +61 -27
- data/lib/citypay_api_client/models/list_merchants_response.rb +37 -25
- data/lib/citypay_api_client/models/mcc6012.rb +31 -23
- data/lib/citypay_api_client/models/merchant.rb +31 -23
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +36 -24
- data/lib/citypay_api_client/models/paylink_address.rb +425 -0
- data/lib/citypay_api_client/models/paylink_adjustment_request.rb +272 -0
- data/lib/citypay_api_client/models/paylink_attachment_request.rb +268 -0
- data/lib/citypay_api_client/models/paylink_attachment_result.rb +248 -0
- data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +289 -0
- data/lib/citypay_api_client/models/paylink_card_holder.rb +360 -0
- data/lib/citypay_api_client/models/paylink_cart.rb +275 -0
- data/lib/citypay_api_client/models/paylink_cart_item_model.rb +284 -0
- data/lib/citypay_api_client/models/paylink_config.rb +428 -0
- data/lib/citypay_api_client/models/paylink_custom_param.rb +321 -0
- data/lib/citypay_api_client/models/paylink_email_notification_path.rb +265 -0
- data/lib/citypay_api_client/models/paylink_error_code.rb +238 -0
- data/lib/citypay_api_client/models/paylink_field_guard_model.rb +274 -0
- data/lib/citypay_api_client/models/paylink_part_payments.rb +264 -0
- data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +231 -0
- data/lib/citypay_api_client/models/paylink_state_event.rb +234 -0
- data/lib/citypay_api_client/models/paylink_token_created.rb +365 -0
- data/lib/citypay_api_client/models/paylink_token_request_model.rb +427 -0
- data/lib/citypay_api_client/models/paylink_token_status.rb +485 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +269 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +232 -0
- data/lib/citypay_api_client/models/paylink_ui.rb +244 -0
- data/lib/citypay_api_client/models/ping.rb +37 -25
- data/lib/citypay_api_client/models/process_batch_request.rb +313 -0
- data/lib/citypay_api_client/models/process_batch_response.rb +231 -0
- data/lib/citypay_api_client/models/refund_request.rb +339 -0
- data/lib/citypay_api_client/models/register_card.rb +79 -27
- data/lib/citypay_api_client/models/request_challenged.rb +39 -31
- data/lib/citypay_api_client/models/retrieve_request.rb +39 -25
- data/lib/citypay_api_client/models/three_d_secure.rb +116 -28
- data/lib/citypay_api_client/models/tokenisation_response_model.rb +332 -0
- data/lib/citypay_api_client/models/void_request.rb +39 -37
- data/lib/citypay_api_client/utils/digest_utils.rb +18 -0
- data/lib/citypay_api_client/utils/direct_post_mac.rb +22 -0
- data/lib/citypay_api_client/version.rb +3 -4
- data/lib/citypay_api_client.rb +53 -6
- data/spec/.DS_Store +0 -0
- data/spec/api/authorisation_and_payment_api___spec.rb +130 -0
- data/spec/api/batch_processing_api___spec.rb +70 -0
- data/spec/api/{card_holder_account_api_spec.rb → card_holder_account_api___spec.rb} +15 -3
- data/spec/api/direct_post_api___spec.rb +98 -0
- data/spec/api/operational_functions_api___spec.rb +94 -0
- data/spec/api/paylink_api___spec.rb +131 -0
- data/spec/api_client_spec.rb +4 -4
- data/spec/configuration_spec.rb +5 -5
- data/spec/it_api_sandbox_spec.rb +117 -55
- data/spec/models/account_create_spec.rb +1 -2
- data/spec/models/account_status_spec.rb +2 -2
- data/spec/models/acknowledgement_spec.rb +7 -22
- data/spec/models/acl_check_request_spec.rb +33 -0
- data/spec/models/acl_check_response_model_spec.rb +51 -0
- data/spec/models/airline_advice_spec.rb +0 -2
- data/spec/models/airline_segment_spec.rb +0 -2
- data/spec/models/auth_references_spec.rb +7 -8
- data/spec/models/auth_request_spec.rb +0 -2
- data/spec/models/auth_response_spec.rb +77 -33
- data/spec/models/batch_report_request_spec.rb +37 -0
- data/spec/models/batch_report_response_model_spec.rb +61 -0
- data/spec/models/batch_spec.rb +43 -0
- data/spec/models/batch_transaction_result_model_spec.rb +85 -0
- data/spec/models/batch_transaction_spec.rb +49 -0
- data/spec/models/bin_lookup_spec.rb +31 -0
- data/spec/models/bin_spec.rb +81 -0
- data/spec/models/capture_request_spec.rb +0 -2
- data/spec/models/card_holder_account_spec.rb +8 -7
- data/spec/models/charge_request_spec.rb +0 -2
- data/spec/models/check_batch_status_response_spec.rb +45 -0
- data/spec/models/check_batch_status_spec.rb +39 -0
- data/spec/models/decision_spec.rb +1 -1
- data/spec/models/direct_post_request_spec.rb +151 -0
- data/spec/models/direct_token_auth_request_spec.rb +51 -0
- data/spec/models/domain_key_check_request_spec.rb +31 -0
- data/spec/models/domain_key_request_spec.rb +45 -0
- data/spec/models/domain_key_response_spec.rb +57 -0
- data/spec/models/event_data_model_spec.rb +57 -0
- data/spec/{api/operational_api_spec.rb → models/exists_spec.rb} +14 -20
- data/spec/models/list_merchants_response_spec.rb +2 -2
- data/spec/models/paylink_address_spec.rb +69 -0
- data/spec/models/paylink_adjustment_request_spec.rb +45 -0
- data/spec/models/paylink_attachment_request_spec.rb +45 -0
- data/spec/models/paylink_attachment_result_spec.rb +45 -0
- data/spec/models/paylink_bill_payment_token_request_spec.rb +63 -0
- data/spec/models/paylink_card_holder_spec.rb +87 -0
- data/spec/models/paylink_cart_item_model_spec.rb +75 -0
- data/spec/models/paylink_cart_spec.rb +69 -0
- data/spec/models/paylink_config_spec.rb +159 -0
- data/spec/models/paylink_custom_param_spec.rb +87 -0
- data/spec/models/paylink_email_notification_path_spec.rb +57 -0
- data/spec/models/paylink_error_code_spec.rb +39 -0
- data/spec/models/paylink_field_guard_model_spec.rb +45 -0
- data/spec/models/paylink_part_payments_spec.rb +63 -0
- data/spec/models/paylink_sms_notification_path_spec.rb +39 -0
- data/spec/models/paylink_state_event_spec.rb +45 -0
- data/spec/models/paylink_token_created_spec.rb +111 -0
- data/spec/models/paylink_token_request_model_spec.rb +91 -0
- data/spec/models/paylink_token_status_change_request_spec.rb +57 -0
- data/spec/models/paylink_token_status_change_response_spec.rb +39 -0
- data/spec/models/paylink_token_status_spec.rb +195 -0
- data/spec/models/paylink_ui_spec.rb +51 -0
- data/spec/models/process_batch_request_spec.rb +49 -0
- data/spec/models/process_batch_response_spec.rb +39 -0
- data/spec/models/refund_request_spec.rb +62 -0
- data/spec/models/register_card_spec.rb +0 -2
- data/spec/models/tokenisation_response_model_spec.rb +87 -0
- data/spec/spec_helper.rb +2 -2
- data/spec/utils/direct_post_mac_spec.rb +13 -0
- metadata +230 -44
- data/Gemfile.lock +0 -70
- data/docs/OperationalApi.md +0 -112
- data/docs/PaymentProcessingApi.md +0 -320
- data/git_push.sh +0 -58
- data/lib/citypay_api_client/api/operational_api.rb +0 -147
- data/lib/citypay_api_client/api/payment_processing_api.rb +0 -405
- data/lib/citypay_api_client/test.rb +0 -20
- data/spec/api/payment_processing_api_spec.rb +0 -106
@@ -1,15 +1,16 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
|
5
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'time'
|
13
14
|
|
14
15
|
module CityPayApiClient
|
15
16
|
class RequestChallenged
|
@@ -22,8 +23,8 @@ module CityPayApiClient
|
|
22
23
|
# The merchant id that processed this transaction.
|
23
24
|
attr_accessor :merchantid
|
24
25
|
|
25
|
-
# The 3DSv2 trans id reference for the challenge process.
|
26
|
-
attr_accessor :
|
26
|
+
# The 3DSv2 trans id reference for the challenge process. May be used to create the ThreeDSSessionData value to send to the ACS.
|
27
|
+
attr_accessor :threedserver_trans_id
|
27
28
|
|
28
29
|
# The transaction number for the challenge, ordered incrementally from 1 for every merchant_id.
|
29
30
|
attr_accessor :transno
|
@@ -34,18 +35,23 @@ module CityPayApiClient
|
|
34
35
|
:'acs_url' => :'acs_url',
|
35
36
|
:'creq' => :'creq',
|
36
37
|
:'merchantid' => :'merchantid',
|
37
|
-
:'
|
38
|
+
:'threedserver_trans_id' => :'threedserver_trans_id',
|
38
39
|
:'transno' => :'transno'
|
39
40
|
}
|
40
41
|
end
|
41
42
|
|
43
|
+
# Returns all the JSON keys this model knows about
|
44
|
+
def self.acceptable_attributes
|
45
|
+
attribute_map.values
|
46
|
+
end
|
47
|
+
|
42
48
|
# Attribute type mapping.
|
43
49
|
def self.openapi_types
|
44
50
|
{
|
45
51
|
:'acs_url' => :'String',
|
46
52
|
:'creq' => :'String',
|
47
53
|
:'merchantid' => :'Integer',
|
48
|
-
:'
|
54
|
+
:'threedserver_trans_id' => :'String',
|
49
55
|
:'transno' => :'Integer'
|
50
56
|
}
|
51
57
|
end
|
@@ -83,8 +89,8 @@ module CityPayApiClient
|
|
83
89
|
self.merchantid = attributes[:'merchantid']
|
84
90
|
end
|
85
91
|
|
86
|
-
if attributes.key?(:'
|
87
|
-
self.
|
92
|
+
if attributes.key?(:'threedserver_trans_id')
|
93
|
+
self.threedserver_trans_id = attributes[:'threedserver_trans_id']
|
88
94
|
end
|
89
95
|
|
90
96
|
if attributes.key?(:'transno')
|
@@ -95,6 +101,7 @@ module CityPayApiClient
|
|
95
101
|
# Show invalid properties with the reasons. Usually used together with valid?
|
96
102
|
# @return Array for valid properties with the reasons
|
97
103
|
def list_invalid_properties
|
104
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
98
105
|
invalid_properties = Array.new
|
99
106
|
invalid_properties
|
100
107
|
end
|
@@ -102,6 +109,7 @@ module CityPayApiClient
|
|
102
109
|
# Check to see if the all the properties in the model are valid
|
103
110
|
# @return true if the model is valid
|
104
111
|
def valid?
|
112
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
113
|
true
|
106
114
|
end
|
107
115
|
|
@@ -113,7 +121,7 @@ module CityPayApiClient
|
|
113
121
|
acs_url == o.acs_url &&
|
114
122
|
creq == o.creq &&
|
115
123
|
merchantid == o.merchantid &&
|
116
|
-
|
124
|
+
threedserver_trans_id == o.threedserver_trans_id &&
|
117
125
|
transno == o.transno
|
118
126
|
end
|
119
127
|
|
@@ -126,44 +134,40 @@ module CityPayApiClient
|
|
126
134
|
# Calculates hash code according to all attributes.
|
127
135
|
# @return [Integer] Hash code
|
128
136
|
def hash
|
129
|
-
[acs_url, creq, merchantid,
|
137
|
+
[acs_url, creq, merchantid, threedserver_trans_id, transno].hash
|
130
138
|
end
|
131
139
|
|
132
140
|
# Builds the object from hash
|
133
141
|
# @param [Hash] attributes Model attributes in the form of hash
|
134
142
|
# @return [Object] Returns the model itself
|
135
143
|
def self.build_from_hash(attributes)
|
136
|
-
new.build_from_hash(attributes)
|
137
|
-
end
|
138
|
-
|
139
|
-
# Builds the object from hash
|
140
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
-
# @return [Object] Returns the model itself
|
142
|
-
def build_from_hash(attributes)
|
143
144
|
return nil unless attributes.is_a?(Hash)
|
144
|
-
|
145
|
-
|
145
|
+
attributes = attributes.transform_keys(&:to_sym)
|
146
|
+
transformed_hash = {}
|
147
|
+
openapi_types.each_pair do |key, type|
|
148
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
149
|
+
transformed_hash["#{key}"] = nil
|
150
|
+
elsif type =~ /\AArray<(.*)>/i
|
146
151
|
# check to ensure the input is an array given that the attribute
|
147
152
|
# is documented as an array but the input is not
|
148
|
-
if attributes[
|
149
|
-
|
153
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
154
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
150
155
|
end
|
151
|
-
elsif !attributes[
|
152
|
-
|
153
|
-
end
|
156
|
+
elsif !attributes[attribute_map[key]].nil?
|
157
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
158
|
+
end
|
154
159
|
end
|
155
|
-
|
156
|
-
self
|
160
|
+
new(transformed_hash)
|
157
161
|
end
|
158
162
|
|
159
163
|
# Deserializes the data based on type
|
160
164
|
# @param string type Data type
|
161
165
|
# @param string value Value to be deserialized
|
162
166
|
# @return [Object] Deserialized data
|
163
|
-
def _deserialize(type, value)
|
167
|
+
def self._deserialize(type, value)
|
164
168
|
case type.to_sym
|
165
|
-
when :
|
166
|
-
|
169
|
+
when :Time
|
170
|
+
Time.parse(value)
|
167
171
|
when :Date
|
168
172
|
Date.parse(value)
|
169
173
|
when :String
|
@@ -193,7 +197,9 @@ module CityPayApiClient
|
|
193
197
|
end
|
194
198
|
end
|
195
199
|
else # model
|
196
|
-
|
200
|
+
# models (e.g. Pet) or oneOf
|
201
|
+
klass = CityPayApiClient.const_get(type)
|
202
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
203
|
end
|
198
204
|
end
|
199
205
|
|
@@ -219,7 +225,7 @@ module CityPayApiClient
|
|
219
225
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
220
226
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
221
227
|
end
|
222
|
-
|
228
|
+
|
223
229
|
hash[param] = _to_hash(value)
|
224
230
|
end
|
225
231
|
hash
|
@@ -242,5 +248,7 @@ module CityPayApiClient
|
|
242
248
|
value
|
243
249
|
end
|
244
250
|
end
|
251
|
+
|
245
252
|
end
|
253
|
+
|
246
254
|
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
|
5
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'time'
|
13
14
|
|
14
15
|
module CityPayApiClient
|
15
16
|
class RetrieveRequest
|
@@ -31,6 +32,11 @@ module CityPayApiClient
|
|
31
32
|
}
|
32
33
|
end
|
33
34
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
36
|
+
def self.acceptable_attributes
|
37
|
+
attribute_map.values
|
38
|
+
end
|
39
|
+
|
34
40
|
# Attribute type mapping.
|
35
41
|
def self.openapi_types
|
36
42
|
{
|
@@ -67,6 +73,8 @@ module CityPayApiClient
|
|
67
73
|
|
68
74
|
if attributes.key?(:'merchantid')
|
69
75
|
self.merchantid = attributes[:'merchantid']
|
76
|
+
else
|
77
|
+
self.merchantid = nil
|
70
78
|
end
|
71
79
|
|
72
80
|
if attributes.key?(:'transno')
|
@@ -77,6 +85,7 @@ module CityPayApiClient
|
|
77
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
78
86
|
# @return Array for valid properties with the reasons
|
79
87
|
def list_invalid_properties
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
80
89
|
invalid_properties = Array.new
|
81
90
|
if !@identifier.nil? && @identifier.to_s.length > 50
|
82
91
|
invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
|
@@ -96,6 +105,7 @@ module CityPayApiClient
|
|
96
105
|
# Check to see if the all the properties in the model are valid
|
97
106
|
# @return true if the model is valid
|
98
107
|
def valid?
|
108
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
99
109
|
return false if !@identifier.nil? && @identifier.to_s.length > 50
|
100
110
|
return false if !@identifier.nil? && @identifier.to_s.length < 4
|
101
111
|
return false if @merchantid.nil?
|
@@ -105,11 +115,15 @@ module CityPayApiClient
|
|
105
115
|
# Custom attribute writer method with validation
|
106
116
|
# @param [Object] identifier Value to be assigned
|
107
117
|
def identifier=(identifier)
|
108
|
-
if
|
118
|
+
if identifier.nil?
|
119
|
+
fail ArgumentError, 'identifier cannot be nil'
|
120
|
+
end
|
121
|
+
|
122
|
+
if identifier.to_s.length > 50
|
109
123
|
fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
|
110
124
|
end
|
111
125
|
|
112
|
-
if
|
126
|
+
if identifier.to_s.length < 4
|
113
127
|
fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
|
114
128
|
end
|
115
129
|
|
@@ -142,37 +156,33 @@ module CityPayApiClient
|
|
142
156
|
# @param [Hash] attributes Model attributes in the form of hash
|
143
157
|
# @return [Object] Returns the model itself
|
144
158
|
def self.build_from_hash(attributes)
|
145
|
-
new.build_from_hash(attributes)
|
146
|
-
end
|
147
|
-
|
148
|
-
# Builds the object from hash
|
149
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
150
|
-
# @return [Object] Returns the model itself
|
151
|
-
def build_from_hash(attributes)
|
152
159
|
return nil unless attributes.is_a?(Hash)
|
153
|
-
|
154
|
-
|
160
|
+
attributes = attributes.transform_keys(&:to_sym)
|
161
|
+
transformed_hash = {}
|
162
|
+
openapi_types.each_pair do |key, type|
|
163
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
164
|
+
transformed_hash["#{key}"] = nil
|
165
|
+
elsif type =~ /\AArray<(.*)>/i
|
155
166
|
# check to ensure the input is an array given that the attribute
|
156
167
|
# is documented as an array but the input is not
|
157
|
-
if attributes[
|
158
|
-
|
168
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
169
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
159
170
|
end
|
160
|
-
elsif !attributes[
|
161
|
-
|
162
|
-
end
|
171
|
+
elsif !attributes[attribute_map[key]].nil?
|
172
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
173
|
+
end
|
163
174
|
end
|
164
|
-
|
165
|
-
self
|
175
|
+
new(transformed_hash)
|
166
176
|
end
|
167
177
|
|
168
178
|
# Deserializes the data based on type
|
169
179
|
# @param string type Data type
|
170
180
|
# @param string value Value to be deserialized
|
171
181
|
# @return [Object] Deserialized data
|
172
|
-
def _deserialize(type, value)
|
182
|
+
def self._deserialize(type, value)
|
173
183
|
case type.to_sym
|
174
|
-
when :
|
175
|
-
|
184
|
+
when :Time
|
185
|
+
Time.parse(value)
|
176
186
|
when :Date
|
177
187
|
Date.parse(value)
|
178
188
|
when :String
|
@@ -202,7 +212,9 @@ module CityPayApiClient
|
|
202
212
|
end
|
203
213
|
end
|
204
214
|
else # model
|
205
|
-
|
215
|
+
# models (e.g. Pet) or oneOf
|
216
|
+
klass = CityPayApiClient.const_get(type)
|
217
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
218
|
end
|
207
219
|
end
|
208
220
|
|
@@ -228,7 +240,7 @@ module CityPayApiClient
|
|
228
240
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
241
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
242
|
end
|
231
|
-
|
243
|
+
|
232
244
|
hash[param] = _to_hash(value)
|
233
245
|
end
|
234
246
|
hash
|
@@ -251,5 +263,7 @@ module CityPayApiClient
|
|
251
263
|
value
|
252
264
|
end
|
253
265
|
end
|
266
|
+
|
254
267
|
end
|
268
|
+
|
255
269
|
end
|
@@ -1,37 +1,70 @@
|
|
1
1
|
=begin
|
2
2
|
#CityPay Payment API
|
3
3
|
|
4
|
-
# This CityPay API is
|
4
|
+
# This CityPay API is an HTTP RESTful payment API used for direct server to server transactional processing. It provides a number of payment mechanisms including: Internet, MOTO, Continuous Authority transaction processing, 3-D Secure decision handling using RFA Secure, Authorisation, Refunding, Pre-Authorisation, Cancellation/Voids and Completion processing. The API is also capable of tokenized payments using cardholder Accounts. ## Compliance and Security Your application will need to adhere to PCI-DSS standards to operate safely and to meet requirements set out by Visa and MasterCard and the PCI Security Standards Council. These include * Data must be collected using TLS version 1.2 using [strong cryptography](https://citypay.github.io/api-docs/payment-api/#enabled-tls-ciphers). We will not accept calls to our API at lower grade encryption levels. We regularly scan our TLS endpoints for vulnerabilities and perform TLS assessments as part of our compliance program. * The application must not store sensitive cardholder data (CHD) such as the card security code (CSC) or primary access number (PAN) * The application must not display the full card number on receipts, it is recommended to mask the PAN and show the last 4 digits. The API will return this for you for ease of receipt creation * If you are developing a website, you will be required to perform regular scans on the network where you host the application to meet your compliance obligations * You will be required to be PCI Compliant and the application must adhere to the security standard. Further information is available from [https://www.pcisecuritystandards.org/](https://www.pcisecuritystandards.org/) * The API verifies that the request is for a valid account and originates from a trusted source using the remote IP address. Our application firewalls analyse data that may be an attempt to break a large number of security common security vulnerabilities.
|
5
5
|
|
6
6
|
Contact: support@citypay.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
8
|
-
OpenAPI Generator version:
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
9
|
|
10
10
|
=end
|
11
11
|
|
12
12
|
require 'date'
|
13
|
+
require 'time'
|
13
14
|
|
14
15
|
module CityPayApiClient
|
15
16
|
class ThreeDSecure
|
16
|
-
# The content of the HTTP accept header as sent to the merchant from the cardholder's user agent.
|
17
|
+
# Required for 3DSv1. Optional if the `cp_bx` value is provided otherwise required for 3Dv2 processing operating in browser authentication mode. The `cp_bx` value will override any value supplied to this field. The content of the HTTP accept header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1.
|
17
18
|
attr_accessor :accept_headers
|
18
19
|
|
20
|
+
# BrowserColorDepth field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
|
21
|
+
attr_accessor :browser_color_depth
|
22
|
+
|
23
|
+
# BrowserIP field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
|
24
|
+
attr_accessor :browser_ip
|
25
|
+
|
26
|
+
# BrowserJavaEnabled field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
|
27
|
+
attr_accessor :browser_java_enabled
|
28
|
+
|
29
|
+
# BrowserLanguage field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
|
30
|
+
attr_accessor :browser_language
|
31
|
+
|
32
|
+
# BrowserScreenHeight field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
|
33
|
+
attr_accessor :browser_screen_height
|
34
|
+
|
35
|
+
# BrowserScreenWidth field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
|
36
|
+
attr_accessor :browser_screen_width
|
37
|
+
|
38
|
+
# BrowserTZ offset field used for 3DSv2 browser enablement. Recommendation is to use citypay.js and the `bx` function to gather this value.
|
39
|
+
attr_accessor :browser_tz
|
40
|
+
|
41
|
+
# Required for 3DSv2. Browser extension value produced by the citypay.js `bx` function. See [https://sandbox.citypay.com/3dsv2/bx](https://sandbox.citypay.com/3dsv2/bx) for details.
|
42
|
+
attr_accessor :cp_bx
|
43
|
+
|
19
44
|
# Where a merchant is configured for 3DSv2, setting this option will attempt to downgrade the transaction to 3DSv1.
|
20
45
|
attr_accessor :downgrade1
|
21
46
|
|
22
|
-
# A controller URL for 3D-Secure processing that any response from an authentication request or challenge request should be sent to. The controller should forward on the response from the URL back via this API for subsequent processing.
|
47
|
+
# A controller URL for 3D-Secure processing that any response from an authentication request or challenge request should be sent to. The controller should forward on the response from the URL back via this API for subsequent processing.
|
23
48
|
attr_accessor :merchant_termurl
|
24
49
|
|
25
|
-
# A policy value which determines whether ThreeDSecure is enforced or bypassed. Note that this will only work for e-commerce transactions and accounts that have 3DSecure enabled and fully registered with Visa, MasterCard or American Express. It is useful when transactions may be wanted to bypass processing rules. Note that this may affect the liability shift of transactions and may occur a higher fee with the acquiring bank. Values are
|
50
|
+
# A policy value which determines whether ThreeDSecure is enforced or bypassed. Note that this will only work for e-commerce transactions and accounts that have 3DSecure enabled and fully registered with Visa, MasterCard or American Express. It is useful when transactions may be wanted to bypass processing rules. Note that this may affect the liability shift of transactions and may occur a higher fee with the acquiring bank. 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 will be enabled for 3DS processing `2` to bypass. Transactions that are bypassed will switch off 3DS processing.
|
26
51
|
attr_accessor :tds_policy
|
27
52
|
|
28
|
-
# The content of the HTTP user-agent header as sent to the merchant from the cardholder's user agent.
|
53
|
+
# Required for 3DSv1. Optional if the `cp_bx` value is provided otherwise required 3Dv2 processing operating in browser authentication mode. The `cp_bx` value will override any value supplied to this field. The content of the HTTP user-agent header as sent to the merchant from the cardholder's user agent. This value will be validated by the ACS when the card holder authenticates themselves to verify that no intermediary is performing this action. Required for 3DSv1.
|
29
54
|
attr_accessor :user_agent
|
30
55
|
|
31
56
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
57
|
def self.attribute_map
|
33
58
|
{
|
34
59
|
:'accept_headers' => :'accept_headers',
|
60
|
+
:'browser_color_depth' => :'browserColorDepth',
|
61
|
+
:'browser_ip' => :'browserIP',
|
62
|
+
:'browser_java_enabled' => :'browserJavaEnabled',
|
63
|
+
:'browser_language' => :'browserLanguage',
|
64
|
+
:'browser_screen_height' => :'browserScreenHeight',
|
65
|
+
:'browser_screen_width' => :'browserScreenWidth',
|
66
|
+
:'browser_tz' => :'browserTZ',
|
67
|
+
:'cp_bx' => :'cp_bx',
|
35
68
|
:'downgrade1' => :'downgrade1',
|
36
69
|
:'merchant_termurl' => :'merchant_termurl',
|
37
70
|
:'tds_policy' => :'tds_policy',
|
@@ -39,10 +72,23 @@ module CityPayApiClient
|
|
39
72
|
}
|
40
73
|
end
|
41
74
|
|
75
|
+
# Returns all the JSON keys this model knows about
|
76
|
+
def self.acceptable_attributes
|
77
|
+
attribute_map.values
|
78
|
+
end
|
79
|
+
|
42
80
|
# Attribute type mapping.
|
43
81
|
def self.openapi_types
|
44
82
|
{
|
45
83
|
:'accept_headers' => :'String',
|
84
|
+
:'browser_color_depth' => :'String',
|
85
|
+
:'browser_ip' => :'String',
|
86
|
+
:'browser_java_enabled' => :'String',
|
87
|
+
:'browser_language' => :'String',
|
88
|
+
:'browser_screen_height' => :'String',
|
89
|
+
:'browser_screen_width' => :'String',
|
90
|
+
:'browser_tz' => :'String',
|
91
|
+
:'cp_bx' => :'String',
|
46
92
|
:'downgrade1' => :'Boolean',
|
47
93
|
:'merchant_termurl' => :'String',
|
48
94
|
:'tds_policy' => :'String',
|
@@ -75,6 +121,38 @@ module CityPayApiClient
|
|
75
121
|
self.accept_headers = attributes[:'accept_headers']
|
76
122
|
end
|
77
123
|
|
124
|
+
if attributes.key?(:'browser_color_depth')
|
125
|
+
self.browser_color_depth = attributes[:'browser_color_depth']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'browser_ip')
|
129
|
+
self.browser_ip = attributes[:'browser_ip']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'browser_java_enabled')
|
133
|
+
self.browser_java_enabled = attributes[:'browser_java_enabled']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'browser_language')
|
137
|
+
self.browser_language = attributes[:'browser_language']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'browser_screen_height')
|
141
|
+
self.browser_screen_height = attributes[:'browser_screen_height']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'browser_screen_width')
|
145
|
+
self.browser_screen_width = attributes[:'browser_screen_width']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'browser_tz')
|
149
|
+
self.browser_tz = attributes[:'browser_tz']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'cp_bx')
|
153
|
+
self.cp_bx = attributes[:'cp_bx']
|
154
|
+
end
|
155
|
+
|
78
156
|
if attributes.key?(:'downgrade1')
|
79
157
|
self.downgrade1 = attributes[:'downgrade1']
|
80
158
|
end
|
@@ -95,6 +173,7 @@ module CityPayApiClient
|
|
95
173
|
# Show invalid properties with the reasons. Usually used together with valid?
|
96
174
|
# @return Array for valid properties with the reasons
|
97
175
|
def list_invalid_properties
|
176
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
98
177
|
invalid_properties = Array.new
|
99
178
|
invalid_properties
|
100
179
|
end
|
@@ -102,6 +181,7 @@ module CityPayApiClient
|
|
102
181
|
# Check to see if the all the properties in the model are valid
|
103
182
|
# @return true if the model is valid
|
104
183
|
def valid?
|
184
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
185
|
true
|
106
186
|
end
|
107
187
|
|
@@ -111,6 +191,14 @@ module CityPayApiClient
|
|
111
191
|
return true if self.equal?(o)
|
112
192
|
self.class == o.class &&
|
113
193
|
accept_headers == o.accept_headers &&
|
194
|
+
browser_color_depth == o.browser_color_depth &&
|
195
|
+
browser_ip == o.browser_ip &&
|
196
|
+
browser_java_enabled == o.browser_java_enabled &&
|
197
|
+
browser_language == o.browser_language &&
|
198
|
+
browser_screen_height == o.browser_screen_height &&
|
199
|
+
browser_screen_width == o.browser_screen_width &&
|
200
|
+
browser_tz == o.browser_tz &&
|
201
|
+
cp_bx == o.cp_bx &&
|
114
202
|
downgrade1 == o.downgrade1 &&
|
115
203
|
merchant_termurl == o.merchant_termurl &&
|
116
204
|
tds_policy == o.tds_policy &&
|
@@ -126,44 +214,40 @@ module CityPayApiClient
|
|
126
214
|
# Calculates hash code according to all attributes.
|
127
215
|
# @return [Integer] Hash code
|
128
216
|
def hash
|
129
|
-
[accept_headers, downgrade1, merchant_termurl, tds_policy, user_agent].hash
|
217
|
+
[accept_headers, browser_color_depth, browser_ip, browser_java_enabled, browser_language, browser_screen_height, browser_screen_width, browser_tz, cp_bx, downgrade1, merchant_termurl, tds_policy, user_agent].hash
|
130
218
|
end
|
131
219
|
|
132
220
|
# Builds the object from hash
|
133
221
|
# @param [Hash] attributes Model attributes in the form of hash
|
134
222
|
# @return [Object] Returns the model itself
|
135
223
|
def self.build_from_hash(attributes)
|
136
|
-
new.build_from_hash(attributes)
|
137
|
-
end
|
138
|
-
|
139
|
-
# Builds the object from hash
|
140
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
-
# @return [Object] Returns the model itself
|
142
|
-
def build_from_hash(attributes)
|
143
224
|
return nil unless attributes.is_a?(Hash)
|
144
|
-
|
145
|
-
|
225
|
+
attributes = attributes.transform_keys(&:to_sym)
|
226
|
+
transformed_hash = {}
|
227
|
+
openapi_types.each_pair do |key, type|
|
228
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
229
|
+
transformed_hash["#{key}"] = nil
|
230
|
+
elsif type =~ /\AArray<(.*)>/i
|
146
231
|
# check to ensure the input is an array given that the attribute
|
147
232
|
# is documented as an array but the input is not
|
148
|
-
if attributes[
|
149
|
-
|
233
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
234
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
150
235
|
end
|
151
|
-
elsif !attributes[
|
152
|
-
|
153
|
-
end
|
236
|
+
elsif !attributes[attribute_map[key]].nil?
|
237
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
238
|
+
end
|
154
239
|
end
|
155
|
-
|
156
|
-
self
|
240
|
+
new(transformed_hash)
|
157
241
|
end
|
158
242
|
|
159
243
|
# Deserializes the data based on type
|
160
244
|
# @param string type Data type
|
161
245
|
# @param string value Value to be deserialized
|
162
246
|
# @return [Object] Deserialized data
|
163
|
-
def _deserialize(type, value)
|
247
|
+
def self._deserialize(type, value)
|
164
248
|
case type.to_sym
|
165
|
-
when :
|
166
|
-
|
249
|
+
when :Time
|
250
|
+
Time.parse(value)
|
167
251
|
when :Date
|
168
252
|
Date.parse(value)
|
169
253
|
when :String
|
@@ -193,7 +277,9 @@ module CityPayApiClient
|
|
193
277
|
end
|
194
278
|
end
|
195
279
|
else # model
|
196
|
-
|
280
|
+
# models (e.g. Pet) or oneOf
|
281
|
+
klass = CityPayApiClient.const_get(type)
|
282
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
283
|
end
|
198
284
|
end
|
199
285
|
|
@@ -219,7 +305,7 @@ module CityPayApiClient
|
|
219
305
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
220
306
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
221
307
|
end
|
222
|
-
|
308
|
+
|
223
309
|
hash[param] = _to_hash(value)
|
224
310
|
end
|
225
311
|
hash
|
@@ -242,5 +328,7 @@ module CityPayApiClient
|
|
242
328
|
value
|
243
329
|
end
|
244
330
|
end
|
331
|
+
|
245
332
|
end
|
333
|
+
|
246
334
|
end
|