Repository navigation
feat: HKKKU — credit card transactions (DK G112, successor of DKKKU) - #40
Open
theovassiliou wants to merge 1 commit into
Open
theovassiliou wants to merge 1 commit into
theovassiliou wants to merge 1 commit into
Conversation
Some banks (e.g. Postbank) no longer offer DKKKU for credit card accounts, only the standardized HKKKU. Adds HKKKU/HIKKU/HIKKUS v1 and CreditCardStatementInteractionHKKKU; the client prefers HKKKU where the account offers it and falls back to DKKKU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some banks no longer offer the proprietary
DKKKUfor credit card accounts, only the standardizedHKKKU(credit card transactions) defined by Die Deutsche Kreditwirtschaft in G112 / change request 538.Postbank is one of them: the UPD of its Mastercard account lists
HKKKUandHKKKS, but neitherDKKKUnorHKSAL. With 1.5.2,canGetCreditCardStatements()therefore returnsfalsefor these cards.Verified against Postbank: we have been running this change (as a patch on the 1.5.2 build) in
production since early October 2026. It fetches the Mastercard transactions every night; we checked them
line by line against two monthly card statements.
What this adds
HKKKUv1 (request): international account (only if the bank'sHIKKUSparameters ask for it),card number, sub-account id, from, to, max entries, continuation mark.
HIKKUv1 (response): card number, account id, balance, last and next statement date, and therepeated entries ("Umsatz Kreditkartenkonto").
HIKKUSv1 (parameters): storage period, max entries allowed, date range allowed, account required.CreditCardStatementInteractionHKKKU. It parses each entry by position (0 card number, 1 receiptdate, 2 booking date, 3 statement date, 4 value date, 5–7 original amount, 8 exchange rate,
9–11 booking amount, 12–19 description, 20 country, 21 merchant, 22 terminal, 23 billed, 24 reference),
honours the
?escape and merges the entries of severalHIKKUsegments (continuation via 3040).The balance from
HIKKUis returned asbalance, so callers get the card balance even whereHKSALis not offered.FinTSClient:canGetCreditCardStatements()acceptsHKKKUorDKKKU;getCreditCardStatements()takes an optional
to, prefersHKKKUwhere the account offers it and falls back toDKKKU;getCreditCardStatementsWithTan()continues either.CreditCardStatementgains the optional fieldsreceiptDate,remoteName(merchant),country,billedandreference.originalCurrency,originalAmountandexchangeRatebecome optional,because
HIKKUleaves them empty for payments in the account currency.CreditCardStatementandCreditCardStatementResponseare now exported as types.Not included
HKKKS(balance only). The balance inHIKKUcovered our needs, so I left it out to keep this PR small.Tests
src/tests/HKKKU.test.tscovers encodingHKKKU(with and without account), decodingHIKKUandHIKKUS, the interaction (parameters respected, balance and entries mapped, foreign currency, refund,escaped
:, several segments merged) and two client tests (HKKKU preferred, capability check for a cardthat only offers HKKKU). The test data is synthetic.
🤖 Generated with Claude Code