mirror of
https://github.com/aclindsa/ofxgo.git
synced 2024-11-25 04:20:05 -05:00
Aaron Lindsay
94a77ac754
This paves the way for more easily implementing different clients for different financial institutions
32 lines
682 B
Go
32 lines
682 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/aclindsa/ofxgo"
|
|
"os"
|
|
)
|
|
|
|
func newRequest() (ofxgo.Client, *ofxgo.Request) {
|
|
ver, err := ofxgo.NewOfxVersion(ofxVersion)
|
|
if err != nil {
|
|
fmt.Println("Error creating new OfxVersion enum:", err)
|
|
os.Exit(1)
|
|
}
|
|
var client = ofxgo.BasicClient{
|
|
AppID: appID,
|
|
AppVer: appVer,
|
|
SpecVersion: ver,
|
|
NoIndent: noIndentRequests,
|
|
}
|
|
|
|
var query ofxgo.Request
|
|
query.URL = serverURL
|
|
query.Signon.ClientUID = ofxgo.UID(clientUID)
|
|
query.Signon.UserID = ofxgo.String(username)
|
|
query.Signon.UserPass = ofxgo.String(password)
|
|
query.Signon.Org = ofxgo.String(org)
|
|
query.Signon.Fid = ofxgo.String(fid)
|
|
|
|
return &client, &query
|
|
}
|