LibOFX
|
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 <cstdlib> 00025 #include <string> 00026 #include "libofx.h" 00027 #include "ofx_request_accountinfo.hh" 00028 00029 using namespace std; 00030 00031 char* libofx_request_accountinfo( const OfxFiLogin* login ) 00032 { 00033 OfxAccountInfoRequest strq( *login ); 00034 string request = OfxHeader(login->header_version) + strq.Output(); 00035 00036 unsigned size = request.size(); 00037 char* result = (char*)malloc(size + 1); 00038 request.copy(result, size); 00039 result[size] = 0; 00040 00041 return result; 00042 } 00043 00044 /* 00045 <OFX> 00046 <SIGNONMSGSRQV1> 00047 <SONRQ> 00048 <DTCLIENT>20050417210306 00049 <USERID>GnuCash 00050 <USERPASS>gcash 00051 <LANGUAGE>ENG 00052 <FI> 00053 <ORG>ReferenceFI 00054 <FID>00000 00055 </FI> 00056 <APPID>QWIN 00057 <APPVER>1100 00058 </SONRQ> 00059 </SIGNONMSGSRQV1> 00060 00061 <SIGNUPMSGSRQV1> 00062 <ACCTINFOTRNRQ> 00063 <TRNUID>FFAAA4AA-A9B1-47F4-98E9-DE635EB41E77 00064 <CLTCOOKIE>4 00065 00066 <ACCTINFORQ> 00067 <DTACCTUP>19700101000000 00068 </ACCTINFORQ> 00069 00070 </ACCTINFOTRNRQ> 00071 </SIGNUPMSGSRQV1> 00072 </OFX> 00073 */ 00074 00075 OfxAccountInfoRequest::OfxAccountInfoRequest( const OfxFiLogin& fi ): 00076 OfxRequest(fi) 00077 { 00078 Add( SignOnRequest() ); 00079 00080 OfxAggregate acctinforqTag("ACCTINFORQ"); 00081 acctinforqTag.Add( "DTACCTUP", time_t_to_ofxdate( 0 ) ); 00082 Add ( RequestMessage("SIGNUP", "ACCTINFO", acctinforqTag) ); 00083 }