### Quickstart: Fetching Bank Movements with Fintoc (Ruby) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This quickstart guide shows how to initialize the Fintoc client, retrieve a specific link, find a checking account, and then fetch its movements, either the last 30 or all movements since a given date. ```Ruby require 'fintoc' client = Fintoc::Client.new('sk_test_9c8d8CeyBTx1VcJzuDgpm4H-bywJCeSx') link = client.get_link('6n12zLmai3lLE9Dq_token_gvEJi8FrBge4fb3cz7Wp856W') account = link.find(type: 'checking_account') # Get the las 30 movements movements = account.get_movements # Or get all the movements since a specific date movements = account.get_movements(since: '2020-08-15') ``` -------------------------------- ### Installing Fintoc Gem via Bundle or Gem (Shell) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md These commands illustrate how to install the 'fintoc' gem: `bundle install` for projects using a Gemfile, or `gem install fintoc` for direct system-wide installation. ```Shell $ bundle install ``` ```Shell $ gem install fintoc ``` -------------------------------- ### Retrieving and Displaying All Accounts for a Link (Ruby) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This example demonstrates how to initialize the Fintoc client, obtain a link, and then either print all associated accounts or use `show_accounts` for a formatted output. ```Ruby require 'fintoc' client = Fintoc::Client.new('api_key') link = client.get_link('link_token') puts link.accounts # Or... you can pretty print all the accounts in a Link link = client.get_link('link_token') link.show_accounts ``` -------------------------------- ### Finding Multiple Accounts by Currency (Ruby) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This example demonstrates how to use the `find_all` method on a Fintoc link to retrieve an array of accounts that match a specified criterion, such as `currency` (e.g., 'CLP'). ```Ruby require 'fintoc' client = Fintoc::Client.new('api_key') link = client.get_link('link_token') accounts = link.find_all(currency: 'CLP') ``` -------------------------------- ### Installing Fintoc Gem via Gemfile (Ruby) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This snippet demonstrates how to declare the 'fintoc' gem as a dependency in your Ruby application's Gemfile, ensuring it's included in your project's dependencies. ```Ruby gem 'fintoc' ``` -------------------------------- ### Fetching Account Movements with Date and Pagination (Ruby) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This example details how to retrieve account movements using `get_movements`, allowing filtering by a `since` date (either a `DateTime` object or an ISO 8601 string) and controlling the number of results per page with `per_page`. ```Ruby require 'fintoc' require 'time' client = Fintoc::Client.new('api_key') link = client.get_link('link_token') account = link.find(type: 'checking_account') # You can get the account movements since a specific DateTime yesterday = DateTime.now - 1 account.get_movements(since: yesterday) # Or you can use an ISO 8601 formatted string representation of the Date account.get_movements(since: '2020-01-01') # You can also set how many movements you want per_page account.get_movements(since: '2020-01-01', per_page: 100) ``` -------------------------------- ### Running Tests for the Fintoc Ruby Client (Shell) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This command executes the test suite for the Fintoc Ruby client, typically used by developers to verify functionality and ensure code integrity. ```Shell rspec ``` -------------------------------- ### Finding a Single Account by Type, Number, or ID (Ruby) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This snippet illustrates using the `find` method on a Fintoc link to locate a single account by specifying criteria such as `type` (e.g., 'checking_account'), `number`, or `id`. ```Ruby require 'fintoc' client = Fintoc::Client.new('api_key') link = client.get_link('link_token') account = link.find(type: 'checking_account') # Or by number account = link.find(number: '1111111') # Or by account id account = link.find(id: 'sdfsdf234') ``` -------------------------------- ### Updating an Account's Balance (Ruby) Source: https://github.com/fintoc-com/fintoc-ruby/blob/main/README.md This snippet shows how to refresh the balance of a specific Fintoc account. After retrieving an account using `find`, the `update_balance` method is called to fetch the latest balance. ```Ruby require 'fintoc' client = Fintoc::Client.new('api_key') link = client.get_link('link_token') account = link.find(number: '1111111') account.update_balance ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.