class TreezorClient::PayinrefundApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

delete_payinrefund(id, opts = {}) click to toggle source

cancel a pay in refund Change payin refund's status to CANCELED. A validated payin refund can't be cancelled. @param id Payinrefund's internal id. @param [Hash] opts the optional parameters @return [InlineResponse20018]

# File lib/treezor_client/api/payinrefund_api.rb, line 27
def delete_payinrefund(id, opts = {})
  data, _status_code, _headers = delete_payinrefund_with_http_info(id, opts)
  data
end
delete_payinrefund_with_http_info(id, opts = {}) click to toggle source

cancel a pay in refund Change payin refund&#39;s status to CANCELED. A validated payin refund can&#39;t be cancelled. @param id Payinrefund&#39;s internal id. @param [Hash] opts the optional parameters @return [Array<(InlineResponse20018, Fixnum, Hash)>] InlineResponse20018 data, response status code and response headers

# File lib/treezor_client/api/payinrefund_api.rb, line 37
def delete_payinrefund_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinrefundApi.delete_payinrefund ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PayinrefundApi.delete_payinrefund"
  end
  # resource path
  local_var_path = '/payinrefunds/{id}'.sub('{' + 'id' + '}', 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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,
    :return_type => 'InlineResponse20018')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinrefundApi#delete_payinrefund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_payinrefund(id, opts = {}) click to toggle source

get a pay in refund Get a payin refund from the system. @param id Payinrefund&#39;s internal id. @param [Hash] opts the optional parameters @return [InlineResponse20018]

# File lib/treezor_client/api/payinrefund_api.rb, line 81
def get_payinrefund(id, opts = {})
  data, _status_code, _headers = get_payinrefund_with_http_info(id, opts)
  data
end
get_payinrefund_with_http_info(id, opts = {}) click to toggle source

get a pay in refund Get a payin refund from the system. @param id Payinrefund&#39;s internal id. @param [Hash] opts the optional parameters @return [Array<(InlineResponse20018, Fixnum, Hash)>] InlineResponse20018 data, response status code and response headers

# File lib/treezor_client/api/payinrefund_api.rb, line 91
def get_payinrefund_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinrefundApi.get_payinrefund ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling PayinrefundApi.get_payinrefund"
  end
  # resource path
  local_var_path = '/payinrefunds/{id}'.sub('{' + 'id' + '}', 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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20018')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinrefundApi#get_payinrefund\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_payinrefunds(opts = {}) click to toggle source

search pay in refunds Search for payinrefunds in the system. @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](agent.treezor.com/basics). @option opts [Integer] :access_user_id Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [String] :access_user_ip Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [Integer] :payin_id Payin&#39;s id. @option opts [Integer] :payinrefund_id Payinrefund&#39;s id. @option opts [String] :payinrefund_tag Custom data. @option opts [String] :payinrefund_status Payinrefund&#39;s status. Possible values: * PENDING * CANCELED * VALIDATED @option opts [Integer] :wallet_id Wallet&#39;s id to refund. @option opts [DateTime] :payinrefund_date payinrefund&#39;s date. Format: YYYY-MM-DD @option opts [Integer] :user_id User&#39;s id who made refunds. @option opts [String] :amount Refund&#39;s amount. @option opts [String] :currency Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217). @option opts [Integer] :page_number Pagination page number. More info [here](agent.treezor.com/lists). @option opts [Integer] :page_count The number of items per page. More info [here](agent.treezor.com/lists). @option opts [String] :sort_by The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists). @option opts [String] :sort_order The order you want to sort the list. * DESC for a descending sort * ASC for a ascending sort. Default value : DESC. More info [here](agent.treezor.com/lists). @option opts [DateTime] :created_date_from The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @option opts [DateTime] :created_date_to The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @option opts [DateTime] :updated_date_from The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @option opts [DateTime] :updated_date_to The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @return [InlineResponse20018]

# File lib/treezor_client/api/payinrefund_api.rb, line 155
def get_payinrefunds(opts = {})
  data, _status_code, _headers = get_payinrefunds_with_http_info(opts)
  data
end
get_payinrefunds_with_http_info(opts = {}) click to toggle source

search pay in refunds Search for payinrefunds in the system. @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](agent.treezor.com/basics). @option opts [Integer] :access_user_id Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [String] :access_user_ip Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [Integer] :payin_id Payin&#39;s id. @option opts [Integer] :payinrefund_id Payinrefund&#39;s id. @option opts [String] :payinrefund_tag Custom data. @option opts [String] :payinrefund_status Payinrefund&#39;s status. Possible values: * PENDING * CANCELED * VALIDATED @option opts [Integer] :wallet_id Wallet&#39;s id to refund. @option opts [DateTime] :payinrefund_date payinrefund&#39;s date. Format: YYYY-MM-DD @option opts [Integer] :user_id User&#39;s id who made refunds. @option opts [String] :amount Refund&#39;s amount. @option opts [String] :currency Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217). @option opts [Integer] :page_number Pagination page number. More info [here](agent.treezor.com/lists). @option opts [Integer] :page_count The number of items per page. More info [here](agent.treezor.com/lists). @option opts [String] :sort_by The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists). @option opts [String] :sort_order The order you want to sort the list. * DESC for a descending sort * ASC for a ascending sort. Default value : DESC. More info [here](agent.treezor.com/lists). @option opts [DateTime] :created_date_from The creation date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @option opts [DateTime] :created_date_to The creation date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @option opts [DateTime] :updated_date_from The modification date from which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @option opts [DateTime] :updated_date_to The modification date up to which you want to filter the request result. Format YYYY-MM-DD HH:MM:SS. More info [here](agent.treezor.com/lists) @return [Array<(InlineResponse20018, Fixnum, Hash)>] InlineResponse20018 data, response status code and response headers

