AqBanking

From GnuCash
Revision as of 16:45, 19 February 2007 by Cstim (talk | contribs) (Using the test account)
Jump to: navigation, search

Setting up a HBCI PIN/TAN account

By Commandline

This instructions will explain how to set up a HBCI account with PIN/TAN authentification. The access data is from a test account that can be used by any gnucash developer; the instructions are also in src/import-export/hbci/HACKING-HBCITEST.txt.

Instructions are copied from http://linuxwiki.de/AqBanking/aqhbci-tool where they are in German.

We assume you have aqbanking and gnucash installed, and aqbanking's program aqhbci-tool is in your PATH.

Attention developers: If you call these programs and/or gnucash from the MSYS command line, you must change your HOME env variable to be the value of the USERPROFILE variable. This is because MSYS sets a new HOME that isn't know to any other (normal) windows program that is started outside MSYS. In particular, if you start gnucash outside of msys, it will look for the configuration and also for aqbanking's configuration in $USERPROFILE, but in msys, it will look in HOME. So you always have to gnucash as HOME="$USERPROFILE" gnucash

Create/register a new security medium in AqBanking

aqhbci-tool addmedium -t pintan

Find out the index number of the newly created security medium

aqhbci-tool listmedia

The output will be something like

Medium 0: "PINTAN-20070216-214030" (pintan)

and the important part is the first number, here: 0.

Create a HBCI user

aqhbci-tool adduser -m N -s SERVERURL -b BANKCODE -u USERID

where N is the medium number (0), SERVERURL is the full URL of the server application, BANKCODE is the bank code, and USERID is the identification string of the user that is allowed to access this account. For the test account, we have the following:

aqhbci-tool adduser -m 0 -s www.hora-obscura.de/pintan/PinTanServlet -b 80007777 -u gnucash

There is an optional argument of the CUSTOMERID, but this concerns you only if your bank explicitly said you have to use some extra customer id that is different from the user id.

Retrieve a system identification number

This system identification is necessary for the HBCI protocol to identify you and your software; if this step is forgotten or fails, nothing else will work.

aqhbci-tool getsysid -b BANKCODE

This command will ask you several questions. First it retrieves the server certificate and asks you whether you accept it. Then it asks whether you want to accept the certificate only this session or forever. Eventually, you have to enter the PIN number (password) of your online banking account. (For the gnucash test account, this is 12345.) The full output looks e.g. like this:

aqhbci-tool getsysid -b 80007777
===== Certificate Received =====
The following certificate has been received:
Name        : www.hora-obscura.de
Organisation: www.hora-obscura.de
Department  : GT90185227
Country     : DE
City        : unknown
State       : unknown
Valid after : 2007/02/15 14:28:06
Valid until : 2008/05/17 14:28:06
Hash        : 69:CF:A0:D9:EA:1F:4B:DA:5F:FA:7D:EE:75:87:C9:FF
Status      : Certificate is valid
Do you wish to accept this certificate?
(1) Yes  (2) No
Please enter your choice: 1
===== Certificate =====
Do you want to accept this certificate permanently?
(1) Permanently  (2) This session only  (3) Abort
Please enter your choice: 1
===== Enter Password =====
Please enter the password for 
PINTAN-20070216-215639
Input: *****

Any additional (error) messages can be ignored for now; just continue to work.

List the resulting accounts

aqhbci-tool listaccounts

The bank server should have sent a list of accounts in the last step already. If this is the case, you can view the list of accessible accounts now. The output for the gnucash test should look like this:

Account 0: Bank: 80007777 Account Number: 2501111538
Account 1: Bank: 80007777 Account Number: 2501111539
Account 2: Bank: 80007777 Account Number: 2501111540

If you've come this far, then congratulations: Your online access works!

Match the HBCI accounts in gnucash

In order to access the accounts from gnucash, you need to match a HBCI account to one of your gnucash accounts each. The next time you start gnucash, press "Tools -> Online Banking Setup" to use the online banking setup wizard. Press "Next" there. Ignore the text that says you should start the external program "AqBanking setup wizard", because you've already set up aqbanking by the command line. Because of this, press "Next" again.

You will now arrive at the "Match HBCI accounts with GnuCash accounts" window. You should see the three accounts mentioned above in the left column of the wizard window.

Click on an account name on the left (the account defined in the AqBanking setup wizard configuration), and select the GnuCash account that should be associated with it.

Click the Forward button.

In the next window, click the Apply button.

Using HBCI accounts in GnuCash

You're now ready to use the HBCI accounts from the respective GnuCash register windows. See Setting_up_OFXDirectConnect_in_GnuCash_2#Using_Gnucash_to_download_transactions_directly_to_an_account_register on how to do this.

Using the test account

As mentioned above, the gnucash developers can use a test account to test some of the aqbanking/HBCI features. Here's a step-by-step instruction of what you can do:

  • Setup the accounts as described above.
  • In gnucash, match one of your gnucash accounts with the first test account (bank code 80007777, account number 2501111538); press "Next" and "Finish" in the wizard.
  • Try "Get Balance" with that test account:
    • Open the gnucash register of that account;
    • Press "Actions -> Online actions -> Get balance"
    • When asked for the PIN, enter "12345"
    • If things run successfully, you are being told a balance and asked whether you want to reconcile your account. The balance value changes by the other test users anyway, so you don't have to care about the actual balance.