Skip to content

Commit

Permalink
fix: log error from response for stored cards
Browse files Browse the repository at this point in the history
  • Loading branch information
mewajda committed Oct 27, 2021
1 parent a8409e3 commit 7724185
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Nixtus.Plugin.Payments.Nmi/Components/NmiViewComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ private void PopulateStoredCards(PaymentInfoModel model)
var response = _httpClient.PostAsync(NMI_QUERY_URL, new FormUrlEncodedContent(values)).Result;
if (response.IsSuccessStatusCode)
{
var nmiQueryResponse = DeserializeXml(response.Content.ReadAsStringAsync().Result);
var content = response.Content.ReadAsStringAsync().Result;
var nmiQueryResponse = DeserializeXml(content);

if (nmiQueryResponse?.CustomerVault != null)
{
foreach (var billing in nmiQueryResponse.CustomerVault.Customer.Billing ?? new List<Billing>())
Expand All @@ -90,7 +92,7 @@ private void PopulateStoredCards(PaymentInfoModel model)
}
else
{
_logger.Information("No saved cards where found in the response from NMI");
_logger.Warning($"No saved cards where found in the response from NMI, Response: {content}");
}
}

Expand Down

0 comments on commit 7724185

Please sign in to comment.