35 string request = OfxHeader(login->header_version) + strq.Output();
37 unsigned size = request.size();
38 char* result = (
char*)malloc(size + 1);
39 request.copy(result, size);
53 Add(CreditCardStatementRequest());
55 Add(InvestmentStatementRequest());
57 Add(BankStatementRequest());
63 bankacctfromTag.Add(
"BANKID", m_account.
bank_id );
66 bankacctfromTag.Add(
"ACCTTYPE",
"CHECKING" );
67 else if ( m_account.account_type == m_account.
OFX_SAVINGS )
68 bankacctfromTag.Add(
"ACCTTYPE",
"SAVINGS" );
70 bankacctfromTag.Add(
"ACCTTYPE",
"MONEYMRKT" );
72 bankacctfromTag.Add(
"ACCTTYPE",
"CREDITLINE" );
73 else if ( m_account.account_type == m_account.
OFX_CMA )
74 bankacctfromTag.Add(
"ACCTTYPE",
"CMA" );
77 inctranTag.Add(
"DTSTART", time_t_to_ofxdate( m_date_from ) );
78 inctranTag.Add(
"INCLUDE",
"Y" );
81 stmtrqTag.Add( bankacctfromTag );
82 stmtrqTag.Add( inctranTag );
101 inctranTag.Add(
"DTSTART", time_t_to_ofxdate( m_date_from ) );
102 inctranTag.Add(
"INCLUDE",
"Y" );
105 ccstmtrqTag.Add( ccacctfromTag );
106 ccstmtrqTag.Add( inctranTag );
115 invacctfromTag.Add(
"BROKERID", m_account.broker_id );
119 inctranTag.Add(
"DTSTART", time_t_to_ofxdate( m_date_from ) );
120 inctranTag.Add(
"INCLUDE",
"Y" );
123 incposTag.Add(
"DTASOF", time_t_to_ofxdatetime( time(NULL) ) );
124 incposTag.Add(
"INCLUDE",
"Y" );
127 invstmtrqTag.Add( invacctfromTag );
128 invstmtrqTag.Add( inctranTag );
129 invstmtrqTag.Add(
"INCOO",
"Y" );
130 invstmtrqTag.Add( incposTag );
131 invstmtrqTag.Add(
"INCBAL",
"Y" );
134 invstmtrqTag.AddXml(
"INC401K",
"Y" );
135 invstmtrqTag.AddXml(
"INC401KBAL",
"Y" );
144 string request = OfxHeader(login->header_version) + strq.Output();
146 unsigned size = request.size();
147 char* result = (
char*)malloc(size + 1);
148 request.copy(result, size);
163 bankacctfromTag.Add(
"BANKID", m_account.
bank_id );
166 bankacctfromTag.Add(
"ACCTTYPE",
"CHECKING" );
167 else if ( m_account.account_type == m_account.
OFX_SAVINGS )
168 bankacctfromTag.Add(
"ACCTTYPE",
"SAVINGS" );
169 else if ( m_account.account_type == m_account.
OFX_MONEYMRKT )
170 bankacctfromTag.Add(
"ACCTTYPE",
"MONEYMRKT" );
172 bankacctfromTag.Add(
"ACCTTYPE",
"CREDITLINE" );
173 else if ( m_account.account_type == m_account.
OFX_CMA )
174 bankacctfromTag.Add(
"ACCTTYPE",
"CMA" );
177 payeeTag.Add(
"NAME", m_payee.name );
178 payeeTag.Add(
"ADDR1", m_payee.address1 );
179 payeeTag.Add(
"CITY", m_payee.city );
180 payeeTag.Add(
"STATE", m_payee.state );
181 payeeTag.Add(
"POSTALCODE", m_payee.postalcode );
182 payeeTag.Add(
"PHONE", m_payee.phone );
185 pmtinfoTag.Add( bankacctfromTag );
186 pmtinfoTag.Add(
"TRNAMT", m_payment.amount );
187 pmtinfoTag.Add( payeeTag );
188 pmtinfoTag.Add(
"PAYACCT", m_payment.account );
189 pmtinfoTag.Add(
"DTDUE", m_payment.datedue );
190 pmtinfoTag.Add(
"MEMO", m_payment.memo );
193 pmtrqTag.Add( pmtinfoTag );
198 char* libofx_request_payment_status(
const struct OfxFiLogin* login,
const char* transactionid )
202 pmtinqrqTag.Add(
"SRVRTID", transactionid );
205 ofx.Add( ofx.SignOnRequest() );
206 ofx.Add( ofx.RequestMessage(
"BILLPAY",
"PMTINQ", pmtinqrqTag) );
208 string request = OfxHeader() + ofx.Output();
210 unsigned size = request.size();
211 char* result = (
char*)malloc(size + 1);
212 request.copy(result, size);
216 payeesyncrq.Add(
"TOKEN",
"0" );
217 payeesyncrq.Add(
"TOKENONLY",
"N" );
218 payeesyncrq.Add(
"REFRESH",
"Y" );
219 payeesyncrq.Add(
"REJECTIFMISSING",
"N" );
222 message.Add( payeesyncrq );
225 ofx.Add( ofx.SignOnRequest() );
228 string request = OfxHeader(login->header_version) + ofx.Output();
230 unsigned size = request.size();
231 char* result = (
char*)malloc(size + 1);
232 request.copy(result, size);
An abstraction of an account.
OfxPaymentRequest(const OfxFiLogin &fi, const OfxAccountData &account, const OfxPayee &payee, const OfxPayment &payment)
char * libofx_request_statement(const struct OfxFiLogin *fi, const struct OfxAccountData *account, time_t date_from)
Creates an OFX statement request in string form.
Various simple functions for type conversion & al.
OfxStatementRequest(const OfxFiLogin &fi, const OfxAccountData &account, time_t from)
OfxAggregate InvestmentStatementRequest(void) const
A single aggregate as described in the OFX 1.02 specification.
OfxAggregate RequestMessage(const string &msgtype, const string &trntype, const OfxAggregate &aggregate) const
char bank_id[OFX_BANKID_LENGTH]
void Add(const string &tag, const string &data)
OfxAggregate BankStatementRequest(void) const
Declaration of libofx_request_statement to create an OFX file containing a request for a statement...
OfxAggregate CreditCardStatementRequest(void) const
char account_number[OFX_ACCTID_LENGTH]
OfxAggregate SignOnRequest(void) const
Information sufficient to log into an financial institution.