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 CardHolderAccount
|
@@ -29,7 +30,10 @@ module CityPayApiClient
|
|
29
30
|
# The index in the array of the default card.
|
30
31
|
attr_accessor :default_card_index
|
31
32
|
|
32
|
-
#
|
33
|
+
# The date and time the account was last modified.
|
34
|
+
attr_accessor :last_modified
|
35
|
+
|
36
|
+
# Defines the status of the account for processing valid values are - ACTIVE for active accounts that are able to process - DISABLED for accounts that are currently disabled for processing.
|
33
37
|
attr_accessor :status
|
34
38
|
|
35
39
|
# A unique id of the card holder account which uniquely identifies the stored account. This value is not searchable.
|
@@ -44,20 +48,27 @@ module CityPayApiClient
|
|
44
48
|
:'date_created' => :'date_created',
|
45
49
|
:'default_card_id' => :'default_card_id',
|
46
50
|
:'default_card_index' => :'default_card_index',
|
51
|
+
:'last_modified' => :'last_modified',
|
47
52
|
:'status' => :'status',
|
48
53
|
:'unique_id' => :'unique_id'
|
49
54
|
}
|
50
55
|
end
|
51
56
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
58
|
+
def self.acceptable_attributes
|
59
|
+
attribute_map.values
|
60
|
+
end
|
61
|
+
|
52
62
|
# Attribute type mapping.
|
53
63
|
def self.openapi_types
|
54
64
|
{
|
55
65
|
:'account_id' => :'String',
|
56
66
|
:'cards' => :'Array<Card>',
|
57
67
|
:'contact' => :'ContactDetails',
|
58
|
-
:'date_created' => :'
|
68
|
+
:'date_created' => :'Time',
|
59
69
|
:'default_card_id' => :'String',
|
60
|
-
:'default_card_index' => :'
|
70
|
+
:'default_card_index' => :'Integer',
|
71
|
+
:'last_modified' => :'Time',
|
61
72
|
:'status' => :'String',
|
62
73
|
:'unique_id' => :'String'
|
63
74
|
}
|
@@ -86,6 +97,8 @@ module CityPayApiClient
|
|
86
97
|
|
87
98
|
if attributes.key?(:'account_id')
|
88
99
|
self.account_id = attributes[:'account_id']
|
100
|
+
else
|
101
|
+
self.account_id = nil
|
89
102
|
end
|
90
103
|
|
91
104
|
if attributes.key?(:'cards')
|
@@ -96,6 +109,8 @@ module CityPayApiClient
|
|
96
109
|
|
97
110
|
if attributes.key?(:'contact')
|
98
111
|
self.contact = attributes[:'contact']
|
112
|
+
else
|
113
|
+
self.contact = nil
|
99
114
|
end
|
100
115
|
|
101
116
|
if attributes.key?(:'date_created')
|
@@ -110,6 +125,10 @@ module CityPayApiClient
|
|
110
125
|
self.default_card_index = attributes[:'default_card_index']
|
111
126
|
end
|
112
127
|
|
128
|
+
if attributes.key?(:'last_modified')
|
129
|
+
self.last_modified = attributes[:'last_modified']
|
130
|
+
end
|
131
|
+
|
113
132
|
if attributes.key?(:'status')
|
114
133
|
self.status = attributes[:'status']
|
115
134
|
end
|
@@ -122,6 +141,7 @@ module CityPayApiClient
|
|
122
141
|
# Show invalid properties with the reasons. Usually used together with valid?
|
123
142
|
# @return Array for valid properties with the reasons
|
124
143
|
def list_invalid_properties
|
144
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
125
145
|
invalid_properties = Array.new
|
126
146
|
if @account_id.nil?
|
127
147
|
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
@@ -145,6 +165,7 @@ module CityPayApiClient
|
|
145
165
|
# Check to see if the all the properties in the model are valid
|
146
166
|
# @return true if the model is valid
|
147
167
|
def valid?
|
168
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
148
169
|
return false if @account_id.nil?
|
149
170
|
return false if @account_id.to_s.length > 50
|
150
171
|
return false if @account_id.to_s.length < 5
|
@@ -181,6 +202,7 @@ module CityPayApiClient
|
|
181
202
|
date_created == o.date_created &&
|
182
203
|
default_card_id == o.default_card_id &&
|
183
204
|
default_card_index == o.default_card_index &&
|
205
|
+
last_modified == o.last_modified &&
|
184
206
|
status == o.status &&
|
185
207
|
unique_id == o.unique_id
|
186
208
|
end
|
@@ -194,44 +216,40 @@ module CityPayApiClient
|
|
194
216
|
# Calculates hash code according to all attributes.
|
195
217
|
# @return [Integer] Hash code
|
196
218
|
def hash
|
197
|
-
[account_id, cards, contact, date_created, default_card_id, default_card_index, status, unique_id].hash
|
219
|
+
[account_id, cards, contact, date_created, default_card_id, default_card_index, last_modified, status, unique_id].hash
|
198
220
|
end
|
199
221
|
|
200
222
|
# Builds the object from hash
|
201
223
|
# @param [Hash] attributes Model attributes in the form of hash
|
202
224
|
# @return [Object] Returns the model itself
|
203
225
|
def self.build_from_hash(attributes)
|
204
|
-
new.build_from_hash(attributes)
|
205
|
-
end
|
206
|
-
|
207
|
-
# Builds the object from hash
|
208
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
209
|
-
# @return [Object] Returns the model itself
|
210
|
-
def build_from_hash(attributes)
|
211
226
|
return nil unless attributes.is_a?(Hash)
|
212
|
-
|
213
|
-
|
227
|
+
attributes = attributes.transform_keys(&:to_sym)
|
228
|
+
transformed_hash = {}
|
229
|
+
openapi_types.each_pair do |key, type|
|
230
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
231
|
+
transformed_hash["#{key}"] = nil
|
232
|
+
elsif type =~ /\AArray<(.*)>/i
|
214
233
|
# check to ensure the input is an array given that the attribute
|
215
234
|
# is documented as an array but the input is not
|
216
|
-
if attributes[
|
217
|
-
|
235
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
236
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
218
237
|
end
|
219
|
-
elsif !attributes[
|
220
|
-
|
221
|
-
end
|
238
|
+
elsif !attributes[attribute_map[key]].nil?
|
239
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
240
|
+
end
|
222
241
|
end
|
223
|
-
|
224
|
-
self
|
242
|
+
new(transformed_hash)
|
225
243
|
end
|
226
244
|
|
227
245
|
# Deserializes the data based on type
|
228
246
|
# @param string type Data type
|
229
247
|
# @param string value Value to be deserialized
|
230
248
|
# @return [Object] Deserialized data
|
231
|
-
def _deserialize(type, value)
|
249
|
+
def self._deserialize(type, value)
|
232
250
|
case type.to_sym
|
233
|
-
when :
|
234
|
-
|
251
|
+
when :Time
|
252
|
+
Time.parse(value)
|
235
253
|
when :Date
|
236
254
|
Date.parse(value)
|
237
255
|
when :String
|
@@ -261,7 +279,9 @@ module CityPayApiClient
|
|
261
279
|
end
|
262
280
|
end
|
263
281
|
else # model
|
264
|
-
|
282
|
+
# models (e.g. Pet) or oneOf
|
283
|
+
klass = CityPayApiClient.const_get(type)
|
284
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
265
285
|
end
|
266
286
|
end
|
267
287
|
|
@@ -287,7 +307,7 @@ module CityPayApiClient
|
|
287
307
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
288
308
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
289
309
|
end
|
290
|
-
|
310
|
+
|
291
311
|
hash[param] = _to_hash(value)
|
292
312
|
end
|
293
313
|
hash
|
@@ -310,5 +330,7 @@ module CityPayApiClient
|
|
310
330
|
value
|
311
331
|
end
|
312
332
|
end
|
333
|
+
|
313
334
|
end
|
335
|
+
|
314
336
|
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 CardStatus
|
@@ -27,6 +28,11 @@ module CityPayApiClient
|
|
27
28
|
}
|
28
29
|
end
|
29
30
|
|
31
|
+
# Returns all the JSON keys this model knows about
|
32
|
+
def self.acceptable_attributes
|
33
|
+
attribute_map.values
|
34
|
+
end
|
35
|
+
|
30
36
|
# Attribute type mapping.
|
31
37
|
def self.openapi_types
|
32
38
|
{
|
@@ -68,6 +74,7 @@ module CityPayApiClient
|
|
68
74
|
# Show invalid properties with the reasons. Usually used together with valid?
|
69
75
|
# @return Array for valid properties with the reasons
|
70
76
|
def list_invalid_properties
|
77
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
71
78
|
invalid_properties = Array.new
|
72
79
|
invalid_properties
|
73
80
|
end
|
@@ -75,6 +82,7 @@ module CityPayApiClient
|
|
75
82
|
# Check to see if the all the properties in the model are valid
|
76
83
|
# @return true if the model is valid
|
77
84
|
def valid?
|
85
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
78
86
|
true
|
79
87
|
end
|
80
88
|
|
@@ -103,37 +111,33 @@ module CityPayApiClient
|
|
103
111
|
# @param [Hash] attributes Model attributes in the form of hash
|
104
112
|
# @return [Object] Returns the model itself
|
105
113
|
def self.build_from_hash(attributes)
|
106
|
-
new.build_from_hash(attributes)
|
107
|
-
end
|
108
|
-
|
109
|
-
# Builds the object from hash
|
110
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
-
# @return [Object] Returns the model itself
|
112
|
-
def build_from_hash(attributes)
|
113
114
|
return nil unless attributes.is_a?(Hash)
|
114
|
-
|
115
|
-
|
115
|
+
attributes = attributes.transform_keys(&:to_sym)
|
116
|
+
transformed_hash = {}
|
117
|
+
openapi_types.each_pair do |key, type|
|
118
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
119
|
+
transformed_hash["#{key}"] = nil
|
120
|
+
elsif type =~ /\AArray<(.*)>/i
|
116
121
|
# check to ensure the input is an array given that the attribute
|
117
122
|
# is documented as an array but the input is not
|
118
|
-
if attributes[
|
119
|
-
|
123
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
124
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
120
125
|
end
|
121
|
-
elsif !attributes[
|
122
|
-
|
123
|
-
end
|
126
|
+
elsif !attributes[attribute_map[key]].nil?
|
127
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
128
|
+
end
|
124
129
|
end
|
125
|
-
|
126
|
-
self
|
130
|
+
new(transformed_hash)
|
127
131
|
end
|
128
132
|
|
129
133
|
# Deserializes the data based on type
|
130
134
|
# @param string type Data type
|
131
135
|
# @param string value Value to be deserialized
|
132
136
|
# @return [Object] Deserialized data
|
133
|
-
def _deserialize(type, value)
|
137
|
+
def self._deserialize(type, value)
|
134
138
|
case type.to_sym
|
135
|
-
when :
|
136
|
-
|
139
|
+
when :Time
|
140
|
+
Time.parse(value)
|
137
141
|
when :Date
|
138
142
|
Date.parse(value)
|
139
143
|
when :String
|
@@ -163,7 +167,9 @@ module CityPayApiClient
|
|
163
167
|
end
|
164
168
|
end
|
165
169
|
else # model
|
166
|
-
|
170
|
+
# models (e.g. Pet) or oneOf
|
171
|
+
klass = CityPayApiClient.const_get(type)
|
172
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
167
173
|
end
|
168
174
|
end
|
169
175
|
|
@@ -189,7 +195,7 @@ module CityPayApiClient
|
|
189
195
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
190
196
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
191
197
|
end
|
192
|
-
|
198
|
+
|
193
199
|
hash[param] = _to_hash(value)
|
194
200
|
end
|
195
201
|
hash
|
@@ -212,5 +218,7 @@ module CityPayApiClient
|
|
212
218
|
value
|
213
219
|
end
|
214
220
|
end
|
221
|
+
|
215
222
|
end
|
223
|
+
|
216
224
|
end
|