zoukankan      html  css  js  c++  java
  • 支付宝订单付款状态查询

    首先需要签约这个接口,接口是免费的。否则会出现ILLEGAL_PARTNER_EXTERFACE错误提示。

    demo可以从支付宝下载,或者找客服。

    正确设置pId和key即可。查询时提供支付宝交易单号或者商家订单号都可以。

    //支付宝交易号
    string trade_no = WIDtrade_no.Text.Trim();
    //支付宝交易号与商户网站订单号不能同时为空
    //商户订单号
    string out_trade_no = WIDout_trade_no.Text.Trim();
    //把请求参数打包成数组
    
    SortedDictionary<string, string> sParaTemp = new SortedDictionary<string, string>();
    sParaTemp.Add("partner", Config.Partner);
    sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
    sParaTemp.Add("service", "single_trade_query");
    sParaTemp.Add("trade_no", trade_no);
    sParaTemp.Add("out_trade_no", out_trade_no);
    //建立请求
    string sHtmlText = Submit.BuildRequest(sParaTemp);
    
    //请在这里加上商户的业务逻辑程序代码
    
    //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
    
    XmlDocument xmlDoc = new XmlDocument();
    try
    {
    xmlDoc.LoadXml(sHtmlText);
    string strXmlResponse = xmlDoc.SelectSingleNode("/alipay").InnerText;
    Response.Write(strXmlResponse);
    }
    catch (Exception exp)
    {
    Response.Write(sHtmlText);
    }
  • 相关阅读:
    Service Workers里的CacheStorage和Cache
    application cache和localstorage的区别
    localStorage和sessionStorage区别
    Ubuntu软件的安装和使用
    C++之数据类型
    C++之C++的词法单位
    C++之语言概述
    Ubuntu双系统无法挂载Windows10 硬盘的解决方法
    opencv 显示摄像头数据
    Ubuntu 中使用git 上传代码
  • 原文地址:https://www.cnblogs.com/lucika/p/4901432.html
Copyright © 2011-2022 走看看