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,32 +1,32 @@
|
|
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 CaptureRequest
|
16
17
|
attr_accessor :airline_data
|
17
18
|
|
18
|
-
# The completion amount provided in the lowest unit of currency for the specific currency of the merchant, with a variable length to a maximum of 12 digits. No decimal points to be included. For example with GBP 75.45 use the value 7545. Please check that you do not supply divisional characters such as 1,024 in the request which may be caused by some number formatters.
|
19
|
+
# The completion amount provided in the lowest unit of currency for the specific currency of the merchant, with a variable length to a maximum of 12 digits. No decimal points to be included. For example with GBP 75.45 use the value 7545. Please check that you do not supply divisional characters such as 1,024 in the request which may be caused by some number formatters. If no amount is supplied, the original processing amount is used.
|
19
20
|
attr_accessor :amount
|
20
21
|
|
22
|
+
attr_accessor :event_management
|
23
|
+
|
21
24
|
# The identifier of the transaction to capture. If an empty value is supplied then a `trans_no` value must be supplied.
|
22
25
|
attr_accessor :identifier
|
23
26
|
|
24
27
|
# Identifies the merchant account to perform the capture for.
|
25
28
|
attr_accessor :merchantid
|
26
29
|
|
27
|
-
# An optional reference value for the calling client such as a version number i.e.
|
28
|
-
attr_accessor :sdk
|
29
|
-
|
30
30
|
# The transaction number of the transaction to look up and capture. If an empty value is supplied then an identifier value must be supplied.
|
31
31
|
attr_accessor :transno
|
32
32
|
|
@@ -35,21 +35,26 @@ module CityPayApiClient
|
|
35
35
|
{
|
36
36
|
:'airline_data' => :'airline_data',
|
37
37
|
:'amount' => :'amount',
|
38
|
+
:'event_management' => :'event_management',
|
38
39
|
:'identifier' => :'identifier',
|
39
40
|
:'merchantid' => :'merchantid',
|
40
|
-
:'sdk' => :'sdk',
|
41
41
|
:'transno' => :'transno'
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
45
|
+
# Returns all the JSON keys this model knows about
|
46
|
+
def self.acceptable_attributes
|
47
|
+
attribute_map.values
|
48
|
+
end
|
49
|
+
|
45
50
|
# Attribute type mapping.
|
46
51
|
def self.openapi_types
|
47
52
|
{
|
48
53
|
:'airline_data' => :'AirlineAdvice',
|
49
54
|
:'amount' => :'Integer',
|
55
|
+
:'event_management' => :'EventDataModel',
|
50
56
|
:'identifier' => :'String',
|
51
57
|
:'merchantid' => :'Integer',
|
52
|
-
:'sdk' => :'String',
|
53
58
|
:'transno' => :'Integer'
|
54
59
|
}
|
55
60
|
end
|
@@ -83,18 +88,18 @@ module CityPayApiClient
|
|
83
88
|
self.amount = attributes[:'amount']
|
84
89
|
end
|
85
90
|
|
91
|
+
if attributes.key?(:'event_management')
|
92
|
+
self.event_management = attributes[:'event_management']
|
93
|
+
end
|
94
|
+
|
86
95
|
if attributes.key?(:'identifier')
|
87
96
|
self.identifier = attributes[:'identifier']
|
88
97
|
end
|
89
98
|
|
90
99
|
if attributes.key?(:'merchantid')
|
91
100
|
self.merchantid = attributes[:'merchantid']
|
92
|
-
end
|
93
|
-
|
94
|
-
if attributes.key?(:'sdk')
|
95
|
-
self.sdk = attributes[:'sdk']
|
96
101
|
else
|
97
|
-
self.
|
102
|
+
self.merchantid = nil
|
98
103
|
end
|
99
104
|
|
100
105
|
if attributes.key?(:'transno')
|
@@ -105,6 +110,7 @@ module CityPayApiClient
|
|
105
110
|
# Show invalid properties with the reasons. Usually used together with valid?
|
106
111
|
# @return Array for valid properties with the reasons
|
107
112
|
def list_invalid_properties
|
113
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
108
114
|
invalid_properties = Array.new
|
109
115
|
if !@identifier.nil? && @identifier.to_s.length > 50
|
110
116
|
invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
|
@@ -124,20 +130,35 @@ module CityPayApiClient
|
|
124
130
|
# Check to see if the all the properties in the model are valid
|
125
131
|
# @return true if the model is valid
|
126
132
|
def valid?
|
133
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
127
134
|
return false if !@identifier.nil? && @identifier.to_s.length > 50
|
128
135
|
return false if !@identifier.nil? && @identifier.to_s.length < 4
|
129
136
|
return false if @merchantid.nil?
|
130
137
|
true
|
131
138
|
end
|
132
139
|
|
140
|
+
# Custom attribute writer method with validation
|
141
|
+
# @param [Object] amount Value to be assigned
|
142
|
+
def amount=(amount)
|
143
|
+
if amount.nil?
|
144
|
+
fail ArgumentError, 'amount cannot be nil'
|
145
|
+
end
|
146
|
+
|
147
|
+
@amount = amount
|
148
|
+
end
|
149
|
+
|
133
150
|
# Custom attribute writer method with validation
|
134
151
|
# @param [Object] identifier Value to be assigned
|
135
152
|
def identifier=(identifier)
|
136
|
-
if
|
153
|
+
if identifier.nil?
|
154
|
+
fail ArgumentError, 'identifier cannot be nil'
|
155
|
+
end
|
156
|
+
|
157
|
+
if identifier.to_s.length > 50
|
137
158
|
fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
|
138
159
|
end
|
139
160
|
|
140
|
-
if
|
161
|
+
if identifier.to_s.length < 4
|
141
162
|
fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
|
142
163
|
end
|
143
164
|
|
@@ -151,9 +172,9 @@ module CityPayApiClient
|
|
151
172
|
self.class == o.class &&
|
152
173
|
airline_data == o.airline_data &&
|
153
174
|
amount == o.amount &&
|
175
|
+
event_management == o.event_management &&
|
154
176
|
identifier == o.identifier &&
|
155
177
|
merchantid == o.merchantid &&
|
156
|
-
sdk == o.sdk &&
|
157
178
|
transno == o.transno
|
158
179
|
end
|
159
180
|
|
@@ -166,44 +187,40 @@ module CityPayApiClient
|
|
166
187
|
# Calculates hash code according to all attributes.
|
167
188
|
# @return [Integer] Hash code
|
168
189
|
def hash
|
169
|
-
[airline_data, amount, identifier, merchantid,
|
190
|
+
[airline_data, amount, event_management, identifier, merchantid, transno].hash
|
170
191
|
end
|
171
192
|
|
172
193
|
# Builds the object from hash
|
173
194
|
# @param [Hash] attributes Model attributes in the form of hash
|
174
195
|
# @return [Object] Returns the model itself
|
175
196
|
def self.build_from_hash(attributes)
|
176
|
-
new.build_from_hash(attributes)
|
177
|
-
end
|
178
|
-
|
179
|
-
# Builds the object from hash
|
180
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
181
|
-
# @return [Object] Returns the model itself
|
182
|
-
def build_from_hash(attributes)
|
183
197
|
return nil unless attributes.is_a?(Hash)
|
184
|
-
|
185
|
-
|
198
|
+
attributes = attributes.transform_keys(&:to_sym)
|
199
|
+
transformed_hash = {}
|
200
|
+
openapi_types.each_pair do |key, type|
|
201
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
202
|
+
transformed_hash["#{key}"] = nil
|
203
|
+
elsif type =~ /\AArray<(.*)>/i
|
186
204
|
# check to ensure the input is an array given that the attribute
|
187
205
|
# is documented as an array but the input is not
|
188
|
-
if attributes[
|
189
|
-
|
206
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
207
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
190
208
|
end
|
191
|
-
elsif !attributes[
|
192
|
-
|
193
|
-
end
|
209
|
+
elsif !attributes[attribute_map[key]].nil?
|
210
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
211
|
+
end
|
194
212
|
end
|
195
|
-
|
196
|
-
self
|
213
|
+
new(transformed_hash)
|
197
214
|
end
|
198
215
|
|
199
216
|
# Deserializes the data based on type
|
200
217
|
# @param string type Data type
|
201
218
|
# @param string value Value to be deserialized
|
202
219
|
# @return [Object] Deserialized data
|
203
|
-
def _deserialize(type, value)
|
220
|
+
def self._deserialize(type, value)
|
204
221
|
case type.to_sym
|
205
|
-
when :
|
206
|
-
|
222
|
+
when :Time
|
223
|
+
Time.parse(value)
|
207
224
|
when :Date
|
208
225
|
Date.parse(value)
|
209
226
|
when :String
|
@@ -233,7 +250,9 @@ module CityPayApiClient
|
|
233
250
|
end
|
234
251
|
end
|
235
252
|
else # model
|
236
|
-
|
253
|
+
# models (e.g. Pet) or oneOf
|
254
|
+
klass = CityPayApiClient.const_get(type)
|
255
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
237
256
|
end
|
238
257
|
end
|
239
258
|
|
@@ -259,7 +278,7 @@ module CityPayApiClient
|
|
259
278
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
260
279
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
261
280
|
end
|
262
|
-
|
281
|
+
|
263
282
|
hash[param] = _to_hash(value)
|
264
283
|
end
|
265
284
|
hash
|
@@ -282,5 +301,7 @@ module CityPayApiClient
|
|
282
301
|
value
|
283
302
|
end
|
284
303
|
end
|
304
|
+
|
285
305
|
end
|
306
|
+
|
286
307
|
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 Card
|
@@ -40,9 +41,12 @@ module CityPayApiClient
|
|
40
41
|
# The id of the card that is returned. Should be used for referencing the card when perform any changes.
|
41
42
|
attr_accessor :card_id
|
42
43
|
|
43
|
-
# The status of the card such, valid values are
|
44
|
+
# The status of the card such, valid values are - ACTIVE the card is active for processing - INACTIVE the card is not active for processing - EXPIRED for cards that have passed their expiry date.
|
44
45
|
attr_accessor :card_status
|
45
46
|
|
47
|
+
# The date time of when the card was created.
|
48
|
+
attr_accessor :date_created
|
49
|
+
|
46
50
|
# Determines if the card is the default card for the account and should be regarded as the first option to be used for processing.
|
47
51
|
attr_accessor :default
|
48
52
|
|
@@ -61,6 +65,9 @@ module CityPayApiClient
|
|
61
65
|
# The last 4 digits of the card to aid in identification.
|
62
66
|
attr_accessor :last4digits
|
63
67
|
|
68
|
+
# The name on the card.
|
69
|
+
attr_accessor :name_on_card
|
70
|
+
|
64
71
|
# The scheme that issued the card.
|
65
72
|
attr_accessor :scheme
|
66
73
|
|
@@ -80,17 +87,24 @@ module CityPayApiClient
|
|
80
87
|
:'bin_eu' => :'bin_eu',
|
81
88
|
:'card_id' => :'card_id',
|
82
89
|
:'card_status' => :'card_status',
|
90
|
+
:'date_created' => :'date_created',
|
83
91
|
:'default' => :'default',
|
84
92
|
:'expmonth' => :'expmonth',
|
85
93
|
:'expyear' => :'expyear',
|
86
94
|
:'label' => :'label',
|
87
95
|
:'label2' => :'label2',
|
88
96
|
:'last4digits' => :'last4digits',
|
97
|
+
:'name_on_card' => :'name_on_card',
|
89
98
|
:'scheme' => :'scheme',
|
90
99
|
:'token' => :'token'
|
91
100
|
}
|
92
101
|
end
|
93
102
|
|
103
|
+
# Returns all the JSON keys this model knows about
|
104
|
+
def self.acceptable_attributes
|
105
|
+
attribute_map.values
|
106
|
+
end
|
107
|
+
|
94
108
|
# Attribute type mapping.
|
95
109
|
def self.openapi_types
|
96
110
|
{
|
@@ -104,12 +118,14 @@ module CityPayApiClient
|
|
104
118
|
:'bin_eu' => :'Boolean',
|
105
119
|
:'card_id' => :'String',
|
106
120
|
:'card_status' => :'String',
|
121
|
+
:'date_created' => :'Time',
|
107
122
|
:'default' => :'Boolean',
|
108
123
|
:'expmonth' => :'Integer',
|
109
124
|
:'expyear' => :'Integer',
|
110
125
|
:'label' => :'String',
|
111
126
|
:'label2' => :'String',
|
112
127
|
:'last4digits' => :'String',
|
128
|
+
:'name_on_card' => :'String',
|
113
129
|
:'scheme' => :'String',
|
114
130
|
:'token' => :'String'
|
115
131
|
}
|
@@ -176,6 +192,10 @@ module CityPayApiClient
|
|
176
192
|
self.card_status = attributes[:'card_status']
|
177
193
|
end
|
178
194
|
|
195
|
+
if attributes.key?(:'date_created')
|
196
|
+
self.date_created = attributes[:'date_created']
|
197
|
+
end
|
198
|
+
|
179
199
|
if attributes.key?(:'default')
|
180
200
|
self.default = attributes[:'default']
|
181
201
|
end
|
@@ -200,6 +220,10 @@ module CityPayApiClient
|
|
200
220
|
self.last4digits = attributes[:'last4digits']
|
201
221
|
end
|
202
222
|
|
223
|
+
if attributes.key?(:'name_on_card')
|
224
|
+
self.name_on_card = attributes[:'name_on_card']
|
225
|
+
end
|
226
|
+
|
203
227
|
if attributes.key?(:'scheme')
|
204
228
|
self.scheme = attributes[:'scheme']
|
205
229
|
end
|
@@ -212,6 +236,7 @@ module CityPayApiClient
|
|
212
236
|
# Show invalid properties with the reasons. Usually used together with valid?
|
213
237
|
# @return Array for valid properties with the reasons
|
214
238
|
def list_invalid_properties
|
239
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
215
240
|
invalid_properties = Array.new
|
216
241
|
if !@expmonth.nil? && @expmonth > 12
|
217
242
|
invalid_properties.push('invalid value for "expmonth", must be smaller than or equal to 12.')
|
@@ -229,27 +254,42 @@ module CityPayApiClient
|
|
229
254
|
invalid_properties.push('invalid value for "expyear", must be greater than or equal to 2000.')
|
230
255
|
end
|
231
256
|
|
257
|
+
if !@name_on_card.nil? && @name_on_card.to_s.length > 45
|
258
|
+
invalid_properties.push('invalid value for "name_on_card", the character length must be smaller than or equal to 45.')
|
259
|
+
end
|
260
|
+
|
261
|
+
if !@name_on_card.nil? && @name_on_card.to_s.length < 2
|
262
|
+
invalid_properties.push('invalid value for "name_on_card", the character length must be great than or equal to 2.')
|
263
|
+
end
|
264
|
+
|
232
265
|
invalid_properties
|
233
266
|
end
|
234
267
|
|
235
268
|
# Check to see if the all the properties in the model are valid
|
236
269
|
# @return true if the model is valid
|
237
270
|
def valid?
|
271
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
238
272
|
return false if !@expmonth.nil? && @expmonth > 12
|
239
273
|
return false if !@expmonth.nil? && @expmonth < 1
|
240
274
|
return false if !@expyear.nil? && @expyear > 2100
|
241
275
|
return false if !@expyear.nil? && @expyear < 2000
|
276
|
+
return false if !@name_on_card.nil? && @name_on_card.to_s.length > 45
|
277
|
+
return false if !@name_on_card.nil? && @name_on_card.to_s.length < 2
|
242
278
|
true
|
243
279
|
end
|
244
280
|
|
245
281
|
# Custom attribute writer method with validation
|
246
282
|
# @param [Object] expmonth Value to be assigned
|
247
283
|
def expmonth=(expmonth)
|
248
|
-
if
|
284
|
+
if expmonth.nil?
|
285
|
+
fail ArgumentError, 'expmonth cannot be nil'
|
286
|
+
end
|
287
|
+
|
288
|
+
if expmonth > 12
|
249
289
|
fail ArgumentError, 'invalid value for "expmonth", must be smaller than or equal to 12.'
|
250
290
|
end
|
251
291
|
|
252
|
-
if
|
292
|
+
if expmonth < 1
|
253
293
|
fail ArgumentError, 'invalid value for "expmonth", must be greater than or equal to 1.'
|
254
294
|
end
|
255
295
|
|
@@ -259,17 +299,39 @@ module CityPayApiClient
|
|
259
299
|
# Custom attribute writer method with validation
|
260
300
|
# @param [Object] expyear Value to be assigned
|
261
301
|
def expyear=(expyear)
|
262
|
-
if
|
302
|
+
if expyear.nil?
|
303
|
+
fail ArgumentError, 'expyear cannot be nil'
|
304
|
+
end
|
305
|
+
|
306
|
+
if expyear > 2100
|
263
307
|
fail ArgumentError, 'invalid value for "expyear", must be smaller than or equal to 2100.'
|
264
308
|
end
|
265
309
|
|
266
|
-
if
|
310
|
+
if expyear < 2000
|
267
311
|
fail ArgumentError, 'invalid value for "expyear", must be greater than or equal to 2000.'
|
268
312
|
end
|
269
313
|
|
270
314
|
@expyear = expyear
|
271
315
|
end
|
272
316
|
|
317
|
+
# Custom attribute writer method with validation
|
318
|
+
# @param [Object] name_on_card Value to be assigned
|
319
|
+
def name_on_card=(name_on_card)
|
320
|
+
if name_on_card.nil?
|
321
|
+
fail ArgumentError, 'name_on_card cannot be nil'
|
322
|
+
end
|
323
|
+
|
324
|
+
if name_on_card.to_s.length > 45
|
325
|
+
fail ArgumentError, 'invalid value for "name_on_card", the character length must be smaller than or equal to 45.'
|
326
|
+
end
|
327
|
+
|
328
|
+
if name_on_card.to_s.length < 2
|
329
|
+
fail ArgumentError, 'invalid value for "name_on_card", the character length must be great than or equal to 2.'
|
330
|
+
end
|
331
|
+
|
332
|
+
@name_on_card = name_on_card
|
333
|
+
end
|
334
|
+
|
273
335
|
# Checks equality by comparing each attribute.
|
274
336
|
# @param [Object] Object to be compared
|
275
337
|
def ==(o)
|
@@ -285,12 +347,14 @@ module CityPayApiClient
|
|
285
347
|
bin_eu == o.bin_eu &&
|
286
348
|
card_id == o.card_id &&
|
287
349
|
card_status == o.card_status &&
|
350
|
+
date_created == o.date_created &&
|
288
351
|
default == o.default &&
|
289
352
|
expmonth == o.expmonth &&
|
290
353
|
expyear == o.expyear &&
|
291
354
|
label == o.label &&
|
292
355
|
label2 == o.label2 &&
|
293
356
|
last4digits == o.last4digits &&
|
357
|
+
name_on_card == o.name_on_card &&
|
294
358
|
scheme == o.scheme &&
|
295
359
|
token == o.token
|
296
360
|
end
|
@@ -304,44 +368,40 @@ module CityPayApiClient
|
|
304
368
|
# Calculates hash code according to all attributes.
|
305
369
|
# @return [Integer] Hash code
|
306
370
|
def hash
|
307
|
-
[bin_commercial, bin_corporate, bin_country_issued, bin_credit, bin_currency, bin_debit, bin_description, bin_eu, card_id, card_status, default, expmonth, expyear, label, label2, last4digits, scheme, token].hash
|
371
|
+
[bin_commercial, bin_corporate, bin_country_issued, bin_credit, bin_currency, bin_debit, bin_description, bin_eu, card_id, card_status, date_created, default, expmonth, expyear, label, label2, last4digits, name_on_card, scheme, token].hash
|
308
372
|
end
|
309
373
|
|
310
374
|
# Builds the object from hash
|
311
375
|
# @param [Hash] attributes Model attributes in the form of hash
|
312
376
|
# @return [Object] Returns the model itself
|
313
377
|
def self.build_from_hash(attributes)
|
314
|
-
new.build_from_hash(attributes)
|
315
|
-
end
|
316
|
-
|
317
|
-
# Builds the object from hash
|
318
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
319
|
-
# @return [Object] Returns the model itself
|
320
|
-
def build_from_hash(attributes)
|
321
378
|
return nil unless attributes.is_a?(Hash)
|
322
|
-
|
323
|
-
|
379
|
+
attributes = attributes.transform_keys(&:to_sym)
|
380
|
+
transformed_hash = {}
|
381
|
+
openapi_types.each_pair do |key, type|
|
382
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
383
|
+
transformed_hash["#{key}"] = nil
|
384
|
+
elsif type =~ /\AArray<(.*)>/i
|
324
385
|
# check to ensure the input is an array given that the attribute
|
325
386
|
# is documented as an array but the input is not
|
326
|
-
if attributes[
|
327
|
-
|
387
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
388
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
328
389
|
end
|
329
|
-
elsif !attributes[
|
330
|
-
|
331
|
-
end
|
390
|
+
elsif !attributes[attribute_map[key]].nil?
|
391
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
392
|
+
end
|
332
393
|
end
|
333
|
-
|
334
|
-
self
|
394
|
+
new(transformed_hash)
|
335
395
|
end
|
336
396
|
|
337
397
|
# Deserializes the data based on type
|
338
398
|
# @param string type Data type
|
339
399
|
# @param string value Value to be deserialized
|
340
400
|
# @return [Object] Deserialized data
|
341
|
-
def _deserialize(type, value)
|
401
|
+
def self._deserialize(type, value)
|
342
402
|
case type.to_sym
|
343
|
-
when :
|
344
|
-
|
403
|
+
when :Time
|
404
|
+
Time.parse(value)
|
345
405
|
when :Date
|
346
406
|
Date.parse(value)
|
347
407
|
when :String
|
@@ -371,7 +431,9 @@ module CityPayApiClient
|
|
371
431
|
end
|
372
432
|
end
|
373
433
|
else # model
|
374
|
-
|
434
|
+
# models (e.g. Pet) or oneOf
|
435
|
+
klass = CityPayApiClient.const_get(type)
|
436
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
375
437
|
end
|
376
438
|
end
|
377
439
|
|
@@ -397,7 +459,7 @@ module CityPayApiClient
|
|
397
459
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
398
460
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
399
461
|
end
|
400
|
-
|
462
|
+
|
401
463
|
hash[param] = _to_hash(value)
|
402
464
|
end
|
403
465
|
hash
|
@@ -420,5 +482,7 @@ module CityPayApiClient
|
|
420
482
|
value
|
421
483
|
end
|
422
484
|
end
|
485
|
+
|
423
486
|
end
|
487
|
+
|
424
488
|
end
|