1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2024-11-22 11:30:05 -05:00

Comment credit card statement requests/responses

This commit is contained in:
Aaron Lindsay 2017-04-12 21:23:57 -04:00
parent eee9348766
commit 6c20007ada
2 changed files with 16 additions and 2 deletions

View File

@ -180,8 +180,7 @@ func (sr *StatementResponse) Name() string {
return "STMTTRNRS" return "STMTTRNRS"
} }
// Valid returns (true, nil) if this struct would be valid OFX if marshalled // Valid returns (true, nil) if this struct was valid OFX when unmarshalled
// into XML/SGML
func (sr *StatementResponse) Valid() (bool, error) { func (sr *StatementResponse) Valid() (bool, error) {
//TODO implement //TODO implement
return true, nil return true, nil

View File

@ -4,6 +4,9 @@ import (
"github.com/aclindsa/go/src/encoding/xml" "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 { type CCStatementRequest struct {
XMLName xml.Name `xml:"CCSTMTTRNRQ"` XMLName xml.Name `xml:"CCSTMTTRNRQ"`
TrnUID UID `xml:"TRNUID"` TrnUID UID `xml:"TRNUID"`
@ -18,19 +21,27 @@ type CCStatementRequest struct {
IncTranImg Boolean `xml:"CCSTMTRQ>INCTRANIMG,omitempty"` // Include transaction images 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 { func (r *CCStatementRequest) Name() string {
return "CCSTMTTRNRQ" return "CCSTMTTRNRQ"
} }
// Valid returns (true, nil) if this struct would be valid OFX if marshalled
// into XML/SGML
func (r *CCStatementRequest) Valid() (bool, error) { func (r *CCStatementRequest) Valid() (bool, error) {
// TODO implement // TODO implement
return true, nil 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 { func (r *CCStatementRequest) Type() messageType {
return CreditCardRq 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 { type CCStatementResponse struct {
XMLName xml.Name `xml:"CCSTMTTRNRS"` XMLName xml.Name `xml:"CCSTMTTRNRS"`
TrnUID UID `xml:"TRNUID"` TrnUID UID `xml:"TRNUID"`
@ -56,15 +67,19 @@ type CCStatementResponse struct {
MktgInfo String `xml:"CCSTMTRS>MKTGINFO,omitempty"` // Marketing information 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 { func (sr *CCStatementResponse) Name() string {
return "CCSTMTTRNRS" return "CCSTMTTRNRS"
} }
// Valid returns (true, nil) if this struct was valid OFX when unmarshalled
func (sr *CCStatementResponse) Valid() (bool, error) { func (sr *CCStatementResponse) Valid() (bool, error) {
//TODO implement //TODO implement
return true, nil 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 { func (sr *CCStatementResponse) Type() messageType {
return CreditCardRs return CreditCardRs
} }