class CityPayApiClient::OperationalApi
Attributes
Public Class Methods
# File lib/citypay_api_client/api/operational_api.rb, line 18 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
List Merchants Request 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`. @param clientid [String] The client id to return merchants for, specifying "default" will use the value in your api key. @param [Hash] opts the optional parameters @return [ListMerchantsResponse]
# File lib/citypay_api_client/api/operational_api.rb, line 26 def list_merchants_request(clientid, opts = {}) data, _status_code, _headers = list_merchants_request_with_http_info(clientid, opts) data end
List Merchants Request 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`. @param clientid [String] The client id to return merchants for, specifying "default" will use the value in your api key. @param [Hash] opts the optional parameters @return [Array<(ListMerchantsResponse
, Integer, Hash)>] ListMerchantsResponse
data, response status code and response headers
# File lib/citypay_api_client/api/operational_api.rb, line 36 def list_merchants_request_with_http_info(clientid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OperationalApi.list_merchants_request ...' end # verify the required parameter 'clientid' is set if @api_client.config.client_side_validation && clientid.nil? fail ArgumentError, "Missing the required parameter 'clientid' when calling OperationalApi.list_merchants_request" end # resource path local_var_path = '/merchants/{clientid}'.sub('{' + 'clientid' + '}', CGI.escape(clientid.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'ListMerchantsResponse' # auth_names auth_names = opts[:auth_names] || ['cp-api-key'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: OperationalApi#list_merchants_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Ping
Request 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. @param ping [Ping] @param [Hash] opts the optional parameters @return [Acknowledgement]
# File lib/citypay_api_client/api/operational_api.rb, line 88 def ping_request(ping, opts = {}) data, _status_code, _headers = ping_request_with_http_info(ping, opts) data end
Ping
Request 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. @param ping [Ping] @param [Hash] opts the optional parameters @return [Array<(Acknowledgement
, Integer, Hash)>] Acknowledgement
data, response status code and response headers
# File lib/citypay_api_client/api/operational_api.rb, line 98 def ping_request_with_http_info(ping, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: OperationalApi.ping_request ...' end # verify the required parameter 'ping' is set if @api_client.config.client_side_validation && ping.nil? fail ArgumentError, "Missing the required parameter 'ping' when calling OperationalApi.ping_request" end # resource path local_var_path = '/ping' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(ping) # return_type return_type = opts[:return_type] || 'Acknowledgement' # auth_names auth_names = opts[:auth_names] || ['cp-api-key'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: OperationalApi#ping_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end