Wolfgang Schlueschen > Finance-Bank-DE-DeutscheBank-0.06 > Finance::Bank::DE::DeutscheBank

Download:
Finance-Bank-DE-DeutscheBank-0.06.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.06   Source  

NAME ^

Finance::Bank::DE::DeutscheBank - Checks your Deutsche Bank account from Perl

SYNOPSIS ^

  use strict;
  use Finance::Bank::DE::DeutscheBank;
  my $account = Finance::Bank::DE::DeutscheBank->new(
                Branch          => '600',
                Account         => '1234567',
                SubAccount      => '00',
                PIN             => '543210',

                status => sub { shift;
                                print join(" ", @_),"\n"
                                  if ($_[0] eq "HTTP Code")
                                      and ($_[1] != 200)
                                  or ($_[0] ne "HTTP Code");

                              },
              );
  # login to account
  if ( $account->login() )
  {
        print( "successfully logged into account\n" );
  }
  else
  {
        print( "error, can not log into account\n" );
  }

  my %saldo = $account->saldo();
  print("The amount of money you have is: $saldo{ 'Saldo' } $saldo{ 'Währung' }\n");

  # get account statement
  my %parameter = (
                        period => 1,
                        StartDate => "01.01.2005",
                        EndDate => "02.02.2005",
                  );

  my @account_statement = $account->account_statement(%parameter);

  $account->close_session;

DESCRIPTION ^

This module provides a rudimentary interface to the Deutsche Bank online banking system at https://meine.deutsche-bank.de/. You will need either Crypt::SSLeay or IO::Socket::SSL installed for HTTPS support to work with LWP.

The interface was cooked up by me by having a look at some other Finance::Bank modules. If you have any proposals for a change, they are welcome !

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.

WARNUNG ^

Dieser Code beschaeftigt sich mit Online Banking, das heisst, hier geht es um Dein Geld und das bedeutet SEI VORSICHTIG ! Ich gehe davon aus, dass Du den Quellcode persoenlich anschaust, um Dich zu vergewissern, dass ich nichts unrechtes mit Deinen Bankdaten anfange. Diese Software finde ich persoenlich nuetzlich, aber ich stelle sie OHNE JEDE GARANTIE zur Verfuegung, weder eine ausdrueckliche noch eine implizierte Garantie.

METHODS ^

new( %parameter )

Creates a new object. It takes four named parameters :

Branch => '600'

The Branch/Geschaeftstelle which is responsible for you.

Account => '1234567'

This is your account number.

SubAccount => '00'

This is your subaccount number.

PIN => '11111'

This is your PIN.

status => sub {}

This is an optional parameter where you can specify a callback that will receive the messages the object Finance::Bank::DE::DeutscheBank produces per session.

login()

Closes the current session and logs in to the website using the credentials given at construction time.

close_session()

Closes the session and invalidates it on the server.

agent()

Returns the WWW::Mechanize object. You can retrieve the content of the current page from there.

select_function( STRING )

Selects a function. The two currently supported functions are Ãœbersicht and Kunden-Logout. Which means account statement and quit.

account_statement( %parameter )

Navigates to the html page which contains the account statement. The content is retrieved by the agent, parsed by parse_account_overview and returned as an array of hashes. Like: @VAR =( { 'Buchungstag' => '18.02.2005', 'Wert' => '18.02.2005', 'Verwendungszweck' => 'this is for you', 'Haben' => '40,00', 'Soll' => '', 'Währung' => 'EUR' }, { 'Buchungstag' => '19.02.2005', 'Wert' => '19.02.2003', 'Verwendungszweck' => 'this was mine', 'Haben' => '', 'Soll' => '-123.98', 'Währung' => 'EUR' }) ;

Keys are in german because they are retrieved directly from the header of the csv file which is downloaded from the server.

You can pass a hash to this method to tell the period you would like to get the statement for. If you don't pass a parameter then you'll receive the account statement since your last visit at the Banks server. Parameter to pass to the function:

my %parameter = ( period => 1, StartDate => "10.02.2005", EndDate => "28.02.2005", );

If period is set to 1 then StartDate and EndDate will be used.

The second possibilty is to get an account overview for the last n days.

my %parameter = ( last => 10, );

This will retrieve an overview for the last ten days. The bank server allows 10,20,30,60,90 days. If you specify any other value then the method account_statement will use one of the above values ( the next biggest one ).

If neither period nor last is defined last login date at the bank server is used. StartDate and EndDate have to be in german format.

TODO: ^

  * Allthough more checks have been implemented to validate the HTML resp. responses from the server
it might be that some are still missing. Please let me know your feedback.

SEE ALSO ^

perl, WWW::Mechanize.

AUTHOR ^

Wolfgang Schlueschen, <wschl@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright 2003 - 2010 by Wolfgang Schlueschen

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: