str2CreateAc=str2CreateAc + "buyer_msg" + buyer_msg;*/
str2CreateAc=str2CreateAc + "seller" + sellerEmail;
/*str2CreateAc=str2CreateAc + "buyer" + buyer;
str2CreateAc=str2CreateAc + "buyer_name" + buyer_name;
str2CreateAc=str2CreateAc + "buyer_address" + buyer_address;
str2CreateAc=str2CreateAc + "buyer_zipcode" + buyer_zipcode;
str2CreateAc=str2CreateAc + "buyer_tel" + buyer_tel;
str2CreateAc=str2CreateAc + "buyer_mobile" + buyer_mobile;*/
str2CreateAc=str2CreateAc + "partner" + partner;
str2CreateAc=str2CreateAc + keyCode;
//acCode=FormsAuthentication.HashPasswordForStoringInConfigFile(str2CreateAc,"MD5");
acCode=this.GetMD5(str2CreateAc,"gb2312");
itemURL=INTERFACE_URL + "?cmd=" + cmd;
itemURL=itemURL + "&subject=" + HttpUtility.UrlEncode(subject);
itemURL=itemURL + "&body=" + HttpUtility.UrlEncode(body);
itemURL=itemURL + "&order_no=" + order_no;
itemURL=itemURL + "&price=" + prices;
//itemURL=itemURL + "&url=" + rurl;
itemURL=itemURL + "&type=" + types;
itemURL=itemURL + "&number=" + number;
itemURL=itemURL + "&transport=" + transport;
/*itemURL=itemURL + "&ordinary_fee=" + ordinary_fee;
itemURL=itemURL + "&express_fee=" + express_fee;
itemURL=itemURL + "&readonly=" + readonlys;
itemURL=itemURL + "&buyer_msg=" + HttpUtility.UrlEncode(buyer_msg);
itemURL=itemURL + "&buyer=" + HttpUtility.UrlEncode(buyer);
itemURL=itemURL + "&buyer_name=" + HttpUtility.UrlEncode(buyer_name);
itemURL=itemURL + "&buyer_address=" + HttpUtility.UrlEncode(buyer_address);
itemURL=itemURL + "&buyer_zipcode=" + buyer_zipcode;
itemURL=itemURL + "&buyer_tel=" + buyer_tel;
itemURL=itemURL + "&buyer_mobile=" + buyer_mobile;*/
itemURL=itemURL + "&partner=" + partner;
itemURL=itemURL + "&ac=" + acCode;
AlipayItemURL=itemURL;
return AlipayItemURL;
}
这个函数就是返回生成的地址,里面注释掉的看你自己需要可以添加进去,然后就是md5码的问题,现在用默认的md5生成程序对中文的支持只限于GB2312,而支付宝使用的是GBK,虽然两个编码的内容GBK兼容GB2312但是毕竟两个编码方式不同,所以会产生错误,如果用英文或者数字不会有问题。上面下载里面带的一个md5.asp的算法支持中文。
现在已经可以跳转到支付宝的页面了,而我们这边就要自己记录用户的信息已经生成的定单编号,这样在支付宝返回信息的时候来查询。在设定了返回地址后,我们就要看接收页面了。
string msg_id,order_no,gross,buyer_email,buyer_name,buyer_address,buyer_zipcode,buyer_tel,buyer_mobile,action,s_date,ac,notify_type;
string returnTxt;//返回给支付宝通知接口的结果
string alipayNotifyURL;//支付宝查询接口URL
string myalipayEmail;//商户的支付宝Email
string ResponseTxt="";
returnTxt = "N";
alipayNotifyURL = ConfigurationSettings.AppSettings["interfaceback"];//支付宝查询接口地址
myalipayEmai