如何整合Azul付款网关?

时间:2019-06-20 07:18:58

标签: asp.net certificate payment-gateway

我想在.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);

            }

0 个答案:

没有答案