citypay_api_client 1.0.3 → 1.1.1
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 +105 -34
- data/citypay_api_client.gemspec +4 -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 +50 -49
- data/docs/AuthResponse.md +60 -59
- data/docs/AuthenRequired.md +12 -11
- data/docs/AuthorisationAndPaymentApi.md +559 -0
- data/docs/Batch.md +22 -0
- data/docs/BatchProcessingApi.md +214 -0
- data/docs/BatchReportRequest.md +20 -0
- data/docs/BatchReportResponseModel.md +28 -0
- data/docs/BatchTransaction.md +24 -0
- data/docs/BatchTransactionResultModel.md +40 -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 +326 -105
- data/docs/CardStatus.md +10 -9
- data/docs/ChargeRequest.md +36 -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 +365 -0
- data/docs/DirectPostRequest.md +58 -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/OperationalApi.md +124 -22
- data/docs/OperationalFunctionsApi.md +355 -0
- data/docs/PaResAuthRequest.md +10 -9
- data/docs/PaylinkAddress.md +30 -0
- data/docs/PaylinkAdjustmentRequest.md +22 -0
- data/docs/PaylinkApi.md +630 -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 +36 -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 +38 -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/PaymentProcessingApi.md +307 -68
- 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/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 +59 -59
- data/lib/citypay_api_client/api_error.rb +2 -2
- data/lib/citypay_api_client/configuration.rb +53 -15
- data/lib/citypay_api_client/models/account_create.rb +21 -8
- data/lib/citypay_api_client/models/account_status.rb +21 -8
- data/lib/citypay_api_client/models/acknowledgement.rb +21 -8
- data/lib/citypay_api_client/models/acl_check_request.rb +224 -0
- data/lib/citypay_api_client/models/acl_check_response_model.rb +249 -0
- data/lib/citypay_api_client/models/airline_advice.rb +23 -10
- data/lib/citypay_api_client/models/airline_segment.rb +21 -8
- data/lib/citypay_api_client/models/auth_reference.rb +45 -11
- data/lib/citypay_api_client/models/auth_references.rb +21 -8
- data/lib/citypay_api_client/models/auth_request.rb +79 -35
- data/lib/citypay_api_client/models/auth_response.rb +43 -106
- data/lib/citypay_api_client/models/authen_required.rb +21 -8
- data/lib/citypay_api_client/models/batch.rb +264 -0
- data/lib/citypay_api_client/models/batch_report_request.rb +277 -0
- data/lib/citypay_api_client/models/batch_report_response_model.rb +357 -0
- data/lib/citypay_api_client/models/batch_transaction.rb +321 -0
- data/lib/citypay_api_client/models/batch_transaction_result_model.rb +421 -0
- data/lib/citypay_api_client/models/bin.rb +299 -0
- data/lib/citypay_api_client/models/bin_lookup.rb +234 -0
- data/lib/citypay_api_client/models/c_res_auth_request.rb +21 -8
- data/lib/citypay_api_client/models/capture_request.rb +38 -22
- data/lib/citypay_api_client/models/card.rb +67 -10
- data/lib/citypay_api_client/models/card_holder_account.rb +35 -12
- data/lib/citypay_api_client/models/card_status.rb +21 -8
- data/lib/citypay_api_client/models/charge_request.rb +96 -26
- data/lib/citypay_api_client/models/check_batch_status.rb +259 -0
- data/lib/citypay_api_client/models/check_batch_status_response.rb +220 -0
- data/lib/citypay_api_client/models/contact_details.rb +87 -44
- data/lib/citypay_api_client/models/decision.rb +21 -8
- data/lib/citypay_api_client/models/direct_post_request.rb +670 -0
- data/lib/citypay_api_client/models/direct_token_auth_request.rb +249 -0
- data/lib/citypay_api_client/models/domain_key_check_request.rb +252 -0
- data/lib/citypay_api_client/models/domain_key_request.rb +250 -0
- data/lib/citypay_api_client/models/domain_key_response.rb +294 -0
- data/lib/citypay_api_client/models/error.rb +35 -12
- data/lib/citypay_api_client/models/event_data_model.rb +259 -0
- data/lib/citypay_api_client/models/exists.rb +244 -0
- data/lib/citypay_api_client/models/external_mpi.rb +27 -8
- data/lib/citypay_api_client/models/list_merchants_response.rb +21 -8
- data/lib/citypay_api_client/models/mcc6012.rb +21 -8
- data/lib/citypay_api_client/models/merchant.rb +21 -8
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +22 -9
- data/lib/citypay_api_client/models/paylink_address.rb +402 -0
- data/lib/citypay_api_client/models/paylink_adjustment_request.rb +269 -0
- data/lib/citypay_api_client/models/paylink_attachment_request.rb +269 -0
- data/lib/citypay_api_client/models/paylink_attachment_result.rb +249 -0
- data/lib/citypay_api_client/models/paylink_bill_payment_token_request.rb +292 -0
- data/lib/citypay_api_client/models/paylink_card_holder.rb +353 -0
- data/lib/citypay_api_client/models/paylink_cart.rb +280 -0
- data/lib/citypay_api_client/models/paylink_cart_item_model.rb +289 -0
- data/lib/citypay_api_client/models/paylink_config.rb +433 -0
- data/lib/citypay_api_client/models/paylink_custom_param.rb +314 -0
- data/lib/citypay_api_client/models/paylink_email_notification_path.rb +268 -0
- data/lib/citypay_api_client/models/paylink_error_code.rb +239 -0
- data/lib/citypay_api_client/models/paylink_field_guard_model.rb +279 -0
- data/lib/citypay_api_client/models/paylink_part_payments.rb +269 -0
- data/lib/citypay_api_client/models/paylink_sms_notification_path.rb +234 -0
- data/lib/citypay_api_client/models/paylink_state_event.rb +239 -0
- data/lib/citypay_api_client/models/paylink_token_created.rb +364 -0
- data/lib/citypay_api_client/models/paylink_token_request_model.rb +374 -0
- data/lib/citypay_api_client/models/paylink_token_status.rb +490 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_request.rb +270 -0
- data/lib/citypay_api_client/models/paylink_token_status_change_response.rb +235 -0
- data/lib/citypay_api_client/models/paylink_ui.rb +249 -0
- data/lib/citypay_api_client/models/ping.rb +21 -8
- data/lib/citypay_api_client/models/process_batch_request.rb +308 -0
- data/lib/citypay_api_client/models/process_batch_response.rb +234 -0
- data/lib/citypay_api_client/models/refund_request.rb +332 -0
- data/lib/citypay_api_client/models/register_card.rb +59 -12
- data/lib/citypay_api_client/models/request_challenged.rb +29 -16
- data/lib/citypay_api_client/models/retrieve_request.rb +21 -8
- data/lib/citypay_api_client/models/three_d_secure.rb +106 -13
- data/lib/citypay_api_client/models/tokenisation_response_model.rb +333 -0
- data/lib/citypay_api_client/models/void_request.rb +22 -21
- 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 +126 -58
- 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/auth_references_spec.rb +7 -8
- data/spec/models/auth_response_spec.rb +29 -30
- data/spec/models/batch_report_request_spec.rb +39 -0
- data/spec/models/batch_report_response_model_spec.rb +63 -0
- data/spec/models/batch_spec.rb +45 -0
- data/spec/models/batch_transaction_result_model_spec.rb +87 -0
- data/spec/models/batch_transaction_spec.rb +51 -0
- data/spec/models/bin_lookup_spec.rb +33 -0
- data/spec/models/bin_spec.rb +81 -0
- data/spec/models/card_holder_account_spec.rb +8 -5
- 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 +153 -0
- data/spec/models/direct_token_auth_request_spec.rb +51 -0
- data/spec/models/domain_key_check_request_spec.rb +33 -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 +93 -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 +51 -0
- data/spec/models/process_batch_response_spec.rb +39 -0
- data/spec/models/refund_request_spec.rb +64 -0
- 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 +210 -37
- data/Gemfile.lock +0 -70
- 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,373 @@
|
|
1
|
+
=begin
|
2
|
+
#CityPay Payment API
|
3
|
+
|
4
|
+
# This CityPay API is a 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 tokinsed payments using Card Holder 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](#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 card holder 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: 6.2.1
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'cgi'
|
13
|
+
|
14
|
+
module CityPayApiClient
|
15
|
+
class DirectPostApi
|
16
|
+
attr_accessor :api_client
|
17
|
+
|
18
|
+
def initialize(api_client = ApiClient.default)
|
19
|
+
@api_client = api_client
|
20
|
+
end
|
21
|
+
# Handles a CRes response from ACS, returning back the result of authorisation
|
22
|
+
# Used to post from an ACS during a ThreeDSecure direct flow process. The endpoint requires a valid `threeDSSessionData` value which defines the unique transaction through its workflow. This endpoint may be used by merchants wishing to perform a `Direct Post` integration who wish to handle the challenge flow themselves.
|
23
|
+
# @param uuid [String] An identifier used to track the CReq/CRes cycle.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @option opts [String] :cres The CRES from the ACS.
|
26
|
+
# @option opts [String] :three_ds_session_data The session data from the ACS.
|
27
|
+
# @return [AuthResponse]
|
28
|
+
def direct_c_res_auth_request(uuid, opts = {})
|
29
|
+
data, _status_code, _headers = direct_c_res_auth_request_with_http_info(uuid, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Handles a CRes response from ACS, returning back the result of authorisation
|
34
|
+
# Used to post from an ACS during a ThreeDSecure direct flow process. The endpoint requires a valid `threeDSSessionData` value which defines the unique transaction through its workflow. This endpoint may be used by merchants wishing to perform a `Direct Post` integration who wish to handle the challenge flow themselves.
|
35
|
+
# @param uuid [String] An identifier used to track the CReq/CRes cycle.
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [String] :cres The CRES from the ACS.
|
38
|
+
# @option opts [String] :three_ds_session_data The session data from the ACS.
|
39
|
+
# @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
|
40
|
+
def direct_c_res_auth_request_with_http_info(uuid, opts = {})
|
41
|
+
if @api_client.config.debugging
|
42
|
+
@api_client.config.logger.debug 'Calling API: DirectPostApi.direct_c_res_auth_request ...'
|
43
|
+
end
|
44
|
+
# verify the required parameter 'uuid' is set
|
45
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
46
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling DirectPostApi.direct_c_res_auth_request"
|
47
|
+
end
|
48
|
+
# resource path
|
49
|
+
local_var_path = '/direct/cres/auth/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
50
|
+
|
51
|
+
# query parameters
|
52
|
+
query_params = opts[:query_params] || {}
|
53
|
+
|
54
|
+
# header parameters
|
55
|
+
header_params = opts[:header_params] || {}
|
56
|
+
# HTTP header 'Accept' (if needed)
|
57
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'application/x-www-form-urlencoded'])
|
58
|
+
# HTTP header 'Content-Type'
|
59
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
60
|
+
if !content_type.nil?
|
61
|
+
header_params['Content-Type'] = content_type
|
62
|
+
end
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = opts[:form_params] || {}
|
66
|
+
form_params['cres'] = opts[:'cres'] if !opts[:'cres'].nil?
|
67
|
+
form_params['threeDSSessionData'] = opts[:'three_ds_session_data'] if !opts[:'three_ds_session_data'].nil?
|
68
|
+
|
69
|
+
# http body (model)
|
70
|
+
post_body = opts[:debug_body]
|
71
|
+
|
72
|
+
# return_type
|
73
|
+
return_type = opts[:debug_return_type] || 'AuthResponse'
|
74
|
+
|
75
|
+
# auth_names
|
76
|
+
auth_names = opts[:debug_auth_names] || []
|
77
|
+
|
78
|
+
new_options = opts.merge(
|
79
|
+
:operation => :"DirectPostApi.direct_c_res_auth_request",
|
80
|
+
:header_params => header_params,
|
81
|
+
:query_params => query_params,
|
82
|
+
:form_params => form_params,
|
83
|
+
:body => post_body,
|
84
|
+
:auth_names => auth_names,
|
85
|
+
:return_type => return_type
|
86
|
+
)
|
87
|
+
|
88
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
89
|
+
if @api_client.config.debugging
|
90
|
+
@api_client.config.logger.debug "API called: DirectPostApi#direct_c_res_auth_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
91
|
+
end
|
92
|
+
return data, status_code, headers
|
93
|
+
end
|
94
|
+
|
95
|
+
# Handles a CRes response from ACS, returning back a token for future authorisation
|
96
|
+
# Used to post from an ACS during a ThreeDSecure direct flow process. The endpoint requires a valid `threeDSSessionData` value which defines the unique transaction through its workflow. This endpoint may be used by merchants wishing to perform a `Direct Post` integration who wish to handle the challenge flow themselves.
|
97
|
+
# @param uuid [String] An identifier used to track the CReq/CRes cycle.
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @option opts [String] :cres The CRES from the ACS.
|
100
|
+
# @option opts [String] :three_ds_session_data The session data from the ACS.
|
101
|
+
# @return [TokenisationResponseModel]
|
102
|
+
def direct_c_res_tokenise_request(uuid, opts = {})
|
103
|
+
data, _status_code, _headers = direct_c_res_tokenise_request_with_http_info(uuid, opts)
|
104
|
+
data
|
105
|
+
end
|
106
|
+
|
107
|
+
# Handles a CRes response from ACS, returning back a token for future authorisation
|
108
|
+
# Used to post from an ACS during a ThreeDSecure direct flow process. The endpoint requires a valid `threeDSSessionData` value which defines the unique transaction through its workflow. This endpoint may be used by merchants wishing to perform a `Direct Post` integration who wish to handle the challenge flow themselves.
|
109
|
+
# @param uuid [String] An identifier used to track the CReq/CRes cycle.
|
110
|
+
# @param [Hash] opts the optional parameters
|
111
|
+
# @option opts [String] :cres The CRES from the ACS.
|
112
|
+
# @option opts [String] :three_ds_session_data The session data from the ACS.
|
113
|
+
# @return [Array<(TokenisationResponseModel, Integer, Hash)>] TokenisationResponseModel data, response status code and response headers
|
114
|
+
def direct_c_res_tokenise_request_with_http_info(uuid, opts = {})
|
115
|
+
if @api_client.config.debugging
|
116
|
+
@api_client.config.logger.debug 'Calling API: DirectPostApi.direct_c_res_tokenise_request ...'
|
117
|
+
end
|
118
|
+
# verify the required parameter 'uuid' is set
|
119
|
+
if @api_client.config.client_side_validation && uuid.nil?
|
120
|
+
fail ArgumentError, "Missing the required parameter 'uuid' when calling DirectPostApi.direct_c_res_tokenise_request"
|
121
|
+
end
|
122
|
+
# resource path
|
123
|
+
local_var_path = '/direct/cres/tokenise/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))
|
124
|
+
|
125
|
+
# query parameters
|
126
|
+
query_params = opts[:query_params] || {}
|
127
|
+
|
128
|
+
# header parameters
|
129
|
+
header_params = opts[:header_params] || {}
|
130
|
+
# HTTP header 'Accept' (if needed)
|
131
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'application/x-www-form-urlencoded'])
|
132
|
+
# HTTP header 'Content-Type'
|
133
|
+
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
134
|
+
if !content_type.nil?
|
135
|
+
header_params['Content-Type'] = content_type
|
136
|
+
end
|
137
|
+
|
138
|
+
# form parameters
|
139
|
+
form_params = opts[:form_params] || {}
|
140
|
+
form_params['cres'] = opts[:'cres'] if !opts[:'cres'].nil?
|
141
|
+
form_params['threeDSSessionData'] = opts[:'three_ds_session_data'] if !opts[:'three_ds_session_data'].nil?
|
142
|
+
|
143
|
+
# http body (model)
|
144
|
+
post_body = opts[:debug_body]
|
145
|
+
|
146
|
+
# return_type
|
147
|
+
return_type = opts[:debug_return_type] || 'TokenisationResponseModel'
|
148
|
+
|
149
|
+
# auth_names
|
150
|
+
auth_names = opts[:debug_auth_names] || []
|
151
|
+
|
152
|
+
new_options = opts.merge(
|
153
|
+
:operation => :"DirectPostApi.direct_c_res_tokenise_request",
|
154
|
+
:header_params => header_params,
|
155
|
+
:query_params => query_params,
|
156
|
+
:form_params => form_params,
|
157
|
+
:body => post_body,
|
158
|
+
:auth_names => auth_names,
|
159
|
+
:return_type => return_type
|
160
|
+
)
|
161
|
+
|
162
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
163
|
+
if @api_client.config.debugging
|
164
|
+
@api_client.config.logger.debug "API called: DirectPostApi#direct_c_res_tokenise_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
165
|
+
end
|
166
|
+
return data, status_code, headers
|
167
|
+
end
|
168
|
+
|
169
|
+
# Direct Post Auth Request
|
170
|
+
# Used to initiate a direct post request transaction flow. <pre class=\"inline-code language-bash\"> <code> curl https://api.citypay.com/direct/auth?cp-domain-key=n834ytqp84y... \\ -d \"amount=7500&identifier=example_trans&cardnumber=4000000000000002&expmonth=9&expyear=2028&bill_to_postcode=L1+7ZW </code> </pre>.
|
171
|
+
# @param direct_post_request [DirectPostRequest]
|
172
|
+
# @param [Hash] opts the optional parameters
|
173
|
+
# @return [AuthResponse]
|
174
|
+
def direct_post_auth_request(direct_post_request, opts = {})
|
175
|
+
data, _status_code, _headers = direct_post_auth_request_with_http_info(direct_post_request, opts)
|
176
|
+
data
|
177
|
+
end
|
178
|
+
|
179
|
+
# Direct Post Auth Request
|
180
|
+
# Used to initiate a direct post request transaction flow. <pre class=\"inline-code language-bash\"> <code> curl https://api.citypay.com/direct/auth?cp-domain-key=n834ytqp84y... \\ -d \"amount=7500&identifier=example_trans&cardnumber=4000000000000002&expmonth=9&expyear=2028&bill_to_postcode=L1+7ZW </code> </pre>.
|
181
|
+
# @param direct_post_request [DirectPostRequest]
|
182
|
+
# @param [Hash] opts the optional parameters
|
183
|
+
# @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
|
184
|
+
def direct_post_auth_request_with_http_info(direct_post_request, opts = {})
|
185
|
+
if @api_client.config.debugging
|
186
|
+
@api_client.config.logger.debug 'Calling API: DirectPostApi.direct_post_auth_request ...'
|
187
|
+
end
|
188
|
+
# verify the required parameter 'direct_post_request' is set
|
189
|
+
if @api_client.config.client_side_validation && direct_post_request.nil?
|
190
|
+
fail ArgumentError, "Missing the required parameter 'direct_post_request' when calling DirectPostApi.direct_post_auth_request"
|
191
|
+
end
|
192
|
+
# resource path
|
193
|
+
local_var_path = '/direct/auth'
|
194
|
+
|
195
|
+
# query parameters
|
196
|
+
query_params = opts[:query_params] || {}
|
197
|
+
|
198
|
+
# header parameters
|
199
|
+
header_params = opts[:header_params] || {}
|
200
|
+
# HTTP header 'Accept' (if needed)
|
201
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'application/x-www-form-urlencoded', 'text/xml'])
|
202
|
+
# HTTP header 'Content-Type'
|
203
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'text/xml'])
|
204
|
+
if !content_type.nil?
|
205
|
+
header_params['Content-Type'] = content_type
|
206
|
+
end
|
207
|
+
|
208
|
+
# form parameters
|
209
|
+
form_params = opts[:form_params] || {}
|
210
|
+
|
211
|
+
# http body (model)
|
212
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(direct_post_request)
|
213
|
+
|
214
|
+
# return_type
|
215
|
+
return_type = opts[:debug_return_type] || 'AuthResponse'
|
216
|
+
|
217
|
+
# auth_names
|
218
|
+
auth_names = opts[:debug_auth_names] || ['cp-api-key', 'cp-domain-key']
|
219
|
+
|
220
|
+
new_options = opts.merge(
|
221
|
+
:operation => :"DirectPostApi.direct_post_auth_request",
|
222
|
+
:header_params => header_params,
|
223
|
+
:query_params => query_params,
|
224
|
+
:form_params => form_params,
|
225
|
+
:body => post_body,
|
226
|
+
:auth_names => auth_names,
|
227
|
+
:return_type => return_type
|
228
|
+
)
|
229
|
+
|
230
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
231
|
+
if @api_client.config.debugging
|
232
|
+
@api_client.config.logger.debug "API called: DirectPostApi#direct_post_auth_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
233
|
+
end
|
234
|
+
return data, status_code, headers
|
235
|
+
end
|
236
|
+
|
237
|
+
# Direct Post Tokenise Request
|
238
|
+
# Used to initiate a direct post request transaction flow. <pre class=\"inline-code language-bash\"> <code> curl https://api.citypay.com/v6/direct?cp-domain-key=n834ytqp84y... \\ -d \"amount=7500&identifier=example_trans&cardnumber=4000000000000002&expmonth=9&expyear=2028&bill_to_postcode=L1+7ZW </code> </pre>.
|
239
|
+
# @param direct_post_request [DirectPostRequest]
|
240
|
+
# @param [Hash] opts the optional parameters
|
241
|
+
# @return [AuthResponse]
|
242
|
+
def direct_post_tokenise_request(direct_post_request, opts = {})
|
243
|
+
data, _status_code, _headers = direct_post_tokenise_request_with_http_info(direct_post_request, opts)
|
244
|
+
data
|
245
|
+
end
|
246
|
+
|
247
|
+
# Direct Post Tokenise Request
|
248
|
+
# Used to initiate a direct post request transaction flow. <pre class=\"inline-code language-bash\"> <code> curl https://api.citypay.com/v6/direct?cp-domain-key=n834ytqp84y... \\ -d \"amount=7500&identifier=example_trans&cardnumber=4000000000000002&expmonth=9&expyear=2028&bill_to_postcode=L1+7ZW </code> </pre>.
|
249
|
+
# @param direct_post_request [DirectPostRequest]
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
|
252
|
+
def direct_post_tokenise_request_with_http_info(direct_post_request, opts = {})
|
253
|
+
if @api_client.config.debugging
|
254
|
+
@api_client.config.logger.debug 'Calling API: DirectPostApi.direct_post_tokenise_request ...'
|
255
|
+
end
|
256
|
+
# verify the required parameter 'direct_post_request' is set
|
257
|
+
if @api_client.config.client_side_validation && direct_post_request.nil?
|
258
|
+
fail ArgumentError, "Missing the required parameter 'direct_post_request' when calling DirectPostApi.direct_post_tokenise_request"
|
259
|
+
end
|
260
|
+
# resource path
|
261
|
+
local_var_path = '/direct/tokenise'
|
262
|
+
|
263
|
+
# query parameters
|
264
|
+
query_params = opts[:query_params] || {}
|
265
|
+
|
266
|
+
# header parameters
|
267
|
+
header_params = opts[:header_params] || {}
|
268
|
+
# HTTP header 'Accept' (if needed)
|
269
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'application/x-www-form-urlencoded', 'text/xml'])
|
270
|
+
# HTTP header 'Content-Type'
|
271
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'text/xml'])
|
272
|
+
if !content_type.nil?
|
273
|
+
header_params['Content-Type'] = content_type
|
274
|
+
end
|
275
|
+
|
276
|
+
# form parameters
|
277
|
+
form_params = opts[:form_params] || {}
|
278
|
+
|
279
|
+
# http body (model)
|
280
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(direct_post_request)
|
281
|
+
|
282
|
+
# return_type
|
283
|
+
return_type = opts[:debug_return_type] || 'AuthResponse'
|
284
|
+
|
285
|
+
# auth_names
|
286
|
+
auth_names = opts[:debug_auth_names] || ['cp-api-key', 'cp-domain-key']
|
287
|
+
|
288
|
+
new_options = opts.merge(
|
289
|
+
:operation => :"DirectPostApi.direct_post_tokenise_request",
|
290
|
+
:header_params => header_params,
|
291
|
+
:query_params => query_params,
|
292
|
+
:form_params => form_params,
|
293
|
+
:body => post_body,
|
294
|
+
:auth_names => auth_names,
|
295
|
+
:return_type => return_type
|
296
|
+
)
|
297
|
+
|
298
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
299
|
+
if @api_client.config.debugging
|
300
|
+
@api_client.config.logger.debug "API called: DirectPostApi#direct_post_tokenise_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
301
|
+
end
|
302
|
+
return data, status_code, headers
|
303
|
+
end
|
304
|
+
|
305
|
+
# Direct Post Token Request
|
306
|
+
# Perform a request for authorisation for a previously generated token. This flow will return an authorisation response stating that the transaction was approved or declined.
|
307
|
+
# @param direct_token_auth_request [DirectTokenAuthRequest]
|
308
|
+
# @param [Hash] opts the optional parameters
|
309
|
+
# @return [AuthResponse]
|
310
|
+
def token_request(direct_token_auth_request, opts = {})
|
311
|
+
data, _status_code, _headers = token_request_with_http_info(direct_token_auth_request, opts)
|
312
|
+
data
|
313
|
+
end
|
314
|
+
|
315
|
+
# Direct Post Token Request
|
316
|
+
# Perform a request for authorisation for a previously generated token. This flow will return an authorisation response stating that the transaction was approved or declined.
|
317
|
+
# @param direct_token_auth_request [DirectTokenAuthRequest]
|
318
|
+
# @param [Hash] opts the optional parameters
|
319
|
+
# @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
|
320
|
+
def token_request_with_http_info(direct_token_auth_request, opts = {})
|
321
|
+
if @api_client.config.debugging
|
322
|
+
@api_client.config.logger.debug 'Calling API: DirectPostApi.token_request ...'
|
323
|
+
end
|
324
|
+
# verify the required parameter 'direct_token_auth_request' is set
|
325
|
+
if @api_client.config.client_side_validation && direct_token_auth_request.nil?
|
326
|
+
fail ArgumentError, "Missing the required parameter 'direct_token_auth_request' when calling DirectPostApi.token_request"
|
327
|
+
end
|
328
|
+
# resource path
|
329
|
+
local_var_path = '/direct/token'
|
330
|
+
|
331
|
+
# query parameters
|
332
|
+
query_params = opts[:query_params] || {}
|
333
|
+
|
334
|
+
# header parameters
|
335
|
+
header_params = opts[:header_params] || {}
|
336
|
+
# HTTP header 'Accept' (if needed)
|
337
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml', 'application/x-www-form-urlencoded', 'text/xml'])
|
338
|
+
# HTTP header 'Content-Type'
|
339
|
+
content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'text/xml'])
|
340
|
+
if !content_type.nil?
|
341
|
+
header_params['Content-Type'] = content_type
|
342
|
+
end
|
343
|
+
|
344
|
+
# form parameters
|
345
|
+
form_params = opts[:form_params] || {}
|
346
|
+
|
347
|
+
# http body (model)
|
348
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(direct_token_auth_request)
|
349
|
+
|
350
|
+
# return_type
|
351
|
+
return_type = opts[:debug_return_type] || 'AuthResponse'
|
352
|
+
|
353
|
+
# auth_names
|
354
|
+
auth_names = opts[:debug_auth_names] || ['cp-api-key', 'cp-domain-key']
|
355
|
+
|
356
|
+
new_options = opts.merge(
|
357
|
+
:operation => :"DirectPostApi.token_request",
|
358
|
+
:header_params => header_params,
|
359
|
+
:query_params => query_params,
|
360
|
+
:form_params => form_params,
|
361
|
+
:body => post_body,
|
362
|
+
:auth_names => auth_names,
|
363
|
+
:return_type => return_type
|
364
|
+
)
|
365
|
+
|
366
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
367
|
+
if @api_client.config.debugging
|
368
|
+
@api_client.config.logger.debug "API called: DirectPostApi#token_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
369
|
+
end
|
370
|
+
return data, status_code, headers
|
371
|
+
end
|
372
|
+
end
|
373
|
+
end
|