Custom URI Scheme

From GnuCash
Revision as of 19:23, 12 March 2011 by Cstim (talk | contribs)
Jump to: navigation, search

This wiki page discusses the possibility to register some custom URL Scheme so that the online banking functions in GnuCash can be called from a browser.

Here's my target use case: Let's say a user looks at the http://www.gnucash.org/de/ website. The website should then contain a link "Click here to donate from your German bank account". That link contains our custom URI Scheme (the part usually called the "protocol"), e.g. as follows:

hbci://de/11111111/22222222?desc=Some%20Description
  • "hbci" is our URL Scheme which is unused so far
  • "de" refers to the fact we're using the German bank account addressing scheme,
  • 1111111 is the bank code of the German bank,
  • 2222222 is the account number,
  • and "Some Description" is the description text that is inserted in the "description" text field of the online banking transfer.

Once clicked, this URL string needs to be passed to GnuCash, most probably as a command line argument similar to the file://path/filename argument. I'll have to tweak the command line parsing so that my custom schemes are redirected into the online banking module, but that shouldn't be a problem.

Once that URL made it into GnuCash's online banking module, it should look up the preferred online banking account which the user regularly uses, then open the dialog for transferring money. The user just has to insert the amount, then press "Send now", then entering his security numbers, and voila, here the money goes to our gnucash donation bank account.

Which URI Scheme to use?

See

The scheme should be Tag scheme rfc4151 using gnucash.org and 2011 as a year:

tag:gnucash.org,2011://de/11111111/22222222?desc=Some%20Description

How can we register gnucash as a handler for our custom scheme?