Class: SilaRuby::Banks

Inherits:
Object
  • Object
show all
Includes:
ApiHelpers
Defined in:
lib/sila-ruby/banks.rb

Overview

BANKS ========================================

Class Method Summary collapse

Methods included from ApiHelpers

included

Class Method Details

.get_accounts(handle, user_key) ⇒ Object


GET-ACCOUNTS ——————————-


Gets basic bank account names linked to user handle



39
40
41
42
43
# File 'lib/sila-ruby/banks.rb', line 39

def self.get_accounts(handle, user_key)
  header = { user_handle: handle }
  message = 'get_accounts_msg'
  post_signed('get_accounts', header, message, nil, user_key)
end

LINK-ACCOUNT ——————————-


Uses a provided Plaid public token to link a bank account to a verified entity



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/sila-ruby/banks.rb', line 20

def self.(handle, params={}, user_key)
  header = { user_handle: handle }
  message = 'link_account_msg'
  
  # Example of params passed
  #
  # params = {
  #   public_token: "public-xxx-xxx",
  #   account_name: "Custom Account Name",
  #   selected_account_id: "optional_selected_account_id"
  # }

  post_signed('link_account', header, message, params, user_key)
end