Я работаю с. net ядром. Я ударил сторонний вызов API с помощью контроллера. Я получаю ответ на звонок. И response.Content выглядит примерно так, как показано ниже.
"{\"GetAlertingTransactionsResult\":\"{\\\"Success\\\":true,\\\"Data\\\":[{\\\"RowNum\\\":\\\"1\\\",\\\"TransactionID\\\":\\\"611\\\",\\\"TransactionType\\\":\\\"Authorization\\\",\\\"Channel\\\":\\\"POS\\\",\\\"TxnStatusDescription\\\":\\\"Processed\\\",\\\"ErrorCode\\\":\\\"0000\\\",\\\"MID\\\":\\\"999222222222222\\\",\\\"TID\\\":\\\"99922236\\\",\\\"MerchantName\\\":\\\"NEW POS TEST MERCHANT\\\",\\\"MerchantAddress\\\":\\\"TEST ADDRESS LINE1 TEST ADDRESS LINE2\\\",\\\"TransactionAmount\\\":\\\"999.9900\\\",\\\"TipAmount\\\":\\\"0.0000\\\",\\\"DiscountAmount\\\":\\\"0.0000\\\",\\\"TotalAmount\\\":\\\"999.9900\\\",\\\"ApplicationVersion\\\":\\\"V6.0.0\\\",\\\"ApplicationID\\\":\\\"A0000007362010\\\",\\\"TxnDateTime\\\":\\\"7\\/9\\/2020 2:36:07 PM\\\",\\\"RequestDateTime\\\":\\\"7\\/9\\/2020 2:36:59 PM\\\",\\\"ResponseDateTime\\\":\\\"7\\/9\\/2020 2:36:59 PM\\\",\\\"InvoiceNumber\\\":\\\"4\\\",\\\"OldInvoiceNumber\\\":\\\"0\\\",\\\"BatchNumber\\\":\\\"15\\\",\\\"AuthNumber\\\":\\\"123\\\",\\\"AssociationName\\\":\\\"PayPakCard\\\",\\\"TC\\\":\\\"123\\\",\\\"ExpiryDate\\\":\\\"123\\\",\\\"ARQC\\\":\\\"2C254884E80D7FD2\\\",\\\"CardHolderName\\\":\\\"DEBIT\\/PAYPAK \\\",\\\"MaskedCardNumber\\\":\\\"2205 60** **** 0476\\\",\\\"Cardtype\\\":\\\"CHIP\\\",\\\"TSI\\\":\\\"6800\\\",\\\"TVR\\\":\\\"123\\\",\\\"AppLabel\\\":\\\"PayPak Debit\\\",\\\"TotalTxnCount\\\":\\\"0\\\",\\\"TerminalSerialNumber\\\":\\\"82683858\\\",\\\"CompositeKey\\\":\\\"123\\\",\\\"PINCaptureCode\\\":\\\"1\\\",\\\"IsReprint\\\":\\\"0\\\",\\\"CustomerMobileNo\\\":null,\\\"IPAddress\\\":\\\"43.245.8.61\\\",\\\"RRN\\\":\\\"123\\\"}],\\\"TotalNumberOfRecords\\\":1}\"}"
Теперь я хочу получить значения, например, TransactionID, TransactionType и Channel et c. Как мне получить эти значения в C# (. net Core)?
Для справки: Код способа вызова стороннего API.
var client = new RestClient("third-party-api-link-here");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddParameter("application/json",
"{\r\n\"TransactionReportDTO\":\r\n{\r\n\"PageSize\":\"15\",\r\n\"PageIndex\":\"1\",\r\n\"TransactionType\":\"Authorization\",\r\n\"Channel\": \"POS\",\r\n\"MerchantName\" :\"NEW POS TEST MERCHANT\",\r\n\"TransactionAmount\" :999.9900,\r\n\"TotalAmount\":999.9900,\r\n\"MID\" :\"999222222222222\",\r\n\"TID\": \"99922236\",\r\n\"InvoiceNumber\":\"4\",\r\n\"RRN\": \"202007091436\",\r\n\"CardNumber\":\"2205600050000476\",\r\n\"TransactionStartDate\":\"2020-07-09\",\r\n\"TransactionEndDate\":\"2020-07-09\"\r\n}\r\n\r\n}"
, ParameterType.RequestBody);
IRestResponse response = client.Execute(request)