Skip to content

Commit

Permalink
Merge pull request #6 from fiskaltrust/user/tsc/cleanup-131
Browse files Browse the repository at this point in the history
Add echo method, fix state in IDESSCD, and add ScuException
  • Loading branch information
TSchmiedlechner committed May 12, 2020
2 parents b22df02 + bff0f4e commit be96582
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 3 deletions.
17 changes: 17 additions & 0 deletions src/fiskaltrust.ifPOS/v1/Exceptions/ScuException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Runtime.Serialization;

namespace fiskaltrust.ifPOS.v1
{
[Serializable]
public class ScuException : Exception
{
public ScuException() { }

public ScuException(string message) : base(message) { }

public ScuException(string message, Exception innerException) : base(message, innerException) { }

protected ScuException(SerializationInfo info, StreamingContext context) : base(info, context) { }
}
}
6 changes: 6 additions & 0 deletions src/fiskaltrust.ifPOS/v1/de/IDESSCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,11 @@ public interface IDESSCD
[WebInvoke(BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "v1/endexportsession", Method = "POST")]
#endif
Task<EndExportSessionResponse> EndExportSessionAsync(EndExportSessionRequest request);

[OperationContract]
#if WCF
[WebInvoke(BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "v1/echo", Method = "POST")]
#endif
Task<ScuEchoResponse> EchoAsync(ScuEchoRequest request);
}
}
11 changes: 11 additions & 0 deletions src/fiskaltrust.ifPOS/v1/de/Models/ScuEchoRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Runtime.Serialization;

namespace fiskaltrust.ifPOS.v1.de
{
[DataContract]
public class ScuEchoRequest
{
[DataMember(Order = 10)]
public string Message { get; set; }
}
}
11 changes: 11 additions & 0 deletions src/fiskaltrust.ifPOS/v1/de/Models/ScuEchoResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Runtime.Serialization;

namespace fiskaltrust.ifPOS.v1.de
{
[DataContract]
public class ScuEchoResponse
{
[DataMember(Order = 10)]
public string Message { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/fiskaltrust.ifPOS/v1/de/Models/TseInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class TseInfo
public string TseSerialNumberOctet { get; set; }

[DataMember(Order = 80)]
public TseState CurrentState { get; set; }
public TseStates CurrentState { get; set; }

[DataMember(Order = 90)]
public IEnumerable<string> CertificatesBase64 { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/fiskaltrust.ifPOS/v1/de/Models/TseState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ namespace fiskaltrust.ifPOS.v1.de
public class TseState
{
[DataMember(Order = 10)]
public TseStates CurrentState;
public TseStates CurrentState { get; set; }
}
}
2 changes: 2 additions & 0 deletions test/fiskaltrust.ifPOS.Tests/Helpers/DummyDESSCD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ public async Task<FinishTransactionResponse> FinishTransactionAsync(FinishTransa
public async Task<ExportDataResponse> ExportDataAsync(ExportDataRequest request) => await FromResult(new ExportDataResponse());

public async Task<EndExportSessionResponse> EndExportSessionAsync(EndExportSessionRequest request) => await FromResult(new EndExportSessionResponse());

public async Task<ScuEchoResponse> EchoAsync(ScuEchoRequest request) => await FromResult(new ScuEchoResponse { Message = request.Message });
}
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.1-rc1",
"version": "1.3.1-rc2",
"releaseBranches": [
"^refs/heads/master$",
"^refs/tags/v\\d+(?:\\.\\d+)*(?:-.*)?$"
Expand Down

0 comments on commit be96582

Please sign in to comment.