
            qr
  q           ֧ʾṹ˵             r
          ts        
                                                                  
     ӿƣ֧ʱʽӿڣcreate_direct_pay_by_user    
   汾3.2                                                
       ԣASP.NET(c#)                                        
           Ȩ֧й缼޹˾                     
       ߣ֧̻ҵ֧                         
       ϵʽ̻绰0571-88158090                          
                                                                    
  ts


 ļṹ


create_direct_pay_by_user_vs2005_utf8
  
  app_code ļ
    
    AlipayConfig.csļ
    
    AlipayCore.cs֧ӿڹúļ
    
    AlipayNotify.cs֧֪ͨļ
    
    AlipayService.cs ֧ӿڹļ
    
    AlipaySubmit.cs֧ӿύļ
  
  log־ļ
  
  default.aspx ֧ӿļ
  default.aspx.cs֧ӿļ
  
  notify_url.aspx첽֪ͨҳļ
  notify_url.aspx.cs 첽֪ͨҳļ
  
  return_url.aspxҳת֪ͬͨļ
  return_url.aspx.cs ҳת֪ͬͨļ
  
  Web.Config ļʱɾ
  
  readme.txt ʹ˵ı

ע
Ҫõļǣ
alipay_config.cs
default.aspx
default.aspx.cs
return_url.aspx
return_url.aspx.cs
notify_url.aspx
notify_url.aspx.cs
ͳһռΪnamespace Com.Alipiay




 ļṹ


AlipayCore.cs

public static string BuildMysign(Dictionary<string, string> dicArray, string key, string sign_type, string _input_charset)
ܣǩ
룺Dictionary<string, string>  dicArray Ҫǩ
      string key ȫУ
      string sign_type ǩ
      string _input_charset ʽ
string ǩַ

public static string CreateLinkstring(Dictionary<string, string> dicArray)
ܣԪأա=ֵģʽá&ַƴӳַ
룺Dictionary<string, string> dicArray Ҫƴӵ
string ƴԺַ

public static Dictionary<string, string> ParaFilter(SortedDictionary<string, string> dicArrayPre)
ܣȥеĿֵǩĸaz˳
룺SortedDictionary<string, string> dicArrayPre ǰĲ
Dictionary<string, string>  ȥֵǩǩ

public static string Sign(string prestr, string sign_type, string _input_charset)
ܣǩַ
룺string prestr Ҫǩַ
      string sign_type ǩ
      string _input_charset ʽ
string ǩ

public static void LogResult(string sPath, string sWord)
ܣд־ԣվҲԸĳɴݿ⣩
룺string sPath ־ıؾ·
      string sWord Ҫд־ı



AlipayNotify.cs

public Notify()
ܣ캯
      ļгʼ
      
public bool Verify(SortedDictionary<string, string> inputPara, string notify_id, string sign)
ܣ֤ϢǷ֧ĺϷϢ
룺SortedDictionary<string, string> inputPara ֪ͨز
      string notify_id ֪֤ͨID
      string sign ֧ɵǩ
string ֤

private string GetPreSignStr(SortedDictionary<string, string> inputPara)
ܣȡǩַã
룺SortedDictionary<string, string> inputPara ֪ͨز
string ǩַ

private string GetResponseMysign(SortedDictionary<string, string> inputPara)
ܣȡػĴǩǩ
룺SortedDictionary<string, string> inputPara ֪ͨز
string ǩַ

private string GetResponseTxt(string notify_id)
ܣȡǷ֧֤
룺string notify_id ֪֤ͨID
string ֤

private string Get_Http(string strUrl, int timeout)
ܣȡԶ̷ATN
룺string strUrl ָURL·ַ
      int timeout ʱʱ
string ATNַ



AlipaySubmit.cs

private static Dictionary<string, string> BuildRequestPara(SortedDictionary<string, string> sParaTemp)
ܣҪ֧Ĳ
룺SortedDictionary<string, string> sParaTemp ǰĲ
Dictionary<string, string> ҪĲ

private static string BuildRequestParaToString(SortedDictionary<string, string> sParaTemp)
ܣҪ֧Ĳ
룺SortedDictionary<string, string> sParaTemp ǰĲ
string ҪĲַ

public static string BuildFormHtml(
		SortedDictionary<string, string> sParaTemp, 
		string gateway, 
		string strMethod, 
		string strButtonValue)
ܣύHTML
룺SortedDictionary<string, string> sParaTemp 
	  string gateway صַ
	  string strMethod ύʽֵѡpostget
	  string strButtonValue ȷϰťʾ
string ύHTMLı

public static XmlDocument SendPostInfo(SortedDictionary<string, string> sParaTemp, string gateway)
ܣģԶHTTPPOST󣬻ȡ֧ķXML
룺SortedDictionary<string, string> sParaTemp 
      string gateway صַ
XmlDocument ֧XML

public static XmlDocument SendGetInfo(SortedDictionary<string, string> sParaTemp, string gateway)
ܣģԶHTTPGET󣬻ȡ֧ķXML
룺SortedDictionary<string, string> sParaTemp 
      string gateway صַ
XmlDocument ֧XML




AlipayService.cs

public string Create_direct_pay_by_user(SortedDictionary<string, string> sParaTemp)
ܣ켴ʱʽӿ
룺SortedDictionary<string, string> sParaTemp 
string ύHTMLϢ

public static string Query_timestamp()
ܣڷ㣬ýӿquery_timestampȡʱĴ
string ʱַ

public string AlipayInterface(SortedDictionary<string, string> sParaTemp)
ܣ(֧ӿ)ӿ
룺SortedDictionary<string, string> sParaTemp 
string ύHTMLı֧XML



return_url.aspx.cs

public SortedDictionary<string, string> GetRequestGet()
ܣȡ֧GET֪ͨϢԡ=ֵʽ
SortedDictionary<string, string> requestϢɵ



notify_url.aspx.cs

public SortedDictionary<string, string> GetRequestPost()
ܣȡ֧POST֪ͨϢԡ=ֵʽ
SortedDictionary<string, string> requestϢɵ



 ⣬


ڼ֧ӿʱʻ⣬ʹӣύ롣
https://b.alipay.com/support/helperApply.htm?action=supportHome
ǻרŵļ֧ԱΪ




