1
0
mirror of https://github.com/aclindsa/ofxgo.git synced 2025-07-01 19:58:37 -04:00

Rename ofxgo_test package to ofxgo and remove self-imports/references

* Fix package in generate_constants.py
* Update generate_constants.py to use the new imports
This commit is contained in:
John Starich
2020-03-30 23:19:18 -05:00
committed by Aaron Lindsay
parent f19189de45
commit 8ad638c7e2
15 changed files with 712 additions and 721 deletions

27
doc.go
View File

@ -71,33 +71,32 @@ account and print the balance:
import (
"fmt"
"github.com/aclindsa/ofxgo"
"os"
)
var client ofxgo.Client // By not initializing them, we accept all default
var client Client // By not initializing them, we accept all default
// client values
var request ofxgo.Request
var request Request
// These are all specific to you and your financial institution
request.URL = "https://ofx.example.com"
request.Signon.UserID = ofxgo.String("john")
request.Signon.UserPass = ofxgo.String("hunter2")
request.Signon.Org = ofxgo.String("MyBank")
request.Signon.Fid = ofxgo.String("0001")
request.Signon.UserID = String("john")
request.Signon.UserPass = String("hunter2")
request.Signon.Org = String("MyBank")
request.Signon.Fid = String("0001")
uid, err := ofxgo.RandomUID()
uid, err := RandomUID()
if err != nil {
fmt.Println("Error creating uid for transaction:", err)
os.Exit(1)
}
statementRequest := ofxgo.StatementRequest{
statementRequest := StatementRequest{
TrnUID: *uid,
BankAcctFrom: ofxgo.BankAcct{
BankID: ofxgo.String("123456789"),
AcctID: ofxgo.String("11111111111"),
AcctType: ofxgo.AcctTypeChecking,
BankAcctFrom: BankAcct{
BankID: String("123456789"),
AcctID: String("11111111111"),
AcctType: AcctTypeChecking,
},
}
@ -117,7 +116,7 @@ account and print the balance:
if len(response.Bank) < 1 {
fmt.Println("No banking messages received")
} else if stmt, ok := response.Bank[0].(*ofxgo.StatementResponse); ok {
} else if stmt, ok := response.Bank[0].(*StatementResponse); ok {
fmt.Printf("Balance: %s %s (as of %s)\n", stmt.BalAmt, stmt.CurDef, stmt.DtAsOf)
}