From 6c20007adaf6509c07d2c744cce8b558b048c931 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Wed, 12 Apr 2017 21:23:57 -0400 Subject: [PATCH] Comment credit card statement requests/responses --- bank.go | 3 +-- creditcard.go | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bank.go b/bank.go index 0e1ae08..b90a49f 100644 --- a/bank.go +++ b/bank.go @@ -180,8 +180,7 @@ func (sr *StatementResponse) Name() string { return "STMTTRNRS" } -// Valid returns (true, nil) if this struct would be valid OFX if marshalled -// into XML/SGML +// Valid returns (true, nil) if this struct was valid OFX when unmarshalled func (sr *StatementResponse) Valid() (bool, error) { //TODO implement return true, nil diff --git a/creditcard.go b/creditcard.go index c3e0710..ae91615 100644 --- a/creditcard.go +++ b/creditcard.go @@ -4,6 +4,9 @@ import ( "github.com/aclindsa/go/src/encoding/xml" ) +// CCStatementRequest represents a request for a credit card statement. It is +// used to request balances and/or transactions. See StatementRequest for the +// analog for all other bank accounts. type CCStatementRequest struct { XMLName xml.Name `xml:"CCSTMTTRNRQ"` TrnUID UID `xml:"TRNUID"` @@ -18,19 +21,27 @@ type CCStatementRequest struct { IncTranImg Boolean `xml:"CCSTMTRQ>INCTRANIMG,omitempty"` // Include transaction images } +// Name returns the name of the top-level transaction XML/SGML element func (r *CCStatementRequest) Name() string { return "CCSTMTTRNRQ" } +// Valid returns (true, nil) if this struct would be valid OFX if marshalled +// into XML/SGML func (r *CCStatementRequest) Valid() (bool, error) { // TODO implement return true, nil } +// Type returns which message set this message belongs to (which Request +// element of type []Message it should appended to) func (r *CCStatementRequest) Type() messageType { return CreditCardRq } +// CCStatementResponse represents a credit card statement, including its +// balances and possibly transactions. It is a response to CCStatementRequest, +// or sometimes provided as part of an OFX file downloaded manually from an FI. type CCStatementResponse struct { XMLName xml.Name `xml:"CCSTMTTRNRS"` TrnUID UID `xml:"TRNUID"` @@ -56,15 +67,19 @@ type CCStatementResponse struct { MktgInfo String `xml:"CCSTMTRS>MKTGINFO,omitempty"` // Marketing information } +// Name returns the name of the top-level transaction XML/SGML element func (sr *CCStatementResponse) Name() string { return "CCSTMTTRNRS" } +// Valid returns (true, nil) if this struct was valid OFX when unmarshalled func (sr *CCStatementResponse) Valid() (bool, error) { //TODO implement return true, nil } +// Type returns which message set this message belongs to (which Response +// element of type []Message it belongs to) func (sr *CCStatementResponse) Type() messageType { return CreditCardRs }