Module: StarkitBanking::BankAccount

Extended by:
ActiveSupport::Concern
Includes:
ApiStepConcern
Defined in:
lib/starkit_banking/concerns/bank_account.rb

Instance Method Summary collapse

Methods included from ApiStepConcern

included

Instance Method Details

#balance(opts = {}) ⇒ Object



8
9
10
11
# File 'lib/starkit_banking/concerns/bank_account.rb', line 8

def balance(opts = {})
  @password = opts[:api_password]
  StarkitBanking::API::Factory.get_client(self, 'GetBalance').exec(self)
end

#credentialsObject

Raises:



18
19
20
21
22
23
# File 'lib/starkit_banking/concerns/bank_account.rb', line 18

def credentials
  c = Finance::ApiBankingCred.find_by(environment: self.environment, bank_name: self.bank_name)
  raise ApiFault.new(OpenStruct.new(code: 'sb:412', subCode: nil, reasonText: "Api Banking Credentials Not Available For #{self.bank_name}, #{self.environment}")) if c.nil?
  c.password = @password unless @password.nil?
  c
end

#transactions(opts = {}) ⇒ Object



13
14
15
16
# File 'lib/starkit_banking/concerns/bank_account.rb', line 13

def transactions(opts = {})
  @password = opts[:api_password]
  StarkitBanking::API::Factory.get_client(self, 'GetMiniStatement').exec(self)
end