# File lib/treezor_client/api/payinrefund_api.rb, line 185
def get_payinrefunds_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinrefundApi.get_payinrefunds ...'
  end
  # resource path
  local_var_path = '/payinrefunds'

  # query parameters
  query_params = {}
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'payinId'] = opts[:'payin_id'] if !opts[:'payin_id'].nil?
  query_params[:'payinrefundId'] = opts[:'payinrefund_id'] if !opts[:'payinrefund_id'].nil?
  query_params[:'payinrefundTag'] = opts[:'payinrefund_tag'] if !opts[:'payinrefund_tag'].nil?
  query_params[:'payinrefundStatus'] = opts[:'payinrefund_status'] if !opts[:'payinrefund_status'].nil?
  query_params[:'walletId'] = opts[:'wallet_id'] if !opts[:'wallet_id'].nil?
  query_params[:'payinrefundDate'] = opts[:'payinrefund_date'] if !opts[:'payinrefund_date'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'amount'] = opts[:'amount'] if !opts[:'amount'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?
  query_params[:'pageNumber'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'pageCount'] = opts[:'page_count'] if !opts[:'page_count'].nil?
  query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
  query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
  query_params[:'createdDateFrom'] = opts[:'created_date_from'] if !opts[:'created_date_from'].nil?
  query_params[:'createdDateTo'] = opts[:'created_date_to'] if !opts[:'created_date_to'].nil?
  query_params[:'updatedDateFrom'] = opts[:'updated_date_from'] if !opts[:'updated_date_from'].nil?
  query_params[:'updatedDateTo'] = opts[:'updated_date_to'] if !opts[:'updated_date_to'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20018')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinrefundApi#get_payinrefunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_payinrefunds(payin_id, amount, currency, opts = {}) click to toggle source

create a pay in refund Create a new payinrefund in the system. @param payin_id payin&#39;s id to refund. @param amount Refund amount. @param currency Refund currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217). @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](agent.treezor.com/basics). @option opts [Integer] :access_user_id Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [String] :access_user_ip Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [String] :payinrefund_tag Custom data. @option opts [String] :comment End user, client or issuer comment. @return [InlineResponse20018]

# File lib/treezor_client/api/payinrefund_api.rb, line 254
def post_payinrefunds(payin_id, amount, currency, opts = {})
  data, _status_code, _headers = post_payinrefunds_with_http_info(payin_id, amount, currency, opts)
  data
end
post_payinrefunds_with_http_info(payin_id, amount, currency, opts = {}) click to toggle source

create a pay in refund Create a new payinrefund in the system. @param payin_id payin&#39;s id to refund. @param amount Refund amount. @param currency Refund currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217). @param [Hash] opts the optional parameters @option opts [String] :access_signature Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication). @option opts [String] :access_tag Access tag is used for idem potency query. More info [here](agent.treezor.com/basics). @option opts [Integer] :access_user_id Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [String] :access_user_ip Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics). @option opts [String] :payinrefund_tag Custom data. @option opts [String] :comment End user, client or issuer comment. @return [Array<(InlineResponse20018, Fixnum, Hash)>] InlineResponse20018 data, response status code and response headers

# File lib/treezor_client/api/payinrefund_api.rb, line 272
def post_payinrefunds_with_http_info(payin_id, amount, currency, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PayinrefundApi.post_payinrefunds ...'
  end
  # verify the required parameter 'payin_id' is set
  if @api_client.config.client_side_validation && payin_id.nil?
    fail ArgumentError, "Missing the required parameter 'payin_id' when calling PayinrefundApi.post_payinrefunds"
  end
  # verify the required parameter 'amount' is set
  if @api_client.config.client_side_validation && amount.nil?
    fail ArgumentError, "Missing the required parameter 'amount' when calling PayinrefundApi.post_payinrefunds"
  end
  # verify the required parameter 'currency' is set
  if @api_client.config.client_side_validation && currency.nil?
    fail ArgumentError, "Missing the required parameter 'currency' when calling PayinrefundApi.post_payinrefunds"
  end
  # resource path
  local_var_path = '/payinrefunds'

  # query parameters
  query_params = {}
  query_params[:'payinId'] = payin_id
  query_params[:'amount'] = amount
  query_params[:'currency'] = currency
  query_params[:'accessSignature'] = opts[:'access_signature'] if !opts[:'access_signature'].nil?
  query_params[:'accessTag'] = opts[:'access_tag'] if !opts[:'access_tag'].nil?
  query_params[:'accessUserId'] = opts[:'access_user_id'] if !opts[:'access_user_id'].nil?
  query_params[:'accessUserIp'] = opts[:'access_user_ip'] if !opts[:'access_user_ip'].nil?
  query_params[:'payinrefundTag'] = opts[:'payinrefund_tag'] if !opts[:'payinrefund_tag'].nil?
  query_params[:'comment'] = opts[:'comment'] if !opts[:'comment'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key']
  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 => 'InlineResponse20018')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: PayinrefundApi#post_payinrefunds\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end