Sha256: 4168c0c964de2abda3634bead161d06f1d15d07316da63c0b3a6d43623d422cc

Contents?: true

Size: 826 Bytes

Versions: 15

Compression:

Stored size: 826 Bytes

Contents

require 'active_support/concern'

module StarkitBanking
  module BankAccount
    extend ActiveSupport::Concern
    include ApiStepConcern

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

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

    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
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
starkit_banking-0.1.26 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.25 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.24 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.23 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.22 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.21 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.20 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.18 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.17 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.16 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.15 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.14 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.12 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.11 lib/starkit_banking/concerns/bank_account.rb
starkit_banking-0.1.10 lib/starkit_banking/concerns/bank_account.rb