The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Finance::Bank::LloydsTSB - Check your bank accounts from Perl

SYNOPSIS

  use Finance::Bank::LloydsTSB;
  my @accounts = Finance::Bank::LloydsTSB->check_balance(
        username  => $username,
        password  => $password
        memorable => $memorable_phrase
  );

  my $total = 0;
  my $format = "%20s : %21s : GBP %9.2f\n";
  for my $acc (@accounts) {
    $total += $acc->balance;
    printf $format, $acc->name, $acc->descr_num, $acc->balance;
  }
  print "-" x 70, "\n";
  printf $format, 'TOTAL', '', $total;

  my $statement = $accounts[0]->fetch_statement;

  # Retrieve QIF for all transactions in January 2008.
  my $qif = $accounts[1]->download_statement(2008, 01, 01, 5);

See fetch-statement.pl for a working example.

DESCRIPTION

This module provides a rudimentary interface to the LloydsTSB online banking system at https://online.lloydstsb.co.uk/. You will need either Crypt::SSLeay or IO::Socket::SSL installed for HTTPS support to work with LWP.

CLASS METHODS

get_accounts(username => $u, password => $p, memorable => $m)

Return a list of Finance::Bank::LloydsTSB::Account objects, one for each of your bank accounts.

normalize_balance($balance)

Converts the website's textual representation of a balance sum into numeric form.

logoff()

Logs off, if you want to be nice and not bloat the sessions table they no doubt have in their backend database.

ACCOUNT OBJECT METHODS

  • $ac->name

  • $ac->sort_code

  • $ac->account_no

    Return the name of the account, the sort code formatted as the familiar XX-YY-ZZ, and the account number.

  • $ac->balance

    Return the balance as a signed floating point value.

  • $ac->statement

    Return a mini-statement as a line-separated list of transactions. Each transaction is a comma-separated list. WARNING: this interface is currently only useful for display, and hence may change in later versions of this module.

WARNING

This is code for online banking, and that means your money, and that means BE CAREFUL. You are encouraged, nay, expected, to audit the source of this module yourself to reassure yourself that I am not doing anything untoward with your banking data. This software is useful to me, but is provided under NO GUARANTEE, explicit or implied.

AUTHORS

Original by Simon Cozens <simon@cpan.org>

Improvements by Adam Spiers <aspiers@cpan.org>