.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Finance::Bank::IE::PermanentTSB 3pm" .TH Finance::Bank::IE::PermanentTSB 3pm "2018-06-29" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Finance::Bank::IE::PermanentTSB \- Perl Interface to the PermanentTSB Open24 homebanking on .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a set of functions that can be used in your Perl code to perform some operations with a Permanent \s-1TSB\s0 homebanking account. .PP Features: .IP "\(bu" 4 \&\fBaccount(s) balance\fR: retrieves the balance for all the accounts you have set up (current account, visa card, etc.) .IP "\(bu" 4 \&\fBaccount(s) statement\fR: retrieves the statement for a particular account, in a range of date. .IP "\(bu" 4 \&\fBmobile phone top-up\fR (to be implemented): top up your mobile phone! .IP "\(bu" 4 \&\fBfunds transfer\fR (to be implemented): transfer money between your accounts or third party accounts. .SH "CONSTANTS" .IX Header "CONSTANTS" The constants below are used with the \fIaccount_statement()\fR function: .IP "\(bu" 4 \&\f(CW\*(C`ALL\*(C'\fR: shortcut for (\s-1WITHDRAWAL\s0 and \s-1DEPOSIT\s0); .IP "\(bu" 4 \&\f(CW\*(C`WITHDRAWAL\*(C'\fR: shows only the WITHDRAWALs; .IP "\(bu" 4 \&\f(CW\*(C`DEPOSIT\*(C'\fR: shows only the DEPOSITs; .IP "\(bu" 4 \&\f(CW\*(C`VISA_ACCOUNT\*(C'\fR: the account refers to a Visa Card; .IP "\(bu" 4 \&\f(CW\*(C`SWITCH_ACCOUNT\*(C'\fR: the account is a normal Current Account; .SH "METHODS / FUNCTIONS" .IX Header "METHODS / FUNCTIONS" Every function in this module requires, as the first argument, a reference to an hash which contains the configuration: .PP .Vb 6 \& my %config = ( \& "open24numba" => "your open24 number", \& "password" => "your internet password", \& "pan" => "your personal access number", \& "debug" => 1, \& ); .Ve .ie n .SS """$boolean = login($config_ref)"" \- \fBprivate\fP" .el .SS "\f(CW$boolean = login($config_ref)\fP \- \fBprivate\fP" .IX Subsection "$boolean = login($config_ref) - private" \&\fBThis is a private function used by other function within the module. You don't need to call it directly from you code!\fR .PP This function performs the login. It takes just one required argument, which is an 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). .ie n .SS """set_pan_fields($config_ref)"" \- \fBprivate\fP" .el .SS "\f(CWset_pan_fields($config_ref)\fP \- \fBprivate\fP" .IX Subsection "set_pan_fields($config_ref) - private" \&\fBThis is a private function used by other function within the module. You don't need to call it directly from you code!\fR .PP 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 \s-1PAN\s0 code. The \s-1PAN\s0 is a secret code that only the PermanentTSB customer knows. If your \s-1PAN\s0 code is 123234 and the web interface is asking for this: .IP "Digit no. 2:" 4 .IX Item "Digit no. 2:" .PD 0 .IP "Digit no. 5:" 4 .IX Item "Digit no. 5:" .IP "Digit no. 6:" 4 .IX Item "Digit no. 6:" .PD .PP The function will fill out the form providing 2,3,4 respectively. .PP This function doesn't return anything. .ie n .SS """@accounts_balance = check_balance($config_ref)"" \- \fBpublic\fP" .el .SS "\f(CW@accounts_balance = check_balance($config_ref)\fP \- \fBpublic\fP" .IX Subsection "@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: .IP "\(bu" 4 \&'accname': account name, i.e. \*(L"Switch Current A/C\*(R". .IP "\(bu" 4 \&'accno': account number. An integer representing the last 4 digits of the account. .IP "\(bu" 4 \&'accbal': account balance. In \s-1EURO.\s0 .PP Here is an example: .PP .Vb 12 \& $VAR1 = { \& \*(Aqavailbal\*(Aq => \*(Aqeuro amount\*(Aq, \& \*(Aqaccno\*(Aq => \*(Aq0223\*(Aq, \& \*(Aqaccbal\*(Aq => \*(Aqeuro amount\*(Aq, \& \*(Aqaccname\*(Aq => \*(AqSwitch Current A/C\*(Aq \& }; \& $VAR2 = { \& \*(Aqavailbal\*(Aq => \*(Aqeuro amount\*(Aq, \& \*(Aqaccno\*(Aq => \*(Aq2337\*(Aq, \& \*(Aqaccbal\*(Aq => \*(Aqeuro amount\*(Aq, \& \*(Aqaccname\*(Aq => \*(AqVisa Card\*(Aq \& }; .Ve .PP The array can be printed using, for example, a foreach loop like this one: .PP .Vb 7 \& foreach my $acc (@$balance) { \& printf ("%s ending with %s: %s\en", \& $acc\->{\*(Aqaccname\*(Aq}, \& $acc\->{\*(Aqaccno\*(Aq}, \& $acc\->{\*(Aqaccbal\*(Aq} \& ); \& } .Ve .ie n .SS """@account_statement = account_statement($config_ref, $acc_type, $acc_no, $from, $to, [$type])"" \- \fBpublic\fP" .el .SS "\f(CW@account_statement = account_statement($config_ref, $acc_type, $acc_no, $from, $to, [$type])\fP \- \fBpublic\fP" .IX Subsection "@account_statement = account_statement($config_ref, $acc_type, $acc_no, $from, $to, [$type]) - public" This function requires 4 mandatory arguments, the 5th is optional. .IP "1. \fB\f(CB$config_ref\fB\fR: the hash reference to the configuration" 4 .IX Item "1. $config_ref: the hash reference to the configuration" .PD 0 .IP "2. \fB\f(CB$acc_type\fB\fR: this is a constant: can be \s-1VISA_ACCOUNT\s0 or \s-1SWITCH_ACCOUNT\s0" 4 .IX Item "2. $acc_type: this is a constant: can be VISA_ACCOUNT or SWITCH_ACCOUNT" .IP "3. \fB\f(CB$acc_no\fB\fR: this is a 4 digits field representing the last 4 digits of the account number (or Visa card number)" 4 .IX Item "3. $acc_no: this is a 4 digits field representing the last 4 digits of the account number (or Visa card number)" .IP "4. \fB\f(CB$from\fB\fR: from date, in format dd/mm/yyyy" 4 .IX Item "4. $from: from date, in format dd/mm/yyyy" .IP "5. \fB\f(CB$to\fB\fR: to date, in format dd/mm/yyyy" 4 .IX Item "5. $to: to date, in format dd/mm/yyyy" .IP "6. \fB\f(CB$type\fB\fR (optional): type of statement (optional). Default: \s-1ALL.\s0 It can be \s-1WITHDRAWAL, DEPOSIT\s0 or \s-1ALL.\s0" 4 .IX Item "6. $type (optional): type of statement (optional). Default: ALL. It can be WITHDRAWAL, DEPOSIT or ALL." .PD .PP 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: .PP .Vb 7 \& foreach my $row (@$statement) { \& printf("%s | %s | %s | %s \en", \& $row\->{date}, \& $row\->{description}, \& $row\->{euro_amount}, \& $row\->{balance}); \& } .Ve .PP Undef is returned in case of error; .SH "INSTALLATION" .IX Header "INSTALLATION" To install this module type the following: .PP .Vb 4 \& perl Makefile.PL \& make \& make test \& make install .Ve .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" This module requires these other modules and libraries: .PP .Vb 3 \& WWW::Mechanize \& HTML::TokeParser \& Date::Calc .Ve .SH "MODULE HOMEPAGES" .IX Header "MODULE HOMEPAGES" .IP "\(bu" 4 Project homepage on Google code (with \s-1SVN\s0 repository): .Sp .IP "\(bu" 4 Project homepage on \s-1CPAN\s0.org: .Sp .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& 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(\e%config); \& \& if(not defined $balance) { \& print "Error!\en" \& exit; \& } \& \& foreach my $acc (@$balance) { \& printf ("%s ending with %s: %s\en", \& $acc\->{\*(Aqaccname\*(Aq}, \& $acc\->{\*(Aqaccno\*(Aq}, \& $acc\->{\*(Aqaccbal\*(Aq} \& ); \& } \& \& my $statement = Finance::Bank::IE::PermanentTSB\->account_statement( \& \e%config, SWITCH_ACCOUNT, \*(Aq2667\*(Aq,\*(Aq2008/12/01\*(Aq,\*(Aq2008/12/31\*(Aq); \& \& if(not defined $statement) { \& print "Error!\en" \& exit; \& } \& \& foreach my $row (@$statement) { \& printf("%s | %s | %s | %s |\en", \& $row\->{date}, \& $row\->{description}, \& $row\->{euro_amount}, \& $row\->{balance} \& ); \& } .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 \&\fBptsb\fR \- \s-1CLI\s0 tool to interact with your home banking .IP "\(bu" 4 Ronan Waider's \f(CW\*(C`Finance::Bank::IE::BankOfIreland\*(C'\fR \- .SH "AUTHOR" .IX Header "AUTHOR" Angelo \*(L"pallotron\*(R" Failla, \- \- .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2009 by Angelo \*(L"pallotron\*(R" Failla .PP 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.