salt-parser 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +88 -0
- data/README.rdoc +39 -0
- data/Rakefile +7 -0
- data/lib/ofx/account.rb +28 -0
- data/lib/ofx/accounts.rb +9 -0
- data/lib/ofx/balance.rb +15 -0
- data/lib/ofx/builder.rb +61 -0
- data/lib/ofx/dependencies.rb +13 -0
- data/lib/ofx/parser/base.rb +366 -0
- data/lib/ofx/parser/ofx102.rb +28 -0
- data/lib/ofx/parser/ofx211.rb +21 -0
- data/lib/ofx/sign_on.rb +18 -0
- data/lib/ofx/transaction.rb +28 -0
- data/lib/qif/account.rb +19 -0
- data/lib/qif/accounts.rb +54 -0
- data/lib/qif/builder.rb +37 -0
- data/lib/qif/dependencies.rb +8 -0
- data/lib/qif/parser.rb +68 -0
- data/lib/qif/transaction.rb +28 -0
- data/lib/salt-parser/accounts.rb +11 -0
- data/lib/salt-parser/base.rb +19 -0
- data/lib/salt-parser/builder.rb +24 -0
- data/lib/salt-parser/errors.rb +14 -0
- data/lib/salt-parser/version.rb +8 -0
- data/salt-parser.gemspec +24 -0
- data/spec/ofx/account_spec.rb +97 -0
- data/spec/ofx/accounts_response_spec.rb +45 -0
- data/spec/ofx/accounts_spec.rb +34 -0
- data/spec/ofx/balance_spec.rb +32 -0
- data/spec/ofx/builder_spec.rb +136 -0
- data/spec/ofx/error_request_spec.rb +37 -0
- data/spec/ofx/fixtures/accounts_partial.ofx +52 -0
- data/spec/ofx/fixtures/accounts_request.ofx +11 -0
- data/spec/ofx/fixtures/accounts_response.ofx +109 -0
- data/spec/ofx/fixtures/avatar.gif +0 -0
- data/spec/ofx/fixtures/bb.ofx +700 -0
- data/spec/ofx/fixtures/credit_card_response.ofx +52 -0
- data/spec/ofx/fixtures/creditcard.ofx +79 -0
- data/spec/ofx/fixtures/creditcard_transactions_request.ofx +11 -0
- data/spec/ofx/fixtures/creditcards_partial.ofx +85 -0
- data/spec/ofx/fixtures/date_missing.ofx +73 -0
- data/spec/ofx/fixtures/empty_balance.ofx +44 -0
- data/spec/ofx/fixtures/invalid_version.ofx +308 -0
- data/spec/ofx/fixtures/investment_transactions_response.ofx +108 -0
- data/spec/ofx/fixtures/investment_transactions_response2.ofx +200 -0
- data/spec/ofx/fixtures/investments_with_mkval.ofx +99 -0
- data/spec/ofx/fixtures/missing_headers.ofx +47 -0
- data/spec/ofx/fixtures/mixed_accountinfo_response.ofx +58 -0
- data/spec/ofx/fixtures/ms_money.ofx +52 -0
- data/spec/ofx/fixtures/request_error.ofx +39 -0
- data/spec/ofx/fixtures/request_error2.ofx +39 -0
- data/spec/ofx/fixtures/request_error3.ofx +36 -0
- data/spec/ofx/fixtures/sample_examples/sample_401K_loan.qfx +651 -0
- data/spec/ofx/fixtures/sample_examples/sample_banking.qbo +258 -0
- data/spec/ofx/fixtures/sample_examples/sample_banking.qfx +258 -0
- data/spec/ofx/fixtures/sample_examples/sample_banking_multiacct.qfx +284 -0
- data/spec/ofx/fixtures/sample_examples/sample_credit_card.qfx +257 -0
- data/spec/ofx/fixtures/sample_examples/sample_investment.qfx +654 -0
- data/spec/ofx/fixtures/transactions_empty.ofx +60 -0
- data/spec/ofx/fixtures/utf8.ofx +65 -0
- data/spec/ofx/fixtures/v102.ofx +314 -0
- data/spec/ofx/fixtures/v202.ofx +22 -0
- data/spec/ofx/fixtures/v211.ofx +85 -0
- data/spec/ofx/investment_accounts_spec.rb +70 -0
- data/spec/ofx/ofx102_spec.rb +44 -0
- data/spec/ofx/ofx211_spec.rb +68 -0
- data/spec/ofx/ofx_parser_spec.rb +100 -0
- data/spec/ofx/sign_on_spec.rb +49 -0
- data/spec/ofx/transaction_spec.rb +157 -0
- data/spec/qif/account_spec.rb +42 -0
- data/spec/qif/fixtures/3_records_ddmmyy.qif +19 -0
- data/spec/qif/fixtures/3_records_ddmmyyyy.qif +19 -0
- data/spec/qif/fixtures/3_records_dmyy.qif +19 -0
- data/spec/qif/fixtures/3_records_invalid_header.qif +20 -0
- data/spec/qif/fixtures/3_records_mdyy.qif +19 -0
- data/spec/qif/fixtures/3_records_mmddyy.qif +19 -0
- data/spec/qif/fixtures/3_records_mmddyyyy.qif +19 -0
- data/spec/qif/fixtures/3_records_spaced.qif +19 -0
- data/spec/qif/fixtures/bank_account.qif +19 -0
- data/spec/qif/fixtures/empty_body.qif +1 -0
- data/spec/qif/fixtures/empty_header.qif +18 -0
- data/spec/qif/fixtures/incompatible_date_formats.qif +13 -0
- data/spec/qif/fixtures/invalid_date_format.qif +7 -0
- data/spec/qif/fixtures/not_a_QIF_file.txt +3 -0
- data/spec/qif/fixtures/quicken_non_investement_account.qif +30 -0
- data/spec/qif/fixtures/unknown_account.qif +20 -0
- data/spec/qif/fixtures/various_date_format.qif +19 -0
- data/spec/qif/fixtures/with_categories_list.qif +8669 -0
- data/spec/qif/parser_spec.rb +156 -0
- data/spec/qif/transaction_spec.rb +18 -0
- data/spec/spec_helper.rb +37 -0
- data/spec/support/fixture.rb +9 -0
- metadata +208 -0
@@ -0,0 +1,60 @@
|
|
1
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
2
|
+
|
3
|
+
<!-- This example is taken from the 2.1.1 specification, pages 610-612 -->
|
4
|
+
<?OFX OFXHEADER="200" VERSION="211" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?>
|
5
|
+
<OFX>
|
6
|
+
<SIGNONMSGSRSV1>
|
7
|
+
<SONRS>
|
8
|
+
<STATUS>
|
9
|
+
<CODE>0</CODE>
|
10
|
+
<SEVERITY>INFO</SEVERITY>
|
11
|
+
</STATUS>
|
12
|
+
<DTSERVER>20050831165153.000[-8:PST]</DTSERVER>
|
13
|
+
<LANGUAGE>ENG</LANGUAGE>
|
14
|
+
</SONRS>
|
15
|
+
</SIGNONMSGSRSV1>
|
16
|
+
<BANKMSGSRSV1>
|
17
|
+
<STMTTRNRS>
|
18
|
+
<TRNUID>0</TRNUID>
|
19
|
+
<STATUS>
|
20
|
+
<CODE>0</CODE>
|
21
|
+
<SEVERITY>INFO</SEVERITY>
|
22
|
+
</STATUS>
|
23
|
+
<STMTRS>
|
24
|
+
<CURDEF>USD</CURDEF>
|
25
|
+
<BANKACCTFROM>
|
26
|
+
<BANKID>000000123</BANKID>
|
27
|
+
<ACCTID>123456</ACCTID>
|
28
|
+
<ACCTTYPE>CHECKING</ACCTTYPE>
|
29
|
+
</BANKACCTFROM>
|
30
|
+
<BANKTRANLIST>
|
31
|
+
<DTSTART>20040801</DTSTART>
|
32
|
+
<DTEND>20050831165153.000[-8:PST]</DTEND>
|
33
|
+
</BANKTRANLIST>
|
34
|
+
<LEDGERBAL>
|
35
|
+
<BALAMT>2156.56</BALAMT>
|
36
|
+
<DTASOF>20050831165153</DTASOF>
|
37
|
+
</LEDGERBAL>
|
38
|
+
</STMTRS>
|
39
|
+
</STMTTRNRS>
|
40
|
+
</BANKMSGSRSV1>
|
41
|
+
<CREDITCARDMSGSRSV1>
|
42
|
+
<CCSTMTTRNRS>
|
43
|
+
<TRNUID>0</TRNUID>
|
44
|
+
<STATUS>
|
45
|
+
<CODE>0</CODE>
|
46
|
+
<SEVERITY>INFO</SEVERITY>
|
47
|
+
</STATUS>
|
48
|
+
<CCSTMTRS>
|
49
|
+
<CURDEF>USD</CURDEF>
|
50
|
+
<CCACCTFROM>
|
51
|
+
<ACCTID>123412341234</ACCTID>
|
52
|
+
</CCACCTFROM>
|
53
|
+
<LEDGERBAL>
|
54
|
+
<BALAMT>-562.00</BALAMT>
|
55
|
+
<DTASOF>20050831165153</DTASOF>
|
56
|
+
</LEDGERBAL>
|
57
|
+
</CCSTMTRS>
|
58
|
+
</CCSTMTTRNRS>
|
59
|
+
</CREDITCARDMSGSRSV1>
|
60
|
+
</OFX>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
OFXHEADER:100
|
4
|
+
DATA:OFXSGML
|
5
|
+
VERSION:102
|
6
|
+
SECURITY:NONE
|
7
|
+
ENCODING:USASCII
|
8
|
+
CHARSET:1252
|
9
|
+
COMPRESSION:NONE
|
10
|
+
OLDFILEUID:NONE
|
11
|
+
NEWFILEUID:NONE
|
12
|
+
|
13
|
+
<OFX>
|
14
|
+
<SIGNONMSGSRSV1>
|
15
|
+
<SONRS>
|
16
|
+
<STATUS>
|
17
|
+
<CODE>0
|
18
|
+
<SEVERITY>INFO
|
19
|
+
</STATUS>
|
20
|
+
<DTSERVER>20091101192253
|
21
|
+
<LANGUAGE>POR
|
22
|
+
</SONRS>
|
23
|
+
</SIGNONMSGSRSV1>
|
24
|
+
<BANKMSGSRSV1>
|
25
|
+
<STMTTRNRS>
|
26
|
+
<TRNUID>1
|
27
|
+
<STATUS>
|
28
|
+
<CODE>0
|
29
|
+
<SEVERITY>INFO
|
30
|
+
</STATUS>
|
31
|
+
<STMTRS>
|
32
|
+
<CURDEF>BRL
|
33
|
+
<BANKACCTFROM>
|
34
|
+
<BANKID>1234
|
35
|
+
<ACCTID>12345678901
|
36
|
+
<ACCTTYPE>CHECKING
|
37
|
+
</BANKACCTFROM>
|
38
|
+
<BANKTRANLIST>
|
39
|
+
<DTSTART>20091009080000
|
40
|
+
<DTEND>20091103080000
|
41
|
+
<STMTTRN>
|
42
|
+
<TRNTYPE>DEBIT
|
43
|
+
<DTPOSTED>20091009080000
|
44
|
+
<TRNAMT>-35.34
|
45
|
+
<FITID>200910091
|
46
|
+
<CHECKNUM>0001223
|
47
|
+
<MEMO>COMPRA VISA ELECTRON
|
48
|
+
</STMTTRN>
|
49
|
+
<STMTTRN>
|
50
|
+
<TRNTYPE>DEBIT
|
51
|
+
<DTPOSTED>20091103080000
|
52
|
+
<TRNAMT>-89.03
|
53
|
+
<FITID>200911031
|
54
|
+
<CHECKNUM>0001223
|
55
|
+
<MEMO>COMPRA VISA ELECTRON
|
56
|
+
</STMTTRN>
|
57
|
+
</BANKTRANLIST>
|
58
|
+
<LEDGERBAL>
|
59
|
+
<BALAMT>598.44
|
60
|
+
<DTASOF>20091101
|
61
|
+
</LEDGERBAL>
|
62
|
+
</STMTRS>
|
63
|
+
</STMTTRNRS>
|
64
|
+
</BANKMSGSRSV1>
|
65
|
+
</OFX>
|
@@ -0,0 +1,314 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
OFXHEADER:100
|
4
|
+
DATA:OFXSGML
|
5
|
+
VERSION:102
|
6
|
+
SECURITY:NONE
|
7
|
+
ENCODING:USASCII
|
8
|
+
CHARSET:1252
|
9
|
+
COMPRESSION:NONE
|
10
|
+
OLDFILEUID:NONE
|
11
|
+
NEWFILEUID:NONE
|
12
|
+
|
13
|
+
<OFX>
|
14
|
+
<SIGNONMSGSRSV1>
|
15
|
+
<SONRS>
|
16
|
+
<STATUS>
|
17
|
+
<CODE>0
|
18
|
+
<SEVERITY>INFO
|
19
|
+
</STATUS>
|
20
|
+
<DTSERVER>20091101192253
|
21
|
+
<LANGUAGE>POR
|
22
|
+
</SONRS>
|
23
|
+
</SIGNONMSGSRSV1>
|
24
|
+
<BANKMSGSRSV1>
|
25
|
+
<STMTTRNRS>
|
26
|
+
<TRNUID>1
|
27
|
+
<STATUS>
|
28
|
+
<CODE>0
|
29
|
+
<SEVERITY>INFO
|
30
|
+
</STATUS>
|
31
|
+
<STMTRS>
|
32
|
+
<CURDEF>BRL
|
33
|
+
<BANKACCTFROM>
|
34
|
+
<BANKID>0356
|
35
|
+
<ACCTID>03227113109
|
36
|
+
<ACCTTYPE>CHECKING
|
37
|
+
</BANKACCTFROM>
|
38
|
+
<BANKTRANLIST>
|
39
|
+
<DTSTART>20091009080000
|
40
|
+
<DTEND>20091103080000
|
41
|
+
<STMTTRN>
|
42
|
+
<TRNTYPE>DEBIT
|
43
|
+
<DTPOSTED>20091009080000
|
44
|
+
<TRNAMT>-35.34
|
45
|
+
<FITID>200910091
|
46
|
+
<CHECKNUM>0001223
|
47
|
+
<MEMO>COMPRA VISA ELECTRON
|
48
|
+
<SIC>5072
|
49
|
+
</STMTTRN><STMTTRN>
|
50
|
+
<TRNTYPE>CREDIT
|
51
|
+
<DTPOSTED>20091016080000
|
52
|
+
<TRNAMT>60.39
|
53
|
+
<FITID>200910162
|
54
|
+
<CHECKNUM>0880136
|
55
|
+
<MEMO>DEPOSITO POUP.CORRENTE
|
56
|
+
</STMTTRN>
|
57
|
+
|
58
|
+
<STMTTRN>
|
59
|
+
<TRNTYPE>OTHER</TRNTYPE>
|
60
|
+
<DTPOSTED>20091019120000[-3:BRT]</DTPOSTED>
|
61
|
+
<TRNAMT>-148.40</TRNAMT>
|
62
|
+
<FITID>200910191148400</FITID>
|
63
|
+
<CHECKNUM>000000101901</CHECKNUM>
|
64
|
+
<REFNUM>101.901</REFNUM>
|
65
|
+
<PAYEE>Pagto conta telefone</PAYEE>
|
66
|
+
<MEMO>Pagto conta telefone</MEMO>
|
67
|
+
</STMTTRN>
|
68
|
+
|
69
|
+
<STMTTRN>
|
70
|
+
<TRNTYPE>DEBIT
|
71
|
+
<DTPOSTED>20091013080000
|
72
|
+
<TRNAMT>-126.13
|
73
|
+
<FITID>200910131
|
74
|
+
<CHECKNUM>0001511
|
75
|
+
<NAME>Pagto conta telefone</NAME>
|
76
|
+
<MEMO>TITULO COBRANCA-IB
|
77
|
+
</STMTTRN><STMTTRN>
|
78
|
+
<TRNTYPE>DEBIT
|
79
|
+
<DTPOSTED>20091013080000
|
80
|
+
<TRNAMT>-232.23
|
81
|
+
<FITID>200910132
|
82
|
+
<CHECKNUM>0001511
|
83
|
+
<MEMO>TITULO COBRANCA-IB
|
84
|
+
</STMTTRN><STMTTRN>
|
85
|
+
<TRNTYPE>DEBIT
|
86
|
+
<DTPOSTED>20091013080000
|
87
|
+
<TRNAMT>-501.24
|
88
|
+
<FITID>200910133
|
89
|
+
<CHECKNUM>0001511
|
90
|
+
<MEMO>TITULO COBRANCA-IB
|
91
|
+
</STMTTRN><STMTTRN>
|
92
|
+
<TRNTYPE>DEBIT
|
93
|
+
<DTPOSTED>20091013080000
|
94
|
+
<TRNAMT>-719.03
|
95
|
+
<FITID>200910134
|
96
|
+
<CHECKNUM>0001511
|
97
|
+
<MEMO>TITULO COBRANCA-IB
|
98
|
+
</STMTTRN><STMTTRN>
|
99
|
+
<TRNTYPE>DEBIT
|
100
|
+
<DTPOSTED>20091013080000
|
101
|
+
<TRNAMT>-90.75
|
102
|
+
<FITID>200910135
|
103
|
+
<CHECKNUM>0001223
|
104
|
+
<MEMO>COMPRA VISA ELECTRON
|
105
|
+
</STMTTRN><STMTTRN>
|
106
|
+
<TRNTYPE>DEBIT
|
107
|
+
<DTPOSTED>20091013080000
|
108
|
+
<TRNAMT>-49.80
|
109
|
+
<FITID>200910136
|
110
|
+
<CHECKNUM>0001223
|
111
|
+
<MEMO>COMPRA VISA ELECTRON
|
112
|
+
</STMTTRN><STMTTRN>
|
113
|
+
<TRNTYPE>DEBIT
|
114
|
+
<DTPOSTED>20091013080000
|
115
|
+
<TRNAMT>-219.90
|
116
|
+
<FITID>200910137
|
117
|
+
<CHECKNUM>0001223
|
118
|
+
<MEMO>COMPRA VISA ELECTRON
|
119
|
+
</STMTTRN><STMTTRN>
|
120
|
+
<TRNTYPE>DEBIT
|
121
|
+
<DTPOSTED>20091013080000
|
122
|
+
<TRNAMT>-54.61
|
123
|
+
<FITID>200910138
|
124
|
+
<CHECKNUM>0001223
|
125
|
+
<MEMO>COMPRA VISA ELECTRON
|
126
|
+
</STMTTRN><STMTTRN>
|
127
|
+
<TRNTYPE>DEBIT
|
128
|
+
<DTPOSTED>20091013080000
|
129
|
+
<TRNAMT>-38.57
|
130
|
+
<FITID>200910139
|
131
|
+
<CHECKNUM>0002208
|
132
|
+
<MEMO>PAGTO CONTA TELEFONE -RIB
|
133
|
+
</STMTTRN><STMTTRN>
|
134
|
+
<TRNTYPE>DEBIT
|
135
|
+
<DTPOSTED>20091013080000
|
136
|
+
<TRNAMT>-119.40
|
137
|
+
<FITID>2009101310
|
138
|
+
<CHECKNUM>0002209
|
139
|
+
<MEMO>CONTA DE LUZ -RIB
|
140
|
+
</STMTTRN><STMTTRN>
|
141
|
+
<TRNTYPE>DEBIT
|
142
|
+
<DTPOSTED>20091013080000
|
143
|
+
<TRNAMT>-34.69
|
144
|
+
<FITID>2009101311
|
145
|
+
<CHECKNUM>0002208
|
146
|
+
<MEMO>PAGTO CONTA TELEFONE -RIB
|
147
|
+
</STMTTRN><STMTTRN>
|
148
|
+
<TRNTYPE>DEBIT
|
149
|
+
<DTPOSTED>20091013080000
|
150
|
+
<TRNAMT>-35.07
|
151
|
+
<FITID>2009101312
|
152
|
+
<CHECKNUM>0002231
|
153
|
+
<MEMO>IPTU / TAXAS SP -RIB
|
154
|
+
</STMTTRN><STMTTRN>
|
155
|
+
<TRNTYPE>DEBIT
|
156
|
+
<DTPOSTED>20091013080000
|
157
|
+
<TRNAMT>-259.10
|
158
|
+
<FITID>2009101313
|
159
|
+
<CHECKNUM>0001085
|
160
|
+
<MEMO>PGTO NET
|
161
|
+
</STMTTRN><STMTTRN>
|
162
|
+
<TRNTYPE>DEBIT
|
163
|
+
<DTPOSTED>20091013080000
|
164
|
+
<TRNAMT>-202.84
|
165
|
+
<FITID>2009101314
|
166
|
+
<CHECKNUM>0002606
|
167
|
+
<MEMO>PARC RC EXCLUSIVO 12
|
168
|
+
</STMTTRN><STMTTRN>
|
169
|
+
<TRNTYPE>DEBIT
|
170
|
+
<DTPOSTED>20091013080000
|
171
|
+
<TRNAMT>-272.77
|
172
|
+
<FITID>2009101315
|
173
|
+
<CHECKNUM>0002606
|
174
|
+
<MEMO>PARC RC EXCLUSIVO 08
|
175
|
+
</STMTTRN><STMTTRN>
|
176
|
+
<TRNTYPE>DEBIT
|
177
|
+
<DTPOSTED>20091014080000
|
178
|
+
<TRNAMT>-80.00
|
179
|
+
<FITID>200910141
|
180
|
+
<CHECKNUM>0010991
|
181
|
+
<MEMO>CHEQUE COMPENSADO
|
182
|
+
</STMTTRN><STMTTRN>
|
183
|
+
<TRNTYPE>DEBIT
|
184
|
+
<DTPOSTED>20091014080000
|
185
|
+
<TRNAMT>-177.00
|
186
|
+
<FITID>200910142
|
187
|
+
<CHECKNUM>0010986
|
188
|
+
<MEMO>CHEQUE COMPENSADO
|
189
|
+
</STMTTRN><STMTTRN>
|
190
|
+
<TRNTYPE>DEBIT
|
191
|
+
<DTPOSTED>20091014080000
|
192
|
+
<TRNAMT>-386.00
|
193
|
+
<FITID>200910143
|
194
|
+
<CHECKNUM>0011063
|
195
|
+
<MEMO>CHEQUE COMPENSADO
|
196
|
+
</STMTTRN><STMTTRN>
|
197
|
+
<TRNTYPE>DEBIT
|
198
|
+
<DTPOSTED>20091014080000
|
199
|
+
<TRNAMT>-12.19
|
200
|
+
<FITID>200910144
|
201
|
+
<CHECKNUM>0001223
|
202
|
+
<MEMO>COMPRA VISA ELECTRON
|
203
|
+
</STMTTRN><STMTTRN>
|
204
|
+
<TRNTYPE>DEBIT
|
205
|
+
<DTPOSTED>20091015080000
|
206
|
+
<TRNAMT>-41.00
|
207
|
+
<FITID>200910151
|
208
|
+
<CHECKNUM>0011064
|
209
|
+
<MEMO>CHEQUE COMPENSADO
|
210
|
+
</STMTTRN><STMTTRN>
|
211
|
+
<TRNTYPE>DEBIT
|
212
|
+
<DTPOSTED>20091016080000
|
213
|
+
<TRNAMT>-63.00
|
214
|
+
<FITID>200910161
|
215
|
+
<CHECKNUM>0010856
|
216
|
+
<MEMO>CHEQUE COMPENSADO
|
217
|
+
</STMTTRN><STMTTRN>
|
218
|
+
<TRNTYPE>DEBIT
|
219
|
+
<DTPOSTED>20091019080000
|
220
|
+
<TRNAMT>-51.00
|
221
|
+
<FITID>200910191
|
222
|
+
<CHECKNUM>0011065
|
223
|
+
<MEMO>CHEQUE COMPENSADO
|
224
|
+
</STMTTRN><STMTTRN>
|
225
|
+
<TRNTYPE>DEBIT
|
226
|
+
<DTPOSTED>20091019080000
|
227
|
+
<TRNAMT>-23.81
|
228
|
+
<FITID>200910192
|
229
|
+
<CHECKNUM>0001203
|
230
|
+
<MEMO>ASSINATURA ABRIL
|
231
|
+
</STMTTRN><STMTTRN>
|
232
|
+
<TRNTYPE>DEBIT
|
233
|
+
<DTPOSTED>20091020080000
|
234
|
+
<TRNAMT>-15.50
|
235
|
+
<FITID>200910201
|
236
|
+
<CHECKNUM>0001223
|
237
|
+
<MEMO>COMPRA VISA ELECTRON
|
238
|
+
</STMTTRN><STMTTRN>
|
239
|
+
<TRNTYPE>DEBIT
|
240
|
+
<DTPOSTED>20091021080000
|
241
|
+
<TRNAMT>-132.00
|
242
|
+
<FITID>200910211
|
243
|
+
<CHECKNUM>0011023
|
244
|
+
<MEMO>CHEQUE COMPENSADO
|
245
|
+
</STMTTRN><STMTTRN>
|
246
|
+
<TRNTYPE>CREDIT
|
247
|
+
<DTPOSTED>20091022080000
|
248
|
+
<TRNAMT>600.00
|
249
|
+
<FITID>200910221
|
250
|
+
<CHECKNUM>0001433
|
251
|
+
<MEMO>DOC REM 216.397.168-66
|
252
|
+
</STMTTRN><STMTTRN>
|
253
|
+
<TRNTYPE>DEBIT
|
254
|
+
<DTPOSTED>20091022080000
|
255
|
+
<TRNAMT>-22.40
|
256
|
+
<FITID>200910222
|
257
|
+
<CHECKNUM>0001223
|
258
|
+
<MEMO>COMPRA VISA ELECTRON
|
259
|
+
</STMTTRN><STMTTRN>
|
260
|
+
<TRNTYPE>DEBIT
|
261
|
+
<DTPOSTED>20091022080000
|
262
|
+
<TRNAMT>-73.16
|
263
|
+
<FITID>200910223
|
264
|
+
<CHECKNUM>0001223
|
265
|
+
<MEMO>COMPRA VISA ELECTRON
|
266
|
+
</STMTTRN><STMTTRN>
|
267
|
+
<TRNTYPE>DEBIT
|
268
|
+
<DTPOSTED>20091023080000
|
269
|
+
<TRNAMT>-61.36
|
270
|
+
<FITID>200910231
|
271
|
+
<CHECKNUM>0000292
|
272
|
+
<MEMO>CONTA AGUA/ESGOTO
|
273
|
+
</STMTTRN><STMTTRN>
|
274
|
+
<TRNTYPE>DEBIT
|
275
|
+
<DTPOSTED>20091026080000
|
276
|
+
<TRNAMT>-96.00
|
277
|
+
<FITID>200910261
|
278
|
+
<CHECKNUM>0002212
|
279
|
+
<MEMO>PAGTO FATURA REALVISA-RIB
|
280
|
+
</STMTTRN><STMTTRN>
|
281
|
+
<TRNTYPE>DEBIT
|
282
|
+
<DTPOSTED>20091030080000
|
283
|
+
<TRNAMT>-67.75
|
284
|
+
<FITID>200910301
|
285
|
+
<CHECKNUM>0011061
|
286
|
+
<MEMO>CHEQUE COMPENSADO
|
287
|
+
</STMTTRN><STMTTRN>
|
288
|
+
<TRNTYPE>DEBIT
|
289
|
+
<DTPOSTED>20091030080000
|
290
|
+
<TRNAMT>-25.88
|
291
|
+
<FITID>200910302
|
292
|
+
<CHECKNUM>0001223
|
293
|
+
<MEMO>COMPRA VISA ELECTRON
|
294
|
+
</STMTTRN><STMTTRN>
|
295
|
+
<TRNTYPE>DEBIT
|
296
|
+
<DTPOSTED>20091103080000
|
297
|
+
<TRNAMT>-89.03
|
298
|
+
<FITID>200911031
|
299
|
+
<CHECKNUM>0001223
|
300
|
+
<MEMO>COMPRA VISA ELECTRON
|
301
|
+
</STMTTRN>
|
302
|
+
</BANKTRANLIST>
|
303
|
+
<LEDGERBAL>
|
304
|
+
<BALAMT>598.44
|
305
|
+
<DTASOF>20091101
|
306
|
+
</LEDGERBAL>
|
307
|
+
<AVAILBAL>
|
308
|
+
<BALAMT>1555.99</BALAMT>
|
309
|
+
<DTASOF>20091101</DTASOF>
|
310
|
+
</AVAILBAL>
|
311
|
+
</STMTRS>
|
312
|
+
</STMTTRNRS>
|
313
|
+
</BANKMSGSRSV1>
|
314
|
+
</OFX>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="USASCII" ?>
|
2
|
+
|
3
|
+
<?OFX OFXHEADER="200" VERSION="202" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?>
|
4
|
+
|
5
|
+
<OFX>
|
6
|
+
<SIGNONMSGSRSV1>
|
7
|
+
<SONRS>
|
8
|
+
<STATUS>
|
9
|
+
<CODE>15500</CODE>
|
10
|
+
<SEVERITY>ERROR</SEVERITY>
|
11
|
+
<MESSAGE>You have entered an invalid ID / Password combination. Please try again or contact your investment professional at Citi Personal Wealth Management.</MESSAGE>
|
12
|
+
</STATUS><DTSERVER>20150124095448</DTSERVER>
|
13
|
+
<LANGUAGE>ENG</LANGUAGE>
|
14
|
+
<DTPROFUP>20130121100000.000[-5:EST]</DTPROFUP>
|
15
|
+
<FI><ORG>Citigroup</ORG>
|
16
|
+
<FID>060</FID>
|
17
|
+
</FI></SONRS></SIGNONMSGSRSV1><SIGNUPMSGSRSV1><ACCTINFOTRNRS><TRNUID>1422154487</TRNUID>
|
18
|
+
<STATUS><CODE>15500</CODE>
|
19
|
+
<SEVERITY>ERROR</SEVERITY>
|
20
|
+
<MESSAGE>You have entered an invalid ID / Password combination. Please try again or contact your investment professional at Citi Personal Wealth Management.</MESSAGE>
|
21
|
+
</STATUS></ACCTINFOTRNRS></SIGNUPMSGSRSV1>
|
22
|
+
</OFX>
|
@@ -0,0 +1,85 @@
|
|
1
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
2
|
+
|
3
|
+
<!-- This example is taken from the 2.1.1 specification, pages 610-612 -->
|
4
|
+
<?OFX OFXHEADER="200" VERSION="211" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?>
|
5
|
+
<OFX>
|
6
|
+
<SIGNONMSGSRSV1>
|
7
|
+
<SONRS>
|
8
|
+
<STATUS>
|
9
|
+
<CODE>0</CODE>
|
10
|
+
<SEVERITY>INFO</SEVERITY>
|
11
|
+
</STATUS>
|
12
|
+
<DTSERVER>20050831165153.000[-8:PST]</DTSERVER>
|
13
|
+
<LANGUAGE>ENG</LANGUAGE>
|
14
|
+
</SONRS>
|
15
|
+
</SIGNONMSGSRSV1>
|
16
|
+
<BANKMSGSRSV1>
|
17
|
+
<STMTTRNRS>
|
18
|
+
<TRNUID>0</TRNUID>
|
19
|
+
<STATUS>
|
20
|
+
<CODE>0</CODE>
|
21
|
+
<SEVERITY>INFO</SEVERITY>
|
22
|
+
</STATUS>
|
23
|
+
<STMTRS>
|
24
|
+
<CURDEF>USD</CURDEF>
|
25
|
+
<BANKACCTFROM>
|
26
|
+
<BANKID>000000123</BANKID>
|
27
|
+
<ACCTID>123456</ACCTID>
|
28
|
+
<ACCTTYPE>CHECKING</ACCTTYPE>
|
29
|
+
</BANKACCTFROM>
|
30
|
+
<BANKTRANLIST>
|
31
|
+
<DTSTART>20040801</DTSTART>
|
32
|
+
<DTEND>20050831165153.000[-8:PST]</DTEND>
|
33
|
+
<STMTTRN>
|
34
|
+
<TRNTYPE>POS</TRNTYPE>
|
35
|
+
<DTPOSTED>20050824080000</DTPOSTED>
|
36
|
+
<TRNAMT>-80</TRNAMT>
|
37
|
+
<FITID>219378</FITID>
|
38
|
+
<NAME>FrogKick Scuba Gear</NAME>
|
39
|
+
</STMTTRN>
|
40
|
+
</BANKTRANLIST>
|
41
|
+
<LEDGERBAL>
|
42
|
+
<BALAMT>2156.56</BALAMT>
|
43
|
+
<DTASOF>20050831165153</DTASOF>
|
44
|
+
</LEDGERBAL>
|
45
|
+
</STMTRS>
|
46
|
+
</STMTTRNRS>
|
47
|
+
</BANKMSGSRSV1>
|
48
|
+
<CREDITCARDMSGSRSV1>
|
49
|
+
<CCSTMTTRNRS>
|
50
|
+
<TRNUID>0</TRNUID>
|
51
|
+
<STATUS>
|
52
|
+
<CODE>0</CODE>
|
53
|
+
<SEVERITY>INFO</SEVERITY>
|
54
|
+
</STATUS>
|
55
|
+
<CCSTMTRS>
|
56
|
+
<CURDEF>USD</CURDEF>
|
57
|
+
<CCACCTFROM>
|
58
|
+
<ACCTID>123412341234</ACCTID>
|
59
|
+
</CCACCTFROM>
|
60
|
+
<BANKTRANLIST>
|
61
|
+
<DTSTART>20050801</DTSTART>
|
62
|
+
<DTEND>20050831165153.000[-8:PST]</DTEND>
|
63
|
+
<STMTTRN>
|
64
|
+
<TRNTYPE>INT</TRNTYPE>
|
65
|
+
<DTPOSTED>20050811080000</DTPOSTED>
|
66
|
+
<TRNAMT>-23.00</TRNAMT>
|
67
|
+
<FITID>219867</FITID>
|
68
|
+
<NAME>Interest Charge</NAME>
|
69
|
+
</STMTTRN>
|
70
|
+
<STMTTRN>
|
71
|
+
<TRNTYPE>CREDIT</TRNTYPE>
|
72
|
+
<DTPOSTED>20050811080000</DTPOSTED>
|
73
|
+
<TRNAMT>350.00</TRNAMT>
|
74
|
+
<FITID>219868</FITID>
|
75
|
+
<NAME>Payment - Thank You</NAME>
|
76
|
+
</STMTTRN>
|
77
|
+
</BANKTRANLIST>
|
78
|
+
<LEDGERBAL>
|
79
|
+
<BALAMT>-562.00</BALAMT>
|
80
|
+
<DTASOF>20050831165153</DTASOF>
|
81
|
+
</LEDGERBAL>
|
82
|
+
</CCSTMTRS>
|
83
|
+
</CCSTMTTRNRS>
|
84
|
+
</CREDITCARDMSGSRSV1>
|
85
|
+
</OFX>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe SaltParser::Ofx::Accounts do
|
4
|
+
let(:sample_ofx) { SaltParser::Ofx::Builder.new("spec/ofx/fixtures/sample_examples/sample_investment.qfx") }
|
5
|
+
let(:hewitt_ofx) { SaltParser::Ofx::Builder.new("spec/ofx/fixtures/investments_with_mkval.ofx") }
|
6
|
+
let(:merrill_lynch_ofx) { SaltParser::Ofx::Builder.new("spec/ofx/fixtures/investment_transactions_response3.ofx") }
|
7
|
+
let(:vanguard_ofx) { SaltParser::Ofx::Builder.new("spec/ofx/fixtures/investment_transactions_response4.ofx") }
|
8
|
+
let(:sample_accounts) { sample_ofx.parser.accounts }
|
9
|
+
let(:hewitt_accounts) { hewitt_ofx.parser.accounts }
|
10
|
+
let(:merrill_lynch_accounts){ merrill_lynch_ofx.parser.accounts }
|
11
|
+
let(:vanguard_accounts) { vanguard_ofx.parser.accounts }
|
12
|
+
let(:hash) { sample_accounts.to_hash }
|
13
|
+
|
14
|
+
describe "accounts" do
|
15
|
+
it "should return sample account" do
|
16
|
+
sample_accounts.size.should == 1
|
17
|
+
|
18
|
+
account = sample_accounts.first
|
19
|
+
account.broker_id.should == "Intuit.com"
|
20
|
+
account.currency.should == "USD"
|
21
|
+
account.id.should == "1234567890"
|
22
|
+
account.type.should == SaltParser::Ofx::Parser::Base::ACCOUNT_TYPES["INVESTMENT"]
|
23
|
+
|
24
|
+
account.balance.amount.should == 100295.69
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should return hewitt account" do
|
28
|
+
hewitt_accounts.size.should == 1
|
29
|
+
|
30
|
+
account = hewitt_accounts.first
|
31
|
+
account.broker_id.should == "hewitt.com"
|
32
|
+
account.currency.should == "USD"
|
33
|
+
account.id.should == "1234-12345678"
|
34
|
+
account.type.should == SaltParser::Ofx::Parser::Base::ACCOUNT_TYPES["INVESTMENT"]
|
35
|
+
account.units.should == 337.502827
|
36
|
+
account.unit_price.should == 1.157869
|
37
|
+
account.balance.amount.should == 390.78
|
38
|
+
|
39
|
+
transaction = account.transactions.first
|
40
|
+
transaction.amount.to_f.should == 64.85
|
41
|
+
transaction.amount_in_pennies.should == 6485
|
42
|
+
transaction.fit_id.should == "CT12345678901234567890123456789012"
|
43
|
+
transaction.memo.should == "Contribution"
|
44
|
+
transaction.ref_number.should == "123456789"
|
45
|
+
transaction.units.should == 56.355139
|
46
|
+
transaction.unit_price.should == 1.150738
|
47
|
+
end
|
48
|
+
|
49
|
+
describe "#find" do
|
50
|
+
it "returns first by id" do
|
51
|
+
sample_accounts.find("1234567890").class.should == SaltParser::Ofx::Account
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "#find_by_transaction" do
|
56
|
+
it "returns first by transaction's account_id and it's currency code" do
|
57
|
+
account = sample_accounts.first
|
58
|
+
transaction = account.transactions.first
|
59
|
+
sample_accounts.find_by_transaction(transaction).should == account
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "#to_hash" do
|
64
|
+
it "should return array of Hashes" do
|
65
|
+
hash.should be_a_kind_of(Array)
|
66
|
+
hash.first.should be_a_kind_of(Hash)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe SaltParser::Ofx::Parser::OFX102 do
|
4
|
+
let(:ofx) { SaltParser::Ofx::Builder.new("spec/ofx/fixtures/v102.ofx") }
|
5
|
+
let(:parser) { ofx.parser }
|
6
|
+
|
7
|
+
it "should have a version" do
|
8
|
+
SaltParser::Ofx::Parser::OFX102::VERSION.should == "1.0.2"
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should set headers" do
|
12
|
+
parser.headers.should == ofx.headers
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should trim trailing whitespace from headers" do
|
16
|
+
headers = SaltParser::Ofx::Parser::OFX102.parse_headers("VERSION:102 ")
|
17
|
+
headers["VERSION"].should == "102"
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should set body" do
|
21
|
+
parser.body.should == ofx.body
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should set accounts" do
|
25
|
+
parser.accounts.should be_a_kind_of(Array)
|
26
|
+
parser.accounts.first.should be_a_kind_of(SaltParser::Ofx::Account)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should set account" do
|
30
|
+
parser.sign_on.should be_a_kind_of(SaltParser::Ofx::SignOn)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should know about all transaction types" do
|
34
|
+
valid_types = [
|
35
|
+
'CREDIT', 'DEBIT', 'INT', 'DIV', 'FEE', 'SRVCHG', 'DEP', 'ATM', 'POS', 'XFER',
|
36
|
+
'CHECK', 'PAYMENT', 'CASH', 'DIRECTDEP', 'DIRECTDEBIT', 'REPEATPMT', 'OTHER'
|
37
|
+
]
|
38
|
+
valid_types.sort.should == SaltParser::Ofx::Parser::OFX102::TRANSACTION_TYPES.keys.sort
|
39
|
+
|
40
|
+
valid_types.each do |transaction_type|
|
41
|
+
transaction_type.downcase.to_sym.should equal SaltParser::Ofx::Parser::OFX102::TRANSACTION_TYPES[transaction_type]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|