Skip to content

Commit 0add792

Browse files
author
Mikhail Kalatchev
committed
Bug fixes
1 parent e710d1e commit 0add792

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

ErpNetClient/Client.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,19 +120,19 @@ public async Task<DeviceStatusWithDateTime> GetPrinterStatusAsync(string deviceI
120120
}
121121

122122
/// <summary>
123-
/// Register sale
123+
/// Sends raw requests to the printer
124124
/// </summary>
125-
/// <param name="receipt">Receipt</param>
126-
/// <returns>Receipt status</returns>
127-
public async Task<DeviceStatusWithReceiptInfo> SendRawRequest(RawRequest request)
125+
/// <param name="request"><see cref="RawRequest"/> to be sent.</param>
126+
/// <returns>Device status status</returns>
127+
public async Task<DeviceStatusWithDateTime> SendRawRequestAsync(RawRequest request)
128128
{
129129
using (var clt = new HttpClient())
130130
{
131131
StringContent cont = new StringContent(JsonSerializer.Serialize<RawRequest>(request, serializeOptions), Encoding.UTF8, "application/json");
132132
clt.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
133133
HttpResponseMessage res = await clt.PostAsync(new Uri($"{BaseUrl}printers/{this.DeviceId}/rawrequest"), cont);
134134
string resStr = await res.Content.ReadAsStringAsync();
135-
return JsonSerializer.Deserialize<DeviceStatusWithReceiptInfo>(resStr, serializeOptions);
135+
return JsonSerializer.Deserialize<DeviceStatusWithDateTime>(resStr, serializeOptions);
136136
}
137137
}
138138

ErpNetClient/ErpNetClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<PackageTags>Fiscal server;Datecs;Tremol;Daisy;Eltrade;Incotex;ISL;SKYWARE Group;ErpNet.FS</PackageTags>
1616
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1717
<RepositoryUrl>https://github.com/SKYWARE-Group/ErpNetClient</RepositoryUrl>
18-
<Version>0.3.1</Version>
18+
<Version>0.3.2</Version>
1919
</PropertyGroup>
2020

2121
<ItemGroup>

TestApp/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ static async Task Main(string[] args)
6262
//Console.WriteLine($"OK: {x.Ok}");
6363

6464
var c = new Client() { DeviceId = "dt937256" };
65-
var res = await c.SendRawRequest(new RawRequest() { Request = "P800\t200\t" });
66-
res = await c.SendRawRequest(new RawRequest() { Request = "P1200\t200\t" });
67-
res = await c.SendRawRequest(new RawRequest() { Request = "P1800\t200\t" });
65+
var res = await c.SendRawRequestAsync(new RawRequest() { Request = "P800\t200\t" });
66+
res = await c.SendRawRequestAsync(new RawRequest() { Request = "P1200\t200\t" });
67+
res = await c.SendRawRequestAsync(new RawRequest() { Request = "P1800\t200\t" });
6868
Console.WriteLine($"OK: {res.Ok}");
6969
}
7070

0 commit comments

Comments
 (0)