diff --git a/packages/fints/src/client.ts b/packages/fints/src/client.ts index d2528b8..5453227 100644 --- a/packages/fints/src/client.ts +++ b/packages/fints/src/client.ts @@ -121,7 +121,18 @@ export abstract class Client { endDate, }), ); - if (dialog.hktanVersion >= 6) { + if (dialog.hktanVersion >= 7) { + segments.push( + new HKTAN({ + segNo: 4, + version: 7, + process: "4", + segmentReference: "HKKAZ", + medium: "Alle Geräte", + }), + ); + } + else if (dialog.hktanVersion >= 6) { segments.push( new HKTAN({ segNo: 4, @@ -154,11 +165,11 @@ export abstract class Client { segments.push( new HKTAN({ segNo: 3, - version: 6, + version: 7, process: "2", segmentReference: "HKKAZ", aref: transactionReference, - medium: dialog.tanMethods[0].name, + medium: "Alle Geräte" }), ); return await this.sendStatementRequest(dialog, segments, tan); diff --git a/packages/fints/src/dialog.ts b/packages/fints/src/dialog.ts index 4119a55..aa54c33 100644 --- a/packages/fints/src/dialog.ts +++ b/packages/fints/src/dialog.ts @@ -130,7 +130,10 @@ export class Dialog extends DialogConfig { new HKIDN({ segNo: 3, blz, name, systemId: "0" }), new HKVVB({ segNo: 4, productId: this.productId, lang: 0 }), ]; - if (this.hktanVersion >= 6) { + if (this.hktanVersion >= 7) { + segments.push(new HKTAN({ segNo: 5, version: 7, process: "4" })); + } + else if (this.hktanVersion >= 6) { segments.push(new HKTAN({ segNo: 5, version: 6, process: "4" })); } const response: Response = await this.send( diff --git a/packages/fints/src/segments/hktan.ts b/packages/fints/src/segments/hktan.ts index 9815b2a..964b0bb 100644 --- a/packages/fints/src/segments/hktan.ts +++ b/packages/fints/src/segments/hktan.ts @@ -25,8 +25,8 @@ export class HKTAN extends SegmentClass(HKTANProps) { if (!["2", "4"].includes(process)) { throw new Error(`HKTAN process ${process} not implemented.`); } - if (![3, 4, 5, 6].includes(version)) { - throw new Error(`HKTAN version ${process} not implemented.`); + if (![3, 4, 5, 6, 7].includes(version)) { + throw new Error(`HKTAN version ${version} not implemented.`); } if (process === "4") { if (medium) { @@ -39,11 +39,11 @@ export class HKTAN extends SegmentClass(HKTANProps) { if (version === 5) { return [process, segmentReference, "", "", "", "", "", "", "", "", "", medium]; } - if (version === 6) { + if (version === 6 || version === 7) { return [process, segmentReference, "", "", "", "", "", "", "", "", medium]; } } else { - if (version === 6) { + if (version === 6 || version === 7) { return [process, "HKIDN"]; } else { return [process];