From 6eaefbb25c14f9d7b458102d5b0253f4894833aa Mon Sep 17 00:00:00 2001 From: Andres Grobas Date: Fri, 26 Jun 2026 11:05:39 +0200 Subject: [PATCH 1/4] EXP-4396: fix DSFinV-K cash point closing error field deserialization (38.1.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fiskaly API v1.27.6 changed closings with incorrect SLAVE_WITHOUT_TSS cash registers to ERROR state. The 200 response now includes an `error` object ({ code, message }) instead of a string, causing a JsonException at $.error during deserialization. - CashPointClosingResponse: change Error from string to CashPointClosingError - CashPointClosingMapper: map error object to string (Message ?? Code) - Versions: Fiskaly 2.5.0 → 2.5.1, All 38.1.0 → 38.1.1 --- .../CashPointClosings/CashPointClosingResponse.cs | 11 ++++++++++- .../CashPointClosings/CashPointClosingMapper.cs | 2 +- .../Mews.Fiscalizations.Fiskaly.csproj | 2 +- .../Mews.Fiscalizations.All.csproj | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs index edc64027..9e06e8ee 100644 --- a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs +++ b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs @@ -19,7 +19,16 @@ internal sealed class CashPointClosingResponse [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - public string Error { get; init; } + public CashPointClosingError Error { get; init; } +} + +internal sealed class CashPointClosingError +{ + [JsonPropertyName("code")] + public string Code { get; init; } + + [JsonPropertyName("message")] + public string Message { get; init; } } internal enum CashPointClosingState diff --git a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs index dcac72fa..d0180e59 100644 --- a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs +++ b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs @@ -59,7 +59,7 @@ public static CashPointClosingResult MapResponse(this CashPointClosingResponseDt ClientId: response.ClientId, CashPointClosingExportId: response.CashPointClosingExportId, State: MapState(response.State), - Error: response.Error + Error: response.Error?.Message ?? response.Error?.Code ); } diff --git a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mews.Fiscalizations.Fiskaly.csproj b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mews.Fiscalizations.Fiskaly.csproj index 3a9a3cc2..5454f803 100644 --- a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mews.Fiscalizations.Fiskaly.csproj +++ b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mews.Fiscalizations.Fiskaly.csproj @@ -9,7 +9,7 @@ https://github.com/MewsSystems/fiscalizations https://raw.githubusercontent.com/msigut/eet/master/receipt.png true - 2.5.0 + 2.5.1 12 true diff --git a/src/Mews.Fiscalizations.All/Mews.Fiscalizations.All.csproj b/src/Mews.Fiscalizations.All/Mews.Fiscalizations.All.csproj index c561d4ba..50512009 100644 --- a/src/Mews.Fiscalizations.All/Mews.Fiscalizations.All.csproj +++ b/src/Mews.Fiscalizations.All/Mews.Fiscalizations.All.csproj @@ -9,7 +9,7 @@ https://github.com/MewsSystems/fiscalizations https://raw.githubusercontent.com/msigut/eet/master/receipt.png true - 38.1.0 + 38.1.1 12 true $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage From ff5710d374e9dbe85f34fd851bed9bd5c9f024b9 Mon Sep 17 00:00:00 2001 From: Andres Grobas Date: Fri, 26 Jun 2026 11:08:14 +0200 Subject: [PATCH 2/4] EXP-4396: concatenate code and message in DSFinV-K closing error --- .../Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs index d0180e59..1a2946ae 100644 --- a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs +++ b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs @@ -59,7 +59,7 @@ public static CashPointClosingResult MapResponse(this CashPointClosingResponseDt ClientId: response.ClientId, CashPointClosingExportId: response.CashPointClosingExportId, State: MapState(response.State), - Error: response.Error?.Message ?? response.Error?.Code + Error: response.Error == null ? null : $"{response.Error.Code}: {response.Error.Message}" ); } From e982ce82faff2bc99c88bb71d5174307bf88a372 Mon Sep 17 00:00:00 2001 From: Andres Grobas Date: Fri, 26 Jun 2026 11:11:24 +0200 Subject: [PATCH 3/4] EXP-4396: simplify DSFinV-K closing error mapping --- .../Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs index 1a2946ae..1f2cf759 100644 --- a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs +++ b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs @@ -59,7 +59,7 @@ public static CashPointClosingResult MapResponse(this CashPointClosingResponseDt ClientId: response.ClientId, CashPointClosingExportId: response.CashPointClosingExportId, State: MapState(response.State), - Error: response.Error == null ? null : $"{response.Error.Code}: {response.Error.Message}" + Error: response.Error != null ? $"{response.Error.Code}: {response.Error.Message}" : null ); } From 2f17cbea0ecd5ea6b99dd652554a45265457d0cc Mon Sep 17 00:00:00 2001 From: Andres Grobas Date: Fri, 26 Jun 2026 12:32:57 +0200 Subject: [PATCH 4/4] EXP-4396: include all error fields in DSFinV-K closing error mapping --- .../DSFinVK/CashPointClosings/CashPointClosingResponse.cs | 6 ++++++ .../DSFinVK/CashPointClosings/CashPointClosingMapper.cs | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs index 9e06e8ee..e4ec8c20 100644 --- a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs +++ b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/DTOs/DSFinVK/CashPointClosings/CashPointClosingResponse.cs @@ -24,6 +24,12 @@ internal sealed class CashPointClosingResponse internal sealed class CashPointClosingError { + [JsonPropertyName("status_code")] + public int? StatusCode { get; init; } + + [JsonPropertyName("error")] + public string Error { get; init; } + [JsonPropertyName("code")] public string Code { get; init; } diff --git a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs index 1f2cf759..f839927f 100644 --- a/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs +++ b/src/Fiskaly/Mews.Fiscalizations.Fiskaly/Mappers/DSFinVK/CashPointClosings/CashPointClosingMapper.cs @@ -59,7 +59,9 @@ public static CashPointClosingResult MapResponse(this CashPointClosingResponseDt ClientId: response.ClientId, CashPointClosingExportId: response.CashPointClosingExportId, State: MapState(response.State), - Error: response.Error != null ? $"{response.Error.Code}: {response.Error.Message}" : null + Error: response.Error != null + ? string.Join(" ", new[] { response.Error.StatusCode?.ToString(), response.Error.Error, response.Error.Code, response.Error.Message }.Where(s => s != null)) + : null ); }