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 AirlineSegment
|
@@ -51,6 +52,11 @@ module CityPayApiClient
|
|
51
52
|
}
|
52
53
|
end
|
53
54
|
|
55
|
+
# Returns all the JSON keys this model knows about
|
56
|
+
def self.acceptable_attributes
|
57
|
+
attribute_map.values
|
58
|
+
end
|
59
|
+
|
54
60
|
# Attribute type mapping.
|
55
61
|
def self.openapi_types
|
56
62
|
{
|
@@ -88,18 +94,26 @@ module CityPayApiClient
|
|
88
94
|
|
89
95
|
if attributes.key?(:'arrival_location_code')
|
90
96
|
self.arrival_location_code = attributes[:'arrival_location_code']
|
97
|
+
else
|
98
|
+
self.arrival_location_code = nil
|
91
99
|
end
|
92
100
|
|
93
101
|
if attributes.key?(:'carrier_code')
|
94
102
|
self.carrier_code = attributes[:'carrier_code']
|
103
|
+
else
|
104
|
+
self.carrier_code = nil
|
95
105
|
end
|
96
106
|
|
97
107
|
if attributes.key?(:'class_service_code')
|
98
108
|
self.class_service_code = attributes[:'class_service_code']
|
109
|
+
else
|
110
|
+
self.class_service_code = nil
|
99
111
|
end
|
100
112
|
|
101
113
|
if attributes.key?(:'departure_date')
|
102
114
|
self.departure_date = attributes[:'departure_date']
|
115
|
+
else
|
116
|
+
self.departure_date = nil
|
103
117
|
end
|
104
118
|
|
105
119
|
if attributes.key?(:'departure_location_code')
|
@@ -108,6 +122,8 @@ module CityPayApiClient
|
|
108
122
|
|
109
123
|
if attributes.key?(:'flight_number')
|
110
124
|
self.flight_number = attributes[:'flight_number']
|
125
|
+
else
|
126
|
+
self.flight_number = nil
|
111
127
|
end
|
112
128
|
|
113
129
|
if attributes.key?(:'segment_fare')
|
@@ -122,6 +138,7 @@ module CityPayApiClient
|
|
122
138
|
# Show invalid properties with the reasons. Usually used together with valid?
|
123
139
|
# @return Array for valid properties with the reasons
|
124
140
|
def list_invalid_properties
|
141
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
125
142
|
invalid_properties = Array.new
|
126
143
|
if @arrival_location_code.nil?
|
127
144
|
invalid_properties.push('invalid value for "arrival_location_code", arrival_location_code cannot be nil.')
|
@@ -173,6 +190,7 @@ module CityPayApiClient
|
|
173
190
|
# Check to see if the all the properties in the model are valid
|
174
191
|
# @return true if the model is valid
|
175
192
|
def valid?
|
193
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
176
194
|
return false if @arrival_location_code.nil?
|
177
195
|
return false if @arrival_location_code.to_s.length > 3
|
178
196
|
return false if @carrier_code.nil?
|
@@ -232,7 +250,11 @@ module CityPayApiClient
|
|
232
250
|
# Custom attribute writer method with validation
|
233
251
|
# @param [Object] departure_location_code Value to be assigned
|
234
252
|
def departure_location_code=(departure_location_code)
|
235
|
-
if
|
253
|
+
if departure_location_code.nil?
|
254
|
+
fail ArgumentError, 'departure_location_code cannot be nil'
|
255
|
+
end
|
256
|
+
|
257
|
+
if departure_location_code.to_s.length > 3
|
236
258
|
fail ArgumentError, 'invalid value for "departure_location_code", the character length must be smaller than or equal to 3.'
|
237
259
|
end
|
238
260
|
|
@@ -256,7 +278,11 @@ module CityPayApiClient
|
|
256
278
|
# Custom attribute writer method with validation
|
257
279
|
# @param [Object] stop_over_indicator Value to be assigned
|
258
280
|
def stop_over_indicator=(stop_over_indicator)
|
259
|
-
if
|
281
|
+
if stop_over_indicator.nil?
|
282
|
+
fail ArgumentError, 'stop_over_indicator cannot be nil'
|
283
|
+
end
|
284
|
+
|
285
|
+
if stop_over_indicator.to_s.length > 1
|
260
286
|
fail ArgumentError, 'invalid value for "stop_over_indicator", the character length must be smaller than or equal to 1.'
|
261
287
|
end
|
262
288
|
|
@@ -294,37 +320,33 @@ module CityPayApiClient
|
|
294
320
|
# @param [Hash] attributes Model attributes in the form of hash
|
295
321
|
# @return [Object] Returns the model itself
|
296
322
|
def self.build_from_hash(attributes)
|
297
|
-
new.build_from_hash(attributes)
|
298
|
-
end
|
299
|
-
|
300
|
-
# Builds the object from hash
|
301
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
302
|
-
# @return [Object] Returns the model itself
|
303
|
-
def build_from_hash(attributes)
|
304
323
|
return nil unless attributes.is_a?(Hash)
|
305
|
-
|
306
|
-
|
324
|
+
attributes = attributes.transform_keys(&:to_sym)
|
325
|
+
transformed_hash = {}
|
326
|
+
openapi_types.each_pair do |key, type|
|
327
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
328
|
+
transformed_hash["#{key}"] = nil
|
329
|
+
elsif type =~ /\AArray<(.*)>/i
|
307
330
|
# check to ensure the input is an array given that the attribute
|
308
331
|
# is documented as an array but the input is not
|
309
|
-
if attributes[
|
310
|
-
|
332
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
333
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
311
334
|
end
|
312
|
-
elsif !attributes[
|
313
|
-
|
314
|
-
end
|
335
|
+
elsif !attributes[attribute_map[key]].nil?
|
336
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
337
|
+
end
|
315
338
|
end
|
316
|
-
|
317
|
-
self
|
339
|
+
new(transformed_hash)
|
318
340
|
end
|
319
341
|
|
320
342
|
# Deserializes the data based on type
|
321
343
|
# @param string type Data type
|
322
344
|
# @param string value Value to be deserialized
|
323
345
|
# @return [Object] Deserialized data
|
324
|
-
def _deserialize(type, value)
|
346
|
+
def self._deserialize(type, value)
|
325
347
|
case type.to_sym
|
326
|
-
when :
|
327
|
-
|
348
|
+
when :Time
|
349
|
+
Time.parse(value)
|
328
350
|
when :Date
|
329
351
|
Date.parse(value)
|
330
352
|
when :String
|
@@ -354,7 +376,9 @@ module CityPayApiClient
|
|
354
376
|
end
|
355
377
|
end
|
356
378
|
else # model
|
357
|
-
|
379
|
+
# models (e.g. Pet) or oneOf
|
380
|
+
klass = CityPayApiClient.const_get(type)
|
381
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
358
382
|
end
|
359
383
|
end
|
360
384
|
|
@@ -380,7 +404,7 @@ module CityPayApiClient
|
|
380
404
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
381
405
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
382
406
|
end
|
383
|
-
|
407
|
+
|
384
408
|
hash[param] = _to_hash(value)
|
385
409
|
end
|
386
410
|
hash
|
@@ -403,5 +427,7 @@ module CityPayApiClient
|
|
403
427
|
value
|
404
428
|
end
|
405
429
|
end
|
430
|
+
|
406
431
|
end
|
432
|
+
|
407
433
|
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 AuthReference
|
@@ -75,16 +76,21 @@ module CityPayApiClient
|
|
75
76
|
}
|
76
77
|
end
|
77
78
|
|
79
|
+
# Returns all the JSON keys this model knows about
|
80
|
+
def self.acceptable_attributes
|
81
|
+
attribute_map.values
|
82
|
+
end
|
83
|
+
|
78
84
|
# Attribute type mapping.
|
79
85
|
def self.openapi_types
|
80
86
|
{
|
81
|
-
:'amount' => :'
|
82
|
-
:'amount_value' => :'
|
87
|
+
:'amount' => :'String',
|
88
|
+
:'amount_value' => :'Integer',
|
83
89
|
:'atrn' => :'String',
|
84
90
|
:'authcode' => :'String',
|
85
91
|
:'batchno' => :'String',
|
86
92
|
:'currency' => :'String',
|
87
|
-
:'datetime' => :'
|
93
|
+
:'datetime' => :'Time',
|
88
94
|
:'identifier' => :'String',
|
89
95
|
:'maskedpan' => :'String',
|
90
96
|
:'merchantid' => :'Integer',
|
@@ -176,7 +182,12 @@ module CityPayApiClient
|
|
176
182
|
# Show invalid properties with the reasons. Usually used together with valid?
|
177
183
|
# @return Array for valid properties with the reasons
|
178
184
|
def list_invalid_properties
|
185
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
179
186
|
invalid_properties = Array.new
|
187
|
+
if !@amount.nil? && @amount.to_s.length > 10
|
188
|
+
invalid_properties.push('invalid value for "amount", the character length must be smaller than or equal to 10.')
|
189
|
+
end
|
190
|
+
|
180
191
|
if !@currency.nil? && @currency.to_s.length > 3
|
181
192
|
invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
|
182
193
|
end
|
@@ -203,6 +214,8 @@ module CityPayApiClient
|
|
203
214
|
# Check to see if the all the properties in the model are valid
|
204
215
|
# @return true if the model is valid
|
205
216
|
def valid?
|
217
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
218
|
+
return false if !@amount.nil? && @amount.to_s.length > 10
|
206
219
|
return false if !@currency.nil? && @currency.to_s.length > 3
|
207
220
|
return false if !@currency.nil? && @currency.to_s.length < 3
|
208
221
|
return false if !@identifier.nil? && @identifier.to_s.length > 50
|
@@ -211,14 +224,42 @@ module CityPayApiClient
|
|
211
224
|
true
|
212
225
|
end
|
213
226
|
|
227
|
+
# Custom attribute writer method with validation
|
228
|
+
# @param [Object] amount Value to be assigned
|
229
|
+
def amount=(amount)
|
230
|
+
if amount.nil?
|
231
|
+
fail ArgumentError, 'amount cannot be nil'
|
232
|
+
end
|
233
|
+
|
234
|
+
if amount.to_s.length > 10
|
235
|
+
fail ArgumentError, 'invalid value for "amount", the character length must be smaller than or equal to 10.'
|
236
|
+
end
|
237
|
+
|
238
|
+
@amount = amount
|
239
|
+
end
|
240
|
+
|
241
|
+
# Custom attribute writer method with validation
|
242
|
+
# @param [Object] amount_value Value to be assigned
|
243
|
+
def amount_value=(amount_value)
|
244
|
+
if amount_value.nil?
|
245
|
+
fail ArgumentError, 'amount_value cannot be nil'
|
246
|
+
end
|
247
|
+
|
248
|
+
@amount_value = amount_value
|
249
|
+
end
|
250
|
+
|
214
251
|
# Custom attribute writer method with validation
|
215
252
|
# @param [Object] currency Value to be assigned
|
216
253
|
def currency=(currency)
|
217
|
-
if
|
254
|
+
if currency.nil?
|
255
|
+
fail ArgumentError, 'currency cannot be nil'
|
256
|
+
end
|
257
|
+
|
258
|
+
if currency.to_s.length > 3
|
218
259
|
fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
|
219
260
|
end
|
220
261
|
|
221
|
-
if
|
262
|
+
if currency.to_s.length < 3
|
222
263
|
fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 3.'
|
223
264
|
end
|
224
265
|
|
@@ -228,11 +269,15 @@ module CityPayApiClient
|
|
228
269
|
# Custom attribute writer method with validation
|
229
270
|
# @param [Object] identifier Value to be assigned
|
230
271
|
def identifier=(identifier)
|
231
|
-
if
|
272
|
+
if identifier.nil?
|
273
|
+
fail ArgumentError, 'identifier cannot be nil'
|
274
|
+
end
|
275
|
+
|
276
|
+
if identifier.to_s.length > 50
|
232
277
|
fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
|
233
278
|
end
|
234
279
|
|
235
|
-
if
|
280
|
+
if identifier.to_s.length < 4
|
236
281
|
fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
|
237
282
|
end
|
238
283
|
|
@@ -242,7 +287,11 @@ module CityPayApiClient
|
|
242
287
|
# Custom attribute writer method with validation
|
243
288
|
# @param [Object] trans_type Value to be assigned
|
244
289
|
def trans_type=(trans_type)
|
245
|
-
if
|
290
|
+
if trans_type.nil?
|
291
|
+
fail ArgumentError, 'trans_type cannot be nil'
|
292
|
+
end
|
293
|
+
|
294
|
+
if trans_type.to_s.length > 1
|
246
295
|
fail ArgumentError, 'invalid value for "trans_type", the character length must be smaller than or equal to 1.'
|
247
296
|
end
|
248
297
|
|
@@ -286,37 +335,33 @@ module CityPayApiClient
|
|
286
335
|
# @param [Hash] attributes Model attributes in the form of hash
|
287
336
|
# @return [Object] Returns the model itself
|
288
337
|
def self.build_from_hash(attributes)
|
289
|
-
new.build_from_hash(attributes)
|
290
|
-
end
|
291
|
-
|
292
|
-
# Builds the object from hash
|
293
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
294
|
-
# @return [Object] Returns the model itself
|
295
|
-
def build_from_hash(attributes)
|
296
338
|
return nil unless attributes.is_a?(Hash)
|
297
|
-
|
298
|
-
|
339
|
+
attributes = attributes.transform_keys(&:to_sym)
|
340
|
+
transformed_hash = {}
|
341
|
+
openapi_types.each_pair do |key, type|
|
342
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
343
|
+
transformed_hash["#{key}"] = nil
|
344
|
+
elsif type =~ /\AArray<(.*)>/i
|
299
345
|
# check to ensure the input is an array given that the attribute
|
300
346
|
# is documented as an array but the input is not
|
301
|
-
if attributes[
|
302
|
-
|
347
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
348
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
303
349
|
end
|
304
|
-
elsif !attributes[
|
305
|
-
|
306
|
-
end
|
350
|
+
elsif !attributes[attribute_map[key]].nil?
|
351
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
352
|
+
end
|
307
353
|
end
|
308
|
-
|
309
|
-
self
|
354
|
+
new(transformed_hash)
|
310
355
|
end
|
311
356
|
|
312
357
|
# Deserializes the data based on type
|
313
358
|
# @param string type Data type
|
314
359
|
# @param string value Value to be deserialized
|
315
360
|
# @return [Object] Deserialized data
|
316
|
-
def _deserialize(type, value)
|
361
|
+
def self._deserialize(type, value)
|
317
362
|
case type.to_sym
|
318
|
-
when :
|
319
|
-
|
363
|
+
when :Time
|
364
|
+
Time.parse(value)
|
320
365
|
when :Date
|
321
366
|
Date.parse(value)
|
322
367
|
when :String
|
@@ -346,7 +391,9 @@ module CityPayApiClient
|
|
346
391
|
end
|
347
392
|
end
|
348
393
|
else # model
|
349
|
-
|
394
|
+
# models (e.g. Pet) or oneOf
|
395
|
+
klass = CityPayApiClient.const_get(type)
|
396
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
350
397
|
end
|
351
398
|
end
|
352
399
|
|
@@ -372,7 +419,7 @@ module CityPayApiClient
|
|
372
419
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
373
420
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
374
421
|
end
|
375
|
-
|
422
|
+
|
376
423
|
hash[param] = _to_hash(value)
|
377
424
|
end
|
378
425
|
hash
|
@@ -395,5 +442,7 @@ module CityPayApiClient
|
|
395
442
|
value
|
396
443
|
end
|
397
444
|
end
|
445
|
+
|
398
446
|
end
|
447
|
+
|
399
448
|
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 AuthReferences
|
@@ -22,6 +23,11 @@ module CityPayApiClient
|
|
22
23
|
}
|
23
24
|
end
|
24
25
|
|
26
|
+
# Returns all the JSON keys this model knows about
|
27
|
+
def self.acceptable_attributes
|
28
|
+
attribute_map.values
|
29
|
+
end
|
30
|
+
|
25
31
|
# Attribute type mapping.
|
26
32
|
def self.openapi_types
|
27
33
|
{
|
@@ -60,6 +66,7 @@ module CityPayApiClient
|
|
60
66
|
# Show invalid properties with the reasons. Usually used together with valid?
|
61
67
|
# @return Array for valid properties with the reasons
|
62
68
|
def list_invalid_properties
|
69
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
63
70
|
invalid_properties = Array.new
|
64
71
|
invalid_properties
|
65
72
|
end
|
@@ -67,6 +74,7 @@ module CityPayApiClient
|
|
67
74
|
# Check to see if the all the properties in the model are valid
|
68
75
|
# @return true if the model is valid
|
69
76
|
def valid?
|
77
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
70
78
|
true
|
71
79
|
end
|
72
80
|
|
@@ -94,37 +102,33 @@ module CityPayApiClient
|
|
94
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
95
103
|
# @return [Object] Returns the model itself
|
96
104
|
def self.build_from_hash(attributes)
|
97
|
-
new.build_from_hash(attributes)
|
98
|
-
end
|
99
|
-
|
100
|
-
# Builds the object from hash
|
101
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
-
# @return [Object] Returns the model itself
|
103
|
-
def build_from_hash(attributes)
|
104
105
|
return nil unless attributes.is_a?(Hash)
|
105
|
-
|
106
|
-
|
106
|
+
attributes = attributes.transform_keys(&:to_sym)
|
107
|
+
transformed_hash = {}
|
108
|
+
openapi_types.each_pair do |key, type|
|
109
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
110
|
+
transformed_hash["#{key}"] = nil
|
111
|
+
elsif type =~ /\AArray<(.*)>/i
|
107
112
|
# check to ensure the input is an array given that the attribute
|
108
113
|
# is documented as an array but the input is not
|
109
|
-
if attributes[
|
110
|
-
|
114
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
115
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
111
116
|
end
|
112
|
-
elsif !attributes[
|
113
|
-
|
114
|
-
end
|
117
|
+
elsif !attributes[attribute_map[key]].nil?
|
118
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
119
|
+
end
|
115
120
|
end
|
116
|
-
|
117
|
-
self
|
121
|
+
new(transformed_hash)
|
118
122
|
end
|
119
123
|
|
120
124
|
# Deserializes the data based on type
|
121
125
|
# @param string type Data type
|
122
126
|
# @param string value Value to be deserialized
|
123
127
|
# @return [Object] Deserialized data
|
124
|
-
def _deserialize(type, value)
|
128
|
+
def self._deserialize(type, value)
|
125
129
|
case type.to_sym
|
126
|
-
when :
|
127
|
-
|
130
|
+
when :Time
|
131
|
+
Time.parse(value)
|
128
132
|
when :Date
|
129
133
|
Date.parse(value)
|
130
134
|
when :String
|
@@ -154,7 +158,9 @@ module CityPayApiClient
|
|
154
158
|
end
|
155
159
|
end
|
156
160
|
else # model
|
157
|
-
|
161
|
+
# models (e.g. Pet) or oneOf
|
162
|
+
klass = CityPayApiClient.const_get(type)
|
163
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
158
164
|
end
|
159
165
|
end
|
160
166
|
|
@@ -180,7 +186,7 @@ module CityPayApiClient
|
|
180
186
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
181
187
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
182
188
|
end
|
183
|
-
|
189
|
+
|
184
190
|
hash[param] = _to_hash(value)
|
185
191
|
end
|
186
192
|
hash
|
@@ -203,5 +209,7 @@ module CityPayApiClient
|
|
203
209
|
value
|
204
210
|
end
|
205
211
|
end
|
212
|
+
|
206
213
|
end
|
214
|
+
|
207
215
|
end
|