Financ...nentTSB(3pm)

πŸ“¦
version 0.4 Β· 2 versions
  • 0.4 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.4 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Financ...nentTSB(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and the module's actual name is Finance::Bank::IE::PermanentTSB πŸ’…


✨ NAME ✨

Finance::Bank::IE::PermanentTSB β€” it's a Perl Interface to the PermanentTSB Open24 homebanking, and the bank lives over at <http://www.open24.ie> πŸ¦πŸ¦‹


🌸 DESCRIPTION 🌸

So like. This is a lil set of functions you can drop into your Perl code to do actual operations with a Permanent TSB homebanking account. no cap, it's giving "I automated my banking" main character energy πŸ‘‘

Features, bestie:

  • account(s) balance: it pulls the balance for all the accounts you have set up (current account, visa card, etc.) πŸ’°
  • account(s) statement: it pulls the statement for a particular account, across a range of dates πŸ“…
  • mobile phone top-up (to be implemented): top up your mobile phone! πŸ“±
  • funds transfer (to be implemented): move money between your accounts or third party accounts πŸ’Έ
heads up: the top-up and the funds transfer are literally not built yet, so don't come for me πŸ™ˆ

πŸŽ€ CONSTANTS πŸŽ€

These constants below are used with the account_statement() function:

  • "ALL" β€” shortcut for (WITHDRAWAL and DEPOSIT); ✨
  • "WITHDRAWAL" β€” shows only the WITHDRAWALs;
  • "DEPOSIT" β€” shows only the DEPOSITs;
  • "VISA_ACCOUNT" β€” the account refers to a Visa Card; πŸ’³
  • "SWITCH_ACCOUNT" β€” the account is a normal Current Account;

πŸ‘‘ METHODS / FUNCTIONS πŸ‘‘

Every single function in this module needs, as the first argument, a reference to a hash containing the configuration. it's giving "here's my whole identity, take it" 🫢

my %config = (
    "open24numba" => "your open24 number",
    "password" => "your internet password",
    "pan" => "your personal access number",
    "debug" => 1,
);

πŸ”’ $boolean = login($config_ref) - private

This is a private function used by other functions within the module. You don't need to call it directly from your code! fr fr, hands off πŸ’…

This function performs the login. It takes just one required argument, which is a hash reference for the configuration. The function returns true (1) if success, or undef for any other state. If debug => 1 then it will dump the html page on the current working directory. Please be aware that this has a security risk. The information will persist on your filesystem until you reboot your machine (and /var/tmp get clean at boot time). 😭

bestie. listen. debug => 1 literally dumps bank html into your cwd. it stays there until you reboot. that's a whole security risk, not me being dramatic πŸ’€

πŸ”’ set_pan_fields($config_ref) - private

This is a private function used by other function within the module. You don't need to call it directly from you code!

This is used for the second step of the login process. The web interface ask you to insert 3 of the 6 digits that form the PAN code. The PAN is a secret code that only the PermanentTSB customer knows. If your PAN code is 123234 and the web interface is asking for this:

Digit no. 2:
Digit no. 5:
Digit no. 6:

The function will fill out the form providing 2,3,4 respectively.

This function doesn't return anything. it's giving silent but deadly 🧚

🌈 @accounts_balance = check_balance($config_ref) - public

This function require the configuration hash reference as argument. It returns an reference to an array of hashes, one hash for each account. In case of error it return undef; Each hash has these keys:

  • 'accname': account name, i.e. "Switch Current A/C". ⭐
  • 'accno': account number. An integer representing the last 4 digits of the account. πŸ”’
  • 'accbal': account balance. In EURO. πŸ’Ά

Here is an example:

$VAR1 = {
        'availbal' => 'euro amount',
        'accno' => '0223',
        'accbal' => 'euro amount',
        'accname' => 'Switch Current A/C'
        };
$VAR2 = {
        'availbal' => 'euro amount',
        'accno' => '2337',
        'accbal' => 'euro amount',
        'accname' => 'Visa Card'
        };

The array can be printed using, for example, a foreach loop like this one:

foreach my $acc (@$balance) {
    printf ("%s ending with %s: %s\n",
        $acc->{'accname'},
        $acc->{'accno'},
        $acc->{'accbal'}
    );
}

🌟 @account_statement = account_statement($config_ref, $acc_type, $acc_no, $from, $to, [$type]) - public

This function requires 4 mandatory arguments, the 5th is optional. okay so let's count them out:

  1. $config_ref: the hash reference to the configuration
  2. $acc_type: this is a constant: can be VISA_ACCOUNT or SWITCH_ACCOUNT
  3. $acc_no: this is a 4 digits field representing the last 4 digits of the account number (or Visa card number)
  4. $from: from date, in format dd/mm/yyyy
  5. $to: to date, in format dd/mm/yyyy
  6. $type (optional): type of statement (optional). Default: ALL. It can be WITHDRAWAL, DEPOSIT or ALL.

The function returns an reference to an array of hashes, one hash for each row of the statement. The array of hashes can be printed using, for example, a foreach loop like this one:

foreach my $row (@$statement) {
    printf("%s | %s | %s | %s \n",
        $row->{date},
        $row->{description},
        $row->{euro_amount},
        $row->{balance});
}

Undef is returned in case of error; 😭


πŸ›  INSTALLATION πŸ› 

To install this module type the following:

perl Makefile.PL
make
make test
make install

slay. that's it. four lines and you're iconic πŸ’…


🧚 DEPENDENCIES 🧚

This module requires these other modules and libraries:

WWW::Mechanize
HTML::TokeParser
Date::Calc

🌐 MODULE HOMEPAGES 🌐

  • Project homepage on Google code (with SVN repository):

<http://code.google.com/p/finance-bank-ie-permanenttsb>

  • Project homepage on CPAN.org:

<http://search.cpan.org/~pallotron/Finance-Bank-IE-PermanentTSB/>


πŸ“œ SYNOPSIS πŸ“œ

use Finance::Bank::IE::PermanentTSB;

my %config = (
    "open24numba" => "your open24 number",
    "password" => "your internet password",
    "pan" => "your personal access number",
    "debug" => 1, # <- enable debug messages
    );

my $balance = Finance::Bank::IE::PermanentTSB->check_balance(\%config);

if(not defined $balance) {
    print "Error!\n"
    exit;
}

foreach my $acc (@$balance) {
    printf ("%s ending with %s: %s\n",
        $acc->{'accname'},
        $acc->{'accno'},
        $acc->{'accbal'}
    );
}

my $statement = Finance::Bank::IE::PermanentTSB->account_statement(
    \%config, SWITCH_ACCOUNT, '2667','2008/12/01','2008/12/31');

if(not defined $statement) {
    print "Error!\n"
    exit;
}

foreach my $row (@$statement) {
    printf("%s | %s | %s | %s |\n",
        $row->{date},
        $row->{description},
        $row->{euro_amount},
         $row->{balance}
    );
}

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’œ AUTHOR πŸ’œ

Angelo "pallotron" Failla, <pallotron@freaknet.org> β€” <http://www.pallotron.net> β€” <http://www.vitadiunsysadmin.net>


Copyright (C) 2009 by Angelo "pallotron" Failla

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.


and that's the whole page bestie 🫢 this one was generated by perl v5.36.0 and dated 2022-11-20, and the manual it belongs to is Financ...nentTSB(3pm). go bank responsibly, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from