Finance::OFX::Account - Object representation of an account at an Open


p5-Finance-OFX documentation Contained in the p5-Finance-OFX distribution.

Index


Code Index:

NAME

Top

Finance::OFX::Account - Object representation of an account at an Open Financial Exchange Financial Institution

SYNOPSIS

Top

 use Finance::OFX::Account

 my $acct = OFX::Account->new(URL => $url);
 $acct->language($lang);
 $acct->org($org);

DESCRIPTION

Top

Finance::OFX::Account encapsulates information about an account held at an OFX Financial Institution.

CONSTRUCTOR

Top

$acct = Finance::OFX::Account->new( %options )

Constructs a new Finance::OFX::Account object and returns it. Key/value pair arguments may be provided to set up the initial state. The following options are recognized:

   Key			Default
   -----------		--------------------
   FID			undef
   ID			undef
   Type			undef

ATTRIBUTES

Top

$acct->fid
$acct->fid( $fid )

Get/Set the Financial Institution's FID.

$acct->id
$acct->id( $id )

Get/Set the Account ID. Most people would call this an Account Number, but the OFX spec calls it an ID and treats it as a string.

$acct->type
$acct->type( $user )

Get/Set the account type.

SEE ALSO

Top

http://ofx.net

WARNING

Top

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

Top

Brandon Fosdick, <bfoz@bfoz.net>

COPYRIGHT AND LICENSE

Top


p5-Finance-OFX documentation Contained in the p5-Finance-OFX distribution.

# Filename: Account.pm
#
# Class interface for an OFX account
# http://www.ofx.net/
# 
# Created February 11, 2008  Brandon Fosdick <bfoz@bfoz.net>
#
# Copyright 2008 Brandon Fosdick <bfoz@bfoz.net> (BSD License)
#
# $Id: Account.pm,v 1.2 2008/03/04 04:22:27 bfoz Exp $

package Finance::OFX::Account;

use strict;
use warnings;
use vars qw($VERSION);

$VERSION = sprintf("%d.%03d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/);

sub new
{
    my ($this, %options) = @_;
    my $class = ref($this) || $this;
    my $self = {};
    bless $self, $class;

    # Initialization
    $self->{Type} = delete $options{Type};
    $self->{ID} = delete $options{ID};
    $self->{FID} = delete $options{FID};

    return $self;
}

sub type
{
    my $s = shift;
    $s->{Type} = shift if scalar @_;
    $s->{Type};
}

sub fid
{
    my $s = shift;
    $s->{FID} = shift if scalar @_; # Assign new value if an argument is given
    $s->{FID};			    # Return the stored value
}

sub id
{
    my $s = shift;
    $s->{ID} = shift if scalar @_;
    $s->{ID};
}

sub bankacctfrom
{
    my $s = shift;
    '<BANKACCTFROM><BANKID>'.$s->{FID}.
	'<ACCTID>'.$s->{ID}.
	'<ACCTTYPE>'.$s->{Type}.
    '</BANKACCTFROM>';
}

1;

__END__