Class: TreezorClient::TransactionApi

Inherits:
Object
  • Object
show all
Defined in:
lib/treezor_client/api/transaction_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TransactionApi

Returns a new instance of TransactionApi.



19
20
21
# File 'lib/treezor_client/api/transaction_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/treezor_client/api/transaction_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_transaction(id, opts = {}) ⇒ InlineResponse20022

get a transaction Get a transaction from the system.

Parameters:

  • id

    Transaction's internal id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/treezor_client/api/transaction_api.rb', line 27

def get_transaction(id, opts = {})
  data, _status_code, _headers = get_transaction_with_http_info(id, opts)
  data
end

#get_transaction_with_http_info(id, opts = {}) ⇒ Array<(InlineResponse20022, Fixnum, Hash)>

get a transaction Get a transaction from the system.

Parameters:

  • id

    Transaction&#39;s internal id.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse20022, Fixnum, Hash)>)

    InlineResponse20022 data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/treezor_client/api/transaction_api.rb', line 37

def get_transaction_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionApi.get_transaction ...'
  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 TransactionApi.get_transaction"
  end
  # resource path
  local_var_path = '/transactions/{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 => 'InlineResponse20022')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionApi#get_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_transactions(opts = {}) ⇒ InlineResponse20022

search transactions Get transactions that match search criteria.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :transaction_id (Integer)

    Transaction&#39;s Id

  • :transaction_type (String)

    Transaction types. Possible values: * Payin * Payout * Transfer * Transfer Refund * Payin Refund * Discount * Bill

  • :wallet_id (Integer)

    Transactions&#39; wallet id.

  • :user_id (Integer)

    Transactions&#39; user id.

  • :name (String)

    Transactions&#39; name.

  • :description (String)

    transactions&#39; description.

  • :amount (String)

    Transactions&#39; amount.

  • :currency (String)

    Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217).

  • :value_date (DateTime)

    The value date of the transaction (date applied for the payment) Format : YYYY-MM-DD HH:MM:SS

  • :execution_date (DateTime)

    Date of the execution of the transaction Format : YYYY-MM-DD HH:MM:SS

  • :page_number (Integer)

    Pagination page number. More info [here](agent.treezor.com/lists).

  • :page_count (Integer)

    The number of items per page. More info [here](agent.treezor.com/lists).

  • :sort_by (String)

    The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists).

  • :sort_order (String)

    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).

  • :created_date_from (DateTime)

    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)

  • :created_date_to (DateTime)

    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)

Returns:



100
101
102
103
# File 'lib/treezor_client/api/transaction_api.rb', line 100

def get_transactions(opts = {})
  data, _status_code, _headers = get_transactions_with_http_info(opts)
  data
end

#get_transactions_with_http_info(opts = {}) ⇒ Array<(InlineResponse20022, Fixnum, Hash)>

search transactions Get transactions that match search criteria.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :access_signature (String)

    Access signature can be mandatory for specific context. Treezor will contact you if so. More info [here](agent.treezor.com/security-authentication).

  • :access_tag (String)

    Access tag is used for idem potency query. More info [here](agent.treezor.com/basics).

  • :access_user_id (Integer)

    Access user&#39;s id is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :access_user_ip (String)

    Access user&#39;s ip is used for user&#39;s action restriction. More info [here](agent.treezor.com/basics).

  • :transaction_id (Integer)

    Transaction&#39;s Id

  • :transaction_type (String)

    Transaction types. Possible values: * Payin * Payout * Transfer * Transfer Refund * Payin Refund * Discount * Bill

  • :wallet_id (Integer)

    Transactions&#39; wallet id.

  • :user_id (Integer)

    Transactions&#39; user id.

  • :name (String)

    Transactions&#39; name.

  • :description (String)

    transactions&#39; description.

  • :amount (String)

    Transactions&#39; amount.

  • :currency (String)

    Transfert amount currency. Format: [ISO 4217](fr.wikipedia.org/wiki/ISO_4217).

  • :value_date (DateTime)

    The value date of the transaction (date applied for the payment) Format : YYYY-MM-DD HH:MM:SS

  • :execution_date (DateTime)

    Date of the execution of the transaction Format : YYYY-MM-DD HH:MM:SS

  • :page_number (Integer)

    Pagination page number. More info [here](agent.treezor.com/lists).

  • :page_count (Integer)

    The number of items per page. More info [here](agent.treezor.com/lists).

  • :sort_by (String)

    The transaction element you want to sort the list with. Default value : createdDate. More info [here](agent.treezor.com/lists).

  • :sort_order (String)

    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).

  • :created_date_from (DateTime)

    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)

  • :created_date_to (DateTime)

    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)

Returns:

  • (Array<(InlineResponse20022, Fixnum, Hash)>)

    InlineResponse20022 data, response status code and response headers



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/treezor_client/api/transaction_api.rb', line 129

def get_transactions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionApi.get_transactions ...'
  end
  # resource path
  local_var_path = '/transactions'

  # 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[:'transactionId'] = opts[:'transaction_id'] if !opts[:'transaction_id'].nil?
  query_params[:'transactionType'] = opts[:'transaction_type'] if !opts[:'transaction_type'].nil?
  query_params[:'walletId'] = opts[:'wallet_id'] if !opts[:'wallet_id'].nil?
  query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'description'] = opts[:'description'] if !opts[:'description'].nil?
  query_params[:'amount'] = opts[:'amount'] if !opts[:'amount'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?
  query_params[:'valueDate'] = opts[:'value_date'] if !opts[:'value_date'].nil?
  query_params[:'executionDate'] = opts[:'execution_date'] if !opts[:'execution_date'].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?

  # 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 => 'InlineResponse20022')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TransactionApi#get_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end