using libofx_request_statement() to get balance

"G. Paul Ziemba" <[email protected]> Mon, 9 Jul 2007 07:21:11 +0000 (UTC)
Newsgroups gmane.comp.finance.libofx.devel
Message-ID <[email protected]>
I'm a new gnucash user and also new to aqbanking & libofx. I am
using FreeBSD and am creating updates to the FreeBSD ports to make
use of the latest versions of aqbanking & libofx. (It remains to
be seen if my updates will be accepted).
 
I think there should be a small change in the way
libofx_request_statement() works, so I'd like to propose it to
the more experienced people here to see if my idea makes sense.
I am mostly unfamiliar with libofx and aqbanking so maybe there
is a better approach.
 
Proposal: when libofx_request_statement() parameter date_from is 0,
the INCTRAN block in the request should be omitted.
 
In order to communicate with my (US) bank's system, I had to
incorporate the changes described at the bottom of
http://wiki.gnucash.org/wiki/Setting_up_OFXDirectConnect_in_GnuCash_2
to support the various account types, and I can get statements now
for my three types of accounts (checking, savings, money market)
via the aqbanking-tool command line.
 
When I request a balance of the checking account via either gnucash or
"aqbanking-tool request --balance", however, the bank takes more than
60 seconds to respond, and the client code times out. I traced this
problem to the way libofx_request_statement() is called:
 
When a "balance" is requested, date_from parameter is set to 0 and as
a result, records of all transactions starting at the beginning of time
are requested.  My bank takes longer than 60 seconds to assemble its
(huge) response (which is not needed anyway), so timeout occurs.
 
aqbanking seems to call libofx_request_statement() with a 0 date_from
when it doesn't want any transactions to be downloaded (i.e., when it
wants just the balance): see the function AO_Provider_RequestStatements()
in aqbanking/src/plugins/backends/aqofxconnect/plugin/provider.c
 
Should date_from==0 mean "get balance only and no transactions", i.e.,
omit <INCTRAN> ? it seems "yes" from aqbanking's use, but I can't
find documentation to support it.
 
thanks!
-- 
G. Paul Ziemba
FreeBSD unix:
12:21AM  up 6 days, 14:44, 9 users, load averages: 0.23, 0.15, 0.19

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/