zoukankan      html  css  js  c++  java
  • 微信支付退款接口

          ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
                    X509Certificate cer = new X509Certificate(cert, password,X509KeyStorageFlags.PersistKeySet|X509KeyStorageFlags.Exportable|X509KeyStorageFlags.MachineKeySet);
                    HttpWebRequest webrequest = (HttpWebRequest)HttpWebRequest.Create(url);
                    webrequest.ClientCertificates.Add(cer);
                    webrequest.Method = "post";
                    webrequest.Proxy = null;
                    Encoding encoding = Encoding.UTF8;
                        byte[] databyte = encoding.GetBytes(xml);
                        webrequest.ContentLength = databyte.Length;
                        Stream stream = webrequest.GetRequestStream();
                        stream.Write(databyte, 0, databyte.Length);
                        stream.Close();
                        string result = string.Empty;
                       webrequest.KeepAlive = false;
                       HttpWebResponse webreponse = (HttpWebResponse)webrequest.GetResponse();
                       Stream responsestream = webreponse.GetResponseStream();
                       using (StreamReader reader = new StreamReader(responsestream))
                   {
                       result = reader.ReadToEnd();
                       writeLogs.writelog("退款接口返回结果:" + result);
                   }
    

      

  • 相关阅读:
    剑桥雅思写作高分范文ESSAY81
    maven安装配置
    IntelliJ IDEA 2017.3.1安装步骤
    Git基本命令整理
    jacoco覆盖率工具测试及性能分析
    OSGI框架
    查看指定库对应GCC版本
    普元eos、soa、esb
    emp架构
    jar包安装到本地仓库
  • 原文地址:https://www.cnblogs.com/xuemykisskui/p/4175516.html
Copyright © 2011-2022 走看看