我想在.net
中实现Azul付款网关。我在txt文件中有一个数字证书。谁能帮助我将AZUL付款网关集成到.net
中?
string webAddr = "https://pruebas.azul.com.do/webservices/JSON/Default.aspx";
var httpWebRequest = (HttpWebRequest)WebRequest.Create(webAddr);
httpWebRequest.ContentType = "application/json; charset=utf-8";
httpWebRequest.Method = "POST";
httpWebRequest.Headers.Add("auth1", "***");
httpWebRequest.Headers.Add("auth2", "***");
httpWebRequest.Headers.Add("cert", Server.MapPath("~/content/ss/cert.pem"));
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
}
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var responseText = streamReader.ReadToEnd();
Console.WriteLine(responseText);
}