build/libofx-0.10.0/lib/ofx_request_accountinfo.cpp
Go to the documentation of this file.
/***************************************************************************
ofx_request_accountinfo.cpp
-------------------
copyright : (C) 2005 by Ace Jones
email : acejones@users.sourceforge.net
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cstdlib>
#include <string>
#include "libofx.h"
#include "ofx_request_accountinfo.hh"
using namespace std;
char* libofx_request_accountinfo( const OfxFiLogin* login )
{
OfxAccountInfoRequest strq( *login );
string request = OfxHeader(login->header_version) + strq.Output();
unsigned size = request.size();
char* result = (char*)malloc(size + 1);
request.copy(result, size);
result[size] = 0;
return result;
}
/*
<OFX>
<SIGNONMSGSRQV1>
<SONRQ>
<DTCLIENT>20050417210306
<USERID>GnuCash
<USERPASS>gcash
<LANGUAGE>ENG
<FI>
<ORG>ReferenceFI
<FID>00000
</FI>
<APPID>QWIN
<APPVER>1100
</SONRQ>
</SIGNONMSGSRQV1>
<SIGNUPMSGSRQV1>
<ACCTINFOTRNRQ>
<TRNUID>FFAAA4AA-A9B1-47F4-98E9-DE635EB41E77
<CLTCOOKIE>4
<ACCTINFORQ>
<DTACCTUP>19700101000000
</ACCTINFORQ>
</ACCTINFOTRNRQ>
</SIGNUPMSGSRQV1>
</OFX>
*/
OfxAccountInfoRequest::OfxAccountInfoRequest( const OfxFiLogin& fi ):
OfxRequest(fi)
{
Add( SignOnRequest() );
OfxAggregate acctinforqTag("ACCTINFORQ");
acctinforqTag.Add( "DTACCTUP", time_t_to_ofxdate( 0 ) );
Add ( RequestMessage("SIGNUP", "ACCTINFO", acctinforqTag) );
}
ofx_request_accountinfo.hh
Declaration of OfxRequestAccountInfo create an OFX file containing a request for all account info at ...
std
OfxAccountInfoRequest
An account information request.
Definition: build/libofx-0.10.0/lib/ofx_request_accountinfo.hh:37
libofx_request_accountinfo
char * libofx_request_accountinfo(const struct OfxFiLogin *login)
Creates an OFX account info (list) request in string form.
OfxRequest
A generic request.
Definition: build/libofx-0.10.0/lib/ofx_request.hh:36
OfxAggregate
A single aggregate as described in the OFX 1.02 specification.
Definition: build/libofx-0.10.0/lib/ofx_aggregate.hh:42
OfxRequest::RequestMessage
OfxAggregate RequestMessage(const string &msgtype, const string &trntype, const OfxAggregate &aggregate) const
Definition: build/libofx-0.10.0/lib/ofx_request.cpp:115
OfxAggregate::Add
void Add(const string &tag, const string &data)
Definition: build/libofx-0.10.0/lib/ofx_aggregate.hh:59
OfxAccountInfoRequest::OfxAccountInfoRequest
OfxAccountInfoRequest(const OfxFiLogin &fi)
Definition: build/libofx-0.10.0/lib/ofx_request_accountinfo.cpp:75
OfxRequest::SignOnRequest
OfxAggregate SignOnRequest(void) const
Definition: build/libofx-0.10.0/lib/ofx_request.cpp:84
OfxFiLogin
Information sufficient to log into an financial institution.
Definition: inc/libofx.h:1372