вот код python и из него надо сделать код c# def send_p2p(api_access_token, to_qw, comment, sum_p2p): s = requests.Session() s.headers = {'content-type': 'application/json'} s.headers['authorization'] = 'Bearer ' + api_access_token s.headers['User-Agent'] = 'Android v3.2.0 MKT' s.headers['Accept'] = 'application/json' postjson = {"id":"","sum":{"amount":"","currency":""},"paymentMethod":{"type":"Account","accountId":"643"}, "comment":"'+comment+'","fields":{"account":""}} postjson['id'] = str(int(time.time() * 1000)) postjson['sum']['amount'] = sum_p2p postjson['sum']['currency'] = '643' postjson['fields']['account'] = to_qw res = s.post('https://edge.****.com/sinap/api/v2/terms/99/payments',json = postjson) return res.json() Код def send_p2p(api_access_token, to_qw, comment, sum_p2p): s = requests.Session() s.headers = {'content-type': 'application/json'} s.headers['authorization'] = 'Bearer ' + api_access_token s.headers['User-Agent'] = 'Android v3.2.0 MKT' s.headers['Accept'] = 'application/json' postjson = {"id":"","sum":{"amount":"","currency":""},"paymentMethod":{"type":"Account","accountId":"643"}, "comment":"'+comment+'","fields":{"account":""}} postjson['id'] = str(int(time.time() * 1000)) postjson['sum']['amount'] = sum_p2p postjson['sum']['currency'] = '643' postjson['fields']['account'] = to_qw res = s.post('https://edge.****.com/sinap/api/v2/terms/99/payments',json = postjson) return res.json() вот код с# private void Plata(string api_access_token, string to_qw, string sum_p2p, string num_volute) { Random rnd = new(); int value = rnd.Next(1, 1000); string postjson = "{\"id\":\"\",\"sum\":{\"amount\":\"\",\"currency\":\"\"},\"paymentMethod\":{\"type\":\"Account\",\"accountId\":\"643\"}, \"comment\":\"None\",\"fields\":{\"account\":\"\"}}"; postjson = postjson.Replace("id", Convert.ToInt32(value * 1000).ToString()); postjson = postjson.Replace("amount", sum_p2p); postjson = postjson.Replace("currency", num_volute); postjson = postjson.Replace("account", to_qw); var httpRequest = (HttpWebRequest)WebRequest.Create("https://edge.****.com/sinap/api/v2/terms/99/payments"); httpRequest.Method = "POST"; httpRequest.ContentType = "application/json"; httpRequest.Headers.Add("authorization", "Bearer " + api_access_token); httpRequest.Headers.Add("user-agent", "Android v3.2.0 MKT"); using (var requestStream = httpRequest.GetRequestStream()) using (var writer = new StreamWriter(requestStream)) { writer.Write(postjson); } using (var httpResponse = httpRequest.GetResponse()) using (var responseStream = httpResponse.GetResponseStream()) using (var reader = new StreamReader(responseStream)) { string response = reader.ReadToEnd(); MessageBox.Show(response); } } Код private void Plata(string api_access_token, string to_qw, string sum_p2p, string num_volute) { Random rnd = new(); int value = rnd.Next(1, 1000); string postjson = "{\"id\":\"\",\"sum\":{\"amount\":\"\",\"currency\":\"\"},\"paymentMethod\":{\"type\":\"Account\",\"accountId\":\"643\"}, \"comment\":\"None\",\"fields\":{\"account\":\"\"}}"; postjson = postjson.Replace("id", Convert.ToInt32(value * 1000).ToString()); postjson = postjson.Replace("amount", sum_p2p); postjson = postjson.Replace("currency", num_volute); postjson = postjson.Replace("account", to_qw); var httpRequest = (HttpWebRequest)WebRequest.Create("https://edge.****.com/sinap/api/v2/terms/99/payments"); httpRequest.Method = "POST"; httpRequest.ContentType = "application/json"; httpRequest.Headers.Add("authorization", "Bearer " + api_access_token); httpRequest.Headers.Add("user-agent", "Android v3.2.0 MKT"); using (var requestStream = httpRequest.GetRequestStream()) using (var writer = new StreamWriter(requestStream)) { writer.Write(postjson); } using (var httpResponse = httpRequest.GetResponse()) using (var responseStream = httpResponse.GetResponseStream()) using (var reader = new StreamReader(responseStream)) { string response = reader.ReadToEnd(); MessageBox.Show(response); } }