Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions packages/fints/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion packages/fints/src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions packages/fints/src/segments/hktan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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];
Expand Down