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
@@ -0,0 +1,332 @@
|
|
1
|
+
=begin
|
2
|
+
#CityPay Payment API
|
3
|
+
|
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
|
+
|
6
|
+
Contact: support@citypay.com
|
7
|
+
Generated by: https://openapi-generator.tech
|
8
|
+
OpenAPI Generator version: 7.2.0
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
require 'time'
|
14
|
+
|
15
|
+
module CityPayApiClient
|
16
|
+
class TokenisationResponseModel
|
17
|
+
# The result of any authentication using 3d_secure authorisation against ecommerce transactions. Values are: <table> <tr> <th>Value</th> <th>Description</th> </tr> <tr> <td>Y</td> <td>Authentication Successful. The Cardholder's password was successfully validated.</td> </tr> <tr> <td>N</td> <td>Authentication Failed. Customer failed or cancelled authentication, transaction denied.</td> </tr> <tr> <td>A</td> <td>Attempts Processing Performed Authentication could not be completed but a proof of authentication attempt (CAVV) was generated.</td> </tr> <tr> <td>U</td> <td>Authentication Could Not Be Performed Authentication could not be completed, due to technical or other problem.</td> </tr> </table>
|
18
|
+
attr_accessor :authen_result
|
19
|
+
|
20
|
+
# Determines whether the bin range was found to be a commercial or business card.
|
21
|
+
attr_accessor :bin_commercial
|
22
|
+
|
23
|
+
# Determines whether the bin range was found to be a debit card. If false the card was considered as a credit card.
|
24
|
+
attr_accessor :bin_debit
|
25
|
+
|
26
|
+
# A description of the bin range found for the card.
|
27
|
+
attr_accessor :bin_description
|
28
|
+
|
29
|
+
# An Electronic Commerce Indicator (ECI) used to identify the result of authentication using 3DSecure.
|
30
|
+
attr_accessor :eci
|
31
|
+
|
32
|
+
# The identifier provided within the request.
|
33
|
+
attr_accessor :identifier
|
34
|
+
|
35
|
+
# A masked value of the card number used for processing displaying limited values that can be used on a receipt.
|
36
|
+
attr_accessor :maskedpan
|
37
|
+
|
38
|
+
# The name of the card scheme of the transaction that processed the transaction such as Visa or MasterCard.
|
39
|
+
attr_accessor :scheme
|
40
|
+
|
41
|
+
# A Base58 encoded SHA-256 digest generated from the token value Base58 decoded and appended with the nonce value UTF-8 decoded.
|
42
|
+
attr_accessor :sig_id
|
43
|
+
|
44
|
+
# The token used for presentment to authorisation later in the processing flow.
|
45
|
+
attr_accessor :token
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
:'authen_result' => :'authen_result',
|
51
|
+
:'bin_commercial' => :'bin_commercial',
|
52
|
+
:'bin_debit' => :'bin_debit',
|
53
|
+
:'bin_description' => :'bin_description',
|
54
|
+
:'eci' => :'eci',
|
55
|
+
:'identifier' => :'identifier',
|
56
|
+
:'maskedpan' => :'maskedpan',
|
57
|
+
:'scheme' => :'scheme',
|
58
|
+
:'sig_id' => :'sig_id',
|
59
|
+
:'token' => :'token'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Returns all the JSON keys this model knows about
|
64
|
+
def self.acceptable_attributes
|
65
|
+
attribute_map.values
|
66
|
+
end
|
67
|
+
|
68
|
+
# Attribute type mapping.
|
69
|
+
def self.openapi_types
|
70
|
+
{
|
71
|
+
:'authen_result' => :'String',
|
72
|
+
:'bin_commercial' => :'Boolean',
|
73
|
+
:'bin_debit' => :'Boolean',
|
74
|
+
:'bin_description' => :'String',
|
75
|
+
:'eci' => :'String',
|
76
|
+
:'identifier' => :'String',
|
77
|
+
:'maskedpan' => :'String',
|
78
|
+
:'scheme' => :'String',
|
79
|
+
:'sig_id' => :'String',
|
80
|
+
:'token' => :'String'
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# List of attributes with nullable: true
|
85
|
+
def self.openapi_nullable
|
86
|
+
Set.new([
|
87
|
+
])
|
88
|
+
end
|
89
|
+
|
90
|
+
# Initializes the object
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
def initialize(attributes = {})
|
93
|
+
if (!attributes.is_a?(Hash))
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::TokenisationResponseModel` initialize method"
|
95
|
+
end
|
96
|
+
|
97
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
98
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
99
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `CityPayApiClient::TokenisationResponseModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
101
|
+
end
|
102
|
+
h[k.to_sym] = v
|
103
|
+
}
|
104
|
+
|
105
|
+
if attributes.key?(:'authen_result')
|
106
|
+
self.authen_result = attributes[:'authen_result']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'bin_commercial')
|
110
|
+
self.bin_commercial = attributes[:'bin_commercial']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'bin_debit')
|
114
|
+
self.bin_debit = attributes[:'bin_debit']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'bin_description')
|
118
|
+
self.bin_description = attributes[:'bin_description']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'eci')
|
122
|
+
self.eci = attributes[:'eci']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'identifier')
|
126
|
+
self.identifier = attributes[:'identifier']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'maskedpan')
|
130
|
+
self.maskedpan = attributes[:'maskedpan']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'scheme')
|
134
|
+
self.scheme = attributes[:'scheme']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'sig_id')
|
138
|
+
self.sig_id = attributes[:'sig_id']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:'token')
|
142
|
+
self.token = attributes[:'token']
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
147
|
+
# @return Array for valid properties with the reasons
|
148
|
+
def list_invalid_properties
|
149
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
150
|
+
invalid_properties = Array.new
|
151
|
+
if !@identifier.nil? && @identifier.to_s.length > 50
|
152
|
+
invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
|
153
|
+
end
|
154
|
+
|
155
|
+
if !@identifier.nil? && @identifier.to_s.length < 4
|
156
|
+
invalid_properties.push('invalid value for "identifier", the character length must be great than or equal to 4.')
|
157
|
+
end
|
158
|
+
|
159
|
+
invalid_properties
|
160
|
+
end
|
161
|
+
|
162
|
+
# Check to see if the all the properties in the model are valid
|
163
|
+
# @return true if the model is valid
|
164
|
+
def valid?
|
165
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
166
|
+
return false if !@identifier.nil? && @identifier.to_s.length > 50
|
167
|
+
return false if !@identifier.nil? && @identifier.to_s.length < 4
|
168
|
+
true
|
169
|
+
end
|
170
|
+
|
171
|
+
# Custom attribute writer method with validation
|
172
|
+
# @param [Object] identifier Value to be assigned
|
173
|
+
def identifier=(identifier)
|
174
|
+
if identifier.nil?
|
175
|
+
fail ArgumentError, 'identifier cannot be nil'
|
176
|
+
end
|
177
|
+
|
178
|
+
if identifier.to_s.length > 50
|
179
|
+
fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
|
180
|
+
end
|
181
|
+
|
182
|
+
if identifier.to_s.length < 4
|
183
|
+
fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
|
184
|
+
end
|
185
|
+
|
186
|
+
@identifier = identifier
|
187
|
+
end
|
188
|
+
|
189
|
+
# Checks equality by comparing each attribute.
|
190
|
+
# @param [Object] Object to be compared
|
191
|
+
def ==(o)
|
192
|
+
return true if self.equal?(o)
|
193
|
+
self.class == o.class &&
|
194
|
+
authen_result == o.authen_result &&
|
195
|
+
bin_commercial == o.bin_commercial &&
|
196
|
+
bin_debit == o.bin_debit &&
|
197
|
+
bin_description == o.bin_description &&
|
198
|
+
eci == o.eci &&
|
199
|
+
identifier == o.identifier &&
|
200
|
+
maskedpan == o.maskedpan &&
|
201
|
+
scheme == o.scheme &&
|
202
|
+
sig_id == o.sig_id &&
|
203
|
+
token == o.token
|
204
|
+
end
|
205
|
+
|
206
|
+
# @see the `==` method
|
207
|
+
# @param [Object] Object to be compared
|
208
|
+
def eql?(o)
|
209
|
+
self == o
|
210
|
+
end
|
211
|
+
|
212
|
+
# Calculates hash code according to all attributes.
|
213
|
+
# @return [Integer] Hash code
|
214
|
+
def hash
|
215
|
+
[authen_result, bin_commercial, bin_debit, bin_description, eci, identifier, maskedpan, scheme, sig_id, token].hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Builds the object from hash
|
219
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
220
|
+
# @return [Object] Returns the model itself
|
221
|
+
def self.build_from_hash(attributes)
|
222
|
+
return nil unless attributes.is_a?(Hash)
|
223
|
+
attributes = attributes.transform_keys(&:to_sym)
|
224
|
+
transformed_hash = {}
|
225
|
+
openapi_types.each_pair do |key, type|
|
226
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
227
|
+
transformed_hash["#{key}"] = nil
|
228
|
+
elsif type =~ /\AArray<(.*)>/i
|
229
|
+
# check to ensure the input is an array given that the attribute
|
230
|
+
# is documented as an array but the input is not
|
231
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
232
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
233
|
+
end
|
234
|
+
elsif !attributes[attribute_map[key]].nil?
|
235
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
236
|
+
end
|
237
|
+
end
|
238
|
+
new(transformed_hash)
|
239
|
+
end
|
240
|
+
|
241
|
+
# Deserializes the data based on type
|
242
|
+
# @param string type Data type
|
243
|
+
# @param string value Value to be deserialized
|
244
|
+
# @return [Object] Deserialized data
|
245
|
+
def self._deserialize(type, value)
|
246
|
+
case type.to_sym
|
247
|
+
when :Time
|
248
|
+
Time.parse(value)
|
249
|
+
when :Date
|
250
|
+
Date.parse(value)
|
251
|
+
when :String
|
252
|
+
value.to_s
|
253
|
+
when :Integer
|
254
|
+
value.to_i
|
255
|
+
when :Float
|
256
|
+
value.to_f
|
257
|
+
when :Boolean
|
258
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
259
|
+
true
|
260
|
+
else
|
261
|
+
false
|
262
|
+
end
|
263
|
+
when :Object
|
264
|
+
# generic object (usually a Hash), return directly
|
265
|
+
value
|
266
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
267
|
+
inner_type = Regexp.last_match[:inner_type]
|
268
|
+
value.map { |v| _deserialize(inner_type, v) }
|
269
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
270
|
+
k_type = Regexp.last_match[:k_type]
|
271
|
+
v_type = Regexp.last_match[:v_type]
|
272
|
+
{}.tap do |hash|
|
273
|
+
value.each do |k, v|
|
274
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
else # model
|
278
|
+
# models (e.g. Pet) or oneOf
|
279
|
+
klass = CityPayApiClient.const_get(type)
|
280
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
# Returns the string representation of the object
|
285
|
+
# @return [String] String presentation of the object
|
286
|
+
def to_s
|
287
|
+
to_hash.to_s
|
288
|
+
end
|
289
|
+
|
290
|
+
# to_body is an alias to to_hash (backward compatibility)
|
291
|
+
# @return [Hash] Returns the object in the form of hash
|
292
|
+
def to_body
|
293
|
+
to_hash
|
294
|
+
end
|
295
|
+
|
296
|
+
# Returns the object in the form of hash
|
297
|
+
# @return [Hash] Returns the object in the form of hash
|
298
|
+
def to_hash
|
299
|
+
hash = {}
|
300
|
+
self.class.attribute_map.each_pair do |attr, param|
|
301
|
+
value = self.send(attr)
|
302
|
+
if value.nil?
|
303
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
304
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
305
|
+
end
|
306
|
+
|
307
|
+
hash[param] = _to_hash(value)
|
308
|
+
end
|
309
|
+
hash
|
310
|
+
end
|
311
|
+
|
312
|
+
# Outputs non-array value in the form of hash
|
313
|
+
# For object, use to_hash. Otherwise, just return the value
|
314
|
+
# @param [Object] value Any valid value
|
315
|
+
# @return [Hash] Returns the value in the form of hash
|
316
|
+
def _to_hash(value)
|
317
|
+
if value.is_a?(Array)
|
318
|
+
value.compact.map { |v| _to_hash(v) }
|
319
|
+
elsif value.is_a?(Hash)
|
320
|
+
{}.tap do |hash|
|
321
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
322
|
+
end
|
323
|
+
elsif value.respond_to? :to_hash
|
324
|
+
value.to_hash
|
325
|
+
else
|
326
|
+
value
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
end
|
331
|
+
|
332
|
+
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 VoidRequest
|
@@ -19,9 +20,6 @@ module CityPayApiClient
|
|
19
20
|
# Identifies the merchant account to perform the void for.
|
20
21
|
attr_accessor :merchantid
|
21
22
|
|
22
|
-
# An optional reference value for the calling client such as a version number i.e.
|
23
|
-
attr_accessor :sdk
|
24
|
-
|
25
23
|
# The transaction number of the transaction to look up and void. If an empty value is supplied then an identifier value must be supplied.
|
26
24
|
attr_accessor :transno
|
27
25
|
|
@@ -30,17 +28,20 @@ module CityPayApiClient
|
|
30
28
|
{
|
31
29
|
:'identifier' => :'identifier',
|
32
30
|
:'merchantid' => :'merchantid',
|
33
|
-
:'sdk' => :'sdk',
|
34
31
|
:'transno' => :'transno'
|
35
32
|
}
|
36
33
|
end
|
37
34
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
36
|
+
def self.acceptable_attributes
|
37
|
+
attribute_map.values
|
38
|
+
end
|
39
|
+
|
38
40
|
# Attribute type mapping.
|
39
41
|
def self.openapi_types
|
40
42
|
{
|
41
43
|
:'identifier' => :'String',
|
42
44
|
:'merchantid' => :'Integer',
|
43
|
-
:'sdk' => :'String',
|
44
45
|
:'transno' => :'Integer'
|
45
46
|
}
|
46
47
|
end
|
@@ -72,12 +73,8 @@ module CityPayApiClient
|
|
72
73
|
|
73
74
|
if attributes.key?(:'merchantid')
|
74
75
|
self.merchantid = attributes[:'merchantid']
|
75
|
-
end
|
76
|
-
|
77
|
-
if attributes.key?(:'sdk')
|
78
|
-
self.sdk = attributes[:'sdk']
|
79
76
|
else
|
80
|
-
self.
|
77
|
+
self.merchantid = nil
|
81
78
|
end
|
82
79
|
|
83
80
|
if attributes.key?(:'transno')
|
@@ -88,6 +85,7 @@ module CityPayApiClient
|
|
88
85
|
# Show invalid properties with the reasons. Usually used together with valid?
|
89
86
|
# @return Array for valid properties with the reasons
|
90
87
|
def list_invalid_properties
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
91
89
|
invalid_properties = Array.new
|
92
90
|
if !@identifier.nil? && @identifier.to_s.length > 50
|
93
91
|
invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
|
@@ -107,6 +105,7 @@ module CityPayApiClient
|
|
107
105
|
# Check to see if the all the properties in the model are valid
|
108
106
|
# @return true if the model is valid
|
109
107
|
def valid?
|
108
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
110
109
|
return false if !@identifier.nil? && @identifier.to_s.length > 50
|
111
110
|
return false if !@identifier.nil? && @identifier.to_s.length < 4
|
112
111
|
return false if @merchantid.nil?
|
@@ -116,11 +115,15 @@ module CityPayApiClient
|
|
116
115
|
# Custom attribute writer method with validation
|
117
116
|
# @param [Object] identifier Value to be assigned
|
118
117
|
def identifier=(identifier)
|
119
|
-
if
|
118
|
+
if identifier.nil?
|
119
|
+
fail ArgumentError, 'identifier cannot be nil'
|
120
|
+
end
|
121
|
+
|
122
|
+
if identifier.to_s.length > 50
|
120
123
|
fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
|
121
124
|
end
|
122
125
|
|
123
|
-
if
|
126
|
+
if identifier.to_s.length < 4
|
124
127
|
fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
|
125
128
|
end
|
126
129
|
|
@@ -134,7 +137,6 @@ module CityPayApiClient
|
|
134
137
|
self.class == o.class &&
|
135
138
|
identifier == o.identifier &&
|
136
139
|
merchantid == o.merchantid &&
|
137
|
-
sdk == o.sdk &&
|
138
140
|
transno == o.transno
|
139
141
|
end
|
140
142
|
|
@@ -147,44 +149,40 @@ module CityPayApiClient
|
|
147
149
|
# Calculates hash code according to all attributes.
|
148
150
|
# @return [Integer] Hash code
|
149
151
|
def hash
|
150
|
-
[identifier, merchantid,
|
152
|
+
[identifier, merchantid, transno].hash
|
151
153
|
end
|
152
154
|
|
153
155
|
# Builds the object from hash
|
154
156
|
# @param [Hash] attributes Model attributes in the form of hash
|
155
157
|
# @return [Object] Returns the model itself
|
156
158
|
def self.build_from_hash(attributes)
|
157
|
-
new.build_from_hash(attributes)
|
158
|
-
end
|
159
|
-
|
160
|
-
# Builds the object from hash
|
161
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
-
# @return [Object] Returns the model itself
|
163
|
-
def build_from_hash(attributes)
|
164
159
|
return nil unless attributes.is_a?(Hash)
|
165
|
-
|
166
|
-
|
160
|
+
attributes = attributes.transform_keys(&:to_sym)
|
161
|
+
transformed_hash = {}
|
162
|
+
openapi_types.each_pair do |key, type|
|
163
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
164
|
+
transformed_hash["#{key}"] = nil
|
165
|
+
elsif type =~ /\AArray<(.*)>/i
|
167
166
|
# check to ensure the input is an array given that the attribute
|
168
167
|
# is documented as an array but the input is not
|
169
|
-
if attributes[
|
170
|
-
|
168
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
169
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
171
170
|
end
|
172
|
-
elsif !attributes[
|
173
|
-
|
174
|
-
end
|
171
|
+
elsif !attributes[attribute_map[key]].nil?
|
172
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
173
|
+
end
|
175
174
|
end
|
176
|
-
|
177
|
-
self
|
175
|
+
new(transformed_hash)
|
178
176
|
end
|
179
177
|
|
180
178
|
# Deserializes the data based on type
|
181
179
|
# @param string type Data type
|
182
180
|
# @param string value Value to be deserialized
|
183
181
|
# @return [Object] Deserialized data
|
184
|
-
def _deserialize(type, value)
|
182
|
+
def self._deserialize(type, value)
|
185
183
|
case type.to_sym
|
186
|
-
when :
|
187
|
-
|
184
|
+
when :Time
|
185
|
+
Time.parse(value)
|
188
186
|
when :Date
|
189
187
|
Date.parse(value)
|
190
188
|
when :String
|
@@ -214,7 +212,9 @@ module CityPayApiClient
|
|
214
212
|
end
|
215
213
|
end
|
216
214
|
else # model
|
217
|
-
|
215
|
+
# models (e.g. Pet) or oneOf
|
216
|
+
klass = CityPayApiClient.const_get(type)
|
217
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
@@ -240,7 +240,7 @@ module CityPayApiClient
|
|
240
240
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
241
241
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
242
242
|
end
|
243
|
-
|
243
|
+
|
244
244
|
hash[param] = _to_hash(value)
|
245
245
|
end
|
246
246
|
hash
|
@@ -263,5 +263,7 @@ module CityPayApiClient
|
|
263
263
|
value
|
264
264
|
end
|
265
265
|
end
|
266
|
+
|
266
267
|
end
|
268
|
+
|
267
269
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'digest'
|
2
|
+
|
3
|
+
module DigestUtils
|
4
|
+
class << self
|
5
|
+
def validate_digest(auth_response, licence_key)
|
6
|
+
|
7
|
+
string_to_convert = auth_response.authcode +
|
8
|
+
auth_response.amount.to_s +
|
9
|
+
auth_response.result_code +
|
10
|
+
auth_response.merchantid.to_s +
|
11
|
+
auth_response.transno.to_s +
|
12
|
+
auth_response.identifier +
|
13
|
+
licence_key
|
14
|
+
|
15
|
+
auth_response.sha256 == Digest::SHA256.base64digest(string_to_convert)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
|
3
|
+
module DirectPostMac
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def validate(licence_key, nonce, amount, identifier, mac_to_validate)
|
7
|
+
mac = create(licence_key, nonce, amount, identifier)
|
8
|
+
mac === mac_to_validate
|
9
|
+
end
|
10
|
+
|
11
|
+
def create(licence_key, nonce, amount, identifier)
|
12
|
+
nonce_s = nonce.pack('c*').upcase
|
13
|
+
|
14
|
+
value = []
|
15
|
+
value.push(*nonce_s.bytes)
|
16
|
+
value.push(*amount.bytes)
|
17
|
+
value.push(*identifier.bytes)
|
18
|
+
|
19
|
+
OpenSSL::HMAC.hexdigest('sha256', licence_key, value.pack("c*")).upcase
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,15 +1,14 @@
|
|
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
|
module CityPayApiClient
|
13
|
-
VERSION = '1.
|
14
|
-
FULL_VERSION = "CP_RUBY_#{RbConfig::CONFIG['MAJOR']}.#{RbConfig::CONFIG['MINOR']}/#{VERSION}"
|
13
|
+
VERSION = '1.1.2'
|
15
14
|
end
|