Class: Plaidio::Customer

Inherits:
Object
  • Object
show all
Defined in:
lib/plaidio/customer.rb

Overview

This is used when a customer needs to be defined by the plaid access token. Abstracting as a class makes it easier since we wont have to redefine the access_token over and over.

Constant Summary collapse

BASE_URL =
'https://tartan.plaid.com'

Instance Method Summary collapse

Constructor Details

#initializeCustomer

This initializes our instance variables, and sets up a new Customer class.



9
10
11
12
13
# File 'lib/plaidio/customer.rb', line 9

def initialize
  Plaidio::Configure::KEYS.each do |key|
    instance_variable_set(:"@#{key}", Plaidio.instance_variable_get(:"@#{key}"))
  end
end

Instance Method Details

#delete_account(access_token) ⇒ Object



26
27
28
29
# File 'lib/plaidio/customer.rb', line 26

def (access_token)
  delete('/connect', access_token)
  return parse_response(@response,3)
end

#get_transactions(access_token) ⇒ Object



21
22
23
24
# File 'lib/plaidio/customer.rb', line 21

def get_transactions(access_token)
  get('/connect', access_token)
  return parse_response(@response,2)
end

#mfa_step(access_token, code) ⇒ Object



15
16
17
18
19
# File 'lib/plaidio/customer.rb', line 15

def mfa_step(access_token,code)
  @mfa = code
  post("/connect/step", access_token, mfa: @mfa)
  return parse_response(@response,1)
end