LibOFX
ofx_request_accountinfo.cpp
Go to the documentation of this file.
1/***************************************************************************
2 ofx_request_accountinfo.cpp
3 -------------------
4 copyright : (C) 2005 by Ace Jones
5 email : acejones@users.sourceforge.net
6***************************************************************************/
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20#ifdef HAVE_CONFIG_H
21#include <config.h>
22#endif
23
24#include <cstdlib>
25#include <string>
26#include "libofx.h"
28
29char* libofx_request_accountinfo( const OfxFiLogin* login )
30{
31 OfxAccountInfoRequest strq( *login );
32 std::string request = OfxHeader(login->header_version) + strq.Output();
33
34 unsigned size = request.size();
35 char* result = (char*)malloc(size + 1);
36 request.copy(result, size);
37 result[size] = 0;
38
39 return result;
40}
41
42/*
43<OFX>
44<SIGNONMSGSRQV1>
45<SONRQ>
46<DTCLIENT>20050417210306
47<USERID>GnuCash
48<USERPASS>gcash
49<LANGUAGE>ENG
50<FI>
51<ORG>ReferenceFI
52<FID>00000
53</FI>
54<APPID>QWIN
55<APPVER>1100
56</SONRQ>
57</SIGNONMSGSRQV1>
58
59<SIGNUPMSGSRQV1>
60<ACCTINFOTRNRQ>
61<TRNUID>FFAAA4AA-A9B1-47F4-98E9-DE635EB41E77
62<CLTCOOKIE>4
63
64<ACCTINFORQ>
65<DTACCTUP>19700101000000
66</ACCTINFORQ>
67
68</ACCTINFOTRNRQ>
69</SIGNUPMSGSRQV1>
70</OFX>
71*/
72
74 OfxRequest(fi)
75{
76 Add( SignOnRequest() );
77
78 OfxAggregate acctinforqTag("ACCTINFORQ");
79 acctinforqTag.Add( "DTACCTUP", time_t_to_ofxdate( 0 ) );
80 Add ( RequestMessage("SIGNUP", "ACCTINFO", acctinforqTag) );
81}
An account information request.
OfxAccountInfoRequest(const OfxFiLogin &fi)
void Add(const std::string &tag, const std::string &data)
OfxAggregate(const std::string &tag)
OfxAggregate SignOnRequest(void) const
OfxAggregate RequestMessage(const std::string &msgtype, const std::string &trntype, const OfxAggregate &aggregate) const
OfxRequest(const OfxFiLogin &fi)
Declaration of OfxRequestAccountInfo create an OFX file containing a request for all account info at ...