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


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

Index


Code Index:

NAME

Top

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

SYNOPSIS

Top

 use Finance::OFX::Institution

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

DESCRIPTION

Top

Finance::OFX::Institution encapsulates information about an OFX Financial Institution.

CONSTRUCTOR

Top

$fi = Finance::OFX::Institution->new( %options )

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

   Key			Default
   -----------		--------------------
   Date			28800 (UNIX time for 1970-01-01)
   FID			undef
   language		ENG
   ORG			undef
   URL			undef

ATTRIBUTES

Top

$fi->date
$fi->date( $fi )

Get/Set the last-update date of the Financial Institution information.

$fi->fid
$fi->fid( $fid )

Get/Set the Financial Institution's FID.

$fi->language
$fi->language( $user )

Get/Set the OFX language code.

$fi->org
$fi->org( $pass )

Get/Set the OFX organizaton code.

$fi->url
$fi->url( $pass )

Get/Set the URL for the Institution's OFX server.

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: Institution.pm
#
# Class interface for an OFX financial institution
# http://www.ofx.net/
# 
# Created January 30, 2008  Brandon Fosdick <bfoz@bfoz.net>
#
# Copyright 2008 Brandon Fosdick <bfoz@bfoz.net> (BSD License)
#
# $Id: Institution.pm,v 1.2 2008/03/04 04:22:27 bfoz Exp $

package Finance::OFX::Institution;

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

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

use constant DEFAULT_OPTIONS =>
{
    'language'	    => 'ENG',
    'Date'	    => 28800,	# 1970-01-01
};

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

    # Initialization
    $self->{ORG} = delete $options{ORG};
    $self->{FID} = delete $options{FID};
    $self->{URL} = delete $options{URL};
    $self->{Date} = delete $options{Date};
    $self->{language} = delete $options{language};

    # Defaults
    for( keys %{DEFAULT_OPTIONS()} )
    {
	$self->{$_} = DEFAULT_OPTIONS()->{$_} unless defined $self->{$_};
    }

    return $self;
}

sub date
{
    my $s = shift;
    $s->{Date} = shift if scalar @_;
    $s->{Date};
}

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 language
{
    my $s = shift;
    $s->{language} = shift if scalar @_;
    $s->{language};
}

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

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

1;

__END__