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

Add transaction UID validation to all messages

This commit is contained in:
Aaron Lindsay 2017-04-18 20:22:07 -04:00
parent 8712be5a9d
commit bc541d881d
5 changed files with 30 additions and 0 deletions

View File

@ -29,6 +29,9 @@ func (r *CCStatementRequest) Name() string {
// Valid returns (true, nil) if this struct would be valid OFX if marshalled // Valid returns (true, nil) if this struct would be valid OFX if marshalled
// into XML/SGML // into XML/SGML
func (r *CCStatementRequest) Valid(version ofxVersion) (bool, error) { func (r *CCStatementRequest) Valid(version ofxVersion) (bool, error) {
if ok, err := r.TrnUID.Valid(); !ok {
return false, err
}
// TODO implement // TODO implement
return true, nil return true, nil
} }
@ -74,6 +77,9 @@ func (sr *CCStatementResponse) Name() string {
// Valid returns (true, nil) if this struct was valid OFX when unmarshalled // Valid returns (true, nil) if this struct was valid OFX when unmarshalled
func (sr *CCStatementResponse) Valid(version ofxVersion) (bool, error) { func (sr *CCStatementResponse) Valid(version ofxVersion) (bool, error) {
if ok, err := sr.TrnUID.Valid(); !ok {
return false, err
}
//TODO implement //TODO implement
return true, nil return true, nil
} }

View File

@ -35,6 +35,9 @@ func (r *InvStatementRequest) Name() string {
// Valid returns (true, nil) if this struct would be valid OFX if marshalled // Valid returns (true, nil) if this struct would be valid OFX if marshalled
// into XML/SGML // into XML/SGML
func (r *InvStatementRequest) Valid(version ofxVersion) (bool, error) { func (r *InvStatementRequest) Valid(version ofxVersion) (bool, error) {
if ok, err := r.TrnUID.Valid(); !ok {
return false, err
}
// TODO implement // TODO implement
return true, nil return true, nil
} }
@ -1181,6 +1184,9 @@ func (sr *InvStatementResponse) Name() string {
// Valid returns (true, nil) if this struct was valid OFX when unmarshalled // Valid returns (true, nil) if this struct was valid OFX when unmarshalled
func (sr *InvStatementResponse) Valid(version ofxVersion) (bool, error) { func (sr *InvStatementResponse) Valid(version ofxVersion) (bool, error) {
if ok, err := sr.TrnUID.Valid(); !ok {
return false, err
}
//TODO implement //TODO implement
return true, nil return true, nil
} }

View File

@ -26,6 +26,9 @@ func (r *ProfileRequest) Name() string {
// Valid returns (true, nil) if this struct would be valid OFX if marshalled // Valid returns (true, nil) if this struct would be valid OFX if marshalled
// into XML/SGML // into XML/SGML
func (r *ProfileRequest) Valid(version ofxVersion) (bool, error) { func (r *ProfileRequest) Valid(version ofxVersion) (bool, error) {
if ok, err := r.TrnUID.Valid(); !ok {
return false, err
}
// TODO implement // TODO implement
r.ClientRouting = "NONE" r.ClientRouting = "NONE"
return true, nil return true, nil
@ -159,6 +162,9 @@ func (pr *ProfileResponse) Name() string {
// Valid returns (true, nil) if this struct was valid OFX when unmarshalled // Valid returns (true, nil) if this struct was valid OFX when unmarshalled
func (pr *ProfileResponse) Valid(version ofxVersion) (bool, error) { func (pr *ProfileResponse) Valid(version ofxVersion) (bool, error) {
if ok, err := pr.TrnUID.Valid(); !ok {
return false, err
}
//TODO implement //TODO implement
return true, nil return true, nil
} }

View File

@ -43,6 +43,9 @@ func (r *SecListRequest) Name() string {
// Valid returns (true, nil) if this struct would be valid OFX if marshalled // Valid returns (true, nil) if this struct would be valid OFX if marshalled
// into XML/SGML // into XML/SGML
func (r *SecListRequest) Valid(version ofxVersion) (bool, error) { func (r *SecListRequest) Valid(version ofxVersion) (bool, error) {
if ok, err := r.TrnUID.Valid(); !ok {
return false, err
}
// TODO implement // TODO implement
return true, nil return true, nil
} }
@ -74,6 +77,9 @@ func (r *SecListResponse) Name() string {
// Valid returns (true, nil) if this struct was valid OFX when unmarshalled // Valid returns (true, nil) if this struct was valid OFX when unmarshalled
func (r *SecListResponse) Valid(version ofxVersion) (bool, error) { func (r *SecListResponse) Valid(version ofxVersion) (bool, error) {
if ok, err := r.TrnUID.Valid(); !ok {
return false, err
}
// TODO implement // TODO implement
return true, nil return true, nil
} }

View File

@ -24,6 +24,9 @@ func (r *AcctInfoRequest) Name() string {
// Valid returns (true, nil) if this struct would be valid OFX if marshalled // Valid returns (true, nil) if this struct would be valid OFX if marshalled
// into XML/SGML // into XML/SGML
func (r *AcctInfoRequest) Valid(version ofxVersion) (bool, error) { func (r *AcctInfoRequest) Valid(version ofxVersion) (bool, error) {
if ok, err := r.TrnUID.Valid(); !ok {
return false, err
}
// TODO implement // TODO implement
return true, nil return true, nil
} }
@ -149,6 +152,9 @@ func (air *AcctInfoResponse) Name() string {
// Valid returns (true, nil) if this struct was valid OFX when unmarshalled // Valid returns (true, nil) if this struct was valid OFX when unmarshalled
func (air *AcctInfoResponse) Valid(version ofxVersion) (bool, error) { func (air *AcctInfoResponse) Valid(version ofxVersion) (bool, error) {
if ok, err := air.TrnUID.Valid(); !ok {
return false, err
}
//TODO implement //TODO implement
return true, nil return true, nil
} }