| p5-Finance-OFX documentation | Contained in the p5-Finance-OFX distribution. |
Finance::OFX::Response - An OFX-specific subclass of HTTP::Response.
use Finance::OFX::Response my $r = OFX::Response->from_http_response($response);
Finance::OFX::Response encapsulates information about an OFX Financial
Institution.
Constructs a new Finance::OFX::Response object and returns it. This is merely
a default constructor that does nothing in particular. Don't use it.
Converts the given HTTP::Response object into an Finance::OFX::Response object and uses Finance::OFX::Parse to parse the response content.
Get/Set the OFX branch of the parsed content tree.
Get/Set the OFX header branch of the parsed content tree.
Get the status code from the SONRS block.
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.
Brandon Fosdick, <bfoz@bfoz.net>
Copyright 2008 Brandon Fosdick <bfoz@bfoz.net>
This software is provided under the terms of the BSD License.
| p5-Finance-OFX documentation | Contained in the p5-Finance-OFX distribution. |
# Filename: Response.pm # # OFX response # http://www.ofx.net/ # # Created February 16, 2008 Brandon Fosdick <bfoz@bfoz.net> # # Copyright 2008 Brandon Fosdick <bfoz@bfoz.net> (BSD License) # # $Id: Response.pm,v 1.2 2008/03/04 04:22:27 bfoz Exp $ package Finance::OFX::Response; use strict; use warnings; use vars qw($VERSION); use base qw(HTTP::Response); $VERSION = sprintf("%d.%03d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/); use Finance::OFX::Parse; sub new { my ($this, %options) = @_; my $class = ref($this) || $this; my $self = $class->SUPER::new(%options); bless $self, $class; return $self; } # Create a new OFX::Response from an HTTP::Response object # NOTE: Re-blesses the passed reference sub from_http_response { my ($this, $self) = @_; my $class = ref($this) || $this; bless $self, $class; return $self unless $self->is_success; # Parse the HTTP response into an OFX tree $self->{tree} = Finance::OFX::Parse::parse($self->content); $self->{ofx} = $self->{tree}{ofx}; $self->{ofxHeader} = $self->{tree}{header}; return $self; } sub ofx { my $s = shift; $s->{ofx} = shift if scalar @_; $s->{ofx}; } sub ofx_header { my $s = shift; $s->{ofxHeader} = shift if scalar @_; $s->{ofxHeader}; } sub signonInstitution { my $s = shift; return $s->{ofx}{signonmsgsrsv1}{sonrs}{fi}; } sub signon_status_code { my $s = shift; return $s->{ofx}{signonmsgsrsv1}{sonrs}{status}{code}; } 1; __END__