citypay_api_client 1.0.0
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 +7 -0
- data/Gemfile +9 -0
- data/README.md +176 -0
- data/Rakefile +10 -0
- data/citypay_api_client.gemspec +39 -0
- data/docs/AccountCreate.md +19 -0
- data/docs/AccountStatus.md +17 -0
- data/docs/Acknowledgement.md +23 -0
- data/docs/AirlineAdvice.md +47 -0
- data/docs/AirlineSegment.md +31 -0
- data/docs/AuthReference.md +43 -0
- data/docs/AuthReferences.md +17 -0
- data/docs/AuthRequest.md +59 -0
- data/docs/AuthResponse.md +69 -0
- data/docs/AuthenRequired.md +21 -0
- data/docs/CResAuthRequest.md +17 -0
- data/docs/CaptureRequest.md +27 -0
- data/docs/Card.md +51 -0
- data/docs/CardHolderAccount.md +31 -0
- data/docs/CardHolderAccountApi.md +515 -0
- data/docs/CardStatus.md +19 -0
- data/docs/ChargeRequest.md +41 -0
- data/docs/ContactDetails.md +41 -0
- data/docs/Decision.md +21 -0
- data/docs/Error.md +23 -0
- data/docs/ExternalMPI.md +25 -0
- data/docs/ListMerchantsResponse.md +21 -0
- data/docs/MCC6012.md +23 -0
- data/docs/Merchant.md +25 -0
- data/docs/OperationalApi.md +118 -0
- data/docs/PaResAuthRequest.md +19 -0
- data/docs/PaymentProcessingApi.md +338 -0
- data/docs/Ping.md +17 -0
- data/docs/RegisterCard.md +23 -0
- data/docs/RequestChallenged.md +25 -0
- data/docs/RetrieveRequest.md +21 -0
- data/docs/ThreeDSecure.md +25 -0
- data/docs/VoidRequest.md +23 -0
- data/git_push.sh +58 -0
- data/lib/citypay_api_client.rb +72 -0
- data/lib/citypay_api_client/api/card_holder_account_api.rb +628 -0
- data/lib/citypay_api_client/api/operational_api.rb +148 -0
- data/lib/citypay_api_client/api/payment_processing_api.rb +406 -0
- data/lib/citypay_api_client/api_client.rb +388 -0
- data/lib/citypay_api_client/api_error.rb +57 -0
- data/lib/citypay_api_client/configuration.rb +252 -0
- data/lib/citypay_api_client/models/account_create.rb +249 -0
- data/lib/citypay_api_client/models/account_status.rb +207 -0
- data/lib/citypay_api_client/models/acknowledgement.rb +285 -0
- data/lib/citypay_api_client/models/airline_advice.rb +551 -0
- data/lib/citypay_api_client/models/airline_segment.rb +408 -0
- data/lib/citypay_api_client/models/api_key.rb +53 -0
- data/lib/citypay_api_client/models/auth_reference.rb +400 -0
- data/lib/citypay_api_client/models/auth_references.rb +208 -0
- data/lib/citypay_api_client/models/auth_request.rb +631 -0
- data/lib/citypay_api_client/models/auth_response.rb +563 -0
- data/lib/citypay_api_client/models/authen_required.rb +227 -0
- data/lib/citypay_api_client/models/c_res_auth_request.rb +207 -0
- data/lib/citypay_api_client/models/capture_request.rb +285 -0
- data/lib/citypay_api_client/models/card.rb +425 -0
- data/lib/citypay_api_client/models/card_holder_account.rb +315 -0
- data/lib/citypay_api_client/models/card_status.rb +217 -0
- data/lib/citypay_api_client/models/charge_request.rb +453 -0
- data/lib/citypay_api_client/models/contact_details.rb +456 -0
- data/lib/citypay_api_client/models/decision.rb +224 -0
- data/lib/citypay_api_client/models/error.rb +285 -0
- data/lib/citypay_api_client/models/external_mpi.rb +307 -0
- data/lib/citypay_api_client/models/list_merchants_response.rb +252 -0
- data/lib/citypay_api_client/models/mcc6012.rb +237 -0
- data/lib/citypay_api_client/models/merchant.rb +247 -0
- data/lib/citypay_api_client/models/pa_res_auth_request.rb +227 -0
- data/lib/citypay_api_client/models/ping.rb +231 -0
- data/lib/citypay_api_client/models/register_card.rb +336 -0
- data/lib/citypay_api_client/models/request_challenged.rb +247 -0
- data/lib/citypay_api_client/models/retrieve_request.rb +256 -0
- data/lib/citypay_api_client/models/three_d_secure.rb +247 -0
- data/lib/citypay_api_client/models/void_request.rb +266 -0
- data/lib/citypay_api_client/version.rb +15 -0
- data/spec/api/card_holder_account_api_spec.rb +149 -0
- data/spec/api/operational_api_spec.rb +59 -0
- data/spec/api/payment_processing_api_spec.rb +107 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/account_create_spec.rb +47 -0
- data/spec/models/account_status_spec.rb +41 -0
- data/spec/models/acknowledgement_spec.rb +59 -0
- data/spec/models/airline_advice_spec.rb +131 -0
- data/spec/models/airline_segment_spec.rb +83 -0
- data/spec/models/auth_reference_spec.rb +119 -0
- data/spec/models/auth_references_spec.rb +41 -0
- data/spec/models/auth_request_spec.rb +167 -0
- data/spec/models/auth_response_spec.rb +197 -0
- data/spec/models/authen_required_spec.rb +53 -0
- data/spec/models/c_res_auth_request_spec.rb +41 -0
- data/spec/models/capture_request_spec.rb +71 -0
- data/spec/models/card_holder_account_spec.rb +83 -0
- data/spec/models/card_spec.rb +143 -0
- data/spec/models/card_status_spec.rb +47 -0
- data/spec/models/charge_request_spec.rb +113 -0
- data/spec/models/contact_details_spec.rb +113 -0
- data/spec/models/decision_spec.rb +53 -0
- data/spec/models/error_spec.rb +59 -0
- data/spec/models/external_mpi_spec.rb +65 -0
- data/spec/models/list_merchants_response_spec.rb +53 -0
- data/spec/models/mcc6012_spec.rb +59 -0
- data/spec/models/merchant_spec.rb +65 -0
- data/spec/models/pa_res_auth_request_spec.rb +47 -0
- data/spec/models/ping_spec.rb +41 -0
- data/spec/models/register_card_spec.rb +59 -0
- data/spec/models/request_challenged_spec.rb +65 -0
- data/spec/models/retrieve_request_spec.rb +53 -0
- data/spec/models/three_d_secure_spec.rb +65 -0
- data/spec/models/void_request_spec.rb +59 -0
- data/spec/spec_helper.rb +111 -0
- metadata +252 -0
@@ -0,0 +1,148 @@
|
|
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 <aside class=\"notice\"> Before we begin a reminder that 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 including: </aside> * 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
|
+
The version of the OpenAPI document: 6.0.0
|
7
|
+
Contact: support@citypay.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module CityPayApiClient
|
16
|
+
class OperationalApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# List Merchants Request
|
23
|
+
# An operational request to list current merchants for a client. ### Sorting Sorting can be performed by include a query parameter i.e. `/merchants/?sort=merchantid` Fields that can be sorted are `merchantid` or `name`.
|
24
|
+
# @param clientid [String] The client id to return merchants for, specifying \"default\" will use the value in your api key.
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [ListMerchantsResponse]
|
27
|
+
def list_merchants_request(clientid, opts = {})
|
28
|
+
data, _status_code, _headers = list_merchants_request_with_http_info(clientid, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# List Merchants Request
|
33
|
+
# An operational request to list current merchants for a client. ### Sorting Sorting can be performed by include a query parameter i.e. `/merchants/?sort=merchantid` Fields that can be sorted are `merchantid` or `name`.
|
34
|
+
# @param clientid [String] The client id to return merchants for, specifying \"default\" will use the value in your api key.
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(ListMerchantsResponse, Integer, Hash)>] ListMerchantsResponse data, response status code and response headers
|
37
|
+
def list_merchants_request_with_http_info(clientid, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: OperationalApi.list_merchants_request ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'clientid' is set
|
42
|
+
if @api_client.config.client_side_validation && clientid.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'clientid' when calling OperationalApi.list_merchants_request"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/merchants/{clientid}'.sub('{' + 'clientid' + '}', CGI.escape(clientid.to_s))
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:return_type] || 'ListMerchantsResponse'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:header_params => header_params,
|
70
|
+
:query_params => query_params,
|
71
|
+
:form_params => form_params,
|
72
|
+
:body => post_body,
|
73
|
+
:auth_names => auth_names,
|
74
|
+
:return_type => return_type
|
75
|
+
)
|
76
|
+
|
77
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: OperationalApi#list_merchants_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
|
84
|
+
# Ping Request
|
85
|
+
# A ping request which performs a connection and authentication test to the CityPay API server. The request will return a standard Acknowledgement with a response code `044` to signify a successful ping. The ping call is useful to confirm that you will be able to access the API from behind any firewalls and that the permission model is granting access from your source.
|
86
|
+
# @param ping [Ping]
|
87
|
+
# @param [Hash] opts the optional parameters
|
88
|
+
# @return [Acknowledgement]
|
89
|
+
def ping_request(ping, opts = {})
|
90
|
+
data, _status_code, _headers = ping_request_with_http_info(ping, opts)
|
91
|
+
data
|
92
|
+
end
|
93
|
+
|
94
|
+
# Ping Request
|
95
|
+
# A ping request which performs a connection and authentication test to the CityPay API server. The request will return a standard Acknowledgement with a response code `044` to signify a successful ping. The ping call is useful to confirm that you will be able to access the API from behind any firewalls and that the permission model is granting access from your source.
|
96
|
+
# @param ping [Ping]
|
97
|
+
# @param [Hash] opts the optional parameters
|
98
|
+
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
99
|
+
def ping_request_with_http_info(ping, opts = {})
|
100
|
+
if @api_client.config.debugging
|
101
|
+
@api_client.config.logger.debug 'Calling API: OperationalApi.ping_request ...'
|
102
|
+
end
|
103
|
+
# verify the required parameter 'ping' is set
|
104
|
+
if @api_client.config.client_side_validation && ping.nil?
|
105
|
+
fail ArgumentError, "Missing the required parameter 'ping' when calling OperationalApi.ping_request"
|
106
|
+
end
|
107
|
+
# resource path
|
108
|
+
local_var_path = '/ping'
|
109
|
+
|
110
|
+
# query parameters
|
111
|
+
query_params = opts[:query_params] || {}
|
112
|
+
|
113
|
+
# header parameters
|
114
|
+
header_params = opts[:header_params] || {}
|
115
|
+
# HTTP header 'Accept' (if needed)
|
116
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
117
|
+
# HTTP header 'Content-Type'
|
118
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
119
|
+
|
120
|
+
# form parameters
|
121
|
+
form_params = opts[:form_params] || {}
|
122
|
+
|
123
|
+
# http body (model)
|
124
|
+
post_body = opts[:body] || @api_client.object_to_http_body(ping)
|
125
|
+
|
126
|
+
# return_type
|
127
|
+
return_type = opts[:return_type] || 'Acknowledgement'
|
128
|
+
|
129
|
+
# auth_names
|
130
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
131
|
+
|
132
|
+
new_options = opts.merge(
|
133
|
+
:header_params => header_params,
|
134
|
+
:query_params => query_params,
|
135
|
+
:form_params => form_params,
|
136
|
+
:body => post_body,
|
137
|
+
:auth_names => auth_names,
|
138
|
+
:return_type => return_type
|
139
|
+
)
|
140
|
+
|
141
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
142
|
+
if @api_client.config.debugging
|
143
|
+
@api_client.config.logger.debug "API called: OperationalApi#ping_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
144
|
+
end
|
145
|
+
return data, status_code, headers
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
@@ -0,0 +1,406 @@
|
|
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 <aside class=\"notice\"> Before we begin a reminder that 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 including: </aside> * 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
|
+
The version of the OpenAPI document: 6.0.0
|
7
|
+
Contact: support@citypay.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module CityPayApiClient
|
16
|
+
class PaymentProcessingApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Authorisation
|
23
|
+
# An authorisation process performs a standard transaction authorisation based on the provided parameters of its request. The CityPay gateway will route your transaction via an Acquiring bank for subsequent authorisation to the appropriate card schemes such as Visa or MasterCard. The authorisation API should be used for server environments to process transactions on demand and in realtime. The authorisation API can be used for multiple types of transactions including E-commerce, mail order, telephone order, customer present (keyed), continuous authority, pre-authorisation and others. CityPay will configure your account for the appropriate coding and this will perform transparently by the gateway. Data properties that are required, may depend on the environment you are conducting payment for. Our API aims to be flexible enough to cater for these structures. Our integration team will aid you in providing the necessary data to transact. ### E-commerce workflows For E-commerce transactions requiring 3DSv1 and 3DSv2 transactions, the API contains a fully accredited in built mechanism to handle authentication. The gateway has been accredited extensively with both Acquirers and Card Schemes and simplifies the nature of these calls into a simple structure for authentication, preventing integrators from performing lengthy and a costly accreditation with Visa and MasterCard. 3D-secure has been around for a number of years and aims to shift the liability of a transaction away from a merchant back to the card holder. A *liability shift* determines whether a card holder can charge back a transaction as unknown. Effectively the process asks for a card holder to authenticate the transaction prior to authorisation producing a Cardholder verification value (CAVV) as evidence of authorisation. #### 3DSv1 ```json { \"AuthenticationRequired\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"pareq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\", \"md\": \"WQgZXZlcnl0aGluZyBiZW\" } } ``` ```xml <AuthenticationRequired> <acsurl>https://bank.com/3DS/ACS</acsurl> <pareq>SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...</pareq> <md>WQgZXZlcnl0aGluZyBiZW</md> </AuthenticationRequired> ``` For E-commerce transactions requiring 3DSv1, the API contains a built in MPI which will be called to check whether the card is participating in 3DSv1 with Verified by Visa or MasterCard SecureCode. We only support Amex SafeKey with 3DSv2. Should the card be enrolled, a payer request (PAReq) value will be created and returned back as an [authentication required](#authenticationrequired) response object. Your system will need to process this authentication packet and forward the user's browser to an authentication server (ACS) to gain the user's authentication. Once complete, the ACS will produce a HTTP `POST` call back to the URL supplied in the authentication request as `merchant_termurl`. This URL should behave as a controller and handle the post data from the ACS and on a forked server to server HTTP request, forward this data to the [pares authentication url](#pares) for subsequent authorisation processing. You may prefer to provide a processing page whilst this is being processed. Processing with our systems should be relatively quick and be between 500ms - 3000ms however it is desirable to let the user see that something is happening rather than a pending browser. The main reason for ensuring that this controller is two fold: 1. We are never in control of the user's browser in a server API call 2. The controller is actioned on your site to ensure that any post actions from authorisation can be executed in real time To forward the user to the ACS, we recommend a simple auto submit HTML form. ```html <html lang=\"en\"> <head> <title>Forward to ACS</title> <script type=\"text/javascript\"> function onLoadEvent() { document.acs.submit(); } </script> <noscript>You will require JavaScript to be enabled to complete this transaction</noscript> </head> <body onload=\"onLoadEvent();\"> <form name=\"acs\" action=\"{{ACSURL from Response}}\" method=\"POST\"> <input type=\"hidden\" name=\"PaReq\" value=\"{{PaReq Packet from Response}}\" /> <input type=\"hidden\" name=\"TermUrl\" value=\"{{Your Controller}}\" /> <input type=\"hidden\" name=\"MD\" value=\"{{MD From Response}}\" /> </form> </body> </html> ``` Please note that 3DSv1 is being phased out due to changes to strong customer authentication mechanisms. 3DSv2 addresses this and will solidify the authorisation and confirmation process. We provide a Test ACS for full 3DSv1 integration testing that simulates an ACS. #### 3DSv2 ```json { \"RequestChallenged\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"creq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\" } } ``` ```xml <RequestChallenged> <acsurl>https://bank.com/3DS/ACS</acsurl> <creq>SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...</creq> </RequestChallenged> ``` All merchants in the EEC will require to migrate their E-commerce transactions to a secure customer authentication model (SCA) throughout 2020. This has been adopted by the payment's industry as a progressive move alongside the European Unions payments service directive. CityPay support 3DSv2 for Verified by Visa, MasterCard Identity Check and American Express SafeKey 2.0 and will be rolling out acquirers on the new platform from Q2 2020. The new enhancement to 3DSv2 will allow for CityPay to seamlessly authenticate transactions in a \"frictionless\" flowed method which will authenticate low risk transactions with minimal impact to a standard authorisation flow. Our API simply performs this on behalf of the merchant and cardholder. For these transactions you will not be required to change anything. However, should a transaction be \"challenged\" the API will return a [request challenge](#requestchallenged) which will require your integration to forward the cardholder's browser to the given [ACS url](#acsurl) by posting the [creq](#creq) value. Once complete, the ACS will have already been in touch with our servers by sending us a result of the authentication known as `RReq`. Our servers however will await confirmation that the authorisation should continue and on receipt of a [cres](#cres) value, the flow will perform full authorisation processing. Please note that the CRes returned to us is purely a mechanism of acknowledging that transactions should be committed for authorisation. The ACS by this point will have sent us the verification value (CAVV) to perform a liability shift. The CRes value will be validated for receipt of the CAVV and subsequently may return back response codes illustrating this. To forward the user to the ACS, we recommend a simple auto submit HTML form. ```html <html lang=\"en\"> <head> <title>Forward to ACS</title> <script type=\"text/javascript\"> function onLoadEvent() { document.acs.submit(); } </script> <noscript>You will require JavaScript to be enabled to complete this transaction</noscript> </head> <body onload=\"onLoadEvent();\"> <form name=\"acs\" action=\"{{ACSURL from Response}}\" method=\"POST\"> <input type=\"hidden\" name=\"creq\" value=\"{{CReq Packet from Response}}\" /> </form> </body> </html> ``` We are currently working on an integration test suite for 3DSv2 which will mock the ACS challenge process.
|
24
|
+
# @param auth_request [AuthRequest]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [Decision]
|
27
|
+
def authorisation_request(auth_request, opts = {})
|
28
|
+
data, _status_code, _headers = authorisation_request_with_http_info(auth_request, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Authorisation
|
33
|
+
# An authorisation process performs a standard transaction authorisation based on the provided parameters of its request. The CityPay gateway will route your transaction via an Acquiring bank for subsequent authorisation to the appropriate card schemes such as Visa or MasterCard. The authorisation API should be used for server environments to process transactions on demand and in realtime. The authorisation API can be used for multiple types of transactions including E-commerce, mail order, telephone order, customer present (keyed), continuous authority, pre-authorisation and others. CityPay will configure your account for the appropriate coding and this will perform transparently by the gateway. Data properties that are required, may depend on the environment you are conducting payment for. Our API aims to be flexible enough to cater for these structures. Our integration team will aid you in providing the necessary data to transact. ### E-commerce workflows For E-commerce transactions requiring 3DSv1 and 3DSv2 transactions, the API contains a fully accredited in built mechanism to handle authentication. The gateway has been accredited extensively with both Acquirers and Card Schemes and simplifies the nature of these calls into a simple structure for authentication, preventing integrators from performing lengthy and a costly accreditation with Visa and MasterCard. 3D-secure has been around for a number of years and aims to shift the liability of a transaction away from a merchant back to the card holder. A *liability shift* determines whether a card holder can charge back a transaction as unknown. Effectively the process asks for a card holder to authenticate the transaction prior to authorisation producing a Cardholder verification value (CAVV) as evidence of authorisation. #### 3DSv1 ```json { \"AuthenticationRequired\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"pareq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\", \"md\": \"WQgZXZlcnl0aGluZyBiZW\" } } ``` ```xml <AuthenticationRequired> <acsurl>https://bank.com/3DS/ACS</acsurl> <pareq>SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...</pareq> <md>WQgZXZlcnl0aGluZyBiZW</md> </AuthenticationRequired> ``` For E-commerce transactions requiring 3DSv1, the API contains a built in MPI which will be called to check whether the card is participating in 3DSv1 with Verified by Visa or MasterCard SecureCode. We only support Amex SafeKey with 3DSv2. Should the card be enrolled, a payer request (PAReq) value will be created and returned back as an [authentication required](#authenticationrequired) response object. Your system will need to process this authentication packet and forward the user's browser to an authentication server (ACS) to gain the user's authentication. Once complete, the ACS will produce a HTTP `POST` call back to the URL supplied in the authentication request as `merchant_termurl`. This URL should behave as a controller and handle the post data from the ACS and on a forked server to server HTTP request, forward this data to the [pares authentication url](#pares) for subsequent authorisation processing. You may prefer to provide a processing page whilst this is being processed. Processing with our systems should be relatively quick and be between 500ms - 3000ms however it is desirable to let the user see that something is happening rather than a pending browser. The main reason for ensuring that this controller is two fold: 1. We are never in control of the user's browser in a server API call 2. The controller is actioned on your site to ensure that any post actions from authorisation can be executed in real time To forward the user to the ACS, we recommend a simple auto submit HTML form. ```html <html lang=\"en\"> <head> <title>Forward to ACS</title> <script type=\"text/javascript\"> function onLoadEvent() { document.acs.submit(); } </script> <noscript>You will require JavaScript to be enabled to complete this transaction</noscript> </head> <body onload=\"onLoadEvent();\"> <form name=\"acs\" action=\"{{ACSURL from Response}}\" method=\"POST\"> <input type=\"hidden\" name=\"PaReq\" value=\"{{PaReq Packet from Response}}\" /> <input type=\"hidden\" name=\"TermUrl\" value=\"{{Your Controller}}\" /> <input type=\"hidden\" name=\"MD\" value=\"{{MD From Response}}\" /> </form> </body> </html> ``` Please note that 3DSv1 is being phased out due to changes to strong customer authentication mechanisms. 3DSv2 addresses this and will solidify the authorisation and confirmation process. We provide a Test ACS for full 3DSv1 integration testing that simulates an ACS. #### 3DSv2 ```json { \"RequestChallenged\": { \"acsurl\": \"https://bank.com/3DS/ACS\", \"creq\": \"SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...\" } } ``` ```xml <RequestChallenged> <acsurl>https://bank.com/3DS/ACS</acsurl> <creq>SXQgd2FzIHRoZSBiZXN0IG9mIHRpbWVzLCBpdCB3YXMgdGhlIHdvcnN00...</creq> </RequestChallenged> ``` All merchants in the EEC will require to migrate their E-commerce transactions to a secure customer authentication model (SCA) throughout 2020. This has been adopted by the payment's industry as a progressive move alongside the European Unions payments service directive. CityPay support 3DSv2 for Verified by Visa, MasterCard Identity Check and American Express SafeKey 2.0 and will be rolling out acquirers on the new platform from Q2 2020. The new enhancement to 3DSv2 will allow for CityPay to seamlessly authenticate transactions in a \"frictionless\" flowed method which will authenticate low risk transactions with minimal impact to a standard authorisation flow. Our API simply performs this on behalf of the merchant and cardholder. For these transactions you will not be required to change anything. However, should a transaction be \"challenged\" the API will return a [request challenge](#requestchallenged) which will require your integration to forward the cardholder's browser to the given [ACS url](#acsurl) by posting the [creq](#creq) value. Once complete, the ACS will have already been in touch with our servers by sending us a result of the authentication known as `RReq`. Our servers however will await confirmation that the authorisation should continue and on receipt of a [cres](#cres) value, the flow will perform full authorisation processing. Please note that the CRes returned to us is purely a mechanism of acknowledging that transactions should be committed for authorisation. The ACS by this point will have sent us the verification value (CAVV) to perform a liability shift. The CRes value will be validated for receipt of the CAVV and subsequently may return back response codes illustrating this. To forward the user to the ACS, we recommend a simple auto submit HTML form. ```html <html lang=\"en\"> <head> <title>Forward to ACS</title> <script type=\"text/javascript\"> function onLoadEvent() { document.acs.submit(); } </script> <noscript>You will require JavaScript to be enabled to complete this transaction</noscript> </head> <body onload=\"onLoadEvent();\"> <form name=\"acs\" action=\"{{ACSURL from Response}}\" method=\"POST\"> <input type=\"hidden\" name=\"creq\" value=\"{{CReq Packet from Response}}\" /> </form> </body> </html> ``` We are currently working on an integration test suite for 3DSv2 which will mock the ACS challenge process.
|
34
|
+
# @param auth_request [AuthRequest]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(Decision, Integer, Hash)>] Decision data, response status code and response headers
|
37
|
+
def authorisation_request_with_http_info(auth_request, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: PaymentProcessingApi.authorisation_request ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'auth_request' is set
|
42
|
+
if @api_client.config.client_side_validation && auth_request.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'auth_request' when calling PaymentProcessingApi.authorisation_request"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/authorise'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = opts[:form_params] || {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = opts[:body] || @api_client.object_to_http_body(auth_request)
|
63
|
+
|
64
|
+
# return_type
|
65
|
+
return_type = opts[:return_type] || 'Decision'
|
66
|
+
|
67
|
+
# auth_names
|
68
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
69
|
+
|
70
|
+
new_options = opts.merge(
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type
|
77
|
+
)
|
78
|
+
|
79
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug "API called: PaymentProcessingApi#authorisation_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
+
end
|
83
|
+
return data, status_code, headers
|
84
|
+
end
|
85
|
+
|
86
|
+
# CRes
|
87
|
+
# The CRes request performs authorisation processing once a challenge request has been completed with an Authentication Server (ACS). This challenge response contains confirmation that will allow the API systems to return an authorisation response based on the result. Our systems will know out of band via an `RReq` call by the ACS to notify us if the liability shift has been issued. Any call to the CRes operation will require a previous authorisation request and cannot be called on its own without a previous [request challenge](#requestchallenged) being obtained.
|
88
|
+
# @param c_res_auth_request [CResAuthRequest]
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [AuthResponse]
|
91
|
+
def c_res_request(c_res_auth_request, opts = {})
|
92
|
+
data, _status_code, _headers = c_res_request_with_http_info(c_res_auth_request, opts)
|
93
|
+
data
|
94
|
+
end
|
95
|
+
|
96
|
+
# CRes
|
97
|
+
# The CRes request performs authorisation processing once a challenge request has been completed with an Authentication Server (ACS). This challenge response contains confirmation that will allow the API systems to return an authorisation response based on the result. Our systems will know out of band via an `RReq` call by the ACS to notify us if the liability shift has been issued. Any call to the CRes operation will require a previous authorisation request and cannot be called on its own without a previous [request challenge](#requestchallenged) being obtained.
|
98
|
+
# @param c_res_auth_request [CResAuthRequest]
|
99
|
+
# @param [Hash] opts the optional parameters
|
100
|
+
# @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
|
101
|
+
def c_res_request_with_http_info(c_res_auth_request, opts = {})
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug 'Calling API: PaymentProcessingApi.c_res_request ...'
|
104
|
+
end
|
105
|
+
# verify the required parameter 'c_res_auth_request' is set
|
106
|
+
if @api_client.config.client_side_validation && c_res_auth_request.nil?
|
107
|
+
fail ArgumentError, "Missing the required parameter 'c_res_auth_request' when calling PaymentProcessingApi.c_res_request"
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '/cres'
|
111
|
+
|
112
|
+
# query parameters
|
113
|
+
query_params = opts[:query_params] || {}
|
114
|
+
|
115
|
+
# header parameters
|
116
|
+
header_params = opts[:header_params] || {}
|
117
|
+
# HTTP header 'Accept' (if needed)
|
118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
119
|
+
# HTTP header 'Content-Type'
|
120
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
121
|
+
|
122
|
+
# form parameters
|
123
|
+
form_params = opts[:form_params] || {}
|
124
|
+
|
125
|
+
# http body (model)
|
126
|
+
post_body = opts[:body] || @api_client.object_to_http_body(c_res_auth_request)
|
127
|
+
|
128
|
+
# return_type
|
129
|
+
return_type = opts[:return_type] || 'AuthResponse'
|
130
|
+
|
131
|
+
# auth_names
|
132
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
133
|
+
|
134
|
+
new_options = opts.merge(
|
135
|
+
:header_params => header_params,
|
136
|
+
:query_params => query_params,
|
137
|
+
:form_params => form_params,
|
138
|
+
:body => post_body,
|
139
|
+
:auth_names => auth_names,
|
140
|
+
:return_type => return_type
|
141
|
+
)
|
142
|
+
|
143
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
144
|
+
if @api_client.config.debugging
|
145
|
+
@api_client.config.logger.debug "API called: PaymentProcessingApi#c_res_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
146
|
+
end
|
147
|
+
return data, status_code, headers
|
148
|
+
end
|
149
|
+
|
150
|
+
# Capture
|
151
|
+
# _The capture process only applies to transactions which have been pre-authorised only._ The capture process will ensure that a transaction will now settle. It is expected that a capture call will be provided within 3 days or a maximum of 7 days. A capture request is provided to confirm that you wish the transaction to be settled. This request can contain a final amount for the transaction which is different to the original authorisation amount. This may be useful in a delayed system process such as waiting for stock to be ordered, confirmed, or services provided before the final cost is known. When a transaction is completed, a new authorisation code may be created and a new confirmation can be sent online to the acquiring bank. Once the transaction has been processed. A standard [`Acknowledgement`](#acknowledgement) will be returned, outlining the result of the transaction. On a successful completion process, the transaction will be available for the settlement and completed at the end of the day.
|
152
|
+
# @param capture_request [CaptureRequest]
|
153
|
+
# @param [Hash] opts the optional parameters
|
154
|
+
# @return [Acknowledgement]
|
155
|
+
def capture_request(capture_request, opts = {})
|
156
|
+
data, _status_code, _headers = capture_request_with_http_info(capture_request, opts)
|
157
|
+
data
|
158
|
+
end
|
159
|
+
|
160
|
+
# Capture
|
161
|
+
# _The capture process only applies to transactions which have been pre-authorised only._ The capture process will ensure that a transaction will now settle. It is expected that a capture call will be provided within 3 days or a maximum of 7 days. A capture request is provided to confirm that you wish the transaction to be settled. This request can contain a final amount for the transaction which is different to the original authorisation amount. This may be useful in a delayed system process such as waiting for stock to be ordered, confirmed, or services provided before the final cost is known. When a transaction is completed, a new authorisation code may be created and a new confirmation can be sent online to the acquiring bank. Once the transaction has been processed. A standard [`Acknowledgement`](#acknowledgement) will be returned, outlining the result of the transaction. On a successful completion process, the transaction will be available for the settlement and completed at the end of the day.
|
162
|
+
# @param capture_request [CaptureRequest]
|
163
|
+
# @param [Hash] opts the optional parameters
|
164
|
+
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
165
|
+
def capture_request_with_http_info(capture_request, opts = {})
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug 'Calling API: PaymentProcessingApi.capture_request ...'
|
168
|
+
end
|
169
|
+
# verify the required parameter 'capture_request' is set
|
170
|
+
if @api_client.config.client_side_validation && capture_request.nil?
|
171
|
+
fail ArgumentError, "Missing the required parameter 'capture_request' when calling PaymentProcessingApi.capture_request"
|
172
|
+
end
|
173
|
+
# resource path
|
174
|
+
local_var_path = '/capture'
|
175
|
+
|
176
|
+
# query parameters
|
177
|
+
query_params = opts[:query_params] || {}
|
178
|
+
|
179
|
+
# header parameters
|
180
|
+
header_params = opts[:header_params] || {}
|
181
|
+
# HTTP header 'Accept' (if needed)
|
182
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
183
|
+
# HTTP header 'Content-Type'
|
184
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
185
|
+
|
186
|
+
# form parameters
|
187
|
+
form_params = opts[:form_params] || {}
|
188
|
+
|
189
|
+
# http body (model)
|
190
|
+
post_body = opts[:body] || @api_client.object_to_http_body(capture_request)
|
191
|
+
|
192
|
+
# return_type
|
193
|
+
return_type = opts[:return_type] || 'Acknowledgement'
|
194
|
+
|
195
|
+
# auth_names
|
196
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
197
|
+
|
198
|
+
new_options = opts.merge(
|
199
|
+
:header_params => header_params,
|
200
|
+
:query_params => query_params,
|
201
|
+
:form_params => form_params,
|
202
|
+
:body => post_body,
|
203
|
+
:auth_names => auth_names,
|
204
|
+
:return_type => return_type
|
205
|
+
)
|
206
|
+
|
207
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
208
|
+
if @api_client.config.debugging
|
209
|
+
@api_client.config.logger.debug "API called: PaymentProcessingApi#capture_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
210
|
+
end
|
211
|
+
return data, status_code, headers
|
212
|
+
end
|
213
|
+
|
214
|
+
# PaRes
|
215
|
+
# The Payer Authentication Response (PaRes) is an operation after the result of authentication being performed. The request uses an encoded packet of authentication data to notify us of the completion of the liability shift. Once this value has been unpacked and its signature is checked, our systems will proceed to authorisation processing. Any call to the PaRes operation will require a previous authorisation request and cannot be called on its own without a previous [authentication required](#authenticationrequired) being obtained.
|
216
|
+
# @param pa_res_auth_request [PaResAuthRequest]
|
217
|
+
# @param [Hash] opts the optional parameters
|
218
|
+
# @return [AuthResponse]
|
219
|
+
def pa_res_request(pa_res_auth_request, opts = {})
|
220
|
+
data, _status_code, _headers = pa_res_request_with_http_info(pa_res_auth_request, opts)
|
221
|
+
data
|
222
|
+
end
|
223
|
+
|
224
|
+
# PaRes
|
225
|
+
# The Payer Authentication Response (PaRes) is an operation after the result of authentication being performed. The request uses an encoded packet of authentication data to notify us of the completion of the liability shift. Once this value has been unpacked and its signature is checked, our systems will proceed to authorisation processing. Any call to the PaRes operation will require a previous authorisation request and cannot be called on its own without a previous [authentication required](#authenticationrequired) being obtained.
|
226
|
+
# @param pa_res_auth_request [PaResAuthRequest]
|
227
|
+
# @param [Hash] opts the optional parameters
|
228
|
+
# @return [Array<(AuthResponse, Integer, Hash)>] AuthResponse data, response status code and response headers
|
229
|
+
def pa_res_request_with_http_info(pa_res_auth_request, opts = {})
|
230
|
+
if @api_client.config.debugging
|
231
|
+
@api_client.config.logger.debug 'Calling API: PaymentProcessingApi.pa_res_request ...'
|
232
|
+
end
|
233
|
+
# verify the required parameter 'pa_res_auth_request' is set
|
234
|
+
if @api_client.config.client_side_validation && pa_res_auth_request.nil?
|
235
|
+
fail ArgumentError, "Missing the required parameter 'pa_res_auth_request' when calling PaymentProcessingApi.pa_res_request"
|
236
|
+
end
|
237
|
+
# resource path
|
238
|
+
local_var_path = '/pares'
|
239
|
+
|
240
|
+
# query parameters
|
241
|
+
query_params = opts[:query_params] || {}
|
242
|
+
|
243
|
+
# header parameters
|
244
|
+
header_params = opts[:header_params] || {}
|
245
|
+
# HTTP header 'Accept' (if needed)
|
246
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
247
|
+
# HTTP header 'Content-Type'
|
248
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
249
|
+
|
250
|
+
# form parameters
|
251
|
+
form_params = opts[:form_params] || {}
|
252
|
+
|
253
|
+
# http body (model)
|
254
|
+
post_body = opts[:body] || @api_client.object_to_http_body(pa_res_auth_request)
|
255
|
+
|
256
|
+
# return_type
|
257
|
+
return_type = opts[:return_type] || 'AuthResponse'
|
258
|
+
|
259
|
+
# auth_names
|
260
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
261
|
+
|
262
|
+
new_options = opts.merge(
|
263
|
+
:header_params => header_params,
|
264
|
+
:query_params => query_params,
|
265
|
+
:form_params => form_params,
|
266
|
+
:body => post_body,
|
267
|
+
:auth_names => auth_names,
|
268
|
+
:return_type => return_type
|
269
|
+
)
|
270
|
+
|
271
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
272
|
+
if @api_client.config.debugging
|
273
|
+
@api_client.config.logger.debug "API called: PaymentProcessingApi#pa_res_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
274
|
+
end
|
275
|
+
return data, status_code, headers
|
276
|
+
end
|
277
|
+
|
278
|
+
# Retrieval
|
279
|
+
# A retrieval request which allows an integration to obtain the result of a transaction processed in the last 90 days. The request allows for retrieval based on the identifier or transaction number. The process may return multiple results in particular where a transaction was processed multiple times against the same identifier. This can happen if errors were first received. The API therefore returns up to the first 5 transactions in the latest date time order. It is not intended for this operation to be a replacement for reporting and only allows for base transaction information to be returned.
|
280
|
+
# @param retrieve_request [RetrieveRequest]
|
281
|
+
# @param [Hash] opts the optional parameters
|
282
|
+
# @return [AuthReferences]
|
283
|
+
def retrieval_request(retrieve_request, opts = {})
|
284
|
+
data, _status_code, _headers = retrieval_request_with_http_info(retrieve_request, opts)
|
285
|
+
data
|
286
|
+
end
|
287
|
+
|
288
|
+
# Retrieval
|
289
|
+
# A retrieval request which allows an integration to obtain the result of a transaction processed in the last 90 days. The request allows for retrieval based on the identifier or transaction number. The process may return multiple results in particular where a transaction was processed multiple times against the same identifier. This can happen if errors were first received. The API therefore returns up to the first 5 transactions in the latest date time order. It is not intended for this operation to be a replacement for reporting and only allows for base transaction information to be returned.
|
290
|
+
# @param retrieve_request [RetrieveRequest]
|
291
|
+
# @param [Hash] opts the optional parameters
|
292
|
+
# @return [Array<(AuthReferences, Integer, Hash)>] AuthReferences data, response status code and response headers
|
293
|
+
def retrieval_request_with_http_info(retrieve_request, opts = {})
|
294
|
+
if @api_client.config.debugging
|
295
|
+
@api_client.config.logger.debug 'Calling API: PaymentProcessingApi.retrieval_request ...'
|
296
|
+
end
|
297
|
+
# verify the required parameter 'retrieve_request' is set
|
298
|
+
if @api_client.config.client_side_validation && retrieve_request.nil?
|
299
|
+
fail ArgumentError, "Missing the required parameter 'retrieve_request' when calling PaymentProcessingApi.retrieval_request"
|
300
|
+
end
|
301
|
+
# resource path
|
302
|
+
local_var_path = '/retrieve'
|
303
|
+
|
304
|
+
# query parameters
|
305
|
+
query_params = opts[:query_params] || {}
|
306
|
+
|
307
|
+
# header parameters
|
308
|
+
header_params = opts[:header_params] || {}
|
309
|
+
# HTTP header 'Accept' (if needed)
|
310
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
311
|
+
# HTTP header 'Content-Type'
|
312
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
313
|
+
|
314
|
+
# form parameters
|
315
|
+
form_params = opts[:form_params] || {}
|
316
|
+
|
317
|
+
# http body (model)
|
318
|
+
post_body = opts[:body] || @api_client.object_to_http_body(retrieve_request)
|
319
|
+
|
320
|
+
# return_type
|
321
|
+
return_type = opts[:return_type] || 'AuthReferences'
|
322
|
+
|
323
|
+
# auth_names
|
324
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
325
|
+
|
326
|
+
new_options = opts.merge(
|
327
|
+
:header_params => header_params,
|
328
|
+
:query_params => query_params,
|
329
|
+
:form_params => form_params,
|
330
|
+
:body => post_body,
|
331
|
+
:auth_names => auth_names,
|
332
|
+
:return_type => return_type
|
333
|
+
)
|
334
|
+
|
335
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
336
|
+
if @api_client.config.debugging
|
337
|
+
@api_client.config.logger.debug "API called: PaymentProcessingApi#retrieval_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
338
|
+
end
|
339
|
+
return data, status_code, headers
|
340
|
+
end
|
341
|
+
|
342
|
+
# Void
|
343
|
+
# _The void process generally applies to transactions which have been pre-authorised only however voids can occur on the same day if performed before batching and settlement._ The void process will ensure that a transaction will now settle. It is expected that a void call will be provided on the same day before batching and settlement or within 3 days or within a maximum of 7 days. Once the transaction has been processed as a void, an [`Acknowledgement`](#acknowledgement) will be returned, outlining the result of the transaction.
|
344
|
+
# @param void_request [VoidRequest]
|
345
|
+
# @param [Hash] opts the optional parameters
|
346
|
+
# @return [Acknowledgement]
|
347
|
+
def void_request(void_request, opts = {})
|
348
|
+
data, _status_code, _headers = void_request_with_http_info(void_request, opts)
|
349
|
+
data
|
350
|
+
end
|
351
|
+
|
352
|
+
# Void
|
353
|
+
# _The void process generally applies to transactions which have been pre-authorised only however voids can occur on the same day if performed before batching and settlement._ The void process will ensure that a transaction will now settle. It is expected that a void call will be provided on the same day before batching and settlement or within 3 days or within a maximum of 7 days. Once the transaction has been processed as a void, an [`Acknowledgement`](#acknowledgement) will be returned, outlining the result of the transaction.
|
354
|
+
# @param void_request [VoidRequest]
|
355
|
+
# @param [Hash] opts the optional parameters
|
356
|
+
# @return [Array<(Acknowledgement, Integer, Hash)>] Acknowledgement data, response status code and response headers
|
357
|
+
def void_request_with_http_info(void_request, opts = {})
|
358
|
+
if @api_client.config.debugging
|
359
|
+
@api_client.config.logger.debug 'Calling API: PaymentProcessingApi.void_request ...'
|
360
|
+
end
|
361
|
+
# verify the required parameter 'void_request' is set
|
362
|
+
if @api_client.config.client_side_validation && void_request.nil?
|
363
|
+
fail ArgumentError, "Missing the required parameter 'void_request' when calling PaymentProcessingApi.void_request"
|
364
|
+
end
|
365
|
+
# resource path
|
366
|
+
local_var_path = '/void'
|
367
|
+
|
368
|
+
# query parameters
|
369
|
+
query_params = opts[:query_params] || {}
|
370
|
+
|
371
|
+
# header parameters
|
372
|
+
header_params = opts[:header_params] || {}
|
373
|
+
# HTTP header 'Accept' (if needed)
|
374
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])
|
375
|
+
# HTTP header 'Content-Type'
|
376
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])
|
377
|
+
|
378
|
+
# form parameters
|
379
|
+
form_params = opts[:form_params] || {}
|
380
|
+
|
381
|
+
# http body (model)
|
382
|
+
post_body = opts[:body] || @api_client.object_to_http_body(void_request)
|
383
|
+
|
384
|
+
# return_type
|
385
|
+
return_type = opts[:return_type] || 'Acknowledgement'
|
386
|
+
|
387
|
+
# auth_names
|
388
|
+
auth_names = opts[:auth_names] || ['cp-api-key']
|
389
|
+
|
390
|
+
new_options = opts.merge(
|
391
|
+
:header_params => header_params,
|
392
|
+
:query_params => query_params,
|
393
|
+
:form_params => form_params,
|
394
|
+
:body => post_body,
|
395
|
+
:auth_names => auth_names,
|
396
|
+
:return_type => return_type
|
397
|
+
)
|
398
|
+
|
399
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
400
|
+
if @api_client.config.debugging
|
401
|
+
@api_client.config.logger.debug "API called: PaymentProcessingApi#void_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
402
|
+
end
|
403
|
+
return data, status_code, headers
|
404
|
+
end
|
405
|
+
end
|
406
|
+
end
|