From 528e3d4c6f520985bb213ab8d5fb323f32cb7e8f Mon Sep 17 00:00:00 2001 From: Sebastian Carmona <83849194+Kaevan89@users.noreply.github.com> Date: Mon, 4 Dec 2023 13:45:41 -0500 Subject: [PATCH 1/2] Add tags to the test --- src/tests/Veryfi.IntegrationTests/DocumentsTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tests/Veryfi.IntegrationTests/DocumentsTests.cs b/src/tests/Veryfi.IntegrationTests/DocumentsTests.cs index 922fb06..c8c2fd2 100644 --- a/src/tests/Veryfi.IntegrationTests/DocumentsTests.cs +++ b/src/tests/Veryfi.IntegrationTests/DocumentsTests.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -245,12 +246,15 @@ public async Task ProcessBase64Test(string fileName) await BaseTests.ApiTestAsync(async (api, cancellationToken) => { string[] categories = { "Meals", "Fat" }; + var tags = new List { "TAG" }; + var documentResponse = await api.Documents2Async( new DocumentPOSTJSONRequest { File_name = file.FileName, File_data = Convert.ToBase64String(file.AsBytes()), - Categories = categories + Categories = categories, + Tags = tags }, cancellationToken); From e9fd92ea351bafa5d9fb0b9f9d6bc1dcac907ec9 Mon Sep 17 00:00:00 2001 From: Sebastian Carmona <83849194+Kaevan89@users.noreply.github.com> Date: Mon, 4 Dec 2023 13:46:29 -0500 Subject: [PATCH 2/2] fix: fix signature generation --- src/libs/Veryfi/Veryfi.SignRequest.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/libs/Veryfi/Veryfi.SignRequest.cs b/src/libs/Veryfi/Veryfi.SignRequest.cs index 877f453..d8bd0fd 100644 --- a/src/libs/Veryfi/Veryfi.SignRequest.cs +++ b/src/libs/Veryfi/Veryfi.SignRequest.cs @@ -46,17 +46,13 @@ private async Task SignRequestAsync( var value = item.Value; if (value == null) continue; string stringValue; - switch (key) + if (value is JArray) { - case "categories": - stringValue = string.Join(",", value); - break; - case "file_urls": - stringValue = string.Join(",", value); - break; - default: - stringValue = (string) value!; - break; + stringValue = string.Join(",", value); + } + else + { + stringValue = (string) value!; } arguments.Add(key, stringValue); }