Skip to content

Commit

Permalink
Improved Austrian fiscalization response handling. (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahbeshi authored Dec 31, 2024
1 parent 591b07a commit 388cc7f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/Austria/Mews.Fiscalizations.Austria/ATrust/ATrustSigner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,19 @@ public async Task<SignerOutput> SignAsync(QrData qrData)

var response = await HttpClient.PostAsync($"{EndpointUrl.Value}/Sign/JWS", requestContent);
var responseContent = await response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject<ATrustSignerResponse>(responseContent);
return new SignerOutput(new JwsRepresentation(result.JwsRepresentation), input.QrData);
try
{
var result = JsonConvert.DeserializeObject<ATrustSignerResponse>(responseContent);
return new SignerOutput(new JwsRepresentation(result.JwsRepresentation), input.QrData);
}
catch (JsonException jsonEx)
{
throw new Exception($"Failed to deserialize response content: {responseContent}", jsonEx);
}
catch (Exception ex)
{
throw new Exception($"An error occurred while processing the response: {responseContent}", ex);
}
}

public async Task<CertificateInfo> GetCertificateInfoAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryUrl>https://github.com/MewsSystems/fiscalizations</RepositoryUrl>
<Icon>https://raw.githubusercontent.com/msigut/eet/master/receipt.png</Icon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>8.0.1</PackageVersion>
<PackageVersion>9.0.0</PackageVersion>
<LangVersion>12</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Mews.Fiscalizations.All/Mews.Fiscalizations.All.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<RepositoryUrl>https://github.com/MewsSystems/fiscalizations</RepositoryUrl>
<Icon>https://raw.githubusercontent.com/msigut/eet/master/receipt.png</Icon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>27.0.2</PackageVersion>
<PackageVersion>28.0.0</PackageVersion>
<LangVersion>12</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput>
Expand Down

0 comments on commit 388cc7f

Please sign in to comment.