Skip to content

feat: HKKKU — credit card transactions (DK G112, successor of DKKKU) - #40

Open
theovassiliou wants to merge 1 commit into
robocode13:mainfrom
theovassiliou:feat/hkkku-credit-card-transactions
Open

theovassiliou wants to merge 1 commit into
robocode13:mainfrom
theovassiliou:feat/hkkku-credit-card-transactions

Conversation

@theovassiliou

Copy link
Copy Markdown

Some banks no longer offer the proprietary DKKKU for credit card accounts, only the standardized
HKKKU (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 HKKKU and HKKKS, but neither
DKKKU nor HKSAL. With 1.5.2, canGetCreditCardStatements() therefore returns false for 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

  • HKKKU v1 (request): international account (only if the bank's HIKKUS parameters ask for it),
    card number, sub-account id, from, to, max entries, continuation mark.
  • HIKKU v1 (response): card number, account id, balance, last and next statement date, and the
    repeated entries ("Umsatz Kreditkartenkonto").
  • HIKKUS v1 (parameters): storage period, max entries allowed, date range allowed, account required.
  • CreditCardStatementInteractionHKKKU. It parses each entry by position (0 card number, 1 receipt
    date, 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 several HIKKU segments (continuation via 3040).
    The balance from HIKKU is returned as balance, so callers get the card balance even where
    HKSAL is not offered.
  • FinTSClient: canGetCreditCardStatements() accepts HKKKU or DKKKU; getCreditCardStatements()
    takes an optional to, prefers HKKKU where the account offers it and falls back to DKKKU;
    getCreditCardStatementsWithTan() continues either.
  • CreditCardStatement gains the optional fields receiptDate, remoteName (merchant), country,
    billed and reference. originalCurrency, originalAmount and exchangeRate become optional,
    because HIKKU leaves them empty for payments in the account currency.
  • CreditCardStatement and CreditCardStatementResponse are now exported as types.

Not included

HKKKS (balance only). The balance in HIKKU covered our needs, so I left it out to keep this PR small.

Tests

src/tests/HKKKU.test.ts covers encoding HKKKU (with and without account), decoding HIKKU and
HIKKUS, 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 card
that only offers HKKKU). The test data is synthetic.

🤖 Generated with Claude Code

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>
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 this pull request may close these issues.

1 participant