private async Task <List <TransactionItem> > GetTransactions(CancellationToken cancellationToken) { var transactions = new List <TransactionItem>(); var response = await PagarMe.GetTransactions(_configuration); if (response.StatusCode == HttpStatusCode.OK) { var content = await response.Content.ReadAsStringAsync(); //var parsed = JObject.Parse(content); transactions = JsonConvert.DeserializeObject <List <TransactionItem> >( content ); } else { string content = await response.Content.ReadAsStringAsync(); await CreateErrorLog("transaction-not-found", content, cancellationToken); } return(transactions); }
private async Task <List <TransactionItem> > GetTransactions() { var transactions = new List <TransactionItem>(); var response = await PagarMe.GetTransactions(_configuration); if (response.StatusCode == HttpStatusCode.OK) { var content = await response.Content.ReadAsStringAsync(); transactions = JsonConvert.DeserializeObject <List <TransactionItem> >( content ); } else { string content = await response.Content.ReadAsStringAsync(); var exc = new Exception($"transaction-not-found: {content}"); SentrySdk.CaptureException(exc); } return(transactions); }