1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-07-03 20:38:39 -04:00

Generalize response parsing code

This removes the many decodeXXXMessageSet() functions and replaces them
with a large map and a single generic decodeMessageSet() function. Also
change Responses to satisfy the Message interface as pointer types
(instead of the raw types), add the full set of top-level message sets
(though most of them still lack any message-parsing ability), adjust the
message set names to more closely mirror their OFX names, and fixup
tests and the command-line client to match the above changes.
This commit is contained in:
2017-03-31 11:54:43 -04:00
parent d822179446
commit f185d78d29
18 changed files with 171 additions and 301 deletions

View File

@ -64,7 +64,7 @@ func TestMarshalBankStatementRequest(t *testing.T) {
},
Include: true,
}
request.Banking = append(request.Banking, &statementRequest)
request.Bank = append(request.Bank, &statementRequest)
request.SetClientFields(&client)
// Overwrite the DtClient value set by SetClientFields to time.Now()
@ -203,7 +203,7 @@ func TestUnmarshalBankStatementResponse(t *testing.T) {
AvailBalAmt: (*ofxgo.Amount)(&availbalamt),
AvailDtAsOf: &availdtasof,
}
expected.Banking = append(expected.Banking, statementResponse)
expected.Bank = append(expected.Bank, &statementResponse)
response, err := ofxgo.ParseResponse(responseReader)
if err != nil {