View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Jim Garvin > Finance-Bank-Wachovia-0.5 > Finance::Bank::Wachovia



Annotate this POD

View/Report Bugs
Module Version: 0.5   Source  


Finance::Bank::Wachovia - access account info from Perl

Does not (yet) provide any means to transfer money or pay bills.


Since this version uses the website to get account info, it will need the information to login: There are two ways to login via the wachovia website, and depending on which login method you use, that decides which parameters you'll provide to the new() method. If you use the Customer access number method (left form on the website) then provide "customer_access_number", "pin", and "code_word". If you use the user id method (right form on the website) then provide "user_id" and "password".

  use Finance::Bank::Wachovia;
  # Two different types of login information,
  # if you login using can/pin/codeword:
  my $wachovia  = Finance::Bank::Wachovia->new(
      customer_access_number => '123456789',
      pin                    => '1234',
      code_word              => 'blah'
  ) or die Finance::Bank::Wachovia->ErrStr();
  # OR if you login using user_id/password:
  $wachovia = Finance::Bank::Wachovia->new(
      user_id  => 'foo',
      password => 'bar'  
  ) or die Finance::Bank::Wachovia->ErrStr();
  my @account_numbers           = $wachovia->account_numbers();
  my @account_names             = $wachovia->account_names();
  my @account_balances  = $wachovia->account_balances();

  my $account = $wachovia->account( $account_numbers[0] )
        or die $wachovia->ErrStr();
  print "Number: ", $account->number, "\n";
  print "Name: ", $account->name, "\n";
  print "Type: ", $account->type, "\n";
  print "Avail. Bal.: ", $account->available_balance, "\n";
  print "Posted.Bal.: ", $account->posted_balance, "\n";
  my $transactions = $account->transactions
        or die $account->ErrStr;
  foreach my $t ( @$transactions ){
        print "Date: ",     $t->date,              "\n",
              "Action: ",   $t->action,            "\n",
              "Desc: ",     $t->description,       "\n",
              "Withdrawal", $t->withdrawal_amount, "\n",
              "Deposit",    $t->deposit_amount,    "\n",
              "Balance",    $t->balance,           "\n",
              "seq_no",     $t->seq_no,            "\n",
              "trans_code", $t->trans_code,        "\n",
              "check_num",  $t->check_num,         "\n";


Internally uses WWW::Mechanize to scrape the bank's website. The idea was to keep the interface as logical as possible. The user is completely abstracted from how the data is obtained, and to a large degree so is the module itself. In case wachovia ever offers an XML interface, or soap, or DBI (right) this should be an easy module to add to/modify, but the application interface will not change, so YOUR code won't have to either.



Returns object Finance::Bank::Wachovia object. This is when you should define your login information. There are currently two login methods, the 3 argument "can/pin/codeword" method, and the two argument "user_id/password" method. Which one you need to use depends on how you login to your account via the wachovia website.

If you use the can/pin/codeword method, then:

  my $wachovia = Finance::Bank::Wachovia->new(
      customer_access_number => '123456789',
      pin                    => '1234',
      code_word              => 'blah'

And if you use the user_id/password method, then:

  my $wachovia = Finance::Bank::Wachovia->new(
      user_id  => 'foo',
      password => 'bar'

On wachovia's website they say that eventually everyone will be migrated to the userid/password method.


Returns a list of account numbers (from the Relationship Summary Page).

  my @numbers = $wachovia->account_numbers();


Returns (in lowercase) a list of account names (ie: "exp access") (from the Relationship Summary Page).

  my @names = $wachovia->account_names;


Returns a list of account balances (from Relationship Summary page ).

  my @balances = $wachovia->account_balances;


Returns a Finance::Bank::Wachovia::Account object OR a Finance::Bank::Wachovia::Credit object. Currently the module looks at the length of the account number to decide whether you are retrieving a credit account object or a regular (savings/checkings) account object. Both the Credit and Account classes have some common attributes: name, type, number. You can use the type to figure out what kind of account you have, OR you can just look at the ref() of the object (better, since type can be unclear (like "mbna")).

  my $account = $wachovia->account( $account_num );

See Finance::Bank::Wachovia::Account and Finance::Bank::Wachovia::Credit to learn what you can do with the returned object.


Doug Feuerbach had the idea for storing login information in an encrypted file to be accessed via a password (like apple's keychain). Then he gave me the code to implement it. He thinks it's silly to thank him for something "so trivial", but he should know that it's not an official perl module without a "thanks" going out to someone by name. The program included with the module makes use of his contribution. Thanks Doug.

Also, thanks to the Giants that authored all the modules that made the conception and creation of this module so easy. Your shoulder's are awesome.

Where would we all be without Perl? Checking our account balances over the phone, that's where. Thanks to Larry Wall.

Thanks to Jason Marcell for helping me test/debug the user_id/password login in a pretty short amount of time.



Jim Garvin <>

Copyright 2004 by Jim Garvin

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


Finance::Bank::Wachovia::Account Finance::Bank::Wachovia::Transaction Finance::Bank::Wachovia::Credit

syntax highlighting: