This commit is contained in:
Paul Schneider 2019-10-08 23:41:19 +01:00
commit fa8e032d21
18 changed files with 102 additions and 80 deletions

View file

@ -5,12 +5,14 @@ using Newtonsoft.Json.Linq;
namespace Yavsc.Helpers
{
using Models.societe.com;
using Yavsc.Server;
public static class ComapnyInfoHelpers { 
public static async Task<CompanyInfoMessage> CheckSiren(this HttpClient web,
string siren, CompanyInfoSettings api)
{
using (var request = new HttpRequestMessage(HttpMethod.Get,
string.Format(Constants.CompanyInfoUrl,siren,api.ApiKey))) {
string.Format(ServerConstants.CompanyInfoUrl,siren,api.ApiKey))) {
using (var response = await web.SendAsync(request)) {
var payload = JObject.Parse(await response.Content.ReadAsStringAsync());
return payload.ToObject<CompanyInfoMessage>();
@ -18,4 +20,4 @@ namespace Yavsc.Helpers
}
}
}
}
}