Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #41

Open
pmoscode opened this issue Mar 2, 2024 · 6 comments · May be fixed by #42
Open

Documentation #41

pmoscode opened this issue Mar 2, 2024 · 6 comments · May be fixed by #42

Comments

@pmoscode
Copy link

pmoscode commented Mar 2, 2024

It's me again :)

Thanks for merging #38!
But my next question is: How to use this lib?
Is there any documentation or code example?

I just need to list transactions, nothing fancy.

Thanks again.

@mitch000001
Copy link
Owner

mitch000001 commented Mar 3, 2024

Hi, there is no real documentation about how to use this code. The closest you can get is looking at the e2e test from the client:

func TestClientAccountTransactions(t *testing.T) {
skipWhenE2EDisabled(t)
c := newClient()
timeframe := domain.Timeframe{
StartDate: domain.NewShortDate(time.Now().AddDate(0, 0, -90)),
}
transactions, err := c.AccountTransactions(testAccount, timeframe, false, "")
if err != nil {
t.Logf("Expected error to be nil, got %T:%v\n", err, err)
t.Fail()
}
if transactions == nil {
t.Logf("Expected transactions not to be nil\n")
t.Fail()
}
for _, tr := range transactions {
fmt.Printf("Transaction: %s\n", tr)
}
}
) or at the also provided CLI which showcases how to use the client:
func fetchTransactions(account domain.InternationalAccountConnection, timeframe domain.Timeframe) {
transactions, err := hbciClient.AccountTransactions(account.ToAccountConnection(), timeframe, false, "")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Print(domain.AccountTransactions(transactions))
}
func fetchSepaTransactions(account domain.InternationalAccountConnection, timeframe domain.Timeframe) {
transactions, err := hbciClient.SepaAccountTransactions(account, timeframe, false, "")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Print(domain.AccountTransactions(transactions))

I will try to provide additional test examples soon.

@mitch000001 mitch000001 linked a pull request Mar 3, 2024 that will close this issue
@mitch000001
Copy link
Owner

@pmoscode I added some documentation to the code. Can you give me some feedback, maybe also in the PR #42?

@pmoscode
Copy link
Author

pmoscode commented Mar 3, 2024

@mitch000001
Thanks a lot for the doc.
I will try it out today evening.

@pmoscode
Copy link
Author

pmoscode commented Mar 3, 2024

Hi @mitch000001,
the most help I could get from the "cmd" code.

But I'm stuck here:

clientConfig = client.Config{
		URL:                "https://hbci.postbank.de/banking/hbci.do",
		AccountID:          "",
		BankID:             "",
		PIN:                "",
		EnableDebugLogging: false,
	}

So,
the "AccountID" is the last part of the IBAN, right? (So called "Kontonummer")
The Bank ID is the BLZ? (first part of the IBAN)
But what is the pin? The password from the online banking? or the card pin?

If I try the password, I get "Anmeldung fehlgeschlagen"... And I don't want to risk more login failure...

Thanks.

The PR #42 is not helping me much.
I think a more "textual" doc could make things more clear.

@mitch000001
Copy link
Owner

So, the account id is your account number and the bank id is the BLZ. The Account id can also be derived from the Iban, that's the latter part with a leading zero if your account id is shorter. So you're correct. The pin is the password used to access your online banking.

@Clauscomputing
Copy link
Contributor

Just as a side note, for me (Sparkasse), it's some kind of combination of first and last name. Same as the login of their web interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants