mirror of
https://github.com/aclindsa/ofxgo.git
synced 2024-11-22 03:30:04 -05:00
Standardize transaction wrapper fields
This commit is contained in:
parent
6efd3ae921
commit
c1777df3df
15
banking.go
15
banking.go
@ -6,8 +6,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type StatementRequest struct {
|
type StatementRequest struct {
|
||||||
XMLName xml.Name `xml:"STMTTRNRQ"`
|
XMLName xml.Name `xml:"STMTTRNRQ"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
|
TAN String `xml:"TAN,omitempty"` // Transaction authorization number
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
BankAcctFrom BankAcct `xml:"STMTRQ>BANKACCTFROM"`
|
BankAcctFrom BankAcct `xml:"STMTRQ>BANKACCTFROM"`
|
||||||
DtStart *Date `xml:"STMTRQ>INCTRAN>DTSTART,omitempty"`
|
DtStart *Date `xml:"STMTRQ>INCTRAN>DTSTART,omitempty"`
|
||||||
DtEnd *Date `xml:"STMTRQ>INCTRAN>DTEND,omitempty"`
|
DtEnd *Date `xml:"STMTRQ>INCTRAN>DTEND,omitempty"`
|
||||||
@ -124,9 +127,11 @@ type Balance struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type StatementResponse struct {
|
type StatementResponse struct {
|
||||||
XMLName xml.Name `xml:"STMTTRNRS"`
|
XMLName xml.Name `xml:"STMTTRNRS"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
Status Status `xml:"STATUS"`
|
Status Status `xml:"STATUS"`
|
||||||
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
CurDef String `xml:"STMTRS>CURDEF"`
|
CurDef String `xml:"STMTRS>CURDEF"`
|
||||||
BankAcctFrom BankAcct `xml:"STMTRS>BANKACCTFROM"`
|
BankAcctFrom BankAcct `xml:"STMTRS>BANKACCTFROM"`
|
||||||
BankTranList *TransactionList `xml:"STMTRS>BANKTRANLIST,omitempty"`
|
BankTranList *TransactionList `xml:"STMTRS>BANKTRANLIST,omitempty"`
|
||||||
|
@ -30,9 +30,8 @@ func getAccounts() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
acctInfo := ofxgo.AcctInfoRequest{
|
acctInfo := ofxgo.AcctInfoRequest{
|
||||||
TrnUID: *uid,
|
TrnUID: *uid,
|
||||||
DtAcctUp: ofxgo.Date(time.Unix(0, 0)),
|
DtAcctUp: ofxgo.Date(time.Unix(0, 0)),
|
||||||
CltCookie: 1,
|
|
||||||
}
|
}
|
||||||
query.Signup = append(query.Signup, &acctInfo)
|
query.Signup = append(query.Signup, &acctInfo)
|
||||||
|
|
||||||
|
@ -6,14 +6,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type CCStatementRequest struct {
|
type CCStatementRequest struct {
|
||||||
XMLName xml.Name `xml:"CCSTMTTRNRQ"`
|
XMLName xml.Name `xml:"CCSTMTTRNRQ"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
CCAcctFrom CCAcct `xml:"CCSTMTRQ>CCACCTFROM"`
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
DtStart *Date `xml:"CCSTMTRQ>INCTRAN>DTSTART,omitempty"`
|
TAN String `xml:"TAN,omitempty"`
|
||||||
DtEnd *Date `xml:"CCSTMTRQ>INCTRAN>DTEND,omitempty"`
|
// TODO OFXEXTENSION
|
||||||
Include Boolean `xml:"CCSTMTRQ>INCTRAN>INCLUDE"` // Include transactions (instead of just balance)
|
CCAcctFrom CCAcct `xml:"CCSTMTRQ>CCACCTFROM"`
|
||||||
IncludePending Boolean `xml:"CCSTMTRQ>INCLUDEPENDING,omitempty"` // Include pending transactions
|
DtStart *Date `xml:"CCSTMTRQ>INCTRAN>DTSTART,omitempty"`
|
||||||
IncTranImg Boolean `xml:"CCSTMTRQ>INCTRANIMG,omitempty"` // Include transaction images
|
DtEnd *Date `xml:"CCSTMTRQ>INCTRAN>DTEND,omitempty"`
|
||||||
|
Include Boolean `xml:"CCSTMTRQ>INCTRAN>INCLUDE"` // Include transactions (instead of just balance)
|
||||||
|
IncludePending Boolean `xml:"CCSTMTRQ>INCLUDEPENDING,omitempty"` // Include pending transactions
|
||||||
|
IncTranImg Boolean `xml:"CCSTMTRQ>INCTRANIMG,omitempty"` // Include transaction images
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *CCStatementRequest) Name() string {
|
func (r *CCStatementRequest) Name() string {
|
||||||
@ -26,9 +29,11 @@ func (r *CCStatementRequest) Valid() (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CCStatementResponse struct {
|
type CCStatementResponse struct {
|
||||||
XMLName xml.Name `xml:"CCSTMTTRNRS"`
|
XMLName xml.Name `xml:"CCSTMTTRNRS"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
Status Status `xml:"STATUS"`
|
Status Status `xml:"STATUS"`
|
||||||
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
CurDef String `xml:"CCSTMTRS>CURDEF"`
|
CurDef String `xml:"CCSTMTRS>CURDEF"`
|
||||||
CCAcctFrom CCAcct `xml:"CCSTMTRS>CCACCTFROM"`
|
CCAcctFrom CCAcct `xml:"CCSTMTRS>CCACCTFROM"`
|
||||||
BankTranList *TransactionList `xml:"CCSTMTRS>BANKTRANLIST,omitempty"`
|
BankTranList *TransactionList `xml:"CCSTMTRS>BANKTRANLIST,omitempty"`
|
||||||
|
@ -794,7 +794,7 @@ type InvStatementResponse struct {
|
|||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
Status Status `xml:"STATUS"`
|
Status Status `xml:"STATUS"`
|
||||||
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
// TODO OFXEXTENSION
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
DtAsOf Date `xml:"INVSTMTRS>DTASOF"`
|
DtAsOf Date `xml:"INVSTMTRS>DTASOF"`
|
||||||
CurDef String `xml:"INVSTMTRS>CURDEF"`
|
CurDef String `xml:"INVSTMTRS>CURDEF"`
|
||||||
InvAcctFrom InvAcct `xml:"INVSTMTRS>INVACCTFROM"`
|
InvAcctFrom InvAcct `xml:"INVSTMTRS>INVACCTFROM"`
|
||||||
|
19
profile.go
19
profile.go
@ -6,10 +6,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ProfileRequest struct {
|
type ProfileRequest struct {
|
||||||
XMLName xml.Name `xml:"PROFTRNRQ"`
|
XMLName xml.Name `xml:"PROFTRNRQ"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
ClientRouting String `xml:"PROFRQ>CLIENTROUTING"` // Forced to NONE
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
DtProfUp Date `xml:"PROFRQ>DTPROFUP"`
|
TAN String `xml:"TAN,omitempty"` // Transaction authorization number
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
|
ClientRouting String `xml:"PROFRQ>CLIENTROUTING"` // Forced to NONE
|
||||||
|
DtProfUp Date `xml:"PROFRQ>DTPROFUP"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *ProfileRequest) Name() string {
|
func (r *ProfileRequest) Name() string {
|
||||||
@ -95,9 +98,11 @@ func (msl *MessageSetList) UnmarshalXML(d *xml.Decoder, start xml.StartElement)
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ProfileResponse struct {
|
type ProfileResponse struct {
|
||||||
XMLName xml.Name `xml:"PROFTRNRS"`
|
XMLName xml.Name `xml:"PROFTRNRS"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
Status Status `xml:"STATUS"`
|
Status Status `xml:"STATUS"`
|
||||||
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
MessageSetList MessageSetList `xml:"PROFRS>MSGSETLIST"`
|
MessageSetList MessageSetList `xml:"PROFRS>MSGSETLIST"`
|
||||||
SignonInfoList []SignonInfo `xml:"PROFRS>SIGNONINFOLIST>SIGNONINFO"`
|
SignonInfoList []SignonInfo `xml:"PROFRS>SIGNONINFOLIST>SIGNONINFO"`
|
||||||
DtProfUp Date `xml:"PROFRS>DTPROFUP"`
|
DtProfUp Date `xml:"PROFRS>DTPROFUP"`
|
||||||
|
@ -20,10 +20,11 @@ type SecurityRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SecListRequest struct {
|
type SecListRequest struct {
|
||||||
XMLName xml.Name `xml:"SECLISTTRNRQ"`
|
XMLName xml.Name `xml:"SECLISTTRNRQ"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
TAN String `xml:"TAN,omitempty"` // Transaction authorization number
|
TAN String `xml:"TAN,omitempty"` // Transaction authorization number
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
Securities []SecurityRequest `xml:"SECLISTRQ>SECRQ,omitempty"`
|
Securities []SecurityRequest `xml:"SECLISTRQ>SECRQ,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ type SecListResponse struct {
|
|||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
Status Status `xml:"STATUS"`
|
Status Status `xml:"STATUS"`
|
||||||
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
// SECLISTRS is always empty, so we don't parse it here. The actual securities list will be in a top-level element parallel to SECLISTTRNRS
|
// SECLISTRS is always empty, so we don't parse it here. The actual securities list will be in a top-level element parallel to SECLISTTRNRS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
signup.go
14
signup.go
@ -9,8 +9,10 @@ import (
|
|||||||
type AcctInfoRequest struct {
|
type AcctInfoRequest struct {
|
||||||
XMLName xml.Name `xml:"ACCTINFOTRNRQ"`
|
XMLName xml.Name `xml:"ACCTINFOTRNRQ"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
CltCookie Int `xml:"CLTCOOKIE"`
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
DtAcctUp Date `xml:"ACCTINFORQ>DTACCTUP"`
|
TAN String `xml:"TAN,omitempty"` // Transaction authorization number
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
|
DtAcctUp Date `xml:"ACCTINFORQ>DTACCTUP"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *AcctInfoRequest) Name() string {
|
func (r *AcctInfoRequest) Name() string {
|
||||||
@ -105,9 +107,11 @@ type AcctInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AcctInfoResponse struct {
|
type AcctInfoResponse struct {
|
||||||
XMLName xml.Name `xml:"ACCTINFOTRNRS"`
|
XMLName xml.Name `xml:"ACCTINFOTRNRS"`
|
||||||
TrnUID UID `xml:"TRNUID"`
|
TrnUID UID `xml:"TRNUID"`
|
||||||
Status Status `xml:"STATUS"`
|
Status Status `xml:"STATUS"`
|
||||||
|
CltCookie String `xml:"CLTCOOKIE,omitempty"`
|
||||||
|
// TODO `xml:"OFXEXTENSION,omitempty"`
|
||||||
DtAcctUp Date `xml:"ACCTINFORS>DTACCTUP"`
|
DtAcctUp Date `xml:"ACCTINFORS>DTACCTUP"`
|
||||||
AcctInfo []AcctInfo `xml:"ACCTINFORS>ACCTINFO,omitempty"`
|
AcctInfo []AcctInfo `xml:"ACCTINFORS>ACCTINFO,omitempty"`
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user