@kreiseck/kasseneck-api 1.32.1 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,15 @@ Was vor 0.7.0 geschah, steht in der Commit-Historie (`git log`); ab hier wird
4
4
  es hier geführt. Ein Eintrag nennt die Änderung **und ihren Grund** —
5
5
  nur der Grund überlebt den nächsten Umbau.
6
6
 
7
+ ## 1.33.0 - unveröffentlicht
8
+
9
+ Card terminal and the browser till on a Mac (Chrome as an installed app, Hobex HPS and printer through Kasseneck Connect). Additive; receipts, bons and every existing call behave as before (all goldens unchanged).
10
+
11
+ - **`terminal_unreachable` is "nothing sent":** new list `TERMINAL_UNREACHABLE_CONNECT_CODES` (`./payments`) next to `PREFLIGHT_CONNECT_CODES`. Connect sends the code only when the TCP connection to the terminal never came up (refused, no route, timeout while connecting), before any byte; the HPS client now throws `HpsPreflightError` (`connectCode: 'terminal_unreachable'`) for it on payment, refund and cancel, without abort or status polling. Reason: the till can say "nothing charged, try again" instead of "unclear, check the terminal receipt" when the terminal is simply off or in another network. Older Connect versions never send it; their `terminal_offline` stays `HpsConnectTerminalError` (unclear: the connection may also have dropped after sending), and any unknown code stays unclear (positive list). During clarification (abort, status) the code says nothing about the payment and is treated like any other failed call.
12
+ - **HPS card data on the receipt:** `hobexReceiptFromHps` (terminal response -> `HobexReceipt` with provider `hobexHps`, `cvm` as number, `null` fields as empty text) is now exported from `./payments`; before it was only reachable inside the package, and the browser till used `fromHobexReceiptPayload`, whose fixed provider `hobexCloudApi` dropped `approvalCode`, `cardExpiry`, `cardIssuer`, `amount` and `currency` from `hobexReceiptToCardPaymentData` on every HPS receipt. `fromHobexReceiptPayload(payload, provider?)` takes the provider as an optional second argument (default `hobexCloudApi`, unchanged); its doc points HPS callers to `hobexReceiptFromHps`. The printed bon does not use these fields, so it stays byte for byte the same.
13
+ - **Texts (browser till only):** message `connect.local_network_blocked` (Chrome's "Local network access" denied for the till: the till finds no Connect, and installing does not help; the sentence gives the way to allow it), messages `terminal.several_found` (placeholder `hosts`) and `terminal.tid_not_found` (`hosts`, `tid`) for a terminal search with several hits where no single one confirms the TID of the device.
14
+ - `fixtures/surface.json`, `pos-texts.json`, `invoice-texts.json`, `hobex-hps-codes.json` and `invoice-api.schema.json` regenerated for the version.
15
+
7
16
  ## 1.32.1 - unveröffentlicht
8
17
 
9
18
  Fix: a deposit payout (a receipt whose amount due is negative because of returned empties) is no longer refused before sending. `sellReceipt`/`createReceipt` accept one negative cash payment when the items contain a `deposit_return` line, with no `tenderedCents` and no `tipCents`, and at most the sum of the return lines. Reason: the server allows this payout (`istLeergutAuszahlung`) but the client check demanded `amountCents > 0` unless the receipt was a voucher payout. Without empties a negative payment is still refused; empties with a positive amount stay an ordinary sale.
@@ -8,10 +8,15 @@ import { CreditCardProvider } from '../enums/index.js';
8
8
  * bleibt deshalb bewusst Euro (siehe [toHobexReceiptPayload]/
9
9
  * [fromHobexReceiptPayload]), intern wird ab hier exakt in Cent gefuehrt.
10
10
  *
11
- * Nur der Cloud-API-Pfad (`fromJson` im Dart-Vorbild) ist Teil dieses Pakets;
12
- * das lokale HPS-Terminal (`fromHps`, TCP-Anbindung an ein physisches Geraet)
13
- * ist wie SumUp/myPOS eine Android/Desktop-Geraete-Anbindung, die ein
14
- * Browser-/Node-Paket nicht bedienen kann.
11
+ * Zwei Wege hinein, je nach Weg der Zahlung:
12
+ *
13
+ * - **Cloud-API** (`fromJson` im Dart-Vorbild): [fromHobexReceiptPayload].
14
+ * - **HPS-Terminal ueber Kasseneck Connect** (`fromHps` im Dart-Vorbild):
15
+ * `hobexReceiptFromHps` aus `@kreiseck/kasseneck-api/payments` auf die
16
+ * Terminal-Antwort (`HpsPaymentResult.response`). Nur dieser Weg setzt den
17
+ * Anbieter `hobexHps` und damit die HPS-Zusatzfelder in
18
+ * [hobexReceiptToCardPaymentData]; er liest auch `cvm` als Zahl und
19
+ * nicht gefuehrte Felder (`null`) als leeren Text.
15
20
  */
16
21
  export interface HobexReceipt {
17
22
  transactionId: string;
@@ -52,7 +57,17 @@ export interface HobexReceiptPayload {
52
57
  cvm: string | number;
53
58
  }
54
59
  export declare function toHobexReceiptPayload(receipt: HobexReceipt): HobexReceiptPayload;
55
- export declare function fromHobexReceiptPayload(payload: HobexReceiptPayload): HobexReceipt;
60
+ /**
61
+ * Liest eine Hobex-Nutzlast der **Cloud-API**.
62
+ *
63
+ * Der Anbieter ergibt sich aus dem Weg, nicht aus dem JSON; Vorgabe ist
64
+ * `hobexCloudApi`. Fuer eine Antwort des HPS-Terminals ist der richtige Weg
65
+ * `hobexReceiptFromHps` (`@kreiseck/kasseneck-api/payments`) — wer trotzdem
66
+ * hier hereinkommt, gibt [provider] `CreditCardProvider.hobexHps`
67
+ * mit, sonst fehlen am Beleg Genehmigungsnummer, Ablaufdatum, Kartenausgeber,
68
+ * Betrag und Waehrung (siehe [hobexReceiptToCardPaymentData]).
69
+ */
70
+ export declare function fromHobexReceiptPayload(payload: HobexReceiptPayload, provider?: CreditCardProvider): HobexReceipt;
56
71
  /**
57
72
  * Wandelt den Beleg in die `cardPaymentData`-Map, die auf dem Kasseneck-Beleg
58
73
  * landet (siehe [Receipt.cardPaymentData]). Bei HPS-Zahlungen kommen weitere
@@ -27,7 +27,17 @@ function toHobexReceiptPayload(receipt) {
27
27
  cvm: receipt.cvm,
28
28
  };
29
29
  }
30
- function fromHobexReceiptPayload(payload) {
30
+ /**
31
+ * Liest eine Hobex-Nutzlast der **Cloud-API**.
32
+ *
33
+ * Der Anbieter ergibt sich aus dem Weg, nicht aus dem JSON; Vorgabe ist
34
+ * `hobexCloudApi`. Fuer eine Antwort des HPS-Terminals ist der richtige Weg
35
+ * `hobexReceiptFromHps` (`@kreiseck/kasseneck-api/payments`) — wer trotzdem
36
+ * hier hereinkommt, gibt [provider] `CreditCardProvider.hobexHps`
37
+ * mit, sonst fehlen am Beleg Genehmigungsnummer, Ablaufdatum, Kartenausgeber,
38
+ * Betrag und Waehrung (siehe [hobexReceiptToCardPaymentData]).
39
+ */
40
+ function fromHobexReceiptPayload(payload, provider = index_js_1.CreditCardProvider.hobexCloudApi) {
31
41
  return {
32
42
  transactionId: payload.transactionId,
33
43
  tid: payload.tid,
@@ -54,11 +64,12 @@ function fromHobexReceiptPayload(payload) {
54
64
  amountCents: (0, money_js_1.euroToCents)(payload.amount),
55
65
  tipCents: (0, money_js_1.euroToCents)(payload.tip),
56
66
  cvm: String(payload.cvm),
57
- // Die Cloud-API-Nutzlast traegt keinen eigenen Provider-Schluessel — der
58
- // Provider ergibt sich aus dem Transportweg (Cloud vs. HPS), nicht aus
59
- // dem JSON. Das Dart-Vorbild setzt ihn in `fromJson` deshalb ebenfalls
60
- // nicht, sondern belaesst den Konstruktor-Default.
61
- creditCardProvider: index_js_1.CreditCardProvider.hobexCloudApi,
67
+ // Die Nutzlast traegt keinen eigenen Provider-Schluessel — der Provider
68
+ // ergibt sich aus dem Transportweg (Cloud vs. HPS), nicht aus dem JSON.
69
+ // Das Dart-Vorbild setzt ihn in `fromJson` deshalb ebenfalls nicht,
70
+ // sondern belaesst den Konstruktor-Default (Cloud); den Weg kennt nur
71
+ // der Aufrufer.
72
+ creditCardProvider: provider,
62
73
  };
63
74
  }
64
75
  /**
@@ -59,15 +59,17 @@ function createHpsConnectClient(options) {
59
59
  const message = typeof h.error?.message === 'string' && h.error.message.trim() !== ''
60
60
  ? h.error.message
61
61
  : `Kasseneck Connect meldet einen Fehler (HTTP ${antwort.status})`;
62
- if (code !== undefined && errors_js_1.PREFLIGHT_CONNECT_CODES.has(code)) {
62
+ if (code !== undefined && (errors_js_1.PREFLIGHT_CONNECT_CODES.has(code) || errors_js_1.TERMINAL_UNREACHABLE_CONNECT_CODES.has(code))) {
63
63
  // Siehe errors.ts: diese Codes entstehen laut `kasseneck-connect`
64
- // ausnahmslos VOR jedem Terminal-Kontakt -- beweisbar nichts gesendet.
64
+ // ausnahmslos VOR jedem Terminal-Kontakt bzw. vor jedem gesendeten Byte
65
+ // (`terminal_unreachable`: keine TCP-Verbindung) -- beweisbar nichts
66
+ // gesendet.
65
67
  throw new errors_js_1.HpsPreflightError(message, code);
66
68
  }
67
69
  // terminal_error / timeout / terminal_offline -- oder ein Code, den
68
70
  // dieses Paket nicht kennt. Bewusst dieselbe Klasse fuer beide: ein
69
71
  // unbekannter Code ist keine bewiesene Nicht-Aussendung, siehe
70
- // PREFLIGHT_CONNECT_CODES.
72
+ // PREFLIGHT_CONNECT_CODES und TERMINAL_UNREACHABLE_CONNECT_CODES.
71
73
  //
72
74
  // `error.detail.terminalHttpStatus` reist seit `kasseneck-connect`
73
75
  // Commit `0fb6f66` mit, wenn das TERMINAL selbst einen HTTP-Status
@@ -7,9 +7,11 @@
7
7
  * - [HpsPreflightError] — es ist NACHWEISLICH nichts gesendet worden. Entweder
8
8
  * die Kennung selbst war unbrauchbar (siehe `connect-client.ts`), oder
9
9
  * Connect hat die Anfrage VOR dem Terminal-Kontakt abgelehnt (falscher
10
- * Host, keine Kopplung, ...). Wird von `payments.ts` unveraendert
11
- * weitergeworfen, niemals in einen Ausgang uebersetzt — Zwilling von
12
- * Dart's `ArgumentError`-Sonderfall in `HpsPayments.pay()`.
10
+ * Host, keine Kopplung, ...), oder die TCP-Verbindung zum Terminal kam gar
11
+ * nicht erst zustande ([TERMINAL_UNREACHABLE_CONNECT_CODES]). Wird von
12
+ * `payments.ts` unveraendert weitergeworfen, niemals in einen Ausgang
13
+ * uebersetzt — Zwilling von Dart's `ArgumentError`-Sonderfall in
14
+ * `HpsPayments.pay()`.
13
15
  * - [HpsConnectTerminalError] — die Anfrage GING RAUS (oder der Versuch dazu
14
16
  * scheiterte am Transport), aber es kam keine schluessige Antwort. Das
15
17
  * umfasst ausdruecklich auch [isTerminalBusy]: HTTP `409` ist die einzige
@@ -27,7 +29,12 @@ export declare abstract class HpsConnectException extends Error {
27
29
  /**
28
30
  * Nichts ist gesendet worden. `reason` ist deutscher Klartext, `connectCode`
29
31
  * gesetzt, wenn die Ablehnung von Connect kam (statt von der lokalen
30
- * Kennungspruefung).
32
+ * Kennungspruefung) — ein Code aus [PREFLIGHT_CONNECT_CODES] oder aus
33
+ * [TERMINAL_UNREACHABLE_CONNECT_CODES].
34
+ *
35
+ * Fuer die Kasse heisst das: sicher nichts belastet, ein neuer Versuch ist
36
+ * gefahrlos. Bei `terminal_unreachable` liegt die Ursache am Terminal (aus,
37
+ * anderes Netz, falsche IP), bei den anderen Codes an Connect oder der Kopplung.
31
38
  */
32
39
  export declare class HpsPreflightError extends HpsConnectException {
33
40
  readonly name: string;
@@ -61,11 +68,31 @@ export declare class HpsTransactionIdError extends HpsPreflightError {
61
68
  * einen Fehlercode erweitert wird, der doch am Terminal entsteht.
62
69
  */
63
70
  export declare const PREFLIGHT_CONNECT_CODES: ReadonlySet<string>;
71
+ /**
72
+ * Connect-Fehlercodes, die AM Weg zum Terminal entstehen, aber beweisbar vor
73
+ * jedem gesendeten Byte: Connect hat die TCP-Verbindung zum Terminal
74
+ * versucht, und sie kam nicht zustande (Verbindung abgelehnt, keine Route zum
75
+ * Host, Zeitablauf beim Verbindungsaufbau). Ohne Verbindung kein Request —
76
+ * am Terminal ist nichts angekommen, also auch nichts belastet.
77
+ *
78
+ * Getrennt von [PREFLIGHT_CONNECT_CODES], weil die Ursache eine andere ist:
79
+ * dort lehnt Connect die Anfrage ab, ohne das Terminal ueberhaupt zu
80
+ * versuchen; hier hat Connect es versucht, und das Terminal war nicht da. Fuer
81
+ * den Ausgang zaehlt beides gleich ([HpsPreflightError]).
82
+ *
83
+ * Nur Connect-Fassungen ab der Einfuehrung von `terminal_unreachable` senden
84
+ * den Code. Aeltere melden jeden Netzfehler zum Terminal als
85
+ * `terminal_offline` — und der bleibt unklar: dort kann die Verbindung auch
86
+ * NACH dem Senden gerissen sein. Wie bei [PREFLIGHT_CONNECT_CODES] gilt die
87
+ * Positivliste: was hier nicht steht, ist [HpsConnectTerminalError].
88
+ */
89
+ export declare const TERMINAL_UNREACHABLE_CONNECT_CODES: ReadonlySet<string>;
64
90
  /**
65
91
  * Die Anfrage ging (oder der Versuch dazu) in Richtung Terminal, aber es kam
66
92
  * keine schluessige Antwort — Connect meldete `terminal_error`, `timeout`
67
93
  * oder `terminal_offline` (`kasseneck-connect/lib/src/terminal/hps.dart`),
68
- * oder einen Fehlercode, den dieses Paket nicht kennt.
94
+ * oder einen Fehlercode, den dieses Paket nicht kennt. `terminal_unreachable`
95
+ * gehoert NICHT hierher (beweisbar nichts gesendet, [HpsPreflightError]).
69
96
  */
70
97
  export declare class HpsConnectTerminalError extends HpsConnectException {
71
98
  readonly name = "HpsConnectTerminalError";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HpsClarifyTimeoutError = exports.HpsConnectTransportError = exports.HpsConnectTerminalError = exports.PREFLIGHT_CONNECT_CODES = exports.HpsTransactionIdError = exports.HpsPreflightError = exports.HpsConnectException = void 0;
3
+ exports.HpsClarifyTimeoutError = exports.HpsConnectTransportError = exports.HpsConnectTerminalError = exports.TERMINAL_UNREACHABLE_CONNECT_CODES = exports.PREFLIGHT_CONNECT_CODES = exports.HpsTransactionIdError = exports.HpsPreflightError = exports.HpsConnectException = void 0;
4
4
  const transaction_response_js_1 = require("./transaction-response.js");
5
5
  /**
6
6
  * Fehlerarten auf dem Weg ueber **Kasseneck Connect** zum hobex-HPS-Terminal.
@@ -11,9 +11,11 @@ const transaction_response_js_1 = require("./transaction-response.js");
11
11
  * - [HpsPreflightError] — es ist NACHWEISLICH nichts gesendet worden. Entweder
12
12
  * die Kennung selbst war unbrauchbar (siehe `connect-client.ts`), oder
13
13
  * Connect hat die Anfrage VOR dem Terminal-Kontakt abgelehnt (falscher
14
- * Host, keine Kopplung, ...). Wird von `payments.ts` unveraendert
15
- * weitergeworfen, niemals in einen Ausgang uebersetzt — Zwilling von
16
- * Dart's `ArgumentError`-Sonderfall in `HpsPayments.pay()`.
14
+ * Host, keine Kopplung, ...), oder die TCP-Verbindung zum Terminal kam gar
15
+ * nicht erst zustande ([TERMINAL_UNREACHABLE_CONNECT_CODES]). Wird von
16
+ * `payments.ts` unveraendert weitergeworfen, niemals in einen Ausgang
17
+ * uebersetzt — Zwilling von Dart's `ArgumentError`-Sonderfall in
18
+ * `HpsPayments.pay()`.
17
19
  * - [HpsConnectTerminalError] — die Anfrage GING RAUS (oder der Versuch dazu
18
20
  * scheiterte am Transport), aber es kam keine schluessige Antwort. Das
19
21
  * umfasst ausdruecklich auch [isTerminalBusy]: HTTP `409` ist die einzige
@@ -32,7 +34,12 @@ exports.HpsConnectException = HpsConnectException;
32
34
  /**
33
35
  * Nichts ist gesendet worden. `reason` ist deutscher Klartext, `connectCode`
34
36
  * gesetzt, wenn die Ablehnung von Connect kam (statt von der lokalen
35
- * Kennungspruefung).
37
+ * Kennungspruefung) — ein Code aus [PREFLIGHT_CONNECT_CODES] oder aus
38
+ * [TERMINAL_UNREACHABLE_CONNECT_CODES].
39
+ *
40
+ * Fuer die Kasse heisst das: sicher nichts belastet, ein neuer Versuch ist
41
+ * gefahrlos. Bei `terminal_unreachable` liegt die Ursache am Terminal (aus,
42
+ * anderes Netz, falsche IP), bei den anderen Codes an Connect oder der Kopplung.
36
43
  */
37
44
  class HpsPreflightError extends HpsConnectException {
38
45
  name = 'HpsPreflightError';
@@ -81,11 +88,33 @@ exports.PREFLIGHT_CONNECT_CODES = new Set([
81
88
  'not_found',
82
89
  'body_too_large',
83
90
  ]);
91
+ /**
92
+ * Connect-Fehlercodes, die AM Weg zum Terminal entstehen, aber beweisbar vor
93
+ * jedem gesendeten Byte: Connect hat die TCP-Verbindung zum Terminal
94
+ * versucht, und sie kam nicht zustande (Verbindung abgelehnt, keine Route zum
95
+ * Host, Zeitablauf beim Verbindungsaufbau). Ohne Verbindung kein Request —
96
+ * am Terminal ist nichts angekommen, also auch nichts belastet.
97
+ *
98
+ * Getrennt von [PREFLIGHT_CONNECT_CODES], weil die Ursache eine andere ist:
99
+ * dort lehnt Connect die Anfrage ab, ohne das Terminal ueberhaupt zu
100
+ * versuchen; hier hat Connect es versucht, und das Terminal war nicht da. Fuer
101
+ * den Ausgang zaehlt beides gleich ([HpsPreflightError]).
102
+ *
103
+ * Nur Connect-Fassungen ab der Einfuehrung von `terminal_unreachable` senden
104
+ * den Code. Aeltere melden jeden Netzfehler zum Terminal als
105
+ * `terminal_offline` — und der bleibt unklar: dort kann die Verbindung auch
106
+ * NACH dem Senden gerissen sein. Wie bei [PREFLIGHT_CONNECT_CODES] gilt die
107
+ * Positivliste: was hier nicht steht, ist [HpsConnectTerminalError].
108
+ */
109
+ exports.TERMINAL_UNREACHABLE_CONNECT_CODES = new Set([
110
+ 'terminal_unreachable',
111
+ ]);
84
112
  /**
85
113
  * Die Anfrage ging (oder der Versuch dazu) in Richtung Terminal, aber es kam
86
114
  * keine schluessige Antwort — Connect meldete `terminal_error`, `timeout`
87
115
  * oder `terminal_offline` (`kasseneck-connect/lib/src/terminal/hps.dart`),
88
- * oder einen Fehlercode, den dieses Paket nicht kennt.
116
+ * oder einen Fehlercode, den dieses Paket nicht kennt. `terminal_unreachable`
117
+ * gehoert NICHT hierher (beweisbar nichts gesendet, [HpsPreflightError]).
89
118
  */
90
119
  class HpsConnectTerminalError extends HpsConnectException {
91
120
  name = 'HpsConnectTerminalError';
@@ -18,7 +18,7 @@
18
18
  * des Aufrufers.
19
19
  */
20
20
  export { type HpsConnectCancelOptions, type HpsConnectClient, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, createHpsConnectClient, } from './connect-client.js';
21
- export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, } from './errors.js';
21
+ export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, } from './errors.js';
22
22
  export { type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, } from './events.js';
23
23
  export { type CardPaymentOutcome, type HpsPaymentResult, isHostUncertainResult, mayRetrySafely, } from './outcome.js';
24
24
  export { type HpsCancelOptions, type HpsPaymentOptions, type HpsPayments, type HpsPaymentsOptions, type HpsRefundOptions, createHpsPayments, } from './payments.js';
@@ -19,8 +19,8 @@
19
19
  * des Aufrufers.
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.isHostUncertain = exports.hpsCodeReason = exports.hpsCodeInfo = exports.UNSUPPORTED_USER_DATA_CODE = exports.TIP_SELECTION_FAILED_CODE = exports.TERMINAL_BUSY_CODE = exports.TERMINAL_BLOCKED_CODE = exports.SCEP_ENROLLMENT_FAILED_CODE = exports.REFUND_PASSWORD_INVALID_CODE = exports.REFUND_DISABLED_CODE = exports.PASSWORD_NOT_ENTERED_CODE = exports.NOT_FOUND_CODE = exports.MAX_RETRIES_EXCEEDED_CODE = exports.INVALID_TX_TYPE_CODE = exports.INVALID_TID_DOCUMENTED_CODE = exports.INVALID_MESSAGE_TYPE_CODE = exports.INTERNAL_ERROR_CODE = exports.HPS_REASON_HINTS = exports.HPS_MEASURED_CODES = exports.HPS_CODES = exports.HOST_TIMEOUT_REVERSED_CODE = exports.HOST_STEP_FAILED_CODE = exports.HOST_COMMUNICATION_FAILED_CODE = exports.DIAGNOSIS_FAILED_CODE = exports.COMPLETION_FAILED_CODE = exports.CHIP_DATA_MISMATCH_CODE = exports.CARD_READ_FAILED_CODE = exports.CARD_NOT_SUPPORTED_CODE = exports.CARD_NOT_PRESENT_CODE = exports.CARD_INFO_NOT_ENTERED_CODE = exports.CARD_DECLINED_CODE = exports.BAD_REQUEST_CODE = exports.APPROVED_CODE = exports.APP_SELECT_FAILED_CODE = exports.ABORTED_CODE = exports.newHpsTransactionId = exports.isValidHpsTransactionId = exports.createHpsTransactionIdGenerator = exports.MAX_TRANSACTION_ID_LENGTH = exports.createHpsPayments = exports.mayRetrySafely = exports.isHostUncertainResult = exports.PREFLIGHT_CONNECT_CODES = exports.HpsTransactionIdError = exports.HpsPreflightError = exports.HpsConnectTransportError = exports.HpsConnectTerminalError = exports.HpsConnectException = exports.HpsClarifyTimeoutError = exports.createHpsConnectClient = void 0;
23
- exports.hobexReceiptFromHps = exports.parseHpsTransactionResponse = exports.isUnknownCode = exports.isTechnicalError = exports.normalizeHpsCode = exports.needsReversal = exports.isNotAbortable = exports.isNoStatement = exports.isInProgress = exports.isConclusiveAsStatus = exports.isConclusive = exports.isCanceled = exports.isApproved = exports.TRANSACTION_CANCELED_CODE = exports.TERMINAL_BUSY_HTTP_STATUS = exports.NOT_FOUND_HTTP_STATUS = exports.TECHNICAL_ERROR_CODE = exports.NO_STATEMENT_CODE = exports.WRONG_PIN_CODE = exports.INVALID_TID_CODE = exports.AMOUNT_OUT_OF_RANGE_CODE = exports.INVALID_AMOUNT_CODE = exports.NOT_ABORTABLE_CODE = exports.INVALID_TRANSACTION_CODE = exports.isHostUncertainReason = void 0;
22
+ exports.hpsCodeReason = exports.hpsCodeInfo = exports.UNSUPPORTED_USER_DATA_CODE = exports.TIP_SELECTION_FAILED_CODE = exports.TERMINAL_BUSY_CODE = exports.TERMINAL_BLOCKED_CODE = exports.SCEP_ENROLLMENT_FAILED_CODE = exports.REFUND_PASSWORD_INVALID_CODE = exports.REFUND_DISABLED_CODE = exports.PASSWORD_NOT_ENTERED_CODE = exports.NOT_FOUND_CODE = exports.MAX_RETRIES_EXCEEDED_CODE = exports.INVALID_TX_TYPE_CODE = exports.INVALID_TID_DOCUMENTED_CODE = exports.INVALID_MESSAGE_TYPE_CODE = exports.INTERNAL_ERROR_CODE = exports.HPS_REASON_HINTS = exports.HPS_MEASURED_CODES = exports.HPS_CODES = exports.HOST_TIMEOUT_REVERSED_CODE = exports.HOST_STEP_FAILED_CODE = exports.HOST_COMMUNICATION_FAILED_CODE = exports.DIAGNOSIS_FAILED_CODE = exports.COMPLETION_FAILED_CODE = exports.CHIP_DATA_MISMATCH_CODE = exports.CARD_READ_FAILED_CODE = exports.CARD_NOT_SUPPORTED_CODE = exports.CARD_NOT_PRESENT_CODE = exports.CARD_INFO_NOT_ENTERED_CODE = exports.CARD_DECLINED_CODE = exports.BAD_REQUEST_CODE = exports.APPROVED_CODE = exports.APP_SELECT_FAILED_CODE = exports.ABORTED_CODE = exports.newHpsTransactionId = exports.isValidHpsTransactionId = exports.createHpsTransactionIdGenerator = exports.MAX_TRANSACTION_ID_LENGTH = exports.createHpsPayments = exports.mayRetrySafely = exports.isHostUncertainResult = exports.TERMINAL_UNREACHABLE_CONNECT_CODES = exports.PREFLIGHT_CONNECT_CODES = exports.HpsTransactionIdError = exports.HpsPreflightError = exports.HpsConnectTransportError = exports.HpsConnectTerminalError = exports.HpsConnectException = exports.HpsClarifyTimeoutError = exports.createHpsConnectClient = void 0;
23
+ exports.hobexReceiptFromHps = exports.parseHpsTransactionResponse = exports.isUnknownCode = exports.isTechnicalError = exports.normalizeHpsCode = exports.needsReversal = exports.isNotAbortable = exports.isNoStatement = exports.isInProgress = exports.isConclusiveAsStatus = exports.isConclusive = exports.isCanceled = exports.isApproved = exports.TRANSACTION_CANCELED_CODE = exports.TERMINAL_BUSY_HTTP_STATUS = exports.NOT_FOUND_HTTP_STATUS = exports.TECHNICAL_ERROR_CODE = exports.NO_STATEMENT_CODE = exports.WRONG_PIN_CODE = exports.INVALID_TID_CODE = exports.AMOUNT_OUT_OF_RANGE_CODE = exports.INVALID_AMOUNT_CODE = exports.NOT_ABORTABLE_CODE = exports.INVALID_TRANSACTION_CODE = exports.isHostUncertainReason = exports.isHostUncertain = void 0;
24
24
  var connect_client_js_1 = require("./connect-client.js");
25
25
  Object.defineProperty(exports, "createHpsConnectClient", { enumerable: true, get: function () { return connect_client_js_1.createHpsConnectClient; } });
26
26
  var errors_js_1 = require("./errors.js");
@@ -31,6 +31,7 @@ Object.defineProperty(exports, "HpsConnectTransportError", { enumerable: true, g
31
31
  Object.defineProperty(exports, "HpsPreflightError", { enumerable: true, get: function () { return errors_js_1.HpsPreflightError; } });
32
32
  Object.defineProperty(exports, "HpsTransactionIdError", { enumerable: true, get: function () { return errors_js_1.HpsTransactionIdError; } });
33
33
  Object.defineProperty(exports, "PREFLIGHT_CONNECT_CODES", { enumerable: true, get: function () { return errors_js_1.PREFLIGHT_CONNECT_CODES; } });
34
+ Object.defineProperty(exports, "TERMINAL_UNREACHABLE_CONNECT_CODES", { enumerable: true, get: function () { return errors_js_1.TERMINAL_UNREACHABLE_CONNECT_CODES; } });
34
35
  var outcome_js_1 = require("./outcome.js");
35
36
  Object.defineProperty(exports, "isHostUncertainResult", { enumerable: true, get: function () { return outcome_js_1.isHostUncertainResult; } });
36
37
  Object.defineProperty(exports, "mayRetrySafely", { enumerable: true, get: function () { return outcome_js_1.mayRetrySafely; } });
@@ -43,4 +43,4 @@
43
43
  export { StripeLinkMode, type StripeLinkModeKey } from '../enums/index.js';
44
44
  export { type CreateStripeLinkOptions, type StripeCaptureResult, createStripeLink, stripeCaptureIntent, } from './stripe.js';
45
45
  export { type HobexPayOptions, type HobexRefundOptions, type HobexTransactionIdOptions, hobexPay, hobexRefund, newHobexTransactionId, } from './hobex.js';
46
- export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
46
+ export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
@@ -42,7 +42,7 @@
42
42
  * nichts zu entscheiden.
43
43
  */
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.TRANSACTION_CANCELED_CODE = exports.TERMINAL_BUSY_HTTP_STATUS = exports.NOT_FOUND_HTTP_STATUS = exports.TECHNICAL_ERROR_CODE = exports.PREFLIGHT_CONNECT_CODES = exports.parseHpsTransactionResponse = exports.NO_STATEMENT_CODE = exports.NOT_ABORTABLE_CODE = exports.newHpsTransactionId = exports.MAX_TRANSACTION_ID_LENGTH = exports.mayRetrySafely = exports.isValidHpsTransactionId = exports.isUnknownCode = exports.isTechnicalError = exports.isNotAbortable = exports.isNoStatement = exports.isInProgress = exports.isHostUncertainResult = exports.isHostUncertain = exports.isConclusiveAsStatus = exports.isConclusive = exports.isApproved = exports.INVALID_TRANSACTION_CODE = exports.HpsTransactionIdError = exports.HpsPreflightError = exports.HpsConnectTransportError = exports.HpsConnectTerminalError = exports.HpsConnectException = exports.HpsClarifyTimeoutError = exports.hpsCodeReason = exports.hpsCodeInfo = exports.HPS_REASON_HINTS = exports.HPS_MEASURED_CODES = exports.HPS_CODES = exports.createHpsTransactionIdGenerator = exports.createHpsPayments = exports.createHpsConnectClient = exports.CARD_NOT_PRESENT_CODE = exports.APPROVED_CODE = exports.ABORTED_CODE = exports.newHobexTransactionId = exports.hobexRefund = exports.hobexPay = exports.stripeCaptureIntent = exports.createStripeLink = exports.StripeLinkMode = void 0;
45
+ exports.TRANSACTION_CANCELED_CODE = exports.TERMINAL_BUSY_HTTP_STATUS = exports.NOT_FOUND_HTTP_STATUS = exports.TECHNICAL_ERROR_CODE = exports.TERMINAL_UNREACHABLE_CONNECT_CODES = exports.PREFLIGHT_CONNECT_CODES = exports.parseHpsTransactionResponse = exports.NO_STATEMENT_CODE = exports.NOT_ABORTABLE_CODE = exports.newHpsTransactionId = exports.MAX_TRANSACTION_ID_LENGTH = exports.mayRetrySafely = exports.isValidHpsTransactionId = exports.isUnknownCode = exports.isTechnicalError = exports.isNotAbortable = exports.isNoStatement = exports.isInProgress = exports.isHostUncertainResult = exports.isHostUncertain = exports.isConclusiveAsStatus = exports.isConclusive = exports.isApproved = exports.INVALID_TRANSACTION_CODE = exports.HpsTransactionIdError = exports.HpsPreflightError = exports.HpsConnectTransportError = exports.HpsConnectTerminalError = exports.HpsConnectException = exports.HpsClarifyTimeoutError = exports.hobexReceiptFromHps = exports.hpsCodeReason = exports.hpsCodeInfo = exports.HPS_REASON_HINTS = exports.HPS_MEASURED_CODES = exports.HPS_CODES = exports.createHpsTransactionIdGenerator = exports.createHpsPayments = exports.createHpsConnectClient = exports.CARD_NOT_PRESENT_CODE = exports.APPROVED_CODE = exports.ABORTED_CODE = exports.newHobexTransactionId = exports.hobexRefund = exports.hobexPay = exports.stripeCaptureIntent = exports.createStripeLink = exports.StripeLinkMode = void 0;
46
46
  var index_js_1 = require("../enums/index.js");
47
47
  Object.defineProperty(exports, "StripeLinkMode", { enumerable: true, get: function () { return index_js_1.StripeLinkMode; } });
48
48
  var stripe_js_1 = require("./stripe.js");
@@ -64,6 +64,7 @@ Object.defineProperty(exports, "HPS_MEASURED_CODES", { enumerable: true, get: fu
64
64
  Object.defineProperty(exports, "HPS_REASON_HINTS", { enumerable: true, get: function () { return index_js_2.HPS_REASON_HINTS; } });
65
65
  Object.defineProperty(exports, "hpsCodeInfo", { enumerable: true, get: function () { return index_js_2.hpsCodeInfo; } });
66
66
  Object.defineProperty(exports, "hpsCodeReason", { enumerable: true, get: function () { return index_js_2.hpsCodeReason; } });
67
+ Object.defineProperty(exports, "hobexReceiptFromHps", { enumerable: true, get: function () { return index_js_2.hobexReceiptFromHps; } });
67
68
  Object.defineProperty(exports, "HpsClarifyTimeoutError", { enumerable: true, get: function () { return index_js_2.HpsClarifyTimeoutError; } });
68
69
  Object.defineProperty(exports, "HpsConnectException", { enumerable: true, get: function () { return index_js_2.HpsConnectException; } });
69
70
  Object.defineProperty(exports, "HpsConnectTerminalError", { enumerable: true, get: function () { return index_js_2.HpsConnectTerminalError; } });
@@ -89,6 +90,7 @@ Object.defineProperty(exports, "NOT_ABORTABLE_CODE", { enumerable: true, get: fu
89
90
  Object.defineProperty(exports, "NO_STATEMENT_CODE", { enumerable: true, get: function () { return index_js_2.NO_STATEMENT_CODE; } });
90
91
  Object.defineProperty(exports, "parseHpsTransactionResponse", { enumerable: true, get: function () { return index_js_2.parseHpsTransactionResponse; } });
91
92
  Object.defineProperty(exports, "PREFLIGHT_CONNECT_CODES", { enumerable: true, get: function () { return index_js_2.PREFLIGHT_CONNECT_CODES; } });
93
+ Object.defineProperty(exports, "TERMINAL_UNREACHABLE_CONNECT_CODES", { enumerable: true, get: function () { return index_js_2.TERMINAL_UNREACHABLE_CONNECT_CODES; } });
92
94
  Object.defineProperty(exports, "TECHNICAL_ERROR_CODE", { enumerable: true, get: function () { return index_js_2.TECHNICAL_ERROR_CODE; } });
93
95
  Object.defineProperty(exports, "NOT_FOUND_HTTP_STATUS", { enumerable: true, get: function () { return index_js_2.NOT_FOUND_HTTP_STATUS; } });
94
96
  Object.defineProperty(exports, "TERMINAL_BUSY_HTTP_STATUS", { enumerable: true, get: function () { return index_js_2.TERMINAL_BUSY_HTTP_STATUS; } });
@@ -250,6 +250,16 @@ declare const MELDUNGEN_ROH: {
250
250
  readonly placeholders: readonly ["response"];
251
251
  readonly only: readonly ["web"];
252
252
  };
253
+ readonly 'terminal.several_found': {
254
+ readonly text: "Mehrere Terminals gefunden: {hosts}. Die IP-Adresse des richtigen von Hand eintragen.";
255
+ readonly placeholders: readonly ["hosts"];
256
+ readonly only: readonly ["web"];
257
+ };
258
+ readonly 'terminal.tid_not_found': {
259
+ readonly text: "Mehrere Terminals gefunden: {hosts}. Keines meldet die TID {tid} – TID prüfen oder die IP-Adresse von Hand eintragen.";
260
+ readonly placeholders: readonly ["hosts", "tid"];
261
+ readonly only: readonly ["web"];
262
+ };
253
263
  readonly 'gptom.app_missing': {
254
264
  readonly text: "Die GP-Tom-App ist auf diesem Gerät nicht da.";
255
265
  readonly only: readonly ["app"];
@@ -783,6 +793,10 @@ declare const MELDUNGEN_ROH: {
783
793
  readonly text: "Kasseneck Connect nicht gefunden – bitte installieren.";
784
794
  readonly only: readonly ["web"];
785
795
  };
796
+ readonly 'connect.local_network_blocked': {
797
+ readonly text: "Der Browser sperrt den Zugang zu Kasseneck Connect. Freigeben: Schloss neben der Adresse (installierte App: Menü ⋮ → App-Info) → Website-Einstellungen → „Lokales Netzwerk“ → „Zulassen“.";
798
+ readonly only: readonly ["web"];
799
+ };
786
800
  readonly 'connect.unpair_question': {
787
801
  readonly text: "Diesen Browser wirklich von Connect trennen? Der Bondruck geht dann nicht mehr.";
788
802
  readonly only: readonly ["web"];
@@ -150,6 +150,10 @@ const MELDUNGEN_ROH = {
150
150
  'card_payment.unpair_card_charged': { text: 'Auf diesem Gerät liegt noch eine gebuchte Kartenzahlung ohne Beleg – sie muss von Hand am Terminal zurückerstattet werden (Betrag siehe unten).' },
151
151
  'terminal.none_found': { text: 'Kein Hobex-Terminal gefunden – ist es eingeschaltet und im selben Netz wie dieser Rechner?', only: ['web'] },
152
152
  'terminal.not_ready': { text: 'Terminal antwortet, ist aber nicht betriebsbereit: {response} – TID prüfen.', placeholders: ['response'], only: ['web'] },
153
+ // Terminal-Suche mit mehreren Treffern (1.33.0): uebernommen wird nur ein Treffer, an dem die
154
+ // Diagnose die TID dieses Geraets bestaetigt -- sonst nennt die Kasse die Adressen und setzt keine.
155
+ 'terminal.several_found': { text: 'Mehrere Terminals gefunden: {hosts}. Die IP-Adresse des richtigen von Hand eintragen.', placeholders: ['hosts'], only: ['web'] },
156
+ 'terminal.tid_not_found': { text: 'Mehrere Terminals gefunden: {hosts}. Keines meldet die TID {tid} – TID prüfen oder die IP-Adresse von Hand eintragen.', placeholders: ['hosts', 'tid'], only: ['web'] },
153
157
  'gptom.app_missing': { text: 'Die GP-Tom-App ist auf diesem Gerät nicht da.', only: ['app'] },
154
158
  'gptom.search_failed': { text: 'GP Tom: Suche nach der App fehlgeschlagen: {reason}', placeholders: ['reason'], only: ['app'] },
155
159
  'gptom.payment_failed': { text: 'GP Tom: Zahlung fehlgeschlagen: {reason}', placeholders: ['reason'], only: ['app'] },
@@ -396,6 +400,9 @@ const MELDUNGEN_ROH = {
396
400
  'connect.printer_unknown': { text: 'Diesen Drucker kennt Kasseneck Connect nicht (mehr) – bitte neu suchen.', only: ['web'] },
397
401
  'connect.origin_not_allowed': { text: 'Kasseneck Connect nimmt von dieser Adresse nichts an (Ursprung nicht freigegeben).', only: ['web'] },
398
402
  'connect.not_installed': { text: 'Kasseneck Connect nicht gefunden – bitte installieren.', only: ['web'] },
403
+ // Chrome fragt ab 142 vor dem Zugriff einer https-Seite auf 127.0.0.1 nach („Lokales Netzwerk“).
404
+ // Ist das gesperrt, findet die Kasse Connect nicht -- installieren hilft dann nicht (1.33.0).
405
+ 'connect.local_network_blocked': { text: 'Der Browser sperrt den Zugang zu Kasseneck Connect. Freigeben: Schloss neben der Adresse (installierte App: Menü ⋮ → App-Info) → Website-Einstellungen → „Lokales Netzwerk“ → „Zulassen“.', only: ['web'] },
399
406
  'connect.unpair_question': { text: 'Diesen Browser wirklich von Connect trennen? Der Bondruck geht dann nicht mehr.', only: ['web'] },
400
407
  // --- Einstellungen -------------------------------------------------------
401
408
  'settings.load_failed': { text: 'Die Einstellungen konnten nicht geladen werden.' },
@@ -4,4 +4,4 @@
4
4
  * Client-Version, Nachtrag §6). Ein Test haelt sie gleich mit `package.json`;
5
5
  * beim Anheben der Version beide Stellen aendern.
6
6
  */
7
- export declare const PACKAGE_VERSION = "1.32.1";
7
+ export declare const PACKAGE_VERSION = "1.33.0";
@@ -7,4 +7,4 @@ exports.PACKAGE_VERSION = void 0;
7
7
  * Client-Version, Nachtrag §6). Ein Test haelt sie gleich mit `package.json`;
8
8
  * beim Anheben der Version beide Stellen aendern.
9
9
  */
10
- exports.PACKAGE_VERSION = '1.32.1';
10
+ exports.PACKAGE_VERSION = '1.33.0';
@@ -8,10 +8,15 @@ import { CreditCardProvider } from '../enums/index.js';
8
8
  * bleibt deshalb bewusst Euro (siehe [toHobexReceiptPayload]/
9
9
  * [fromHobexReceiptPayload]), intern wird ab hier exakt in Cent gefuehrt.
10
10
  *
11
- * Nur der Cloud-API-Pfad (`fromJson` im Dart-Vorbild) ist Teil dieses Pakets;
12
- * das lokale HPS-Terminal (`fromHps`, TCP-Anbindung an ein physisches Geraet)
13
- * ist wie SumUp/myPOS eine Android/Desktop-Geraete-Anbindung, die ein
14
- * Browser-/Node-Paket nicht bedienen kann.
11
+ * Zwei Wege hinein, je nach Weg der Zahlung:
12
+ *
13
+ * - **Cloud-API** (`fromJson` im Dart-Vorbild): [fromHobexReceiptPayload].
14
+ * - **HPS-Terminal ueber Kasseneck Connect** (`fromHps` im Dart-Vorbild):
15
+ * `hobexReceiptFromHps` aus `@kreiseck/kasseneck-api/payments` auf die
16
+ * Terminal-Antwort (`HpsPaymentResult.response`). Nur dieser Weg setzt den
17
+ * Anbieter `hobexHps` und damit die HPS-Zusatzfelder in
18
+ * [hobexReceiptToCardPaymentData]; er liest auch `cvm` als Zahl und
19
+ * nicht gefuehrte Felder (`null`) als leeren Text.
15
20
  */
16
21
  export interface HobexReceipt {
17
22
  transactionId: string;
@@ -52,7 +57,17 @@ export interface HobexReceiptPayload {
52
57
  cvm: string | number;
53
58
  }
54
59
  export declare function toHobexReceiptPayload(receipt: HobexReceipt): HobexReceiptPayload;
55
- export declare function fromHobexReceiptPayload(payload: HobexReceiptPayload): HobexReceipt;
60
+ /**
61
+ * Liest eine Hobex-Nutzlast der **Cloud-API**.
62
+ *
63
+ * Der Anbieter ergibt sich aus dem Weg, nicht aus dem JSON; Vorgabe ist
64
+ * `hobexCloudApi`. Fuer eine Antwort des HPS-Terminals ist der richtige Weg
65
+ * `hobexReceiptFromHps` (`@kreiseck/kasseneck-api/payments`) — wer trotzdem
66
+ * hier hereinkommt, gibt [provider] `CreditCardProvider.hobexHps`
67
+ * mit, sonst fehlen am Beleg Genehmigungsnummer, Ablaufdatum, Kartenausgeber,
68
+ * Betrag und Waehrung (siehe [hobexReceiptToCardPaymentData]).
69
+ */
70
+ export declare function fromHobexReceiptPayload(payload: HobexReceiptPayload, provider?: CreditCardProvider): HobexReceipt;
56
71
  /**
57
72
  * Wandelt den Beleg in die `cardPaymentData`-Map, die auf dem Kasseneck-Beleg
58
73
  * landet (siehe [Receipt.cardPaymentData]). Bei HPS-Zahlungen kommen weitere
@@ -21,7 +21,17 @@ export function toHobexReceiptPayload(receipt) {
21
21
  cvm: receipt.cvm,
22
22
  };
23
23
  }
24
- export function fromHobexReceiptPayload(payload) {
24
+ /**
25
+ * Liest eine Hobex-Nutzlast der **Cloud-API**.
26
+ *
27
+ * Der Anbieter ergibt sich aus dem Weg, nicht aus dem JSON; Vorgabe ist
28
+ * `hobexCloudApi`. Fuer eine Antwort des HPS-Terminals ist der richtige Weg
29
+ * `hobexReceiptFromHps` (`@kreiseck/kasseneck-api/payments`) — wer trotzdem
30
+ * hier hereinkommt, gibt [provider] `CreditCardProvider.hobexHps`
31
+ * mit, sonst fehlen am Beleg Genehmigungsnummer, Ablaufdatum, Kartenausgeber,
32
+ * Betrag und Waehrung (siehe [hobexReceiptToCardPaymentData]).
33
+ */
34
+ export function fromHobexReceiptPayload(payload, provider = CreditCardProvider.hobexCloudApi) {
25
35
  return {
26
36
  transactionId: payload.transactionId,
27
37
  tid: payload.tid,
@@ -48,11 +58,12 @@ export function fromHobexReceiptPayload(payload) {
48
58
  amountCents: euroToCents(payload.amount),
49
59
  tipCents: euroToCents(payload.tip),
50
60
  cvm: String(payload.cvm),
51
- // Die Cloud-API-Nutzlast traegt keinen eigenen Provider-Schluessel — der
52
- // Provider ergibt sich aus dem Transportweg (Cloud vs. HPS), nicht aus
53
- // dem JSON. Das Dart-Vorbild setzt ihn in `fromJson` deshalb ebenfalls
54
- // nicht, sondern belaesst den Konstruktor-Default.
55
- creditCardProvider: CreditCardProvider.hobexCloudApi,
61
+ // Die Nutzlast traegt keinen eigenen Provider-Schluessel — der Provider
62
+ // ergibt sich aus dem Transportweg (Cloud vs. HPS), nicht aus dem JSON.
63
+ // Das Dart-Vorbild setzt ihn in `fromJson` deshalb ebenfalls nicht,
64
+ // sondern belaesst den Konstruktor-Default (Cloud); den Weg kennt nur
65
+ // der Aufrufer.
66
+ creditCardProvider: provider,
56
67
  };
57
68
  }
58
69
  /**
@@ -1,4 +1,4 @@
1
- import { HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, } from './errors.js';
1
+ import { HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, } from './errors.js';
2
2
  import { isValidHpsTransactionId } from './transaction-id.js';
3
3
  import { parseHpsTransactionResponse } from './transaction-response.js';
4
4
  const DEFAULT_BASE_URL = 'http://127.0.0.1:27182';
@@ -56,15 +56,17 @@ export function createHpsConnectClient(options) {
56
56
  const message = typeof h.error?.message === 'string' && h.error.message.trim() !== ''
57
57
  ? h.error.message
58
58
  : `Kasseneck Connect meldet einen Fehler (HTTP ${antwort.status})`;
59
- if (code !== undefined && PREFLIGHT_CONNECT_CODES.has(code)) {
59
+ if (code !== undefined && (PREFLIGHT_CONNECT_CODES.has(code) || TERMINAL_UNREACHABLE_CONNECT_CODES.has(code))) {
60
60
  // Siehe errors.ts: diese Codes entstehen laut `kasseneck-connect`
61
- // ausnahmslos VOR jedem Terminal-Kontakt -- beweisbar nichts gesendet.
61
+ // ausnahmslos VOR jedem Terminal-Kontakt bzw. vor jedem gesendeten Byte
62
+ // (`terminal_unreachable`: keine TCP-Verbindung) -- beweisbar nichts
63
+ // gesendet.
62
64
  throw new HpsPreflightError(message, code);
63
65
  }
64
66
  // terminal_error / timeout / terminal_offline -- oder ein Code, den
65
67
  // dieses Paket nicht kennt. Bewusst dieselbe Klasse fuer beide: ein
66
68
  // unbekannter Code ist keine bewiesene Nicht-Aussendung, siehe
67
- // PREFLIGHT_CONNECT_CODES.
69
+ // PREFLIGHT_CONNECT_CODES und TERMINAL_UNREACHABLE_CONNECT_CODES.
68
70
  //
69
71
  // `error.detail.terminalHttpStatus` reist seit `kasseneck-connect`
70
72
  // Commit `0fb6f66` mit, wenn das TERMINAL selbst einen HTTP-Status
@@ -7,9 +7,11 @@
7
7
  * - [HpsPreflightError] — es ist NACHWEISLICH nichts gesendet worden. Entweder
8
8
  * die Kennung selbst war unbrauchbar (siehe `connect-client.ts`), oder
9
9
  * Connect hat die Anfrage VOR dem Terminal-Kontakt abgelehnt (falscher
10
- * Host, keine Kopplung, ...). Wird von `payments.ts` unveraendert
11
- * weitergeworfen, niemals in einen Ausgang uebersetzt — Zwilling von
12
- * Dart's `ArgumentError`-Sonderfall in `HpsPayments.pay()`.
10
+ * Host, keine Kopplung, ...), oder die TCP-Verbindung zum Terminal kam gar
11
+ * nicht erst zustande ([TERMINAL_UNREACHABLE_CONNECT_CODES]). Wird von
12
+ * `payments.ts` unveraendert weitergeworfen, niemals in einen Ausgang
13
+ * uebersetzt — Zwilling von Dart's `ArgumentError`-Sonderfall in
14
+ * `HpsPayments.pay()`.
13
15
  * - [HpsConnectTerminalError] — die Anfrage GING RAUS (oder der Versuch dazu
14
16
  * scheiterte am Transport), aber es kam keine schluessige Antwort. Das
15
17
  * umfasst ausdruecklich auch [isTerminalBusy]: HTTP `409` ist die einzige
@@ -27,7 +29,12 @@ export declare abstract class HpsConnectException extends Error {
27
29
  /**
28
30
  * Nichts ist gesendet worden. `reason` ist deutscher Klartext, `connectCode`
29
31
  * gesetzt, wenn die Ablehnung von Connect kam (statt von der lokalen
30
- * Kennungspruefung).
32
+ * Kennungspruefung) — ein Code aus [PREFLIGHT_CONNECT_CODES] oder aus
33
+ * [TERMINAL_UNREACHABLE_CONNECT_CODES].
34
+ *
35
+ * Fuer die Kasse heisst das: sicher nichts belastet, ein neuer Versuch ist
36
+ * gefahrlos. Bei `terminal_unreachable` liegt die Ursache am Terminal (aus,
37
+ * anderes Netz, falsche IP), bei den anderen Codes an Connect oder der Kopplung.
31
38
  */
32
39
  export declare class HpsPreflightError extends HpsConnectException {
33
40
  readonly name: string;
@@ -61,11 +68,31 @@ export declare class HpsTransactionIdError extends HpsPreflightError {
61
68
  * einen Fehlercode erweitert wird, der doch am Terminal entsteht.
62
69
  */
63
70
  export declare const PREFLIGHT_CONNECT_CODES: ReadonlySet<string>;
71
+ /**
72
+ * Connect-Fehlercodes, die AM Weg zum Terminal entstehen, aber beweisbar vor
73
+ * jedem gesendeten Byte: Connect hat die TCP-Verbindung zum Terminal
74
+ * versucht, und sie kam nicht zustande (Verbindung abgelehnt, keine Route zum
75
+ * Host, Zeitablauf beim Verbindungsaufbau). Ohne Verbindung kein Request —
76
+ * am Terminal ist nichts angekommen, also auch nichts belastet.
77
+ *
78
+ * Getrennt von [PREFLIGHT_CONNECT_CODES], weil die Ursache eine andere ist:
79
+ * dort lehnt Connect die Anfrage ab, ohne das Terminal ueberhaupt zu
80
+ * versuchen; hier hat Connect es versucht, und das Terminal war nicht da. Fuer
81
+ * den Ausgang zaehlt beides gleich ([HpsPreflightError]).
82
+ *
83
+ * Nur Connect-Fassungen ab der Einfuehrung von `terminal_unreachable` senden
84
+ * den Code. Aeltere melden jeden Netzfehler zum Terminal als
85
+ * `terminal_offline` — und der bleibt unklar: dort kann die Verbindung auch
86
+ * NACH dem Senden gerissen sein. Wie bei [PREFLIGHT_CONNECT_CODES] gilt die
87
+ * Positivliste: was hier nicht steht, ist [HpsConnectTerminalError].
88
+ */
89
+ export declare const TERMINAL_UNREACHABLE_CONNECT_CODES: ReadonlySet<string>;
64
90
  /**
65
91
  * Die Anfrage ging (oder der Versuch dazu) in Richtung Terminal, aber es kam
66
92
  * keine schluessige Antwort — Connect meldete `terminal_error`, `timeout`
67
93
  * oder `terminal_offline` (`kasseneck-connect/lib/src/terminal/hps.dart`),
68
- * oder einen Fehlercode, den dieses Paket nicht kennt.
94
+ * oder einen Fehlercode, den dieses Paket nicht kennt. `terminal_unreachable`
95
+ * gehoert NICHT hierher (beweisbar nichts gesendet, [HpsPreflightError]).
69
96
  */
70
97
  export declare class HpsConnectTerminalError extends HpsConnectException {
71
98
  readonly name = "HpsConnectTerminalError";
@@ -8,9 +8,11 @@ import { NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS } from './transaction-
8
8
  * - [HpsPreflightError] — es ist NACHWEISLICH nichts gesendet worden. Entweder
9
9
  * die Kennung selbst war unbrauchbar (siehe `connect-client.ts`), oder
10
10
  * Connect hat die Anfrage VOR dem Terminal-Kontakt abgelehnt (falscher
11
- * Host, keine Kopplung, ...). Wird von `payments.ts` unveraendert
12
- * weitergeworfen, niemals in einen Ausgang uebersetzt — Zwilling von
13
- * Dart's `ArgumentError`-Sonderfall in `HpsPayments.pay()`.
11
+ * Host, keine Kopplung, ...), oder die TCP-Verbindung zum Terminal kam gar
12
+ * nicht erst zustande ([TERMINAL_UNREACHABLE_CONNECT_CODES]). Wird von
13
+ * `payments.ts` unveraendert weitergeworfen, niemals in einen Ausgang
14
+ * uebersetzt — Zwilling von Dart's `ArgumentError`-Sonderfall in
15
+ * `HpsPayments.pay()`.
14
16
  * - [HpsConnectTerminalError] — die Anfrage GING RAUS (oder der Versuch dazu
15
17
  * scheiterte am Transport), aber es kam keine schluessige Antwort. Das
16
18
  * umfasst ausdruecklich auch [isTerminalBusy]: HTTP `409` ist die einzige
@@ -28,7 +30,12 @@ export class HpsConnectException extends Error {
28
30
  /**
29
31
  * Nichts ist gesendet worden. `reason` ist deutscher Klartext, `connectCode`
30
32
  * gesetzt, wenn die Ablehnung von Connect kam (statt von der lokalen
31
- * Kennungspruefung).
33
+ * Kennungspruefung) — ein Code aus [PREFLIGHT_CONNECT_CODES] oder aus
34
+ * [TERMINAL_UNREACHABLE_CONNECT_CODES].
35
+ *
36
+ * Fuer die Kasse heisst das: sicher nichts belastet, ein neuer Versuch ist
37
+ * gefahrlos. Bei `terminal_unreachable` liegt die Ursache am Terminal (aus,
38
+ * anderes Netz, falsche IP), bei den anderen Codes an Connect oder der Kopplung.
32
39
  */
33
40
  export class HpsPreflightError extends HpsConnectException {
34
41
  name = 'HpsPreflightError';
@@ -75,11 +82,33 @@ export const PREFLIGHT_CONNECT_CODES = new Set([
75
82
  'not_found',
76
83
  'body_too_large',
77
84
  ]);
85
+ /**
86
+ * Connect-Fehlercodes, die AM Weg zum Terminal entstehen, aber beweisbar vor
87
+ * jedem gesendeten Byte: Connect hat die TCP-Verbindung zum Terminal
88
+ * versucht, und sie kam nicht zustande (Verbindung abgelehnt, keine Route zum
89
+ * Host, Zeitablauf beim Verbindungsaufbau). Ohne Verbindung kein Request —
90
+ * am Terminal ist nichts angekommen, also auch nichts belastet.
91
+ *
92
+ * Getrennt von [PREFLIGHT_CONNECT_CODES], weil die Ursache eine andere ist:
93
+ * dort lehnt Connect die Anfrage ab, ohne das Terminal ueberhaupt zu
94
+ * versuchen; hier hat Connect es versucht, und das Terminal war nicht da. Fuer
95
+ * den Ausgang zaehlt beides gleich ([HpsPreflightError]).
96
+ *
97
+ * Nur Connect-Fassungen ab der Einfuehrung von `terminal_unreachable` senden
98
+ * den Code. Aeltere melden jeden Netzfehler zum Terminal als
99
+ * `terminal_offline` — und der bleibt unklar: dort kann die Verbindung auch
100
+ * NACH dem Senden gerissen sein. Wie bei [PREFLIGHT_CONNECT_CODES] gilt die
101
+ * Positivliste: was hier nicht steht, ist [HpsConnectTerminalError].
102
+ */
103
+ export const TERMINAL_UNREACHABLE_CONNECT_CODES = new Set([
104
+ 'terminal_unreachable',
105
+ ]);
78
106
  /**
79
107
  * Die Anfrage ging (oder der Versuch dazu) in Richtung Terminal, aber es kam
80
108
  * keine schluessige Antwort — Connect meldete `terminal_error`, `timeout`
81
109
  * oder `terminal_offline` (`kasseneck-connect/lib/src/terminal/hps.dart`),
82
- * oder einen Fehlercode, den dieses Paket nicht kennt.
110
+ * oder einen Fehlercode, den dieses Paket nicht kennt. `terminal_unreachable`
111
+ * gehoert NICHT hierher (beweisbar nichts gesendet, [HpsPreflightError]).
83
112
  */
84
113
  export class HpsConnectTerminalError extends HpsConnectException {
85
114
  name = 'HpsConnectTerminalError';
@@ -18,7 +18,7 @@
18
18
  * des Aufrufers.
19
19
  */
20
20
  export { type HpsConnectCancelOptions, type HpsConnectClient, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, createHpsConnectClient, } from './connect-client.js';
21
- export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, } from './errors.js';
21
+ export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, } from './errors.js';
22
22
  export { type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, } from './events.js';
23
23
  export { type CardPaymentOutcome, type HpsPaymentResult, isHostUncertainResult, mayRetrySafely, } from './outcome.js';
24
24
  export { type HpsCancelOptions, type HpsPaymentOptions, type HpsPayments, type HpsPaymentsOptions, type HpsRefundOptions, createHpsPayments, } from './payments.js';
@@ -18,7 +18,7 @@
18
18
  * des Aufrufers.
19
19
  */
20
20
  export { createHpsConnectClient, } from './connect-client.js';
21
- export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, } from './errors.js';
21
+ export { HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, } from './errors.js';
22
22
  export { isHostUncertainResult, mayRetrySafely, } from './outcome.js';
23
23
  export { createHpsPayments, } from './payments.js';
24
24
  export { MAX_TRANSACTION_ID_LENGTH, createHpsTransactionIdGenerator, isValidHpsTransactionId, newHpsTransactionId, } from './transaction-id.js';
@@ -43,4 +43,4 @@
43
43
  export { StripeLinkMode, type StripeLinkModeKey } from '../enums/index.js';
44
44
  export { type CreateStripeLinkOptions, type StripeCaptureResult, createStripeLink, stripeCaptureIntent, } from './stripe.js';
45
45
  export { type HobexPayOptions, type HobexRefundOptions, type HobexTransactionIdOptions, hobexPay, hobexRefund, newHobexTransactionId, } from './hobex.js';
46
- export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
46
+ export { type CardPaymentOutcome, type HpsConnectClient, type HpsConnectCancelOptions, type HpsConnectClientOptions, type HpsConnectFetch, type HpsConnectFetchResponse, type HpsConnectPaymentOptions, type HpsConnectRefundOptions, type HpsConnectTarget, type HpsConnectTransactionOptions, type HpsCancelOptions, type HpsCode, type HpsCodeEffect, type HpsCodeReason, type HpsCodeSource, type HpsMeasuredCode, type HpsPaymentEvent, type HpsPaymentEventKind, type HpsPaymentObserver, type HpsPaymentOptions, type HpsPayments, type HpsPaymentResult, type HpsPaymentsOptions, type HpsRefundOptions, type HpsTransactionIdGeneratorOptions, type HpsTransactionResponse, ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
@@ -43,4 +43,4 @@
43
43
  export { StripeLinkMode } from '../enums/index.js';
44
44
  export { createStripeLink, stripeCaptureIntent, } from './stripe.js';
45
45
  export { hobexPay, hobexRefund, newHobexTransactionId, } from './hobex.js';
46
- export { ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
46
+ export { ABORTED_CODE, APPROVED_CODE, CARD_NOT_PRESENT_CODE, createHpsConnectClient, createHpsPayments, createHpsTransactionIdGenerator, HPS_CODES, HPS_MEASURED_CODES, HPS_REASON_HINTS, hpsCodeInfo, hpsCodeReason, hobexReceiptFromHps, HpsClarifyTimeoutError, HpsConnectException, HpsConnectTerminalError, HpsConnectTransportError, HpsPreflightError, HpsTransactionIdError, INVALID_TRANSACTION_CODE, isApproved, isConclusive, isConclusiveAsStatus, isHostUncertain, isHostUncertainResult, isInProgress, isNoStatement, isNotAbortable, isTechnicalError, isUnknownCode, isValidHpsTransactionId, mayRetrySafely, MAX_TRANSACTION_ID_LENGTH, newHpsTransactionId, NOT_ABORTABLE_CODE, NO_STATEMENT_CODE, parseHpsTransactionResponse, PREFLIGHT_CONNECT_CODES, TERMINAL_UNREACHABLE_CONNECT_CODES, TECHNICAL_ERROR_CODE, NOT_FOUND_HTTP_STATUS, TERMINAL_BUSY_HTTP_STATUS, TRANSACTION_CANCELED_CODE, } from './hobex-hps/index.js';
@@ -250,6 +250,16 @@ declare const MELDUNGEN_ROH: {
250
250
  readonly placeholders: readonly ["response"];
251
251
  readonly only: readonly ["web"];
252
252
  };
253
+ readonly 'terminal.several_found': {
254
+ readonly text: "Mehrere Terminals gefunden: {hosts}. Die IP-Adresse des richtigen von Hand eintragen.";
255
+ readonly placeholders: readonly ["hosts"];
256
+ readonly only: readonly ["web"];
257
+ };
258
+ readonly 'terminal.tid_not_found': {
259
+ readonly text: "Mehrere Terminals gefunden: {hosts}. Keines meldet die TID {tid} – TID prüfen oder die IP-Adresse von Hand eintragen.";
260
+ readonly placeholders: readonly ["hosts", "tid"];
261
+ readonly only: readonly ["web"];
262
+ };
253
263
  readonly 'gptom.app_missing': {
254
264
  readonly text: "Die GP-Tom-App ist auf diesem Gerät nicht da.";
255
265
  readonly only: readonly ["app"];
@@ -783,6 +793,10 @@ declare const MELDUNGEN_ROH: {
783
793
  readonly text: "Kasseneck Connect nicht gefunden – bitte installieren.";
784
794
  readonly only: readonly ["web"];
785
795
  };
796
+ readonly 'connect.local_network_blocked': {
797
+ readonly text: "Der Browser sperrt den Zugang zu Kasseneck Connect. Freigeben: Schloss neben der Adresse (installierte App: Menü ⋮ → App-Info) → Website-Einstellungen → „Lokales Netzwerk“ → „Zulassen“.";
798
+ readonly only: readonly ["web"];
799
+ };
786
800
  readonly 'connect.unpair_question': {
787
801
  readonly text: "Diesen Browser wirklich von Connect trennen? Der Bondruck geht dann nicht mehr.";
788
802
  readonly only: readonly ["web"];
@@ -135,6 +135,10 @@ const MELDUNGEN_ROH = {
135
135
  'card_payment.unpair_card_charged': { text: 'Auf diesem Gerät liegt noch eine gebuchte Kartenzahlung ohne Beleg – sie muss von Hand am Terminal zurückerstattet werden (Betrag siehe unten).' },
136
136
  'terminal.none_found': { text: 'Kein Hobex-Terminal gefunden – ist es eingeschaltet und im selben Netz wie dieser Rechner?', only: ['web'] },
137
137
  'terminal.not_ready': { text: 'Terminal antwortet, ist aber nicht betriebsbereit: {response} – TID prüfen.', placeholders: ['response'], only: ['web'] },
138
+ // Terminal-Suche mit mehreren Treffern (1.33.0): uebernommen wird nur ein Treffer, an dem die
139
+ // Diagnose die TID dieses Geraets bestaetigt -- sonst nennt die Kasse die Adressen und setzt keine.
140
+ 'terminal.several_found': { text: 'Mehrere Terminals gefunden: {hosts}. Die IP-Adresse des richtigen von Hand eintragen.', placeholders: ['hosts'], only: ['web'] },
141
+ 'terminal.tid_not_found': { text: 'Mehrere Terminals gefunden: {hosts}. Keines meldet die TID {tid} – TID prüfen oder die IP-Adresse von Hand eintragen.', placeholders: ['hosts', 'tid'], only: ['web'] },
138
142
  'gptom.app_missing': { text: 'Die GP-Tom-App ist auf diesem Gerät nicht da.', only: ['app'] },
139
143
  'gptom.search_failed': { text: 'GP Tom: Suche nach der App fehlgeschlagen: {reason}', placeholders: ['reason'], only: ['app'] },
140
144
  'gptom.payment_failed': { text: 'GP Tom: Zahlung fehlgeschlagen: {reason}', placeholders: ['reason'], only: ['app'] },
@@ -381,6 +385,9 @@ const MELDUNGEN_ROH = {
381
385
  'connect.printer_unknown': { text: 'Diesen Drucker kennt Kasseneck Connect nicht (mehr) – bitte neu suchen.', only: ['web'] },
382
386
  'connect.origin_not_allowed': { text: 'Kasseneck Connect nimmt von dieser Adresse nichts an (Ursprung nicht freigegeben).', only: ['web'] },
383
387
  'connect.not_installed': { text: 'Kasseneck Connect nicht gefunden – bitte installieren.', only: ['web'] },
388
+ // Chrome fragt ab 142 vor dem Zugriff einer https-Seite auf 127.0.0.1 nach („Lokales Netzwerk“).
389
+ // Ist das gesperrt, findet die Kasse Connect nicht -- installieren hilft dann nicht (1.33.0).
390
+ 'connect.local_network_blocked': { text: 'Der Browser sperrt den Zugang zu Kasseneck Connect. Freigeben: Schloss neben der Adresse (installierte App: Menü ⋮ → App-Info) → Website-Einstellungen → „Lokales Netzwerk“ → „Zulassen“.', only: ['web'] },
384
391
  'connect.unpair_question': { text: 'Diesen Browser wirklich von Connect trennen? Der Bondruck geht dann nicht mehr.', only: ['web'] },
385
392
  // --- Einstellungen -------------------------------------------------------
386
393
  'settings.load_failed': { text: 'Die Einstellungen konnten nicht geladen werden.' },
@@ -4,4 +4,4 @@
4
4
  * Client-Version, Nachtrag §6). Ein Test haelt sie gleich mit `package.json`;
5
5
  * beim Anheben der Version beide Stellen aendern.
6
6
  */
7
- export declare const PACKAGE_VERSION = "1.32.1";
7
+ export declare const PACKAGE_VERSION = "1.33.0";
@@ -4,4 +4,4 @@
4
4
  * Client-Version, Nachtrag §6). Ein Test haelt sie gleich mit `package.json`;
5
5
  * beim Anheben der Version beide Stellen aendern.
6
6
  */
7
- export const PACKAGE_VERSION = '1.32.1';
7
+ export const PACKAGE_VERSION = '1.33.0';
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.32.1",
2
+ "version": "1.33.0",
3
3
  "measuredOn": {
4
4
  "tid": "3600335",
5
5
  "hpsVersion": "1.10.0",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "Kasseneck Rechnungs-API",
4
4
  "version": 2,
5
- "package": "1.32.1",
5
+ "package": "1.33.0",
6
6
  "endpoints": {
7
7
  "createCustomer": {
8
8
  "request": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.32.1",
2
+ "version": "1.33.0",
3
3
  "languages": [
4
4
  "de",
5
5
  "en"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.32.1",
2
+ "version": "1.33.0",
3
3
  "messages": {
4
4
  "network.no_connection": {
5
5
  "text": "Keine Verbindung zum Server. Bitte die Internetverbindung prüfen und erneut versuchen."
@@ -252,6 +252,25 @@
252
252
  "web"
253
253
  ]
254
254
  },
255
+ "terminal.several_found": {
256
+ "text": "Mehrere Terminals gefunden: {hosts}. Die IP-Adresse des richtigen von Hand eintragen.",
257
+ "placeholders": [
258
+ "hosts"
259
+ ],
260
+ "only": [
261
+ "web"
262
+ ]
263
+ },
264
+ "terminal.tid_not_found": {
265
+ "text": "Mehrere Terminals gefunden: {hosts}. Keines meldet die TID {tid} – TID prüfen oder die IP-Adresse von Hand eintragen.",
266
+ "placeholders": [
267
+ "hosts",
268
+ "tid"
269
+ ],
270
+ "only": [
271
+ "web"
272
+ ]
273
+ },
255
274
  "gptom.app_missing": {
256
275
  "text": "Die GP-Tom-App ist auf diesem Gerät nicht da.",
257
276
  "only": [
@@ -903,6 +922,12 @@
903
922
  "web"
904
923
  ]
905
924
  },
925
+ "connect.local_network_blocked": {
926
+ "text": "Der Browser sperrt den Zugang zu Kasseneck Connect. Freigeben: Schloss neben der Adresse (installierte App: Menü ⋮ → App-Info) → Website-Einstellungen → „Lokales Netzwerk“ → „Zulassen“.",
927
+ "only": [
928
+ "web"
929
+ ]
930
+ },
906
931
  "connect.unpair_question": {
907
932
  "text": "Diesen Browser wirklich von Connect trennen? Der Bondruck geht dann nicht mehr.",
908
933
  "only": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.32.1",
2
+ "version": "1.33.0",
3
3
  "baseUrls": {
4
4
  "public": "https://api.kasseneck.at/v3",
5
5
  "pos": "https://kasse.kasseneck.at/api/v3"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kreiseck/kasseneck-api",
3
- "version": "1.32.1",
3
+ "version": "1.33.0",
4
4
  "description": "Austrian fiscal cash register (RKSV) client for JavaScript and TypeScript: signed receipts, cancellations, card payments, receipt printing (ESC/POS), invoices, inventory. RKSV-Registrierkasse für JavaScript und TypeScript.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Kreiseck",