class CyberSource::InstrumentIdentifierApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

instrumentidentifiers_post(profile_id, opts = {}) click to toggle source

Create an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param [Hash] opts the optional parameters @option opts [Body] :body Please specify either a Card or Bank Account. @return [InlineResponse2007]

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 27
def instrumentidentifiers_post(profile_id, opts = {})
  data, _status_code, _headers = instrumentidentifiers_post_with_http_info(profile_id, opts)
  return data, _status_code, _headers
end
instrumentidentifiers_post_with_http_info(profile_id, opts = {}) click to toggle source

Create an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param [Hash] opts the optional parameters @option opts [Body] :body Please specify either a Card or Bank Account. @return [Array<(InlineResponse2007, Fixnum, Hash)>] InlineResponse2007 data, response status code and response headers

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 37
def instrumentidentifiers_post_with_http_info(profile_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InstrumentIdentifierApi.instrumentidentifiers_post ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling InstrumentIdentifierApi.instrumentidentifiers_post"
  end
  # if @api_client.config.client_side_validation && profile_id > 36
  #   fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_post, must be smaller than or equal to 36.'
  # end

  # if @api_client.config.client_side_validation && profile_id < 36
  #   fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_post, must be greater than or equal to 36.'
  # end

  # resource path
  local_var_path = 'tms/v1/instrumentidentifiers'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'profile-id'] = profile_id

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2007')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InstrumentIdentifierApi#instrumentidentifiers_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
instrumentidentifiers_token_id_delete(profile_id, token_id, opts = {}) click to toggle source

Delete an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier. @param [Hash] opts the optional parameters @return [nil]

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 88
def instrumentidentifiers_token_id_delete(profile_id, token_id, opts = {})
  data, _status_code, _headers = instrumentidentifiers_token_id_delete_with_http_info(profile_id, token_id, opts)
  return data, _status_code, _headers
end
instrumentidentifiers_token_id_delete_with_http_info(profile_id, token_id, opts = {}) click to toggle source

