Class: CybridApiBank::TransactionsBankApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cybrid_api_bank_ruby/api/transactions_bank_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TransactionsBankApi



19
20
21
# File 'lib/cybrid_api_bank_ruby/api/transactions_bank_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/cybrid_api_bank_ruby/api/transactions_bank_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#list_transactions(account_guid, opts = {}) ⇒ TransactionListBankModel

List Transactions Retrieves a listing of transactions (an account statement) for an account. Required scope: transactions:read

Options Hash (opts):

  • :bank_guid (String)

    Comma separated bank_guids the account must belong to.

  • :customer_guid (String)

    Comma separated customer_guids the account must belong to.

  • :cursor (String)
  • :per_page (Integer)
  • :direction (String)
  • :created_at_gte (String)

    Created at start date-time inclusive lower bound, ISO8601.

  • :created_at_lt (String)

    Created at end date-time exclusive upper bound, ISO8601.

  • :include_balances (Boolean)

    Include the running posted balance on the account as of each transaction.



35
36
37
38
# File 'lib/cybrid_api_bank_ruby/api/transactions_bank_api.rb', line 35

def list_transactions(, opts = {})
  data, _status_code, _headers = list_transactions_with_http_info(, opts)
  data
end

#list_transactions_with_http_info(account_guid, opts = {}) ⇒ Array<(TransactionListBankModel, Integer, Hash)>

List Transactions Retrieves a listing of transactions (an account statement) for an account. Required scope: transactions:read

Options Hash (opts):

  • :bank_guid (String)

    Comma separated bank_guids the account must belong to.

  • :customer_guid (String)

    Comma separated customer_guids the account must belong to.

  • :cursor (String)
  • :per_page (Integer)
  • :direction (String)
  • :created_at_gte (String)

    Created at start date-time inclusive lower bound, ISO8601.

  • :created_at_lt (String)

    Created at end date-time exclusive upper bound, ISO8601.

  • :include_balances (Boolean)

    Include the running posted balance on the account as of each transaction.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/cybrid_api_bank_ruby/api/transactions_bank_api.rb', line 53

def list_transactions_with_http_info(, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TransactionsBankApi.list_transactions ...'
  end
  # verify the required parameter 'account_guid' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_guid' when calling TransactionsBankApi.list_transactions"
  end
  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling TransactionsBankApi.list_transactions, must be smaller than or equal to 100.'
  end

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

  allowable_values = ["credit", "debit"]
  if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])
    fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/transactions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'account_guid'] = 
  query_params[:'bank_guid'] = opts[:'bank_guid'] if !opts[:'bank_guid'].nil?
  query_params[:'customer_guid'] = opts[:'customer_guid'] if !opts[:'customer_guid'].nil?
  query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
  query_params[:'created_at_gte'] = opts[:'created_at_gte'] if !opts[:'created_at_gte'].nil?
  query_params[:'created_at_lt'] = opts[:'created_at_lt'] if !opts[:'created_at_lt'].nil?
  query_params[:'include_balances'] = opts[:'include_balances'] if !opts[:'include_balances'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TransactionListBankModel'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['BearerAuth', 'oauth2']

  new_options = opts.merge(
    :operation => :"TransactionsBankApi.list_transactions",
    :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: TransactionsBankApi#list_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end