# ofx_request_accountinfo.cpp

Go to the documentation of this file.

    00001 /***************************************************************************
    00002          ofx_request_accountinfo.cpp
    00003                              -------------------
    00004     copyright            : (C) 2005 by Ace Jones
    00005     email                : acejones@users.sourceforge.net
    00006 ***************************************************************************/
    00011 /***************************************************************************
    00012  *                                                                         *
    00013  *   This program is free software; you can redistribute it and/or modify  *
    00014  *   it under the terms of the GNU General Public License as published by  *
    00015  *   the Free Software Foundation; either version 2 of the License, or     *
    00016  *   (at your option) any later version.                                   *
    00017  *                                                                         *
    00018  ***************************************************************************/
    00019
    00020 #ifdef HAVE_CONFIG_H
    00021 #include <config.h>
    00022 #endif
    00023
    00024 #include <string>
    00025 #include "libofx.h"
    00026 #include "ofx_request_accountinfo.hh"
    00027
    00028 using namespace std;
    00029
    00030 char* libofx_request_accountinfo( const OfxFiLogin* login )
    00031 {
    00032   OfxAccountInfoRequest strq( *login );
    00033   string request = OfxHeader() + strq.Output();
    00034
    00035   unsigned size = request.size();
    00036   char* result = (char*)malloc(size + 1);
    00037   request.copy(result,size);
    00038   result[size] = 0;
    00039
    00040   return result;
    00041 }
    00042
    00043 /*
    00044 <OFX>
    00045 <SIGNONMSGSRQV1>
    00046 <SONRQ>
    00047 <DTCLIENT>20050417210306
    00048 <USERID>GnuCash
    00049 <USERPASS>gcash
    00050 <LANGUAGE>ENG
    00051 <FI>
    00052 <ORG>ReferenceFI
    00053 <FID>00000
    00054 </FI>
    00055 <APPID>QWIN
    00056 <APPVER>1100
    00057 </SONRQ>
    00058 </SIGNONMSGSRQV1>
    00059
    00060 <SIGNUPMSGSRQV1>
    00061 <ACCTINFOTRNRQ>
    00062 <TRNUID>FFAAA4AA-A9B1-47F4-98E9-DE635EB41E77
    00063 <CLTCOOKIE>4
    00064
    00065 <ACCTINFORQ>
    00066 <DTACCTUP>19700101000000
    00067 </ACCTINFORQ>
    00068
    00069 </ACCTINFOTRNRQ>
    00070 </SIGNUPMSGSRQV1>
    00071 </OFX>
    00072 */
    00073
    00074 OfxAccountInfoRequest::OfxAccountInfoRequest( const OfxFiLogin& fi ):
    00075   OfxRequest(fi)
    00076 {
    00077   Add( SignOnRequest() );
    00078
    00079   OfxAggregate acctinforqTag("ACCTINFORQ");
    00080   acctinforqTag.Add( "DTACCTUP", time_t_to_ofxdate( 0 ) );
    00081   Add ( RequestMessage("SIGNUP","ACCTINFO", acctinforqTag) );
    00082 }