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

NAME

Finance::OFX::UserAgent - Open Financial Exchange client

SYNOPSIS

 use Finance::OFX::UserAgent
 
 my $ua = OFX::UserAgent->new(Institution => $fi);
 $ua->user_id($user);
 $ua->user_pass($pass);
 
 my $response = $ua->account_info();

DESCRIPTION

Finance::OFX::UserAgent provides an LWP::UserAgent like interface to an OFX server. It provides several convenience methods for performing common OFX requests. Results are returned as an Finance::OFX::Response object, which is an extension of HTTP::Response.

CONSTRUCTOR

$ua = Finance::OFX::UserAgent->new( %options )

Constructs a new Finance::OFX::UserAgent object and returns it. Key/value pair arguments may be provided to set up the initial state. In addition to the regular LWP::UserAgent options, the following options are also recognized:

   Key                  Default
   -----------          --------------------
   Institution          undef
   language             ENG
   ofxVersion           100
   ofxAppID             QWIN
   ofxAppVer            0900
   userID               anonymous00000000000000000000000
   userPass             anonymous00000000000000000000000

All unrecognized keys are passed to LWP::UserAgent.

ATTRIBUTES

$ua->institution
$ua->institution( $fi )

Get/Set the Finance::OFX::Institution object. Setter expects a reference.

$ua->response

Get a reference to the most recently returned Finance::OFX::Response object.

$ua->user_id
$ua->user_id( $user )

Get/Set the OFX user ID.

$ua->user_pass
$ua->user_pass( $pass )

Get/Set the OFX user password.

REQUEST METHODS

All request methods return a Finance::OFX::Response object unless otherwise noted.

If a user ID and password have not been set the default/anonymous OFX ID and password will be used.

$ua->account_info

Request account dicovery from the configured Financial Institution.

$ua->profile

Requests OFX profile information. Untested.

$ua->statement( $account, %options )

Request a statement download. Expects a Finance::OFX::Account object as the first argument to indicate the account to retrieve a statement for. %options can be:

   Key                  Description
   ------------         -------------------------------------------
   start                Start of date range to retrieve (UNIX time)
   end                  End of date range to retrieve (UNIX time)
   transactions         Request transaction list if set, otherwise 
                        get account balances

Not specifying a date range, or specifying an incomplete range, may or may not be a fatal error, depending on how the OFX server is configured. Some institutions appear to ignore the date range entirely and simply return whatever they feel like.

SEE ALSO

LWP::UserAgent Finance::OFX::Institution Finance::OFX::Response http://ofx.net

WARNING

From Finance::Bank::LloydsTSB:

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.

AUTHOR

Brandon Fosdick, <bfoz@bfoz.net>

COPYRIGHT AND LICENSE

Copyright 2008 Brandon Fosdick <bfoz@bfoz.net>

This software is provided under the terms of the BSD License.