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"
char* libofx_request_accountinfo( const OfxFiLogin* login )
{
OfxAccountInfoRequest strq( *login );
std::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) );
}
OfxAggregate::Add
void Add(const std::string &tag, const std::string &data)
Definition: ofx_aggregate.hh:64
ofx_request_accountinfo.hh
Declaration of OfxRequestAccountInfo create an OFX file containing a request for all account info at ...
OfxRequest::RequestMessage
OfxAggregate RequestMessage(const std::string &msgtype, const std::string &trntype, const OfxAggregate &aggregate) const
Definition: ofx_request.cpp:113
OfxRequest::SignOnRequest
OfxAggregate SignOnRequest(void) const
Definition: ofx_request.cpp:82
OfxAccountInfoRequest
An account information request.
Definition: ofx_request_accountinfo.hh:34
OfxFiLogin
Information sufficient to log into an financial institution.
Definition: inc/libofx.h:1383
OfxAggregate
A single aggregate as described in the OFX 1.02 specification.
Definition: ofx_aggregate.hh:40
OfxRequest
A generic request.
Definition: ofx_request.hh:34
libofx_request_accountinfo
char * libofx_request_accountinfo(const struct OfxFiLogin *login)
Creates an OFX account info (list) request in string form.
OfxAccountInfoRequest::OfxAccountInfoRequest
OfxAccountInfoRequest(const OfxFiLogin &fi)
Definition: ofx_request_accountinfo.cpp:73