Delete an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 98
def instrumentidentifiers_token_id_delete_with_http_info(profile_id, token_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InstrumentIdentifierApi.instrumentidentifiers_token_id_delete ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_delete"
  end
  # z

  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_delete"
  end
  # if @api_client.config.client_side_validation && token_id > 32
  #   fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_delete, must be smaller than or equal to 32.'
  # end

  # if @api_client.config.client_side_validation && token_id < 16
  #   fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_delete, must be greater than or equal to 16.'
  # end

  # resource path
  local_var_path = 'tms/v1/instrumentidentifiers/{tokenId}'.sub('{' + 'tokenId' + '}', token_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'profile-id'] = profile_id

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InstrumentIdentifierApi#instrumentidentifiers_token_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
instrumentidentifiers_token_id_get(profile_id, token_id, opts = {}) click to toggle source

Retrieve an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier. @param [Hash] opts the optional parameters @return [InlineResponse2007]

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 154
def instrumentidentifiers_token_id_get(profile_id, token_id, opts = {})
  data, _status_code, _headers = instrumentidentifiers_token_id_get_with_http_info(profile_id, token_id, opts)
  return data, _status_code, _headers
end
instrumentidentifiers_token_id_get_with_http_info(profile_id, token_id, opts = {}) click to toggle source

Retrieve an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier. @param [Hash] opts the optional parameters @return [Array<(InlineResponse2007, Fixnum, Hash)>] InlineResponse2007 data, response status code and response headers

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 164
def instrumentidentifiers_token_id_get_with_http_info(profile_id, token_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InstrumentIdentifierApi.instrumentidentifiers_token_id_get ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_get"
  end
  # if @api_client.config.client_side_validation && profile_id > "36"
  #   fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_get, must be smaller than or equal to 36.'
  # end

  # if @api_client.config.client_side_validation && profile_id < "36"
  #   fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_get, must be greater than or equal to 36.'
  # end

  # # verify the required parameter 'token_id' is set
  # if @api_client.config.client_side_validation && token_id.nil?
  #   fail ArgumentError, "Missing the required parameter 'token_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_get"
  # end
  # if @api_client.config.client_side_validation && token_id > 32
  #   fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_get, must be smaller than or equal to 32.'
  # end

  # if @api_client.config.client_side_validation && token_id < 16
  #   fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_get, must be greater than or equal to 16.'
  # end

  # resource path
  local_var_path = 'tms/v1/instrumentidentifiers/{tokenId}'.sub('{' + 'tokenId' + '}', token_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'profile-id'] = profile_id

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2007')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InstrumentIdentifierApi#instrumentidentifiers_token_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
instrumentidentifiers_token_id_patch(profile_id, token_id, body, opts = {}) click to toggle source

Update a Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier @param body Please specify the previous transaction Id to update. @param [Hash] opts the optional parameters @return [InlineResponse2007]

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 228
def instrumentidentifiers_token_id_patch(profile_id, token_id, body, opts = {})
  data, _status_code, _headers = instrumentidentifiers_token_id_patch_with_http_info(profile_id, token_id, body, opts)
  return data, _status_code, _headers
end
instrumentidentifiers_token_id_patch_with_http_info(profile_id, token_id, body, opts = {}) click to toggle source

Update a Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier @param body Please specify the previous transaction Id to update. @param [Hash] opts the optional parameters @return [Array<(InlineResponse2007, Fixnum, Hash)>] InlineResponse2007 data, response status code and response headers

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 239
def instrumentidentifiers_token_id_patch_with_http_info(profile_id, token_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InstrumentIdentifierApi.instrumentidentifiers_token_id_patch ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_patch"
  end
  if @api_client.config.client_side_validation && profile_id > 36
    fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_patch, must be smaller than or equal to 36.'
  end

  if @api_client.config.client_side_validation && profile_id < 36
    fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_patch, must be greater than or equal to 36.'
  end

  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_patch"
  end
  if @api_client.config.client_side_validation && token_id > 32
    fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_patch, must be smaller than or equal to 32.'
  end

  if @api_client.config.client_side_validation && token_id < 16
    fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_patch, must be greater than or equal to 16.'
  end

  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_patch"
  end
  # resource path
  local_var_path = '/instrumentidentifiers/{tokenId}'.sub('{' + 'tokenId' + '}', token_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'profile-id'] = profile_id

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2007')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InstrumentIdentifierApi#instrumentidentifiers_token_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
instrumentidentifiers_token_id_paymentinstruments_get(profile_id, token_id, opts = {}) click to toggle source

Retrieve all Payment Instruments associated with an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier. @param [Hash] opts the optional parameters @option opts [String] :offset Starting Payment Instrument record in zero-based dataset that should be returned as the first object in the array. Default is 0. @option opts [String] :limit The maximum number of Payment Instruments that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. (default to 20) @return [InlineResponse2008]

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 308
def instrumentidentifiers_token_id_paymentinstruments_get(profile_id, token_id, opts = {})
  data, _status_code, _headers = instrumentidentifiers_token_id_paymentinstruments_get_with_http_info(profile_id, token_id, opts)
  return data, _status_code, _headers
end
instrumentidentifiers_token_id_paymentinstruments_get_with_http_info(profile_id, token_id, opts = {}) click to toggle source

Retrieve all Payment Instruments associated with an Instrument Identifier @param profile_id The id of a profile containing user specific TMS configuration. @param token_id The TokenId of an Instrument Identifier. @param [Hash] opts the optional parameters @option opts [String] :offset Starting Payment Instrument record in zero-based dataset that should be returned as the first object in the array. Default is 0. @option opts [String] :limit The maximum number of Payment Instruments that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. @return [Array<(InlineResponse2008, Fixnum, Hash)>] InlineResponse2008 data, response status code and response headers

# File lib/cyberSource_client/api/instrument_identifier_api.rb, line 320
def instrumentidentifiers_token_id_paymentinstruments_get_with_http_info(profile_id, token_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get ...'
  end
  # verify the required parameter 'profile_id' is set
  if @api_client.config.client_side_validation && profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'profile_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get"
  end
  # if @api_client.config.client_side_validation && profile_id > 36
  #   fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get, must be smaller than or equal to 36.'
  # end

  # if @api_client.config.client_side_validation && profile_id < 36
  #   fail ArgumentError, 'invalid value for "profile_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get, must be greater than or equal to 36.'
  # end

  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get"
  end
  # if @api_client.config.client_side_validation && token_id > 32
  #   fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get, must be smaller than or equal to 32.'
  # end

  # if @api_client.config.client_side_validation && token_id < 16
  #   fail ArgumentError, 'invalid value for "token_id" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get, must be greater than or equal to 16.'
  # end

  if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
    fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get, must be greater than or equal to 0.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
    fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling InstrumentIdentifierApi.instrumentidentifiers_token_id_paymentinstruments_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = 'tms/v1/instrumentidentifiers/{tokenId}/paymentinstruments'.sub('{' + 'tokenId' + '}', token_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'profile-id'] = profile_id

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2008')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InstrumentIdentifierApi#instrumentidentifiers_token_id_paymentinstruments_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end