mirror of
https://github.com/aclindsa/ofxgo.git
synced 2025-07-03 12:28:38 -04:00
Add Type() to Message interface, check types when marshalling requests
This commit is contained in:
@ -28,6 +28,10 @@ func (r *CCStatementRequest) Valid() (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (r *CCStatementRequest) Type() messageType {
|
||||
return CreditCardRq
|
||||
}
|
||||
|
||||
type CCStatementResponse struct {
|
||||
XMLName xml.Name `xml:"CCSTMTTRNRS"`
|
||||
TrnUID UID `xml:"TRNUID"`
|
||||
@ -62,6 +66,10 @@ func (sr CCStatementResponse) Valid() (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func (sr CCStatementResponse) Type() messageType {
|
||||
return CreditCardRs
|
||||
}
|
||||
|
||||
func decodeCCMessageSet(d *xml.Decoder, start xml.StartElement) ([]Message, error) {
|
||||
var msgs []Message
|
||||
for {
|
||||
|
Reference in New Issue
Block a user